Ejemplo n.º 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);
     }
 }
Ejemplo n.º 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);
         }
     }
 }
Ejemplo n.º 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);
         }
     }
 }
Ejemplo n.º 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);
         }
     }
 }
Ejemplo n.º 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();
     }
 }
Ejemplo n.º 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);
     }
 }
Ejemplo n.º 8
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);
            }
        }
Ejemplo n.º 9
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();
     }
 }