Exemplo n.º 1
0
        public void RemoveFromGroup(IUser addedBy, IGroup group, IRichTextString reason = null)
        {
            if (!IsCurrentlyInGroup(group))
            {
                return;                                         //Not even in the group.
            }
            GroupUpdateHistory.Add(
                new GroupUpdate()
            {
                Group = group,
                Rank  = group.GetLowestRank(),

                ActionedBy       = addedBy,
                ActionedDateTime = DateTime.Now.ToDateTime(),

                Reason = reason ?? ObjectFactory.CreateRichTextString("No Reason.")
            }
                );
        }
Exemplo n.º 2
0
        public void AddToGroup(IUser addedBy, IGroup group, IRichTextString reason = null)
        {
            if (IsCurrentlyInGroup(group))
            {
                return;                                        //Currently a member, no need to add again.
            }
            GroupUpdateHistory.Add(
                new GroupUpdate()
            {
                Group = group,
                Rank  = group.GetLowestRank(),

                ActionedBy       = addedBy,
                ActionedDateTime = DateTime.Now.ToDateTime(),

                Reason = reason ?? ObjectFactory.CreateRichTextString("No Reason.")
            }
                );
        }
Exemplo n.º 3
0
        public void Demote(IUser demotedBy, IGroup group, IRichTextString reason = null)
        {
            if (!IsCurrentlyInGroup(group))
            {
                return;                                         //Not in the group. Can't demote!
            }
            IRank currentRank = GetRankInGroupOrNull(group) ?? group.GetLowestRank();
            IRank newRank     = group.GetNextLowerRank(currentRank);

            GroupUpdateHistory.Add(
                new GroupUpdate()
            {
                Group = group,
                Rank  = newRank,

                ActionedBy       = demotedBy,
                ActionedDateTime = DateTime.Now.ToDateTime(),

                Reason = reason ?? ObjectFactory.CreateRichTextString("No Reason.")
            }
                );
        }