Exemple #1
0
 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;
 }
Exemple #2
0
        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;
        }
Exemple #3
0
        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]);
                }
            }
        }
Exemple #4
0
 public UnitIndexCategory(AbstractUnitIndexId unitIndexCategoryId, UnitIndexCategory parent, string name,
                          string dictionaryName)
     : base(unitIndexCategoryId, name, dictionaryName)
 {
     this.parent = parent;
 }