I have code that gets a class derived from a specific class. Let me name this class of parameters.
The code uses reflection to go to class members and analyze their attributes. Basically, it is a custom analyzer that will parse input data according to attributes and put what it finds into data members.
This is used in several places in our code. You specify a parameter class, add attribute data elements and pass it to the parser. Something like that:
public class MyFancyParameters : ParametersBase
{
[SomeAttribute(Name="blah", AnotherParam=true)]
public string Blah { get; set; }
}
var parameters = new MyFancyParameters();
Parser.Parse(input, parameters);
, . , . , , . , , , . , .
, .
, ++, - , , , , . ( , .)
# . , . .
?