/// <summary> /// Deselects the card tree view items. /// </summary> /// <param name="learningModuleTreeViewItem">The learning module tree view item.</param> /// <remarks>Documented by Dev08, 2009-07-16</remarks> private void DeselectCardTreeViewItems(LearningModuleTreeViewItem learningModuleTreeViewItem) { foreach (ChapterTreeViewItem chapterTreeViewItem in learningModuleTreeViewItem.Chapters) { DeselectCardTreeViewItems(chapterTreeViewItem); } }
/// <summary> /// Handles the Click event of the checkBoxFilterLearningMode control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.Windows.RoutedEventArgs"/> instance containing the event data.</param> /// <remarks>Documented by Dev08, 2009-07-16</remarks> private void checkBoxFilter_Click(object sender, RoutedEventArgs e) { if (e.Source is CheckBox) { if ((e.Source as CheckBox) == checkBoxFilterPicture || (e.Source as CheckBox) == checkBoxFilterAudio || (e.Source as CheckBox) == checkBoxFilterVideo) { LearningModuleTreeViewItem item = TreeViewItems[0]; if (!item.IsMediaInfoLoaded) { item.MediaContentLoaded += new EventHandler(MediaContentLoaded); item.MediaContentLoading += new LearningModuleTreeViewItem.MediaContentLoadingEventHandler(MediaContentLoading); item.LoadLearningModuleMediaInfo(); return; } } else if ((e.Source as CheckBox) == checkBoxFilterExampleSentence) { LearningModuleTreeViewItem item = TreeViewItems[0]; if (!item.IsExampleInfoLoaded) { item.ExampleContentLoaded += new EventHandler(ExampleContentLoaded); item.ExampleContentLoading += new LearningModuleTreeViewItem.ExampleContentLoadingEventHandler(ExampleContentLoading); item.LoadLearningModuleExampleSentenceInfo(); return; } } } UpdateFilter(); }
/// <summary> /// Loads the content. /// </summary> /// <remarks>Documented by Dev08, 2009-07-18</remarks> private void LoadContent() { textBlockProgressBar.Text = string.Empty; progressBarLoad.IsIndeterminate = false; TreeViewItems.Add(new LearningModuleTreeViewItem(SettingsManagerLogic.LearningModule)); LearningModuleTreeViewItem item = TreeViewItems[0]; item.ContentLoaded += new EventHandler(ContentLoaded); item.ContentLoading += new LearningModuleTreeViewItem.ContentLoadingEventHandler(ContentLoading); item.LoadLearningModuleContent(); }
/// <summary> /// Handles the Opened event of the contextMenuLearningModule control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.Windows.RoutedEventArgs"/> instance containing the event data.</param> /// <remarks>Documented by Dev08, 2009-07-16</remarks> private void contextMenuLearningModule_Opened(object sender, RoutedEventArgs e) { if (!(sender is ContextMenu)) { return; } LearningModuleTreeViewItem learningModuleTreeViewItem = (sender as ContextMenu).Tag as LearningModuleTreeViewItem; if (learningModuleTreeViewItem == null) { return; } learningModuleTreeViewItem.IsSelected = true; }
/// <summary> /// Handles the Click event of the menuItemLMDeselectAllCards control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.Windows.RoutedEventArgs"/> instance containing the event data.</param> /// <remarks>Documented by Dev08, 2009-07-16</remarks> private void menuItemLMDeselectAllCards_Click(object sender, RoutedEventArgs e) { if (!(sender is MenuItem)) { return; } LearningModuleTreeViewItem learningModuleTreeViewItem = (sender as MenuItem).Tag as LearningModuleTreeViewItem; if (learningModuleTreeViewItem == null) { return; } DeselectCardTreeViewItems(learningModuleTreeViewItem); }
/// <summary> /// Handles the SelectedItemChanged event of the treeViewLearningModule control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.Windows.RoutedPropertyChangedEventArgs<System.Object>"/> instance containing the event data.</param> /// <remarks>Documented by Dev08, 2009-07-20</remarks> private void treeViewLearningModule_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs <object> e) { if (!(sender is TreeView)) { return; } if ((sender as TreeView).SelectedItem is LearningModuleTreeViewItem) { LearningModuleTreeViewItem learningModuleTreeViewItem = (sender as TreeView).SelectedItem as LearningModuleTreeViewItem; settingsControlMain.SetSettings(learningModuleTreeViewItem.Settings); } else if ((sender as TreeView).SelectedItem is ChapterTreeViewItem) { ChapterTreeViewItem chapterTreeViewItem = (sender as TreeView).SelectedItem as ChapterTreeViewItem; settingsControlMain.SetSettings(chapterTreeViewItem.Settings); } else if ((sender as TreeView).SelectedItem is CardTreeViewItem) { CardTreeViewItem cardTreeViewItem = (sender as TreeView).SelectedItem as CardTreeViewItem; settingsControlMain.SetSettings(cardTreeViewItem.Settings); } }
/// <summary> /// Initializes a new instance of the <see cref="ChapterTreeViewItem"/> class. /// </summary> /// <param name="chapter">The chapter.</param> /// <remarks>Documented by Dev08, 2009-07-15</remarks> public ChapterTreeViewItem(IChapter chapter, LearningModuleTreeViewItem parent) : base(parent) { this.chapter = chapter; hasCustomSettings = chapter.Settings != null && !SettingsManagerBusinessLogic.IsEmptySetting(chapter.Settings) ? true : false; }
/// <summary> /// Initializes a new instance of the <see cref="ChapterTreeViewItem"/> class. /// </summary> /// <param name="chapter">The chapter.</param> /// <remarks>Documented by Dev08, 2009-07-15</remarks> public ChapterTreeViewItem(IChapter chapter, LearningModuleTreeViewItem parent) : base(parent) { this.chapter = chapter; hasCustomSettings = chapter.Settings != null && !SettingsManagerBusinessLogic.IsEmptySetting(chapter.Settings) ? true : false; }
/// <summary> /// Deselects the card tree view items. /// </summary> /// <param name="learningModuleTreeViewItem">The learning module tree view item.</param> /// <remarks>Documented by Dev08, 2009-07-16</remarks> private void DeselectCardTreeViewItems(LearningModuleTreeViewItem learningModuleTreeViewItem) { foreach (ChapterTreeViewItem chapterTreeViewItem in learningModuleTreeViewItem.Chapters) DeselectCardTreeViewItems(chapterTreeViewItem); }