예제 #1
0
파일: Form1.cs 프로젝트: duurt/tcx-editor
 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
                });
            }
        }
예제 #4
0
        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);
            }
        }
예제 #5
0
파일: MainForm.cs 프로젝트: Agil13/ide-2019
        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
                    });
                }
            }
        }
예제 #6
0
        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
                    });
                }
            }
        }
예제 #7
0
        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);
            }
        }
예제 #8
0
파일: GuiStub.cs 프로젝트: duurt/tcx-editor
 public void RaiseOpenFileEvent(OpenRouteEventArgs args) => OpenFileEvent.Invoke(this, args);
예제 #9
0
 public void Handle(OpenFileEvent message) => Task.Run(() => AddOpenFile(message.FilePath));
예제 #10
0
 public void OpenFileTL_Click(object sender, EventArgs e)
 {
     OpenFileEvent.Invoke(sender, e);
 }
예제 #11
0
 private void OpenFileMN_Click(object sender, EventArgs e)
 {
     OpenFileEvent.Invoke(sender, e);
 }