Ejemplo n.º 1
0
 private void browseTargetFile_BeforeFileSelected(object sender, BeforeFileSelectedEventArgs e)
 {
     if (BeforeTargetFileChanged != null)
     {
         BeforeTargetFileChanged(this, e); // new BeforeFileSelectedEventArgs(cancelFileSelection, e.ExpectedFilePath));
     }
 }
Ejemplo n.º 2
0
        private void btnBrowse_Click(object sender, EventArgs e)
        {
            OpenFileDialog dialog = new OpenFileDialog(); // ApplicationDialogs.OpenScriptDialog("");

            dialog.CheckFileExists = false;
            DialogResult result = dialog.ShowDialog(this);

            if (result == DialogResult.OK)
            {
                if (BeforeFileSelected != null)
                {
                    BeforeFileSelectedEventArgs eventArgs = new BeforeFileSelectedEventArgs(textBox1.Text, dialog.FileName);
                    BeforeFileSelected(this, eventArgs);
                    if (eventArgs.Cancel)
                    {
                        return;
                    }
                }

                textBox1.Text = dialog.FileName;
                if (FileChanged != null)
                {
                    FileChanged(this, new EventArgs());
                }
            }
        }
Ejemplo n.º 3
0
        private void itemSyncBox1_BeforeTargetFileChanged(object sender, BeforeFileSelectedEventArgs e)
        {
            if (!string.IsNullOrWhiteSpace(e.CurrentFilePath))
            {
                DialogResult result = Dialogs.ChangeTargetPathPrompt(this, e.ExpectedFilePath);
                if (result == System.Windows.Forms.DialogResult.No)
                {
                    e.Cancel = true;
                    return;
                }
            }

            if (syncProject.TargetFileExists(e.ExpectedFilePath))
            {
                DialogResult result = Dialogs.DuplicateTargetPathPrompt(this, e.ExpectedFilePath);
                if (result == System.Windows.Forms.DialogResult.No)
                {
                    e.Cancel = true;
                }
            }
        }