Exemplo n.º 1
0
        /// <summary>
        /// Adds a PropertyType, which does not belong to a PropertyGroup.
        /// </summary>
        /// <param name="propertyType"><see cref="PropertyType"/> to add</param>
        /// <returns>Returns <c>True</c> if PropertyType was added, otherwise <c>False</c></returns>
        public bool AddPropertyType(PropertyType propertyType)
        {
            if (PropertyTypeExists(propertyType.Alias) == false)
            {
                _propertyTypes.Add(propertyType);
                return(true);
            }

            return(false);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Adds a PropertyType, which does not belong to a PropertyGroup.
        /// </summary>
        /// <param name="propertyType"><see cref="PropertyType"/> to add</param>
        /// <returns>Returns <c>True</c> if PropertyType was added, otherwise <c>False</c></returns>
        public bool AddPropertyType(PropertyType propertyType)
        {
            if (propertyType.HasIdentity == false)
            {
                propertyType.Key = Guid.NewGuid();
            }

            if (PropertyTypeExists(propertyType.Alias) == false)
            {
                _propertyTypes.Add(propertyType);
                return(true);
            }

            return(false);
        }
        public object DeepClone()
        {
            var newGroup = new PropertyTypeCollection();

            foreach (var p in this)
            {
                newGroup.Add((PropertyType)p.DeepClone());
            }
            return(newGroup);
        }
Exemplo n.º 4
0
        public object DeepClone()
        {
            var clone = new PropertyTypeCollection(IsPublishing);

            foreach (var propertyType in this)
            {
                clone.Add((PropertyType)propertyType.DeepClone());
            }
            return(clone);
        }
Exemplo n.º 5
0
        /// <summary>
        /// Adds a PropertyType, which does not belong to a PropertyGroup.
        /// </summary>
        /// <param name="propertyType"><see cref="PropertyType"/> to add</param>
        /// <returns>Returns <c>True</c> if PropertyType was added, otherwise <c>False</c></returns>
        public bool AddPropertyType(PropertyType propertyType)
        {
            if (PropertyTypeExists(propertyType.Alias) == false)
            {
                _propertyTypes.Add(propertyType);
                _propertyTypes.CollectionChanged += PropertyTypesChanged;
                return(true);
            }

            return(false);
        }
Exemplo n.º 6
0
        internal PropertyGroup Clone()
        {
            var clone      = (PropertyGroup)this.MemberwiseClone();
            var collection = new PropertyTypeCollection();

            foreach (var propertyType in this.PropertyTypes)
            {
                var property = propertyType.Clone();
                property.ResetIdentity();
                property.ResetDirtyProperties(false);
                collection.Add(property);
            }
            clone.PropertyTypes = collection;
            clone.ResetIdentity();
            clone.ResetDirtyProperties(false);
            return(clone);
        }