Exemplo n.º 1
0
        protected ContentTypeBase(int parentId)
        {
            Mandate.ParameterCondition(parentId != 0, "parentId");

            _parentId                         = new Lazy <int>(() => parentId);
            _allowedContentTypes              = new List <ContentTypeSort>();
            _propertyGroups                   = new PropertyGroupCollection();
            _propertyTypes                    = new PropertyTypeCollection();
            _propertyTypes.CollectionChanged += PropertyTypesChanged;
            _additionalData                   = new Dictionary <string, object>();
        }
Exemplo n.º 2
0
        protected ContentTypeBase(IContentTypeBase parent, string alias)
        {
            Mandate.ParameterNotNull(parent, "parent");

            _alias                            = alias;
            _parentId                         = new Lazy <int>(() => parent.Id);
            _allowedContentTypes              = new List <ContentTypeSort>();
            _propertyGroups                   = new PropertyGroupCollection();
            _propertyTypes                    = new PropertyTypeCollection();
            _propertyTypes.CollectionChanged += PropertyTypesChanged;
            _additionalData                   = new Dictionary <string, object>();
        }
Exemplo n.º 3
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);
        }
Exemplo n.º 4
0
        protected ContentTypeBase(int parentId)
        {
            if (parentId == 0)
            {
                throw new ArgumentOutOfRangeException(nameof(parentId));
            }
            ParentId = parentId;

            _allowedContentTypes = new List <ContentTypeSort>();
            _propertyGroups      = new PropertyGroupCollection();

            // actually OK as IsPublishing is constant
            // ReSharper disable once VirtualMemberCallInConstructor
            _noGroupPropertyTypes = new PropertyTypeCollection(SupportsPublishing);
            _noGroupPropertyTypes.CollectionChanged += PropertyTypesChanged;

            _variations = ContentVariation.Nothing;
        }
Exemplo n.º 5
0
        protected ContentTypeBase(IContentTypeBase parent, string alias)
        {
            if (parent == null)
            {
                throw new ArgumentNullException(nameof(parent));
            }
            SetParent(parent);

            _alias = alias;
            _allowedContentTypes = new List <ContentTypeSort>();
            _propertyGroups      = new PropertyGroupCollection();

            // actually OK as IsPublishing is constant
            // ReSharper disable once VirtualMemberCallInConstructor
            _noGroupPropertyTypes = new PropertyTypeCollection(SupportsPublishing);
            _noGroupPropertyTypes.CollectionChanged += PropertyTypesChanged;

            _variations = ContentVariation.Nothing;
        }
Exemplo n.º 6
0
 public PropertyGroup(PropertyTypeCollection propertyTypeCollection)
 {
     PropertyTypes = propertyTypeCollection;
 }