public UnitIndex(AbstractUnitIndexId unitIndexId, UnitIndexCategory category, string name, string dictionaryName) : base(unitIndexId, name, dictionaryName) { if (category == null) { throw new ArgumentException("category is null"); } this.category = category; }
public virtual void Update(UnitIndexCategory parent, string name, string dictionaryName) { this.parent = parent; if (string.IsNullOrWhiteSpace(name)) { throw new UnitIndexArgumentException("UnitIndex", "Name"); } this.name = name; if (string.IsNullOrWhiteSpace(name)) { throw new UnitIndexArgumentException("UnitIndex", "DictionaryName"); } this.dictionaryName = dictionaryName; }
public virtual void Update(string name, string dictionaryName, UnitIndexCategory category, List <CustomFieldType> customFieldTypes) { if (category == null) { throw new ArgumentException("category"); } if (string.IsNullOrWhiteSpace(name)) { throw new UnitIndexArgumentException("UnitIndex", "Name"); } base.name = name; if (string.IsNullOrWhiteSpace(name)) { throw new UnitIndexArgumentException("UnitIndex", "DictionaryName"); } base.dictionaryName = dictionaryName; this.category = category; foreach (var customFieldType in customFieldTypes) { if (!customFieldTypeIdList.Contains(customFieldType.Id)) { AssignCustomField(customFieldType); } } var customFieldTypeIdListClone = new List <CustomFieldTypeId>(customFieldTypeIdList); for (int i = 0; i < customFieldTypeIdListClone.Count; i++) { if (!customFieldTypes.Select(c => c.Id).Contains(customFieldTypeIdListClone[i])) { RemoveCustomField(customFieldTypeIdListClone[i]); } } }
public UnitIndexCategory(AbstractUnitIndexId unitIndexCategoryId, UnitIndexCategory parent, string name, string dictionaryName) : base(unitIndexCategoryId, name, dictionaryName) { this.parent = parent; }