Пример #1
0
        private async void OpenFileCommandExecute(object o)
        {
            var fileDialog = new OpenFileDialog();
            var result     = fileDialog.ShowDialog();

            if (!result.HasValue || !result.Value)
            {
                return;
            }

            FilePath = fileDialog.FileName;

            bool isValid = _fileTypeChecker.IsValid(FilePath);

            if (!isValid)
            {
                await((MetroWindow)Application.Current.MainWindow).ShowMessageAsync("Error",
                                                                                    "Given file is not valid exe or dll, please try another one");
            }

            fileDialog.Reset();
            Models.Clear();
            FileModel model = new FileModel()
            {
                FilePath = FilePath, Name = Path.GetFileNameWithoutExtension(FilePath)
            };

            Models.Add(new SampleViewModel()
            {
                FileModel = model, Pos = Models.Count
            });
        }
Пример #2
0
 public void Reset()
 {
     mInnerDialog.Reset();
 }