public ConversationDetails(String title, String jid, String author, List<Slide> slides, Permissions permissions, String subject)
     : base()
 {
     this.Title = title;
     this.Jid = jid;
     this.Author = author;
     this.Slides = slides;
     this.Permissions = permissions;
     this.Subject = subject;
 }
        public static Permissions ReadXml(XElement doc)
        {
            var studentCanPublish = Boolean.Parse(doc.Element(CANPUBLISH).ValueOrDefault("false"));
            var studentCanOpenFriends = Boolean.Parse(doc.Element(CANFRIEND).ValueOrDefault("false"));
            var usersAreCompulsorilySynced = false;
            if (doc.Element(ALLSYNC) != null)
                usersAreCompulsorilySynced = Boolean.Parse(doc.Element(ALLSYNC).Value);
            var permission = new Permissions("custom", studentCanOpenFriends, studentCanPublish, usersAreCompulsorilySynced);
            if (doc.Element(NAVIGATIONLOCKED) != null)
                permission.NavigationLocked = Boolean.Parse(doc.Element(NAVIGATIONLOCKED).Value);
            permission.studentsCanViewQuizResults = Boolean.Parse(doc.Element(CANVIEWQUIZ).ValueOrDefault("false")); ;
            permission.studentsCanDisplayQuizResults = Boolean.Parse(doc.Element(CANDISPLAYQUIZRESULTS).ValueOrDefault("false")); ;
            permission.studentsCanDisplayQuiz = Boolean.Parse(doc.Element(CANDISPLAYQUIZ).ValueOrDefault("false")); ;
            permission.studentsCanViewQuiz = Boolean.Parse(doc.Element(CANVIEWQUIZ).ValueOrDefault("true")); ;
            permission.studentsCanAnswerQuiz = Boolean.Parse(doc.Element(CANANSWERQUIZ).ValueOrDefault("true")); ;
            permission.studentsCanCreateQuiz = Boolean.Parse(doc.Element(CANCREATEQUIZ).ValueOrDefault("false")); ;
            permission.studentCanUploadAttachment = Boolean.Parse(doc.Element(STUDENTCANUPLOAD).ValueOrDefault("false")); ;
            permission.studentCanWorkPublicly = Boolean.Parse(doc.Element(CANPUBLISH).ValueOrDefault("false"));
            permission.studentCanAddPage = Boolean.Parse(doc.Element(CANADDPAGE).ValueOrDefault("false"));
            permission.studentCanSubmitScreenshot = Boolean.Parse(doc.Element(CANSUBMITSCREENSHOT).ValueOrDefault("true"));

            return permission;
        }
        /* copy constructor */
        public Permissions(Permissions copyPermissions)
        {
            this.Label = copyPermissions.Label;

            studentCanWorkPublicly = copyPermissions.studentCanWorkPublicly;
            this.studentCanOpenFriends = copyPermissions.studentCanOpenFriends;
            this.NavigationLocked = copyPermissions.NavigationLocked;
            this.usersAreCompulsorilySynced = copyPermissions.usersAreCompulsorilySynced;
            this.conversationGroup = copyPermissions.conversationGroup;
        }
 public ConversationDetails(String title, String jid, String author, String tag, List<Slide> slides, Permissions permissions, String subject)
     : this(title, jid, author, slides, permissions, subject)
 {
     this.Tag = tag;
 }
 public ConversationDetails(String title, String jid, String author, String tag, List<Slide> slides, Permissions permissions, String subject, DateTime created, DateTime lastAccessed, List<string> blacklist)
     : this(title, jid, author, slides, permissions, subject, created, lastAccessed)
 {
     this.blacklist = blacklist;
     this.Tag = tag;
 }
 public ConversationDetails(String title, String jid, String author, List<Slide> slides, Permissions permissions, String subject, DateTime created, DateTime lastAccessed)
     : this(title, jid, author, slides, permissions, subject)
 {
     this.Created = created;
     this.CreatedAsTicks = created.Ticks;
     this.LastAccessed = lastAccessed;
 }
 public static Permissions InferredTypeOf(Permissions permissions)
 {
     var typeOfPermissions = new[] { LECTURE_PERMISSIONS, LABORATORY_PERMISSIONS, TUTORIAL_PERMISSIONS, MEETING_PERMISSIONS }.Where(
            p => p.studentCanOpenFriends == permissions.studentCanOpenFriends &&
                p.studentCanPublish == permissions.studentCanPublish &&
                p.usersAreCompulsorilySynced == permissions.usersAreCompulsorilySynced).FirstOrDefault();
     if (typeOfPermissions != null) return typeOfPermissions;
     return CUSTOM_PERMISSIONS;
 }
 public void ReadXmlTest()
 {
     Permissions target = new Permissions(); // TODO: Initialize to an appropriate value
     XElement doc = null; // TODO: Initialize to an appropriate value
     Permissions expected = null; // TODO: Initialize to an appropriate value
     Permissions actual;
     actual = target.ReadXml(doc);
     Assert.AreEqual(expected, actual);
     Assert.Inconclusive("Verify the correctness of this test method.");
 }
 public void PermissionsConstructorTest()
 {
     Permissions target = new Permissions();
     Assert.Inconclusive("TODO: Implement code to verify target");
 }