Ejemplo n.º 1
0
        /// <summary>
        /// event handler when close window button is clicked
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ButtonClose_Click(object sender, RoutedEventArgs e)
        {
            debugLogger.LogMessage(leftPath, rightPath, "ExcludeWindow.xaml.cs - ButtonClose_Click()", "Closing Exclude Window");

            cancel = true;
            this.Close();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// This method is called when user clicks on the Restore button
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ButtonRestore_Click(object sender, RoutedEventArgs e)
        {
            debugLogger.LogMessage(actualLeftFolderPath, actualRightFolderPath, "TrackBackPage.xaml.cs - ButtonRestore_Click()", "Trying to restore folders");
            try
            {
                if (GetOriginalFolderPath(GetSelectedComboBoxItem()) == actualLeftFolderPath && !trackback.hasEnoughDiskSpaceInLeftFolder())
                {
                    DisplayErrorInterface();
                    helper.Show(Properties.Resources.leftFolderInsufficientDiskSpace, HELPER_WINDOW_HIGH_PRIORITY, HelperWindow.windowStartPosition.windowTop);
                    debugLogger.LogMessage(actualLeftFolderPath, actualRightFolderPath, "TrackBackPage.xaml.cs - ButtonRestore_Click()", nsync.Properties.Resources.leftFolderInsufficientDiskSpace);
                }
                else if (GetOriginalFolderPath(GetSelectedComboBoxItem()) == actualRightFolderPath && !trackback.hasEnoughDiskSpaceInRightFolder())
                {
                    DisplayErrorInterface();
                    helper.Show(Properties.Resources.rightFolderInsufficientDiskSpace, HELPER_WINDOW_HIGH_PRIORITY, HelperWindow.windowStartPosition.windowTop);
                    debugLogger.LogMessage(actualLeftFolderPath, actualRightFolderPath, "TrackBackPage.xaml.cs - ButtonRestore_Click()", nsync.Properties.Resources.rightFolderInsufficientDiskSpace);
                }
                else
                {
                    EnableInterface(false);
                    LabelProgress.Visibility = Visibility.Visible;
                    LabelProgress.Content    = MESSAGE_RESTORING_FOLDERS;

                    if (GetOriginalFolderPath(GetSelectedComboBoxItem()) == actualLeftFolderPath)
                    {
                        trackback.StartRestore(actualLeftFolderPath, GetSelectedListViewItem(ListViewForLeftFolder));
                        debugLogger.LogMessage(actualLeftFolderPath, actualRightFolderPath, "TrackBackPage.xaml.cs - ButtonRestore_Click()", "Restoring left folder in progress");
                    }
                    else if (GetOriginalFolderPath(GetSelectedComboBoxItem()) == actualRightFolderPath)
                    {
                        trackback.StartRestore(actualRightFolderPath, GetSelectedListViewItem(ListViewForRightFolder));
                        debugLogger.LogMessage(actualLeftFolderPath, actualRightFolderPath, "TrackBackPage.xaml.cs - ButtonRestore_Click()", "Restoring right folder in progress");
                    }
                }
            }
            catch (UnauthorizedAccessException)
            {
                DisplayErrorInterface();
                helper.Show(Properties.Resources.accessRightsInsufficient, HELPER_WINDOW_HIGH_PRIORITY, HelperWindow.windowStartPosition.windowTop);
                debugLogger.LogMessage(actualLeftFolderPath, actualRightFolderPath, "TrackBackPage.xaml.cs - ButtonRestore_Click()", nsync.Properties.Resources.accessRightsInsufficient);
                return;
            }
            catch (FileNotFoundException fileNotFoundException)
            {
                DisplayErrorInterface();
                helper.Show(fileNotFoundException.Message, HELPER_WINDOW_HIGH_PRIORITY, HelperWindow.windowStartPosition.windowTop);
                debugLogger.LogMessage(actualLeftFolderPath, actualRightFolderPath, "TrackBackPage.xaml.cs - ButtonRestore_Click()", fileNotFoundException.Message);
                return;
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Event when comboBox value is changed
        /// </summary>
        private void HelperWindowSliderValue_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            ResetUI();
            if (pageIsLoaded)
            {
                if (HelperWindowSlider.Value != HelperWindowSliderValue.SelectedIndex)
                {
                    HelperWindowSlider.Value = HelperWindowSliderValue.SelectedIndex;
                    settingsManager.SetHelperWindowStatus((int)HelperWindowSlider.Value);
                }

                debugLogger.LogMessage(nsync.Properties.Resources.notApplicable, nsync.Properties.Resources.notApplicable, "SettingsPage.xaml.cs - HelperWindowSliderValue_SelectionChanged()", "Helper window combobox changed to " + HelperWindowSlider.Value.ToString());
            }
        }
Ejemplo n.º 4
0
        private void ButtonClose_Click(object sender, RoutedEventArgs e)
        {
            debugLogger.LogMessage(leftPath, rightPath, "VisualPreviewWindow.xaml.cs - ButtonClose_Click()", "Closing preview window");

            this.Close();
        }
Ejemplo n.º 5
0
        /// <summary>
        /// This method is called when user clicks on the exit button on MainWindow
        /// <para>nsync will exit after this</para>
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ButtonClose_Click(object sender, RoutedEventArgs e)
        {
            debugLogger.LogMessage(nsync.Properties.Resources.notApplicable, nsync.Properties.Resources.notApplicable, "MainWindow.xaml.cs - ButtonClose_Click()", "nsync closing from #" + viewList.SelectedIndex.ToString());

            this.Close();
        }