Ejemplo n.º 1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void MainWindow_Loaded(object sender, RoutedEventArgs e)
 {
     try
     {
         if (Environment.GetCommandLineArgs().Length > 1)
         {
             changesFile = Environment.GetCommandLineArgs()[1];
         }
         else
         {
             OpenFileDialog fileDialog = new OpenFileDialog();
             fileDialog.Title  = "Provide a changes.xml file";
             fileDialog.Filter = "XML files|*.xml";
             bool?fileChosen = fileDialog.ShowDialog();
             if (fileChosen.Value)
             {
                 changesFile = fileDialog.FileName;
             }
             else
             {
                 MessageBox.Show("Provide a delta file as argument.", "Warning");
                 Application.Current.Shutdown();
             }
         }
         delta = new Delta(changesFile);
         deltaViewController = new DeltaViewController(delta);
         view.Source         = deltaViewController.View;
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString(), "Error", MessageBoxButton.OK, MessageBoxImage.Error);
         Application.Current.Shutdown();
     }
 }
Ejemplo n.º 2
0
        private void Open_Click(object sender, RoutedEventArgs e)
        {
            OpenFiles of = new OpenFiles();

            if (!string.IsNullOrEmpty(SourceFileName))
            {
                of.SourceFileName = SourceFileName;
            }

            if (!string.IsNullOrEmpty(TargetFileName))
            {
                of.TargetFileName = TargetFileName;
            }

            if (!string.IsNullOrEmpty(ChangesFileName))
            {
                of.ChangesFileName = ChangesFileName;
            }

            of.Owner = this;
            of.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterOwner;
            of.ShowDialog();
            if (of.delta != null)
            {
                delta       = of.delta;
                deltaVC     = new DeltaViewController(delta);
                view.Source = deltaVC.View;
            }
        }
Ejemplo n.º 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();
            }
        }
Ejemplo n.º 4
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();
     }
 }
Ejemplo n.º 5
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();
            }
        }
Ejemplo n.º 6
0
        private void Open_Click(object sender, RoutedEventArgs e)
        {
            OpenFiles of = new OpenFiles();

            if (!string.IsNullOrEmpty(SourceFileName))
            {
                of.SourceFileName = SourceFileName;
            }

            if (!string.IsNullOrEmpty(TargetFileName))
            {
                of.TargetFileName = TargetFileName;
            }

            if (!string.IsNullOrEmpty(ChangesFileName))
            {
                of.ChangesFileName = ChangesFileName;
            }

            of.Owner = this;
            of.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterOwner;
            of.ShowDialog();
            if (of.delta != null)
            {
                delta = of.delta;
                deltaVC = new DeltaViewController(delta);
                view.Source = deltaVC.View;
            }
        }