コード例 #1
0
ファイル: SectionInfo.cs プロジェクト: nberardi/omniportal
        public static SectionInfo CreateNew(SectionInfo parent)
        {
            if (parent == null)
                throw new ArgumentNullException("parent");
            if (parent.Identity == TempIdentity)
                throw new ArgumentException("Must be commited to database before a child can be created.");
            if (parent.ConnectedCommunity == null)
                throw new ArgumentNullException("parent", "ConnectedCommunity must be set and commited to database before a child can be created.");
            if (parent.ConnectedCommunity.Identity == CommunityInfo.TempIdentity)
                throw new ArgumentException("ConnectedCommunity must be commited to database before a child can be created.");

            SectionInfo section = new SectionInfo(parent.Identity, parent.ConnectedCommunity.Identity);
            section.SetState(State.Added);

            return section;
        }
コード例 #2
0
ファイル: SectionInfo.cs プロジェクト: nberardi/omniportal
        public static SectionInfo CreateNew()
        {
            SectionInfo section = new SectionInfo(RootSection.Identity, CommunityInfo.NullIdentity);
            section.SetState(State.Added);

            return section;
        }