public CommunityPropertyCollection(CommunityInfo owner, NameValueCollection properties) { for(int i = 0; i < properties.Count; i++) base.Add( properties.GetKey(i), properties[i] ); this._owner = owner; }
public ThemeInfo this[string name, CommunityInfo community] { get { return this.GetThemeByCommunity(name, community); } }
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[]); }
public CommunityThemeCollection GetThemes(CommunityInfo community) { return GetThemes(community, false); }
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; }
/// <summary></summary> /// <returns></returns> public static CommunityInfo CreateNew() { CommunityInfo portal = new CommunityInfo(); portal.SetState(State.Added); return portal; }
public abstract void RemoveGeneralPropertyForCommunity(string name, CommunityInfo section);
public abstract void CommitPortalChanges(CommunityInfo portal);
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; } }
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) { } }
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) { }
/// <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); }
private void InvalidateExternalCommunityCollections(object sender, EventArgs e) { this._ConnectedCommunity = null; }
/// <summary></summary> /// <param name="portal"></param> public static void RemoveCommunity(CommunityInfo community) { Collection.Remove(community); }
public bool Contains(string name, CommunityInfo community) { return (this[name,community] != null); }
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); }
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) { } }
public abstract CommunityPropertyCollection GetGeneralPropertiesForCommunity(CommunityInfo section);
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) { } }
public abstract void UpdateGeneralPropertyForCommunity(string name, string value, CommunityInfo section);
/// <summary></summary> /// <param name="portal"></param> public static void AddCommunity(CommunityInfo community) { Collection.Add(community); }