protected void UpdatedConversationDetails(ConversationDetails conv)
 {
     Dispatcher.adopt(delegate
     {
         if (Globals.isAuthor)
         {
             ownerQuickControls.Visibility = Visibility.Visible;
             participantQuickControls.Visibility = Visibility.Collapsed;
         }
         else
         {
             ownerQuickControls.Visibility = Visibility.Collapsed;
             participantQuickControls.Visibility = Visibility.Visible;
         }
         studentCanPublishCheckbox.IsChecked = conv.Permissions.studentCanWorkPublicly;
         studentMustFollowTeacherCheckbox.IsChecked = conv.Permissions.usersAreCompulsorilySynced;
         if (conv.Permissions.usersAreCompulsorilySynced)
         {
             syncButton.IsChecked = true;
             syncButton.IsEnabled = false;
             Globals.synched = true;
             if (Globals.teacherSlide > 0)
             {
                 if (Globals.location.currentSlide.id != Globals.teacherSlide && Globals.location.availableSlides.Exists(sl => sl.id == Globals.teacherSlide))
                 {
                     Commands.MoveTo.Execute(new Location(Globals.location.activeConversation,Globals.location.availableSlides.Find(s => s.id == Globals.teacherSlide),Globals.location.availableSlides));
                 }
             }
         }
         else
         {
             syncButton.IsEnabled = true;
         }
     });
 }
 private void JoinConversation(ConversationDetails details)
 {
     Dispatcher.adopt(delegate
     {
         submissionList.Clear();
     });
 }
 private void UpdateDialogBoxAppearance()
 {
     var suggestedName = ConversationDetails.DefaultName(Globals.me);
     switch (dialogMode)
     {
         case ConversationConfigurationMode.CREATE:
             createGroup.Visibility = Visibility.Visible;
             importGroup.Visibility = Visibility.Collapsed;
             CommitButton.Content = "Create";
             if (details == null)
                 details = new ConversationDetails
                 (suggestedName,"",Globals.me,new List<Slide>(),Permissions.LECTURE_PERMISSIONS,"Unrestricted",SandRibbonObjects.DateTimeFactory.Now(),SandRibbonObjects.DateTimeFactory.Now());
             break;
         case ConversationConfigurationMode.EDIT:
             createGroup.Visibility = Visibility.Collapsed;
             importGroup.Visibility = Visibility.Collapsed;
             CommitButton.Content = "Update";
             details = App.controller.client.DetailsOf(conversationJid);
             PopulateFields();
             if (details == null)
             {
                 MeTLMessage.Warning("No valid conversation currently selected.  Please ensure you are in a conversation you own when editing a conversation.");
                 this.Close();
             }
             break;
         case ConversationConfigurationMode.IMPORT:
             createGroup.Visibility = Visibility.Visible;
             importGroup.Visibility = Visibility.Visible;
             LowQualityPowerpointListBoxItem.IsChecked = true;
             CommitButton.Content = "Create";
             details = new ConversationDetails
             (suggestedName, "", Globals.me, new List<Slide>(), Permissions.LECTURE_PERMISSIONS, "Unrestricted", SandRibbonObjects.DateTimeFactory.Now(), SandRibbonObjects.DateTimeFactory.Now());
             break;
     }
 }
        private void UpdateConversationDetails(ConversationDetails details)
        {
            Dispatcher.adopt(delegate
            {
                if (Globals.location.activeConversation.IsEmpty)
                {
                    current.Visibility = Visibility.Collapsed;
                    currentConversation.Visibility = Visibility.Collapsed;
                    separator2.Visibility = Visibility.Collapsed;
                }
                if (details.IsEmpty) return;

                // if the conversation we're participating in has been deleted or we're no longer in the listed permission group 
                if (details.Jid == Globals.location.activeConversation.Jid)
                {
                    if (details.isDeleted || (!details.UserHasPermission(Globals.credentials)))
                    {
                        current.Visibility = Visibility.Collapsed;
                        currentConversation.Visibility = Visibility.Collapsed;
                        separator2.Visibility = Visibility.Collapsed;
                        Commands.ShowConversationSearchBox.Execute("find");
                    }
                }
            });
        }
 private void updateConversationDetails(ConversationDetails details)
 {
     if (details.IsEmpty) return;
     Dispatcher.adopt(delegate
     {
         try
         {
             if (Globals.isAuthor)
             {
                 amAuthor();
             }
             else
             {
                 amRespondent();
             }
         }
         catch (NotSetException)
         {
         }
         if (details.Jid == Globals.location.activeConversation.Jid && details.isDeleted)
         {
             Globals.quiz.answers.Clear();
             Globals.quiz.activeQuizzes.Clear();
         }
     });
 }
 private void UpdateConversationDetails(ConversationDetails details)
 {
     if (ConversationDetails.Empty.Equals(details)) return;
     Dispatcher.adopt(delegate
     {
         nav.Visibility = Visibility.Visible;
     });
 }
 private void updateConversationDetails(ConversationDetails details)
 {
     Dispatcher.adopt(delegate
     {
         editConversation.Visibility = Globals.isAuthor ? Visibility.Visible : Visibility.Collapsed;
         bannedContentManagement.Visibility = Globals.isAuthor ? Visibility.Visible : Visibility.Collapsed;
     });
 }
 private void UpdateConversationDetails(ConversationDetails details)
 {
     if (details.IsEmpty) return;
     if (details.Jid == Globals.location.activeConversation.Jid && details.isDeleted)
         Dispatcher.adopt(delegate
     {
         clearOutAttachments(null);
     });
 }
 public void EqualsTest()
 {
     ConversationDetails target = new ConversationDetails(); // TODO: Initialize to an appropriate value
     object obj = null; // TODO: Initialize to an appropriate value
     bool expected = false; // TODO: Initialize to an appropriate value
     bool actual;
     actual = target.Equals(obj);
     Assert.AreEqual(expected, actual);
     Assert.Inconclusive("Verify the correctness of this test method.");
 }
 private void settingEnabledModes(ConversationDetails details)
 {
     Dispatcher.adopt(delegate
                           {
                               if (canBecomePublic() && !details.blacklist.Contains(Globals.me))
                               {
                                   publicMode.IsEnabled = true;
                               }
                               else
                               {
                                   publicMode.IsEnabled = false;
                                   SetPrivacy("private");
                               }
                           });
 }
 private void joinConversation(ConversationDetails details)
 {
     Dispatcher.adopt(delegate
     {
         details.LastAccessed = DateTime.Now;
         if (recentConversations.Where(c => c.Jid == details.Jid).Count() > 0)
             recentConversations.Where(c => c.Jid == details.Jid).First().LastAccessed = details.LastAccessed;
         else
         {
             recentConversations = recentConversations.Concat(new[] { details });
         }
         RecentConversationProvider.addRecentConversation(details, Globals.me);
         conversations.ItemsSource = recentConversations.OrderByDescending(c => c.LastAccessed).Take(6);
     });
 }
 private void UpdateConversationDetails(ConversationDetails details)
 {
     if (ConversationDetails.Empty.Equals(details)) return;
     if (recentConversations.Where(c => c.IsJidEqual(details.Jid)).Count() == 0) return;
     Dispatcher.adopt(delegate
     {
         if (details.isDeleted)
         {
             recentConversations = recentConversations.Where(c => c.Jid != details.Jid);
             RecentConversationProvider.removeRecentConversation(details.Jid);
         }
         else
             recentConversations.Where(c => c.Jid == details.Jid).First().Title = details.Title;
         conversations.ItemsSource = recentConversations.OrderByDescending(c => c.LastAccessed).Take(6);
     });
 }
 private void updateConversationDetails(ConversationDetails details)
 {
     Dispatcher.adopt(delegate
     {
         NavigationIsLocked = details.Permissions.NavigationLocked;
         /*
         if (details.Permissions.studentCanPublish)
         {
             tutorialStyle.IsChecked = true;
         }
         else {
             lectureStyle.IsChecked = true;
         }
         */
     });
 }
        private void detailsChanged(ConversationDetails details)
        {
            if (ConversationDetails.Empty.Equals(details)) return;
            Dispatcher.adopt(delegate
            {
                try
                {
                    if (Globals.conversationDetails.Author == Globals.me)
                        amTeacher();
                    else
                        amStudent();
                }
                catch (NotSetException)
                {
                }

            });
        }
 public static void addRecentConversation(ConversationDetails document, String me)
 {
     try
     {
         if (document.Title == null) return;
         if (!File.Exists(RECENT_DOCUMENTS))
             new XDocument(new XElement("recentConversations")).Save(RECENT_DOCUMENTS);
         var recentDocs = XDocument.Load(RECENT_DOCUMENTS);
         var referencesToThisConversation = recentDocs.Descendants("conversation")
             .Where(c => safeAttr(c,"jid") == document.Jid && safeAttr(c,"server") == serverId);
         switch (referencesToThisConversation.Count())
         {
             case 0:
                 recentDocs.Root.Add(new XElement("conversation",
                     new XAttribute("server", serverId),
                     new XAttribute("title", document.Title),
                     new XAttribute("author", document.Author),
                     new XAttribute("jid", document.Jid),
                     new XAttribute("subject", document.Subject),
                     new XAttribute("deleted", document.isDeleted.ToString()),
                     new XAttribute("lastAccessTime", SandRibbonObjects.DateTimeFactory.Now().ToString())));
                 break;
             case 1:
                 var cd = referencesToThisConversation.Single();
                 cd.SetAttributeValue("title", document.Title);
                 cd.SetAttributeValue("subject", document.Subject);
                 cd.SetAttributeValue("lastAccessTime", SandRibbonObjects.DateTimeFactory.Now().ToString());
                 cd.SetAttributeValue("deleted",document.isDeleted.ToString());
                 break;
             default:
                 MeTLMessage.Warning("Too many instances of " + document.Title + " in recent history.  Not listing.");
                 break;
         }
         recentDocs.Save(RECENT_DOCUMENTS);
     }
     catch (IOException)
     {
     }
 }
 public void ConversationDetailsConstructorTest()
 {
     ConversationDetails target = new ConversationDetails();
     Assert.Inconclusive("TODO: Implement code to verify target");
 }
 public void UpdateTest()
 {
     ConversationDetails proposedDetails = new ConversationDetails
     (
         "Welcome to Staging on Madam",
         "100",
         "hagand",
         "",
         new List<Slide> 
         {
             new Slide(101,"hagand",Slide.TYPE.SLIDE,0,720,540),
             new Slide(106,"hagand",Slide.TYPE.SLIDE,1,720,540),
             new Slide(105,"hagand",Slide.TYPE.SLIDE,2,720,540),
             new Slide(104,"hagand",Slide.TYPE.SLIDE,3,720,540),
             new Slide(102,"hagand",Slide.TYPE.SLIDE,4,720,540),
             new Slide(103,"hagand",Slide.TYPE.SLIDE,5,720,540)
         },
         new Permissions(null, true, true, false),
         "Unrestricted",
         new DateTime(2010, 05, 18, 15, 00, 53),
         new DateTime(0001, 01, 1, 0, 0, 0)
     );
     ConversationDetails expectedDetails = new ConversationDetails
     (
         "Welcome to Staging on Madam",
         "100",
         "hagand",
         "",
         new List<Slide> 
         {
             new Slide(101,"hagand",Slide.TYPE.SLIDE,0,720,540),
             new Slide(106,"hagand",Slide.TYPE.SLIDE,1,720,540),
             new Slide(105,"hagand",Slide.TYPE.SLIDE,2,720,540),
             new Slide(104,"hagand",Slide.TYPE.SLIDE,3,720,540),
             new Slide(102,"hagand",Slide.TYPE.SLIDE,4,720,540),
             new Slide(103,"hagand",Slide.TYPE.SLIDE,5,720,540)
         },
         new Permissions(null, true, true, false),
         "Unrestricted",
         new DateTime(2010, 05, 18, 15, 00, 53),
         new DateTime(0001, 01, 1, 0, 0, 0)
     );
     FileConversationDetailsProvider provider = kernel.Get<FileConversationDetailsProvider>();
     ConversationDetails actual = provider.Update(proposedDetails);
     Assert.AreEqual(actual, expectedDetails);
 }
 public void PermissionsTest()
 {
     ConversationDetails target = new ConversationDetails(); // TODO: Initialize to an appropriate value
     Permissions expected = null; // TODO: Initialize to an appropriate value
     Permissions actual;
     target.Permissions = expected;
     actual = target.Permissions;
     Assert.AreEqual(expected, actual);
     Assert.Inconclusive("Verify the correctness of this test method.");
 }
 public void TitleTest()
 {
     ConversationDetails target = new ConversationDetails(); // TODO: Initialize to an appropriate value
     string expected = string.Empty; // TODO: Initialize to an appropriate value
     string actual;
     target.Title = expected;
     actual = target.Title;
     Assert.AreEqual(expected, actual);
     Assert.Inconclusive("Verify the correctness of this test method.");
 }
 public void WriteXmlTest()
 {
     ConversationDetails target = new ConversationDetails(); // TODO: Initialize to an appropriate value
     XElement expected = null; // TODO: Initialize to an appropriate value
     XElement actual;
     actual = target.WriteXml();
     Assert.AreEqual(expected, actual);
     Assert.Inconclusive("Verify the correctness of this test method.");
 }
 public void IsValidTest()
 {
     ConversationDetails target = new ConversationDetails(); // TODO: Initialize to an appropriate value
     bool actual;
     actual = target.IsValid;
     Assert.Inconclusive("Verify the correctness of this test method.");
 }
 public void RefreshTest()
 {
     ConversationDetails target = new ConversationDetails(); // TODO: Initialize to an appropriate value
     target.Refresh();
     Assert.Inconclusive("A method that does not return a value cannot be verified.");
 }
 public void NextAvailableSlideIdTest()
 {
     ConversationDetails target = new ConversationDetails(); // TODO: Initialize to an appropriate value
     int expected = 0; // TODO: Initialize to an appropriate value
     int actual;
     actual = target.NextAvailableSlideId();
     Assert.AreEqual(expected, actual);
     Assert.Inconclusive("Verify the correctness of this test method.");
 }
 public void GetBytesTest()
 {
     ConversationDetails target = new ConversationDetails(); // TODO: Initialize to an appropriate value
     byte[] expected = null; // TODO: Initialize to an appropriate value
     byte[] actual;
     actual = target.GetBytes();
     Assert.AreEqual(expected, actual);
     Assert.Inconclusive("Verify the correctness of this test method.");
 }
 public void receiveConversationDetails(ConversationDetails cd) { }
 private void JoinConversation(ConversationDetails details)
 {
     Commands.CheckExtendedDesktop.ExecuteAsync(null);
     client.JoinConversation(details);
 }
 private void LeaveConversation(ConversationDetails details)
 {
     client.LeaveConversation(details);
 }
 public void detailsOfTest()
 {
     String conversationJid = "100";
     ConversationDetails expectedDetails = new ConversationDetails
     (
         "Welcome to Staging on Madam",
         "100",
         "hagand",
         "",
         new List<Slide> 
         {
             new Slide(101,"hagand",Slide.TYPE.SLIDE,0,720,540),
             new Slide(106,"hagand",Slide.TYPE.SLIDE,1,720,540),
             new Slide(105,"hagand",Slide.TYPE.SLIDE,2,720,540),
             new Slide(104,"hagand",Slide.TYPE.SLIDE,3,720,540),
             new Slide(102,"hagand",Slide.TYPE.SLIDE,4,720,540),
             new Slide(103,"hagand",Slide.TYPE.SLIDE,5,720,540)
         },
         new Permissions(null, true, true, false),
         "Unrestricted",
         new DateTime(2010, 05, 18, 15, 00, 53),
         new DateTime(0001, 01, 1, 0, 0, 0)
     );
     kernel.Unbind<FileConversationDetailsProvider>();
     kernel.Bind<FileConversationDetailsProvider>().To<FileConversationDetailsProvider>().InSingletonScope();
     FileConversationDetailsProvider provider = kernel.Get<FileConversationDetailsProvider>();
     ConversationDetails actual = provider.DetailsOf(conversationJid);
     Assert.AreEqual(expectedDetails.Title, actual.Title);
     Assert.AreEqual(expectedDetails.Jid, actual.Jid);
     Assert.AreEqual(expectedDetails.Slides.Count, actual.Slides.Count);
 }
 private void MoveTo(ConversationDetails details, Slide slide)
 {
     client.MoveTo(details,slide);
 }
 public void CreateTest()
 {
     ConversationDetails proposedConversationDetails = new ConversationDetails();
     ConversationDetails expectedDetails = null;
     FileConversationDetailsProvider provider = kernel.Get<FileConversationDetailsProvider>();
     ConversationDetails actual = provider.Create(proposedConversationDetails);
     Assert.AreEqual(1, actual.Slides.Count);
 }