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

            this._owner = owner;
        }
Ejemplo n.º 2
0
 public ThemeInfo this[string name, CommunityInfo community]
 {
     get { return this.GetThemeByCommunity(name, community); }
 }
Ejemplo n.º 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[]);
        }
Ejemplo n.º 4
0
 public CommunityThemeCollection GetThemes(CommunityInfo community)
 {
     return GetThemes(community, false);
 }
Ejemplo n.º 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;
        }
Ejemplo n.º 6
0
        /// <summary></summary>
        /// <returns></returns>
        public static CommunityInfo CreateNew()
        {
            CommunityInfo portal = new CommunityInfo();
            portal.SetState(State.Added);

            return portal;
        }
Ejemplo n.º 7
0
 public abstract void RemoveGeneralPropertyForCommunity(string name, CommunityInfo section);
Ejemplo n.º 8
0
 public abstract void CommitPortalChanges(CommunityInfo portal);
Ejemplo n.º 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;
     }
 }
Ejemplo n.º 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) { }
        }
Ejemplo n.º 11
0
        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)
        {
        }
Ejemplo n.º 12
0
        /// <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);
        }
Ejemplo n.º 13
0
 private void InvalidateExternalCommunityCollections(object sender, EventArgs e)
 {
     this._ConnectedCommunity = null;
 }
Ejemplo n.º 14
0
 /// <summary></summary>
 /// <param name="portal"></param>
 public static void RemoveCommunity(CommunityInfo community)
 {
     Collection.Remove(community);
 }
Ejemplo n.º 15
0
 public bool Contains(string name, CommunityInfo community)
 {
     return (this[name,community] != null);
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 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) { }
        }
Ejemplo n.º 18
0
 public abstract CommunityPropertyCollection GetGeneralPropertiesForCommunity(CommunityInfo section);
Ejemplo n.º 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) { }
        }
Ejemplo n.º 20
0
 public abstract void UpdateGeneralPropertyForCommunity(string name, string value, CommunityInfo section);
Ejemplo n.º 21
0
 /// <summary></summary>
 /// <param name="portal"></param>
 public static void AddCommunity(CommunityInfo community)
 {
     Collection.Add(community);
 }