예제 #1
0
 /// <summary>
 /// Browse button was clicked by user.
 /// </summary>
 private void OnBrowseButtonClicked(object sender, OpenDialogArgs e)
 {
     try
     {
         ExplorerPresenter.CommandHistory.Add(new Commands.ChangeProperty(Input, "FullFileName", e.FileNames[0]));
     }
     catch (Exception err)
     {
         ExplorerPresenter.MainPresenter.ShowMessage(err.Message, DataStore.ErrorLevel.Error);
     }
 }
예제 #2
0
        /// <summary>
        /// Browse button was clicked - send event to presenter.
        /// </summary>
        private void OnBrowseButtonClick(object sender, EventArgs e)
        {
            if (BrowseButtonClicked != null && OpenFileDialog.ShowDialog() == DialogResult.OK)
            {
                OpenDialogArgs args = new OpenDialogArgs();
                args.FileNames = OpenFileDialog.FileNames;


                BrowseButtonClicked.Invoke(this, args);
            }
        }
 /// <summary>
 /// Browse button was clicked - send event to presenter.
 /// </summary>
 private void OnBrowseButtonClick(object sender, EventArgs e)
 {
     if (BrowseButtonClicked != null)
     {
         string fileName = AskUserForFileName("Select a file to open", Utility.FileDialog.FileActionType.Open, "Sqlite (*.db) | *.db");
         if (!String.IsNullOrEmpty(fileName))
         {
             OpenDialogArgs args = new OpenDialogArgs();
             args.FileName = fileName;
             BrowseButtonClicked.Invoke(this, args);
         }
     }
 }
예제 #4
0
 /// <summary>
 /// Browse button was clicked - send event to presenter.
 /// </summary>
 private void OnBrowseButtonClick(object sender, EventArgs e)
 {
     if (BrowseButtonClicked != null)
     {
         string fileName = AskUserForFileName("Select a file to open", "", FileChooserAction.Open, FileName);
         if (!String.IsNullOrEmpty(fileName))
         {
             OpenDialogArgs args = new OpenDialogArgs();
             args.FileName = fileName;
             BrowseButtonClicked.Invoke(this, args);
         }
     }
 }
예제 #5
0
 /// <summary>
 /// Browse button was clicked - send event to presenter.
 /// </summary>
 private void OnBrowseButtonClick(object sender, EventArgs e)
 {
     if (BrowseButtonClicked != null)
     {
         string fileName = AskUserForFileName("Select a file to open", Utility.FileDialog.FileActionType.Open, "ASCII Text Files (*.*) | *.*");
         if (!String.IsNullOrEmpty(fileName))
         {
             OpenDialogArgs args = new OpenDialogArgs();
             args.FileName = fileName; //Dialogs seem to return the full file path not just the filename.
             BrowseButtonClicked.Invoke(this, args);
         }
     }
 }
예제 #6
0
 /// <summary>
 /// Browse button was clicked - send event to presenter.
 /// </summary>
 private void OnBrowseButtonClick(object sender, EventArgs e)
 {
     if (BrowseButtonClicked != null)
     {
         FileChooserDialog fileChooser = new FileChooserDialog("Select a file to open", null, FileChooserAction.Open, "Cancel", ResponseType.Cancel, "Select", ResponseType.Accept);
         FileFilter        allFilter   = new FileFilter();
         allFilter.AddPattern("*");
         allFilter.Name = "All files";
         fileChooser.AddFilter(allFilter);
         if (fileChooser.Run() == (int)ResponseType.Accept)
         {
             OpenDialogArgs args = new OpenDialogArgs();
             args.FileNames = fileChooser.Filenames;
             BrowseButtonClicked.Invoke(this, args);
         }
         fileChooser.Destroy();
     }
 }
예제 #7
0
 /// <summary>
 /// Browse button was clicked - send event to presenter.
 /// </summary>
 private void OnBrowseButtonClick(object sender, EventArgs e)
 {
     try
     {
         if (BrowseButtonClicked != null)
         {
             string fileName = AskUserForFileName("Select a file to open", Utility.FileDialog.FileActionType.Open, "All Files (*.*) | *.*", FileName);
             if (!string.IsNullOrEmpty(fileName))
             {
                 OpenDialogArgs args = new OpenDialogArgs();
                 args.FileName = fileName;
                 BrowseButtonClicked.Invoke(this, args);
             }
         }
     }
     catch (Exception err)
     {
         ShowError(err);
     }
 }
예제 #8
0
파일: InputView.cs 프로젝트: hol353/ApsimX
        /// <summary>
        /// Browse button was clicked - send event to presenter.
        /// </summary>
        private void OnBrowseButtonClick(object sender, EventArgs e)
        {
            if (BrowseButtonClicked != null && OpenFileDialog.ShowDialog() == DialogResult.OK)
            {
                OpenDialogArgs args = new OpenDialogArgs();
                args.FileNames = OpenFileDialog.FileNames;

                BrowseButtonClicked.Invoke(this, args);
            }
        }
예제 #9
0
파일: InputView.cs 프로젝트: hol353/ApsimX
 /// <summary>
 /// Browse button was clicked - send event to presenter.
 /// </summary>
 private void OnBrowseButtonClick(object sender, EventArgs e)
 {
     if (BrowseButtonClicked != null )
     {
         FileChooserDialog fileChooser = new FileChooserDialog("Select a file to open", null, FileChooserAction.Open, "Cancel", ResponseType.Cancel, "Select", ResponseType.Accept);
         FileFilter allFilter = new FileFilter();
         allFilter.AddPattern("*");
         allFilter.Name = "All files";
         fileChooser.AddFilter(allFilter);
         if (fileChooser.Run() == (int)ResponseType.Accept)
         {
             OpenDialogArgs args = new OpenDialogArgs();
             args.FileNames = fileChooser.Filenames;
             BrowseButtonClicked.Invoke(this, args);
         }
         fileChooser.Destroy();
     }
 }