예제 #1
0
        /// <summary>
        /// Called when the button is clicked.
        /// </summary>
        /// <param name="e">An <see cref="T:System.EventArgs"/> that contains the event data. </param>
        protected override void OnClick(EventArgs e)
        {
            base.OnClick(e);

            using (var ofd = new OpenFileDialog())
            {
                ofd.Multiselect = MultiSelect;
                ofd.Filter = Filter;
                ofd.InitialDirectory = InitialDirectory;
                ofd.Title = DialogTitle;
                if (ofd.ShowDialog() == DialogResult.OK)
                {
                    var fse = new FileSelectEventArgs(ofd.FileName, ofd.FileNames);
                    OnFileSelect(fse);
                }
            }
        }
예제 #2
0
파일: Form1.cs 프로젝트: apsun/ieProxy
 private void pacBrowseButton_FileSelect(object sender, FileSelectEventArgs e)
 {
     pacPathTextBox.Text = e.FileName;
 }
예제 #3
0
 /// <summary>
 /// Called when the user presses OK in the OpenFileDialog.
 /// </summary>
 /// <param name="e"></param>
 protected virtual void OnFileSelect(FileSelectEventArgs e)
 {
     EventHandler<FileSelectEventArgs> handler = FileSelect;
     if (handler != null) handler(this, e);
 }