Exemplo n.º 1
0
        public string ImportAsComparison(IRun run, Form form = null)
        {
            var splitDialog = new OpenFileDialog();

            var result = splitDialog.ShowDialog();

            if (result == DialogResult.OK)
            {
                var filePath = splitDialog.FileName;

                using (var stream = File.OpenRead(filePath))
                {
                    var runFactory = new StandardFormatsRunFactory();
                    var comparisonGeneratorsFactory = new StandardComparisonGeneratorsFactory();

                    runFactory.Stream   = stream;
                    runFactory.FilePath = filePath;

                    var imported = runFactory.Create(comparisonGeneratorsFactory);

                    var comparisonName = Path.GetFileNameWithoutExtension(splitDialog.FileName);
                    result = InputBox.Show(form, "Enter Comparison Name", "Name:", ref comparisonName);
                    if (result != DialogResult.Cancel)
                    {
                        return(run.AddComparisonWithNameInput(imported, comparisonName, form));
                    }
                }
            }
            return(null);
        }
Exemplo n.º 2
0
        public string ImportAsComparison(IRun run, Form form = null)
        {
            var splitDialog = new OpenFileDialog();

            var result = splitDialog.ShowDialog();
            if (result == DialogResult.OK)
            {
                var filePath = splitDialog.FileName;

                using (var stream = File.OpenRead(filePath))
                {
                    var runFactory = new StandardFormatsRunFactory();
                    var comparisonGeneratorsFactory = new StandardComparisonGeneratorsFactory();

                    runFactory.Stream = stream;
                    runFactory.FilePath = filePath;

                    var imported = runFactory.Create(comparisonGeneratorsFactory);

                    var comparisonName = Path.GetFileNameWithoutExtension(splitDialog.FileName);
                    result = InputBox.Show(form, "Enter Comparison Name", "Name:", ref comparisonName);
                    if (result != DialogResult.Cancel)
                        return run.AddComparisonWithNameInput(imported, comparisonName, form);
                }
            }
            return null;
        }
Exemplo n.º 3
0
 public string ImportAsComparison(IRun run, Form form = null)
 {
     string url = null;
     string name = null;
     if (DialogResult.OK == InputBox.Show(form, "Import Comparison from URL", "Name:", "URL:", ref name, ref url))
     {
         var imported = LoadRunFromURL(url, form);
         return run.AddComparisonWithNameInput(imported, name, form);
     }
     return null;
 }
Exemplo n.º 4
0
        public string ImportAsComparison(IRun run, Form form = null)
        {
            string url  = null;
            string name = null;

            if (DialogResult.OK == InputBox.Show(form, "Import Comparison from URL", "Name:", "URL:", ref name, ref url))
            {
                var imported = LoadRunFromURL(url, form);
                return(run.AddComparisonWithNameInput(imported, name, form));
            }
            return(null);
        }
 public string ImportAsComparison(IRun run, Form form = null)
 {
     var dialog = new BrowseSpeedrunComDialog(true, run.GameName, run.CategoryName);
     var result = dialog.ShowDialog(form);
     var name = dialog.RunName;
     if (result == DialogResult.OK)
     {
         result = InputBox.Show(form, "Enter Comparison Name", "Name:", ref name);
     }
     if (result == DialogResult.OK)
     {
         return run.AddComparisonWithNameInput(dialog.Run, name, form);
     }
     return null;
 }
Exemplo n.º 6
0
        public string ImportAsComparison(IRun run, Form form = null)
        {
            var dialog = new BrowseSplitsIODialog(true);
            var result = dialog.ShowDialog(form);
            var name   = dialog.RunName;

            if (result == DialogResult.OK)
            {
                result = InputBox.Show(form, "Enter Comparison Name", "Name:", ref name);
            }
            if (result == DialogResult.OK)
            {
                return(run.AddComparisonWithNameInput(dialog.Run, name, form));
            }
            return(null);
        }