コード例 #1
0
ファイル: ItemDefinition.cs プロジェクト: zeeshananjum/n2cms
        public ItemDefinition Clone()
        {
            var id = new ItemDefinition(ItemType);

            id.AllowedChildFilters  = AllowedChildFilters.ToList();
            id.AllowedIn            = AllowedIn;
            id.AllowedParentFilters = AllowedParentFilters.ToList();
            id.Attributes           = Attributes.ToList();
            id.AllowedZoneNames     = AllowedZoneNames.ToList();
            id.AuthorizedRoles      = AuthorizedRoles != null?AuthorizedRoles.ToArray() : AuthorizedRoles;

            id.AvailableZones      = AvailableZones.ToList();
            id.Containers          = new ContentList <IEditableContainer>(Containers.Select(ec => ec.TryClone()));
            id.ContentTransformers = ContentTransformers.ToList();
            id.Description         = Description;
            id.Discriminator       = Discriminator;
            id.Displayables        = new ContentList <IDisplayable>(Displayables.Select(d => d.TryClone()));
            id.Editables           = new ContentList <IEditable>(Editables.Select(e => e.TryClone()));
            id.Enabled             = Enabled;
            id.EditableModifiers   = EditableModifiers.ToList();
            id.IconUrl             = IconUrl;
            id.Installer           = Installer;
            id.IsDefined           = IsDefined;
            id.NumberOfItems       = 0;
            id.Metadata            = Metadata.ToDictionary(kvp => kvp.Key, kvp => kvp.Value);
            id.AdditionalFlags     = AdditionalFlags.ToList();
            id.RemovedFlags        = RemovedFlags.ToList();
            id.Properties          = Properties.ToDictionary(p => p.Key, p => p.Value.Clone());
            id.RelatedTo           = RelatedTo;
            id.SortOrder           = SortOrder;
            id.TemplateKey         = TemplateKey;
            id.Title   = Title;
            id.ToolTip = ToolTip;
            return(id);
        }
コード例 #2
0
ファイル: ItemDefinition.cs プロジェクト: wrohrbach/n2cms
        public ItemDefinition Clone()
        {
            var id = new ItemDefinition(ItemType);

            id.AllowedChildFilters  = AllowedChildFilters.ToList();
            id.AllowedIn            = AllowedIn;
            id.AllowedParentFilters = AllowedParentFilters.ToList();
            id.AllowedZoneNames     = AllowedZoneNames.ToList();
            id.AuthorizedRoles      = AuthorizedRoles != null?AuthorizedRoles.ToArray() : AuthorizedRoles;

            id.AvailableZones      = AvailableZones.ToList();
            id.Containers          = Containers.ToList();
            id.Description         = Description;
            id.Discriminator       = Discriminator;
            id.Displayables        = new ContentList <IDisplayable>(Displayables);
            id.Editables           = Editables.ToList();
            id.Enabled             = Enabled;
            id.IconUrl             = IconUrl;
            id.Installer           = Installer;
            id.IsDefined           = IsDefined;
            id.EditableModifiers   = EditableModifiers.ToList();
            id.ContentTransformers = ContentTransformers.ToList();
            id.NumberOfItems       = 0;
            id.RelatedTo           = RelatedTo;
            id.SortOrder           = SortOrder;
            id.TemplateKey         = TemplateKey;
            id.Title   = Title;
            id.ToolTip = ToolTip;
            return(id);
        }