/// <summary> /// Initializes a new instance of the <see cref="RegistryProperties" /> class. /// </summary> /// <param name="root">root (required).</param> /// <param name="path">path (required).</param> /// <param name="key">key (required).</param> /// <param name="type">type (required).</param> /// <param name="value">value (required).</param> public RegistryProperties(RootEnum root = default(RootEnum), string path = default(string), string key = default(string), TypeEnum type = default(TypeEnum), Value value = default(Value)) { // to ensure "root" is required (not null) if (root == null) { throw new InvalidDataException("root is a required property for RegistryProperties and cannot be null"); } else { this.Root = root; } // to ensure "path" is required (not null) if (path == null) { throw new InvalidDataException("path is a required property for RegistryProperties and cannot be null"); } else { this.Path = path; } // to ensure "key" is required (not null) if (key == null) { throw new InvalidDataException("key is a required property for RegistryProperties and cannot be null"); } else { this.Key = key; } // to ensure "type" is required (not null) if (type == null) { throw new InvalidDataException("type is a required property for RegistryProperties and cannot be null"); } else { this.Type = type; } // to ensure "value" is required (not null) if (value == null) { throw new InvalidDataException("value is a required property for RegistryProperties and cannot be null"); } else { this.Value = value; } }
static DataItems() { PropertyInfo[] propertyInfos = typeof(EDataFields).GetProperties(); PropertyCount = propertyInfos.Length; RootList = new List <RootEnum>(PropertyCount); DescList = new List <DescEnum>(PropertyCount); DataList = new List <DataEnum>(PropertyCount); FilterList = new List <FilterEnum>(PropertyCount); // ResetColumnList(); // use reflection to access all of the data items // update the data item's name with its variable name // categorize the properties into arrays for easy access foreach (PropertyInfo p in propertyInfos) { RootEnum r = (RootEnum)p.GetValue(null); r.Name = p.Name; RootList.Add(r); if (r is DescEnum ds) { DescList.Insert(ds.DescItemIdx, ds); // // ds.Column = -1; } if (r is DataEnum) { DataEnum de = (DataEnum)r; DataList.Insert(de.DataIdx, de); } if (r is FilterEnum) { FilterEnum f = (FilterEnum)r; FilterList.Insert(f.FilterIdx, f); } } REV_SORT_ORDER_CODE.SubDataList = new [] { REV_SUB_ALTID, REV_SUB_TYPE_CODE, REV_SUB_DISCIPLINE_CODE }; REV_SUB_ALTID.SubDataIdx = 0; REV_SUB_TYPE_CODE.SubDataIdx = 1; REV_SUB_DISCIPLINE_CODE.SubDataIdx = 2; // update the column list and set the column // for each field based on the above order // ResetColumnOrder(); // setup the revision meta data RevisionMetaData.Init(); // RevColumns<DataEnum> co = RevColumnOrder.Default; // // RevColumnOrder.Default.Start(REV_SORT_ITEM_REVID, // REV_SORT_ORDER_CODE, REV_SORT_DELTA_TITLE, REV_SORT_SHEETNUM, // REV_ITEM_VISIBLE, REV_ITEM_BLOCK_TITLE, REV_ITEM_DATE, // REV_SORT_ITEM_BASIS, REV_SORT_ITEM_DESC); // // RevSortOrder.Default.Start(REV_SORT_ORDER_CODE, // REV_SORT_DELTA_TITLE, REV_SORT_SHEETNUM); }
} //todo url to photo protected AbstractUser(int id, RootEnum rootType) { Id = id; RootType = rootType; Profile = new UserProfile(); }
public bool HasRoot(RootEnum root) { return(root == RootType); }
public RegistrationData(string login, string password) : base(login, password) { RootType = RootEnum.Candidate; }