Posted 14 years ago
by Iurii Gazin
Version: 4.0.0284
Platform: .NET 3.5
Environment: Windows 7 (64-bit)
Hi,
DotNetProjectResolver is skipping default constructor is structs (if there are no constructors, defined by developer) when syntaxEditor is collecting data threw AddExternalReference.
I assume, that such structs don`t have constructors threw reflection, and syntaxEditor just skipping them. In case if I write down struct without constructors in syntaxEditor, it shows them.
So, if I type "new SomeStruct" - after keyword new, it shows nothing, if SomeStruct isn`t having ctors and it is added by AddExternalReference
In special cases we should use new keyword and parameterless ctors. For example if I use:I can`t write:
Don`t know why, but VS requires
If there are auto-properties in structure.
I`m attaching screenshot and demo-project
DotNetProjectResolver is skipping default constructor is structs (if there are no constructors, defined by developer) when syntaxEditor is collecting data threw AddExternalReference.
I assume, that such structs don`t have constructors threw reflection, and syntaxEditor just skipping them. In case if I write down struct without constructors in syntaxEditor, it shows them.
So, if I type "new SomeStruct" - after keyword new, it shows nothing, if SomeStruct isn`t having ctors and it is added by AddExternalReference
In special cases we should use new keyword and parameterless ctors. For example if I use:
struct Person
{
public int Age { get; set; }
public string Name { get; set; }
}
Person person;
person.Age = 5;
Person person = new Person();
I`m attaching screenshot and demo-project