Esempio n. 1
0
        /// <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);
        }
Esempio n. 2
0
 /// <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;
 }
Esempio n. 3
0
 /// <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);
 }
Esempio n. 4
0
 /// <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;
 }