예제 #1
0
        public ObjectSubtype AddObjectSubType([NotNull] ObjectSubtype objectSubtype)
        {
            Assert.ArgumentNotNull(objectSubtype, nameof(objectSubtype));
            Assert.ArgumentCondition(Equals(objectSubtype.ObjectType),
                                     "ObjectSubtype does not belong to this ObjectType");

            int index = _objectSubtypes.Count;

            _objectSubtypes.Add(objectSubtype);

            objectSubtype.SortOrder = index;

            return(objectSubtype);
        }
예제 #2
0
        public ObjectSubtype AddObjectSubType([NotNull] string name,
                                              [NotNull] ObjectAttribute attribute,
                                              [CanBeNull] object attributeValue,
                                              VariantValueType valueType =
                                              VariantValueType.Null)
        {
            Assert.ArgumentNotNullOrEmpty(name, nameof(name));
            Assert.ArgumentNotNull(attribute, nameof(attribute));

            ObjectSubtype objectSubtype = AddObjectSubType(name);

            objectSubtype.AddCriterion(attribute, attributeValue, valueType);

            return(objectSubtype);
        }
예제 #3
0
        public ObjectSubtype AddObjectSubType([CanBeNull] string name = null)
        {
            var objectSubtype = new ObjectSubtype(this, name);

            return(AddObjectSubType(objectSubtype));
        }
예제 #4
0
        // TODO move up / move down methods on _objectSubtypes (modify SortOrder)

        public bool RemoveObjectSubtype([NotNull] ObjectSubtype objectSubtype)
        {
            Assert.ArgumentNotNull(objectSubtype, nameof(objectSubtype));

            return(_objectSubtypes.Remove(objectSubtype));
        }