// Constructor for a fixed, undefined field public FieldsEditorRow(DataGridView view, UniversalFieldInfo fixedfield) { // Undefined this.DefaultCellStyle.ForeColor = SystemColors.GrayText; isdefined = false; // Fixed this.fieldinfo = fixedfield; this.rowtype = FieldsEditorRowType.FIXED; //mxd // Type this.fieldtype = General.Types.GetFieldHandler(fixedfield); // Make all cells base.CreateCells(view); // Setup property cell this.Cells[0].Value = fixedfield.Name; this.Cells[0].ReadOnly = true; // Setup type cell this.Cells[1].Value = fieldtype.GetDisplayType(); this.Cells[1].ReadOnly = true; // Setup value cell this.Cells[2].Value = fieldtype.GetStringValue(); // We have no destructor GC.SuppressFinalize(this); }
// Constructor for a non-fixed, defined field //mxd. Also for a user variable field. public FieldsEditorRow(DataGridView view, string name, int type, object value, bool isuservar) { //mxd. Row type this.rowtype = (isuservar ? FieldsEditorRowType.USERVAR : FieldsEditorRowType.DYNAMIC); // Type this.fieldtype = General.Types.GetFieldHandler(type, value); // Make all cells base.CreateCells(view); //mxd. Our path splits here... if (isuservar) { // Not defined this.DefaultCellStyle.ForeColor = SystemColors.GrayText; isdefined = false; fieldtype.ApplyDefaultValue(); // Setup property cell this.Cells[0].Value = name; this.Cells[0].ReadOnly = true; // Setup type cell this.Cells[1].Value = fieldtype.GetDisplayType(); this.Cells[1].ReadOnly = true; // Setup value cell this.Cells[2].Value = fieldtype.GetStringValue(); } else { // Defined this.DefaultCellStyle.ForeColor = SystemColors.WindowText; isdefined = true; // Setup property cell this.Cells[0].Value = name; this.Cells[0].ReadOnly = true; // Setup type cell this.Cells[1].Value = fieldtype.GetDisplayType(); this.Cells[1].ReadOnly = false; // Setup value cell this.Cells[2].Value = fieldtype.GetStringValue(); } // We have no destructor GC.SuppressFinalize(this); }