Example #1
0
        /// <summary>
        /// Constructor for HomePage class
        /// </summary>
        public HomePage()
        {
            InitializeComponent();

            //Initialise Helper
            helper = new HelperManager(mainWindow);

            settingsManager = Settings.Instance;

            mainWindow.Closing += new CancelEventHandler(mainWindow_Closing);

            actualLeftPath  = nsync.Properties.Resources.panelText;
            actualRightPath = nsync.Properties.Resources.panelText;
        }
Example #2
0
        /// <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);
            }
        }
        /// <summary>
        /// Does the steps to an emergency closing of nsync
        /// </summary>
        /// <returns>HelperManager window for emergency closing message</returns>
        private HelperManager nsyncEmergencyClose()
        {
            homePage.IsErrorClosing();
            HelperManager emergencyHelper = new HelperManager(mainWindow);
            mainWindow.Visibility = Visibility.Hidden;
            if (visualPreviewWindow != null)
                visualPreviewWindow.Visibility = Visibility.Hidden;
            if (excludeWindow != null)
                excludeWindow.Visibility = Visibility.Hidden;

            return emergencyHelper;
        }
        /// <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>
        /// 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);
            }
        }