I do not know anything about the instrument in question, but (assuming that this is not a limitation of the instrument), I really doubt the wisdom of public fields. Properties will also provide you with the ability to reinforce values:
[DelimitedRecord(",")] public class Example { public string Code {get;set;} public int Month {get;set;} public int Day {get;set;} private readonly double[] h = new double[4]; public double H1 {get {return h[0];} set {h[0] = value;}} public double H2 {get {return h[1];} set {h[1] = value;}} public double H3 {get {return h[2];} set {h[2] = value;}} public double H4 {get {return h[3];} set {h[3] = value;}} }
Again - I have no idea if this tool will help this, but it will be a viable way to implement it. Of course, the values ββof "h" will do the same (in fact, a little more efficiently - without an array on the heap and without de-referencing) as direct members:
public double H1 {get;set;} public double H2 {get;set;} public double H3 {get;set;} public double H4 {get;set;}
source share