本文整理汇总了C#中System.Windows.Forms.FolderBrowserDialog.Dispose方法的典型用法代码示例。如果您正苦于以下问题:C# System.Windows.Forms.FolderBrowserDialog.Dispose方法的具体用法?C# System.Windows.Forms.FolderBrowserDialog.Dispose怎么用?C# System.Windows.Forms.FolderBrowserDialog.Dispose使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.FolderBrowserDialog
的用法示例。
在下文中一共展示了System.Windows.Forms.FolderBrowserDialog.Dispose方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SelectScreenshotsFolder
private void SelectScreenshotsFolder()
{
var selectFolder = new System.Windows.Forms.FolderBrowserDialog();
try
{
if (String.IsNullOrEmpty(tboxScreenshotsPath.Text) == false)
{
selectFolder.SelectedPath = tboxScreenshotsPath.Text;
}
//else selectFolder.RootFolder = Environment.SpecialFolder.Personal;
if (selectFolder.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
tboxScreenshotsPath.Text = selectFolder.SelectedPath;
}
}
finally { selectFolder.Dispose(); }
}
示例2: Add_Click
private void Add_Click(object sender, RoutedEventArgs e)
{
var fb = new System.Windows.Forms.FolderBrowserDialog();
fb.Description = "Find Manga Folder";
fb.ShowNewFolderButton = false;
if (fb.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
if (!(bool)cbLook.IsChecked)
if (!ImportList.Items.Contains(fb.SelectedPath))
ImportList.Items.Add(fb.SelectedPath);
else
MessageBox.Show("This Item is Already in the Import List!", "Import Manga", MessageBoxButton.OK);
else
{
foreach (var MangaDir in System.IO.Directory.EnumerateDirectories(fb.SelectedPath))
{
if (!ImportList.Items.Contains(MangaDir))
ImportList.Items.Add(MangaDir);
}
}
}
fb.Dispose();
}
示例3: BrowseClicked
/// <summary>
/// Browse for output folder
/// </summary>
public void BrowseClicked()
{
// WPF doesn't have folder browser dialog, so we have to use the one from Windows.Forms
System.Windows.Forms.FolderBrowserDialog dlg = new System.Windows.Forms.FolderBrowserDialog();
dlg.SelectedPath = OutputPath;
dlg.Description = "Select output directory.";
dlg.ShowNewFolderButton = true;
System.Windows.Forms.DialogResult result = dlg.ShowDialog();
if(result == System.Windows.Forms.DialogResult.OK)
{
OutputPath = dlg.SelectedPath;
InvokePropertyChanged("OutputPath");
}
dlg.Dispose();
}
示例4: Button_savefile_Click
private void Button_savefile_Click(object sender, RoutedEventArgs e)
{
System.Windows.Forms.FolderBrowserDialog folderBrowserDialog1 = new System.Windows.Forms.FolderBrowserDialog();
folderBrowserDialog1.Description = "フォルダを選択";
folderBrowserDialog1.RootFolder = System.Environment.SpecialFolder.MyComputer;
folderBrowserDialog1.SelectedPath = "C:\\Windows";
folderBrowserDialog1.ShowNewFolderButton = true;
if (folderBrowserDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
this.savefolder = folderBrowserDialog1.SelectedPath;
}
folderBrowserDialog1.Dispose();
}
示例5: Export
private void Export()
{
SnapshotSettings snapSettings = SettingsManager.Instance.GetSnapshotSettings();
System.Windows.Forms.FolderBrowserDialog browser = new System.Windows.Forms.FolderBrowserDialog();
string subDirectory = snapSettings.GetCurrentSubdirectory();
string parentDirectory = snapSettings.GetParentDirectory();
//Initialise browser folder for easier navigation
browser.SelectedPath = parentDirectory;
browser.Description = "Choose directory for exporting";
System.Windows.Forms.DialogResult result = browser.ShowDialog();
if (result != System.Windows.Forms.DialogResult.OK)
return;
m_exporter = new ImageExporter();
m_exporter.SetRootDirectory(browser.SelectedPath);
if (!m_exporter.CanExport())
{
MessageBox.Show("There are no screenshots to export.\nExporting stopped.");
return;
}
btnPlay.IsEnabled = false;
btnStop.IsEnabled = false;
preferencesMenu.IsEnabled = false;
progressCircular.Visibility = Visibility.Visible;
CancelLink.Visibility = System.Windows.Visibility.Visible;
trayIcon.Icon = m_app_exporting;
m_exporter_worker.DoWork += worker_DoWork;
m_exporter_worker.RunWorkerCompleted += ExportWorker_RunWorkerCompleted;
if (!m_exporter_worker.IsBusy)
m_exporter_worker.RunWorkerAsync();
browser.Dispose();
btnExport.IsEnabled = false;
}
示例6: browseLocalPath
internal string browseLocalPath(string LocalPath)
{
var dialog = new System.Windows.Forms.FolderBrowserDialog();
System.Windows.Forms.DialogResult result = dialog.ShowDialog();
String path = dialog.SelectedPath;
dialog.Dispose();
return path;
}