Пример #1
0
            public override CommandResult InternalExecute(ICommandTarget target, params IAdaptable[] args)
            {
                string path;
                int    repeat;

                using (DataLoadDialog dialog = new DataLoadDialog()) {
                    DialogResult result = dialog.ShowDialog();
                    if (result != DialogResult.OK)
                    {
                        return(CommandResult.Cancelled);
                    }
                    path   = dialog.DataFileToLoad;
                    repeat = dialog.Repeat;
                }

                byte[] data = LoadFile(path);
                if (data == null)
                {
                    return(CommandResult.Failed);
                }

                DataLoadBenchmark benchmark = new DataLoadBenchmark(target, data, repeat);

                return(benchmark.Start());
            }
Пример #2
0
            public override CommandResult InternalExecute(ICommandTarget target, params IAdaptable[] args)
            {
                string path;
                int repeat;
                using (DataLoadDialog dialog = new DataLoadDialog()) {
                    DialogResult result = dialog.ShowDialog();
                    if (result != DialogResult.OK)
                        return CommandResult.Cancelled;
                    path = dialog.DataFileToLoad;
                    repeat = dialog.Repeat;
                }

                byte[] data = LoadFile(path);
                if (data == null)
                    return CommandResult.Failed;

                DataLoadBenchmark benchmark = new DataLoadBenchmark(target, data, repeat);
                return benchmark.Start();
            }