how to set a property initialization in a constructor as quick action

Hi all!i'm figuring out, how to set a default value of a property in a constructor (or create default one).Idea:public string Query{get;set;}use ALT+ENTER then choose set default value and resultpublic MyClassName(){ Query="";}if having a reference type:public List<MyClass> Lists{get;set;}after ALT+ENTERpublic MyClassName(){ Lists = new List<MyClass>();}i was able to create a constructor, use SetBody method on IConstructorDeclaration and add it via AddClassMemberDeclarationBefore option to create the constructor with my own impl of IBlock. I was also able to get all the constructor and set it via AddStatmentBefore method with use of CSharpElementFactory.But this complicate things - not for valuable types, but for reference types :( First question: how to get a default value for a type to use it in statment or IBlock respectively, not via if / switch?Second question:Now i've got a idea to use the same behavior as Live Templates. I will create a constructor / name of the property, but will like to know, how to add an opportunity for user to change the value, how to highlight the value, how to set the caret to that position?f.e.public MyClassName(){Query="HIGHLIGHTED as in live templates"}Thank you for any pointers or guidance!

Please sign in to leave a comment.