public ReplyDialog(SPDiscussion discussion, SPTopic topic) : this() { _discussion = discussion; _topic = topic; Title = string.Format("Klabr - {0} : {1}", discussion.Title, topic.Title); UpdateReplies(); }
public TopicView(SPDiscussion discussion) { InitializeComponent(); _discussion = discussion; // Copy the results to our ObservableCollection and attach the // PropertyChanged Event so we know when this has been updated foreach (SPTopic topic in discussion.Topics) { _topicCollection.Add(topic); topic.PropertyChanged += TopicChanged; } // Add this to handle double-click on topics if needed //topicListView.AddHandler( // Control.MouseDoubleClickEvent, // new RoutedEventHandler(topicListView_DoubleClick)); }
public SPDiscussion(SPDiscussion discussion) : this() { /* this.Communities = discussion.Communities; this.Created = discussion.Created; this.Description = discussion.Description; this.IsUnsubscribed = discussion.IsUnsubscribed; this.ItemCount = discussion.ItemCount; this.LastModified = discussion.LastModified; this.LastViewed = discussion.LastViewed; this.Moderators = discussion.Moderators; this.Site = discussion.Site; this.Title = discussion.Title; this.Topics = new List<SPTopic>(); this.UniqueID = discussion.UniqueID; this.Url = discussion.Url; */ foreach (PropertyInfo info in discussion.GetType().GetProperties()) { info.SetValue(this, info.GetValue(discussion, null), null); } }
//public WorkerData(string status, string site) //{ // Status = status; // Site = site; //} //public WorkerData(SPDiscussion discussion) //{ // Discussion = discussion; //} public WorkerData(string status, SPDiscussion discussion) { Status = status; Discussion = discussion; }
private void RefreshWorkerDoWork(object sender, DoWorkEventArgs e) { try { // Indicate operation in progress... _refreshWorker.ReportProgress(2, new WorkerData("Connecting to SharePoint...")); List<PublishedDiscussion> publishedDiscussions = MainWindow.Portal.GetPublishedDiscussions( Properties.Settings.Default.PublishedDiscussionsUrl, Properties.Settings.Default.PublishedDiscussionsListName); foreach (PublishedDiscussion publishedDiscussion in publishedDiscussions) { SPDiscussion discussion = new SPDiscussion(); discussion.Title = publishedDiscussion.Title; discussion.Description = publishedDiscussion.Description; discussion.Moderators = publishedDiscussion.Moderators; discussion.Communities = publishedDiscussion.Communities; discussion.Url = publishedDiscussion.Url; try { discussion = MainWindow.Portal.UpdateDiscussion(discussion); // Filter out discussion boards that fall below the legal limit if (discussion.ItemCount >= Properties.Settings.Default.DiscussionFilter) { _refreshWorker.ReportProgress(2, new WorkerData("Collecting discussion boards...", discussion)); } } catch (Exception) { /*ignored*/ } } } catch (Exception) { /*ignored*/ } _refreshWorker.ReportProgress(0, new WorkerData("Discussion boards loaded.")); }
public AddTopicDialog(SPDiscussion discussion) : this() { _discussion = discussion; Title = "Klabr - Add Topic : " + discussion.Title; }