Example #1
0
        public string GroupGetVisibility(int id)
        {
            Group g = Group.Find(id);

            DataNew.Entities.GroupVisibility vis = g.Visibility;
            switch (vis)
            {
            case DataNew.Entities.GroupVisibility.Everybody:
                return("all");

            case DataNew.Entities.GroupVisibility.Nobody:
                return("none");

            case DataNew.Entities.GroupVisibility.Owner:
                return("me");

            case DataNew.Entities.GroupVisibility.Undefined:
                return("undefined");

            case DataNew.Entities.GroupVisibility.Custom:
                if (g.Viewers.Count == 1 && g.Viewers[0] == g.Controller)
                {
                    return("me");
                }
                else
                {
                    return("custom");
                }

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
Example #2
0
        public string GroupGetVisibility(int id)
        {
            DataNew.Entities.GroupVisibility vis = Group.Find(id).Visibility;
            switch (vis)
            {
            case DataNew.Entities.GroupVisibility.Everybody:
                return("all");

            case DataNew.Entities.GroupVisibility.Nobody:
                return("none");

            case DataNew.Entities.GroupVisibility.Owner:
                return("me");

            case DataNew.Entities.GroupVisibility.Undefined:
                return("undefined");

            case DataNew.Entities.GroupVisibility.Custom:
                return("custom");

            default:
                throw new ArgumentOutOfRangeException();
            }
        }