/// <summary> /// Construct new group object /// </summary> /// <param name="name">name of the new group</param> /// <param name="container">container of groups</param> /// <returns></returns> public static ZreGroup NewGroup(string name, Dictionary <string, ZreGroup> container) { var group = new ZreGroup(name); container[name] = group; return(group); }
/// <summary> /// Find or create group via its name /// </summary> /// <param name="groupName"></param> /// <returns></returns> public ZreGroup RequirePeerGroup(string groupName) { ZreGroup group; if (!_peerGroups.TryGetValue(groupName, out group)) { group = new ZreGroup(groupName); } return group; }
/// <summary> /// Remove peer from group, if it's a member /// </summary> /// <param name="group"></param> /// <param name="peer"></param> public void DeletePeer(ZreGroup group, ZrePeer peer) { group.Leave(peer); }
/// <summary> /// Construct new group object /// </summary> /// <param name="name">name of the new group</param> /// <param name="container">container of groups</param> /// <returns></returns> public static ZreGroup NewGroup(string name, Dictionary<string, ZreGroup> container) { var group = new ZreGroup(name); container[name] = group; return group; }