Пример #1
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            if (delta == null)
            {
                return;
            }

            DeltaParser.SaveDelta(delta, Settings.Default.SaveTo);
        }
Пример #2
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            if (delta == null)
            {
                return;
            }
            var dir  = Utils.BrowseForFolder("Select Output Directory");
            var file = "MIM_Delta_" + DateTime.Now.ToString("yyyyMMdd_hhmmss") + ".xml";

            file = System.IO.Path.Combine(dir, file);
            DeltaParser.SaveDelta(delta, file);
            MessageBox.Show(string.Format("File saved as '{0}'", file), "File Saved", MessageBoxButton.OK, MessageBoxImage.Information);
        }
Пример #3
0
        void MainWindow_Loaded(object sender, RoutedEventArgs e)
        {
            try
            {
                delta = DeltaParser.ReadDelta(Settings.Default.SourceFile, Settings.Default.TargetFile, Settings.Default.DeltaFile);

                deltaVC     = new DeltaViewController(delta);
                view.Source = deltaVC.View;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString(), "Error", MessageBoxButton.OK, MessageBoxImage.Error);
                Application.Current.Shutdown();
            }
        }
Пример #4
0
        private void Save_Exclusions_Click(object sender, RoutedEventArgs e)
        {
            if (delta == null)
            {
                return;
            }


            Microsoft.Win32.SaveFileDialog dlg = new Microsoft.Win32.SaveFileDialog();
            dlg.FileName   = "exclusions.xml";
            dlg.DefaultExt = ".xml";
            dlg.Filter     = "Exclusions (.xml)|*.xml|All Files (*.*)|*.*";

            Nullable <bool> result = dlg.ShowDialog();

            if (result == true)
            {
                DeltaParser.SaveExclusions(delta, dlg.FileName);
            }
        }
Пример #5
0
        private void Save_Click(object sender, RoutedEventArgs e)
        {
            if (delta == null)
            {
                return;
            }


            Microsoft.Win32.SaveFileDialog dlg = new Microsoft.Win32.SaveFileDialog();
            dlg.FileName   = FilteredChangesFileName;
            dlg.DefaultExt = ".xml";
            dlg.Filter     = "Filtered Delta FIM Service objects (.xml)|*.xml|All Files (*.*)|*.*";

            Nullable <bool> result = dlg.ShowDialog();

            if (result == true)
            {
                DeltaParser.SaveDelta(delta, dlg.FileName);
            }
        }
Пример #6
0
        void MainWindow_Loaded(object sender, RoutedEventArgs e)
        {
            try
            {
                string src = Utils.BrowseForFile("Select the Source file");
                string tgt = Utils.BrowseForFile("Select the Target file");
                string dlt = Utils.BrowseForFile("Select the Changes file");

                // delta = DeltaParser.ReadDelta(Settings.Default.SourceFile, Settings.Default.TargetFile, Settings.Default.DeltaFile);
                delta = DeltaParser.ReadDelta(src, tgt, dlt);

                deltaVC     = new DeltaViewController(delta);
                view.Source = deltaVC.View;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString(), "Error", MessageBoxButton.OK, MessageBoxImage.Error);
                Application.Current.Shutdown();
            }
        }
Пример #7
0
        private void OKButton_Click(object sender, RoutedEventArgs e)
        {
            // In case the user just typed in the file names and didn't browse, we need to copy
            // the textbox values into our public properties

            if (!SourceFileName.EndsWith(SourceFileNameTextBox.Text))
            {
                SourceFileName = SourceFileNameTextBox.Text;
            }

            if (!TargetFileName.EndsWith(TargetFileNameTextBox.Text))
            {
                TargetFileName = TargetFileNameTextBox.Text;
            }

            if (!ChangesFileName.EndsWith(ChangesFileNameTextBox.Text))
            {
                ChangesFileName = ChangesFileNameTextBox.Text;
            }

            try
            {
                delta = DeltaParser.ReadDelta(SourceFileName, TargetFileName, ChangesFileName);
            }
            catch (System.IO.FileNotFoundException ex)
            {
                MessageBox.Show(string.Format("Unable to open files: {0}", ex.Message), "Error", MessageBoxButton.OK, MessageBoxImage.Error);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString(), "Error", MessageBoxButton.OK, MessageBoxImage.Error);
            }

            if (delta != null)
            {
                this.Close();
            }
        }