Exemplo n.º 1
0
        public static GroupImpl ToGroupImpl(this Group group)
        {
            var groupImpl = new GroupImpl()
            {
                GroupId = group.GroupId,
                Name    = group.Name.Trim()
            };

            return(groupImpl);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Create an empty Group
        /// </summary>
        /// <param name="groupImpl"></param>
        /// <returns></returns>
        public static Group Empty(this GroupImpl groupImpl)
        {
            var userList = groupImpl.Users.ToList().ToUsers();

            var group = new Group(userList)
            {
                GroupId = NULL_ID,
                Name    = string.Empty
            };

            return(group);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Return the given group
        /// </summary>
        /// <param name="groupImpl"></param>
        /// <returns></returns>
        public static Group ToGroup(this GroupImpl groupImpl)
        {
            var userList = groupImpl.Users.ToList().ToUsers();

            var group = new Group(userList)
            {
                GroupId = groupImpl.GroupId,
                Name    = groupImpl.Name.TrimEnd()
            };

            return(group);
        }
        /// <summary>
        /// Adds the group to the collection of groups maintained by the group manager.
        /// Publishes details of this group to all listeners.
        /// </summary>
        /// <param name="groupId"> the identifier of the group that will be added.</param>
        /// <param name="groupName"> the name of the group that will be added.</param>
        /// <param name="isValid"> the validity of the group that will be added.</param>
        /// <exception cref="ArgumentException"> thrown if any of the string parameters are null or empty.</exception>
        public void AddGroup(int groupId, string groupName, bool isValid)
        {
            if (String.IsNullOrEmpty(groupName))
            {
                throw new ArgumentException("groupName");
            }

            var newGroup = new GroupImpl()
            {
                GroupId   = groupId,
                GroupName = groupName,
                IsValid   = isValid
            };

            Groups.Add(newGroup);

            eventAggregator.GetEvent <NewGroupEvent>().Publish(new NewGroupEventPayload()
            {
                NewGroup = newGroup
            });
        }
Exemplo n.º 5
0
 /// <summary>
 /// See if the group impl is empty
 /// </summary>
 /// <param name="groupImpl"></param>
 /// <returns></returns>
 public static bool IsEmpty(this GroupImpl groupImpl)
 {
     return(groupImpl.GroupId == NULL_ID);
 }
 public virtual void CreateGroup(GroupImpl group)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 7
0
 /// <summary>
 /// Create the given group
 /// </summary>
 /// <param name="group"></param>
 public void CreateGroup(GroupImpl group)
 {
     db.GroupImpls.Add(group);
     db.SaveChanges();
 }
 /// <summary>
 /// Create the given group
 /// </summary>
 /// <param name="group"></param>
 public void CreateGroup(GroupImpl group)
 {
 }