protected void AddAnonymityLevel(DiscussionSettings level) { AnonymitySettings = (byte)(AnonymitySettings | (byte)level); }
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)); }
/// <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); }