/// <summary> /// Constructor for HelperManager /// </summary> /// <param name="ownerWindow">Setting the owner of windowHelper to ownerWindow</param> public HelperManager(Window ownerWindow) { settingsManager = Settings.Instance; windowHelper = new HelperWindow(); windowHelper.Owner = ownerWindow; mainWindow = ownerWindow; windowHelper.Show(); windowHelper.Visibility = Visibility.Hidden; }
/// <summary> /// Function to Load exclusion from settings to Exclude Box /// </summary> /// <returns></returns> public void LoadExcludeData() { settingsManager = Settings.Instance; settingsManager.SetOwnerWindow(this); ExcludeData loadedExcludeData = settingsManager.LoadExcludeData(leftPath, rightPath); int fileTypeListSize = loadedExcludeData.ExcludeFileTypeList.Count; int fileNameListSize = loadedExcludeData.ExcludeFileNameList.Count; int folderListSize = loadedExcludeData.ExcludeFolderList.Count; if (fileTypeListSize != 0) { for (int i = 0; i < fileTypeListSize; i++) { excludeFileTypes.Add(loadedExcludeData.ExcludeFileTypeList[i]); } } if (fileNameListSize != 0) { for (int i = 0; i < fileNameListSize; i++) { excludeFileNames.Add(loadedExcludeData.ExcludeFileNameList[i]); } } if (folderListSize != 0) { for (int i = 0; i < folderListSize; i++) { excludeFolders.Add(loadedExcludeData.ExcludeFolderList[i]); } } if ((fileTypeListSize != 0) || (fileNameListSize != 0) || (folderListSize != 0)) { if (HintText.Visibility == Visibility.Visible) { HintText.Visibility = Visibility.Collapsed; HintIcon.Visibility = Visibility.Collapsed; ListBoxExclude.Visibility = Visibility.Visible; } ClearListBox(); UpdateListBox(); } }
/// <summary> /// Constructor for VisualPreviewWindow /// </summary> public VisualPreviewWindow() { InitializeComponent(); settingsManager = Settings.Instance; settingsManager.SetOwnerWindow(this); // Get the debugLogger class instance debugLogger = DebugLogger.Instance; }
/// <summary> /// Constructor for HomePage class /// </summary> public HomePage() { InitializeComponent(); // Initialise Helper helper = new HelperManager(mainWindow); // Get the settings class instance settingsManager = Settings.Instance; settingsManager.SetHomePage(this); // Get the debugLogger class instance debugLogger = DebugLogger.Instance; mainWindow.Closing += new CancelEventHandler(mainWindow_Closing); actualLeftPath = nsync.Properties.Resources.panelText; actualRightPath = nsync.Properties.Resources.panelText; }
/// <summary> /// Update the checkbox on SettingsPage /// </summary> private void CheckSettings() { settingsManager = Settings.Instance; //gets helper window settings int loadedTimer = settingsManager.GetHelperWindowStatus(); if (loadedTimer == -1) loadedTimer = 11; HelperWindowSlider.Value = loadedTimer; HelperWindowSliderValue.SelectedIndex = loadedTimer; //gets exclude window settings if (settingsManager.GetExcludeWindowStatus() == 0) CheckboxToggleExcludeWindow.IsChecked = true; //gets trackback settings if (settingsManager.GetTrackBackStatus() == 0) CheckboxToggleTrackBack.IsChecked = true; //flag for enabling the boxes for user input pageIsLoaded = true; }
/// <summary> /// TrackBackPage Contructor /// </summary> public TrackBackPage() { InitializeComponent(); settingsManager = Settings.Instance; // Get the debugLogger class instance debugLogger = DebugLogger.Instance; helper = new HelperManager(mainWindow); // Disables the TrackBackPage interface if no folder pairs are loaded in HomePage if (!File.Exists(SETTINGS_FILE_NAME) || settingsManager.LoadFolderPaths()[0] == "") { HideListViewForBothFolders(false); return; } else { LoadTrackBackXML(); trackback = new TrackBackEngine(); trackback.LeftFolderPath = actualLeftFolderPath; trackback.RightFolderPath = actualRightFolderPath; // Displays the message 'No TrackBack Data' if the folder does not have any previously backed up folders if (trackback.hasTrackBackData(actualLeftFolderPath) && trackback.hasTrackBackData(actualRightFolderPath)) { GridTrackBack.IsEnabled = true; } else if (trackback.hasTrackBackData(actualLeftFolderPath)) { DisplayListViewForLeftFolderOnly(true); } else if (trackback.hasTrackBackData(actualRightFolderPath)) { DisplayListViewForRightFolderOnly(true); } else { HideListViewForBothFolders(false); } // Adds the event handler for Restore trackback.backgroundWorkerForTrackBackRestore.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(backgroundWorkerForTrackBackRestore_RunWorkerCompleted); } }