コード例 #1
0
        public CommunityPropertyCollection(CommunityInfo owner, NameValueCollection properties)
        {
            for(int i = 0; i < properties.Count; i++)
                base.Add(
                    properties.GetKey(i),
                    properties[i]
                    );

            this._owner = owner;
        }
コード例 #2
0
 public ThemeInfo this[string name, CommunityInfo community]
 {
     get { return this.GetThemeByCommunity(name, community); }
 }
コード例 #3
0
        public CommunityThemeCollection GetThemes(CommunityInfo community, bool includeDefaults)
        {
            ArrayList list = new ArrayList();

            // go through each theme and look for ones in the
            // community
            foreach (ThemeInfo theme in this._collection)
            {
                if (theme.CommunityID == community.Identity)
                    list.Add(theme);
            }

            // now check to see if defaults should be included
            if (includeDefaults)
            {
                foreach(ThemeInfo theme in this.GetDefaultThemes())
                    list.Add(theme);
            }

            // returns a list of the themes
            return new CommunityThemeCollection(list.ToArray(typeof(ThemeInfo)) as ThemeInfo[]);
        }
コード例 #4
0
 public CommunityThemeCollection GetThemes(CommunityInfo community)
 {
     return GetThemes(community, false);
 }
コード例 #5
0
        public ThemeInfo GetThemeByCommunity(string name, CommunityInfo community)
        {
            ThemeInfo defaultTheme = null;

            // search through each theme for the specified theme
            foreach(ThemeInfo theme in this._collection)
            {
                // check to see if the theme meets the default community
                // and the name is what is being looked for
                if (theme.IsDefaultTheme && theme.Name == name)
                {
                    defaultTheme = theme;
                    continue;
                }

                // check to see if this theme matches the community
                // and name this indexor is looking for
                if (theme.CommunityID == community.Identity && theme.Name == name)
                    return theme;
            }

            // returns default theme according to name if community theme was not found
            // returns null if nothing is found and returns
            return defaultTheme;
        }
コード例 #6
0
ファイル: CommunityInfo.cs プロジェクト: nberardi/omniportal
        /// <summary></summary>
        /// <returns></returns>
        public static CommunityInfo CreateNew()
        {
            CommunityInfo portal = new CommunityInfo();
            portal.SetState(State.Added);

            return portal;
        }
コード例 #7
0
 public abstract void RemoveGeneralPropertyForCommunity(string name, CommunityInfo section);
コード例 #8
0
 public abstract void CommitPortalChanges(CommunityInfo portal);
コード例 #9
0
 public override void CommitPortalChanges(CommunityInfo community)
 {
     switch (community.State)
     {
         case State.Added :		// insert
             Community.Insert((Community)community);
             break;
         case State.Changed :	// commit changes
             Community.Update((Community)community);
             break;
         case State.Deleted :	// remove
             Community.Delete((Community)community);
             break;
     }
 }
コード例 #10
0
        public override void AddGeneralPropertyForCommunity(string name, string value, CommunityInfo community)
        {
            CommunityProperty property = new CommunityProperty(
                community.Identity,
                CommunityGeneralPropertiesGroup,
                name,
                value
                );

            try
            {
                // insert new property
                property.CommitChanges();
            }
            catch (Exception) { }
        }
コード例 #11
0
ファイル: SectionInfo.cs プロジェクト: nberardi/omniportal
        public SectionInfo(
			int id,
			string name,
			string title,
			SectionInfo parent,
			int order,
			bool visible,
			bool syndicated,
			string theme,
			string style,
			SectionModule module,
			string owner,
			DateTime touched,
			CommunityInfo community
			)
            : this(id,
			name,
			title,
			(parent == null) ? RootSection.Identity : parent.Identity,
			order,
			visible,
			syndicated,
			theme,
			style,
			module.Identity,
			owner,
			touched,
			community.Identity)
        {
        }
コード例 #12
0
ファイル: SectionInfo.cs プロジェクト: nberardi/omniportal
        /// <summary>This is to by-pass the <see cref="Resources"/> thrown from set_ConnectedCommunity.</summary>
        /// <param name="community"></param>
        private void SetConnectedCommunity(CommunityInfo community)
        {
            this._ConnectedCommunity = community;
            this._community_id = community.Identity;
            this.ValueChanged();

            // set the community for all children
            foreach (SectionInfo child in this.Children)
                child.SetConnectedCommunity(community);
        }
コード例 #13
0
ファイル: SectionInfo.cs プロジェクト: nberardi/omniportal
 private void InvalidateExternalCommunityCollections(object sender, EventArgs e)
 {
     this._ConnectedCommunity = null;
 }
コード例 #14
0
ファイル: CommunityInfo.cs プロジェクト: nberardi/omniportal
 /// <summary></summary>
 /// <param name="portal"></param>
 public static void RemoveCommunity(CommunityInfo community)
 {
     Collection.Remove(community);
 }
コード例 #15
0
 public bool Contains(string name, CommunityInfo community)
 {
     return (this[name,community] != null);
 }
コード例 #16
0
        public override ManagedFusion.CommunityPropertyCollection GetGeneralPropertiesForCommunity(CommunityInfo community)
        {
            List<CommunityProperty> properties = CommunityProperty.GetList("CommunityID = " + community.Identity + " and PropertyGroup = '" + CommunityGeneralPropertiesGroup + "'");
            NameValueCollection collection = new NameValueCollection(properties.Count);

            // add all rows to NameValueCollection
            foreach (CommunityProperty property in properties)
                collection.Add(
                    property.Name,
                    property.Value
                    );

            // returns a property collection
            return new ManagedFusion.CommunityPropertyCollection(community, collection);
        }
コード例 #17
0
        public override void RemoveGeneralPropertyForCommunity(string name, CommunityInfo community)
        {
            CommunityProperty property = CommunityProperty.GetByCommunityIDAndPropertyGroupAndName(
                community.Identity,
                CommunityGeneralPropertiesGroup,
                name
                );

            try
            {
                // delete property
                property.Delete();
                property.CommitChanges();
            }
            catch (Exception) { }
        }
コード例 #18
0
 public abstract CommunityPropertyCollection GetGeneralPropertiesForCommunity(CommunityInfo section);
コード例 #19
0
        public override void UpdateGeneralPropertyForCommunity(string name, string value, CommunityInfo community)
        {
            CommunityProperty property = CommunityProperty.GetByCommunityIDAndPropertyGroupAndName(
                community.Identity,
                CommunityGeneralPropertiesGroup,
                name
                );
            property.Value = value;

            try
            {
                // update property
                property.CommitChanges();
            }
            catch (Exception) { }
        }
コード例 #20
0
 public abstract void UpdateGeneralPropertyForCommunity(string name, string value, CommunityInfo section);
コード例 #21
0
ファイル: CommunityInfo.cs プロジェクト: nberardi/omniportal
 /// <summary></summary>
 /// <param name="portal"></param>
 public static void AddCommunity(CommunityInfo community)
 {
     Collection.Add(community);
 }