Open felipebz opened 9 years ago
Currently, the NdapiMetaObject requires the PropertyAttribute in every property of the class, to extract its metadata.
So, a simple property becames:
[Property(NdapiConstants.D2FP_COMMENT)] public string Comment { get { return GetStringProperty(NdapiConstants.D2FP_COMMENT); } set { SetStringProperty(NdapiConstants.D2FP_COMMENT, value); } }
Ideally, the code would have to be like:
[Property(NdapiConstants.D2FP_COMMENT)] public string Comment { get; set; }
The getter and setter code would be injected in compile time, calling the right GetProperty and SetProperty.
Now this can be implemented using a source generator: https://learn.microsoft.com/en-us/dotnet/csharp/roslyn-sdk/source-generators-overview
Currently, the NdapiMetaObject requires the PropertyAttribute in every property of the class, to extract its metadata.
So, a simple property becames:
Ideally, the code would have to be like:
The getter and setter code would be injected in compile time, calling the right GetProperty and SetProperty.