Пример #1
0
 protected void AddAnonymityLevel(DiscussionSettings level)
 {
     AnonymitySettings = (byte)(AnonymitySettings | (byte)level);
 }
Пример #2
0
 protected void RemoveAnonymityLevel(DiscussionSettings level)
 {
     //~ is a bitwise not in c#
     //Doing a bitwise AND on a NOTed level should result in the level being removed
     AnonymitySettings = (byte)(AnonymitySettings & (~(byte)level));
 }
Пример #3
0
        /// <summary>
        /// Returns true if the discussion has the specified anonymity setting
        /// </summary>
        /// <param name="level"></param>
        /// <returns></returns>
        protected bool HasAnonymityLevel(DiscussionSettings level)
        {
            int result = AnonymitySettings & (byte)level;

            return(result == (int)level);
        }