Ejemplo n.º 1
0
        public DifferencesDialog(Difference.DifferenceModel diff)
        {
            InitializeComponent();

            Icon  = Application.Current.MainWindow.Icon;
            Owner = Application.Current.MainWindow;

            if (Config.Root.HasSection("dialogs") && Config.Root.dialogs.HasSection("diff"))
            {
                dynamic section = Config.Root.dialogs.diff;
                Left   = section.pos_x;
                Top    = section.pos_y;
                Width  = section.size_x;
                Height = section.size_y;
            }
            else
            {
                Width  = 750;
                Height = 500;
                WindowStartupLocation = WindowStartupLocation.CenterOwner;
            }

            view.DataContext = diff;
            view.Root        = diff.Root;

            var cols = ((view as ListView).View as GridView).Columns;

            cols[1].Header = Path.GetFileNameWithoutExtension(diff.LeftSavegame.Filename);
            cols[2].Header = Path.GetFileNameWithoutExtension(diff.RightSavegame.Filename);
        }
        public async Task <bool?> RunAsync(string filename_2nd)
        {
            return(await Task.Run(() => {
                //_progress.CounterFormat = Translate._("Action.Validate.Compare.CounterFormat");
                _progress.Interval = 1024 * 1024;              //1024 * 128;
                _right_save = _LoadSave(filename_2nd);
                if (_right_save == null)
                {
                    return (bool?)null;
                }

                _differences = new D.DifferenceModel(_left_save, _right_save);
                _classes = new Dictionary <string, Dialogs.Difference.DifferenceNode>();

                _progress.CounterFormat = Translate._("Action.Compare.Progress.CounterFormat");
                _progress.Interval = 1000;                // -1;
                Log.Info("Starting up comparison ...");
                DateTime start_time = DateTime.Now;

                bool outcome = _CompareAll();

                DateTime end_time = DateTime.Now;
                TimeSpan ofs = end_time - start_time;
                Log.Info("Comparison took {0}", ofs);

                return outcome;
            }));
        }
Ejemplo n.º 3
0
        public static void Show(Difference.DifferenceModel diff)
        {
            var dlg = new DifferencesDialog(diff);

            dlg.ShowDialog();
        }