private void btnOpenRoute_Click(object sender, EventArgs e) { using (var dialog = new OpenFileDialog()) { if (dialog.ShowDialog() == DialogResult.OK) { _fileName = dialog.FileName; OpenFileEvent?.Invoke(this, new OpenRouteEventArgs(dialog.FileName)); } } }
private void DoubleClickEventOnFilename(object sender, EventArgs e) { var dataContext = this.GetDatacontextFromBaseObject(sender); if (dataContext == null) { return; } OpenFileEvent.OpenEvent(dataContext.SelectedObject); }
private void ButtonOpenFile_Click(object sender, RoutedEventArgs e) { string filename = ShowDialog(DialogBox.OpenFile, ".bin"); if (filename != null) { OpenFileEvent?.Invoke(this, new FileOperationEventArgs { OldFilename = file.Filename, SelectedFilename = filename }); } }
private void OpenFileToolStripMenuItem_Click(object sender, EventArgs e) // выбираем файл { OpenFileDialog SelectFile = new OpenFileDialog() { Filter = "Text Files|*.txt|All Files|*.*" }; if (SelectFile.ShowDialog() == DialogResult.OK) // если пользователь выбирает файл, то вызываем событие на открытие файла { FilePath = SelectFile.FileName; Text = "Simple Text Editor [" + FilePath + "]"; FontChange(_defaultFontSize); OpenFileEvent?.Invoke(this, EventArgs.Empty); } }
private void OpenFile_ToolStripButton_Click(object sender, EventArgs e) { using (var openFileDialog = new OpenFileDialog()) { openFileDialog.InitialDirectory = @"C:\Users\ACER\source\repos\IDE2019"; openFileDialog.Filter = "All files (*.*)|*.*|cs files (*.cs)|*.cs"; openFileDialog.FilterIndex = 2; openFileDialog.RestoreDirectory = true; if (openFileDialog.ShowDialog() == DialogResult.OK) { var filePath = openFileDialog.FileName; OpenFileEvent?.Invoke(this, new OpenFileEventArgs { Path = filePath }); } } }
private void toolStripButtonOpenFile_Click(object sender, EventArgs e) { string filePath; using (OpenFileDialog openFileDialog = new OpenFileDialog()) { openFileDialog.InitialDirectory = @"C:\Users\Директор\source\repos\ExzamenVS\Projects"; openFileDialog.Filter = "All files (*.*)|*.*|cs files (*.cs)|*.cs"; openFileDialog.FilterIndex = 2; openFileDialog.RestoreDirectory = true; if (openFileDialog.ShowDialog() == DialogResult.OK) { filePath = openFileDialog.FileName; OpenFileEvent?.Invoke(this, new OpenFileEventArgs() { path = filePath }); } } }
public void Handle(OpenFileEvent message) { // Configure open file dialog box var dlg = new OpenFileDialog { FileName = "Document", DefaultExt = ".dax", Filter = "DAX documents|*.dax;*.msdax|DAX Studio documents|*.dax|SSMS DAX documents|*.msdax" }; // Show open file dialog box var result = dlg.ShowDialog(); // Process open file dialog box results if (result == true) { // Open document var fileName = dlg.FileName; _eventAggregator.PublishOnUIThread(new FileOpenedEvent(fileName)); NewQueryDocument(fileName); } }
public void RaiseOpenFileEvent(OpenRouteEventArgs args) => OpenFileEvent.Invoke(this, args);
public void Handle(OpenFileEvent message) => Task.Run(() => AddOpenFile(message.FilePath));
public void OpenFileTL_Click(object sender, EventArgs e) { OpenFileEvent.Invoke(sender, e); }
private void OpenFileMN_Click(object sender, EventArgs e) { OpenFileEvent.Invoke(sender, e); }