本文整理汇总了C#中FolderBrowserDialog.Dispose方法的典型用法代码示例。如果您正苦于以下问题:C# FolderBrowserDialog.Dispose方法的具体用法?C# FolderBrowserDialog.Dispose怎么用?C# FolderBrowserDialog.Dispose使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FolderBrowserDialog
的用法示例。
在下文中一共展示了FolderBrowserDialog.Dispose方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ShowDialog
internal DialogResult ShowDialog(IWin32Window owner)
{
FolderBrowserDialog dialog = new FolderBrowserDialog();
DialogResult result = dialog.ShowDialog();
Folder = dialog.SelectedPath;
dialog.Dispose();
return result;
}
示例2: AcceptiFolder
public bool AcceptiFolder(iFolderWeb ifolder, out bool added, bool mergeFolder)
{
bool result = false;
added = false;
if (ifolder.MigratediFolder > 0)
{
if (MigrationWindow.OldiFoldersPresent() == true)
{
System.Resources.ResourceManager resManager = new System.Resources.ResourceManager(typeof(FormsTrayApp));
MyMessageBox mmb = new MyMessageBox(resManager.GetString("MigrationMergePrompt.Text"), resManager.GetString("MigrationAlert"), "", MyMessageBoxButtons.OKCancel, MyMessageBoxIcon.Question);
DialogResult res = mmb.ShowDialog();
if (res == DialogResult.OK)
{
Novell.FormsTrayApp.MigrationWindow migrationWindow = new MigrationWindow(this.ifWebService, this.simiasWebService);
migrationWindow.Merge = true;
migrationWindow.iFolderName = ifolder.Name;
migrationWindow.ShowDialog();
string loc = migrationWindow.iFolderLocation;
string uName = migrationWindow.UserName;
if (loc == null || uName == null)
{
return false;
}
else
{
result = acceptiFolder(ifolder, loc, out added, true);
if (result == true)
{
MigrationWindow.RemoveRegistryForUser(uName);
}
}
return result;
}
}
}
string selectedPath = string.Empty;
FolderBrowserDialog browserDialog = new FolderBrowserDialog();
Cursor.Current = Cursors.WaitCursor;
while (true)
{
browserDialog.ShowNewFolderButton = true;
browserDialog.SelectedPath = selectedPath;
if (!mergeFolder)
{
browserDialog.Description = string.Format(TrayApp.Properties.Resources.acceptDescription, ifolder.Name);
}
else
{
browserDialog.Description = string.Format(TrayApp.Properties.Resources.mergeDescription, ifolder.Name);
}
DialogResult dialogResult = browserDialog.ShowDialog();
if ( dialogResult == DialogResult.OK )
{
browserDialog.Dispose();
Invalidate();
Update();
result = acceptiFolder(ifolder, browserDialog.SelectedPath, out added, mergeFolder);
if (result && !added)
{
break;
}
else if ( result )
{
if (!mergeFolder)
DownloadPath = browserDialog.SelectedPath + ifolder.Name;
else
DownloadPath = browserDialog.SelectedPath;
break;
}
}
else
{
browserDialog.Dispose();
break;
}
}
Cursor.Current = Cursors.Default;
refreshAll();
return result;
}
示例3: browseCoronaSDKFolder_Click
private void browseCoronaSDKFolder_Click(object sender, EventArgs e)
{
Settings1.Default.CoronaSDKFolder = "";
FolderBrowserDialog folderDial = new FolderBrowserDialog();
if (folderDial.ShowDialog() == DialogResult.OK)
{
string path = folderDial.SelectedPath;
string[] filenames = Directory.GetFiles(path);
foreach (string filename in filenames)
{
if (filename.Contains("Corona Simulator.exe"))
{
Settings1.Default.CoronaSDKFolder = path+"\\Corona Simulator.exe";
Settings1.Default.Save();
break;
}
}
if (Settings1.Default.CoronaSDKFolder.Equals(""))
{
MessageBox.Show("The selected path does not contain the Corona Simulator application!\nPlease select another folder!",
"Folder does not contain Corona SDK", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
folderDial.Dispose();
folderDial = null;
this.coronaPathTxtBx.Text = Settings1.Default.CoronaSDKFolder;
}
示例4: GetOutputDirectory
private void GetOutputDirectory(TextBox txt)
{
System.Windows.Forms.FolderBrowserDialog fbd = new FolderBrowserDialog();
fbd.Description = "Select an output folder for the created classes.";
fbd.ShowNewFolderButton = true;
if (txt.Text.Length == 0)
{
if (m_LastSelectedOutputdirectory.Length > 0)
{
fbd.SelectedPath = m_LastSelectedOutputdirectory;
}
}
else
{
fbd.SelectedPath = txt.Text;
}
if (fbd.ShowDialog(this) == DialogResult.OK)
{
m_LastSelectedOutputdirectory = fbd.SelectedPath;
txt.Text = m_LastSelectedOutputdirectory;
}
fbd.Dispose();
}
示例5: browseButton_Click
private void browseButton_Click(object sender, EventArgs e)
{
System.Windows.Forms.FolderBrowserDialog fd = new FolderBrowserDialog();
fd.Description = SR.GetString("SelectQtPath");
fd.SelectedPath = RestoreLastSelectedPath();
if (fd.ShowDialog() == DialogResult.OK)
{
pathBox.Text = fd.SelectedPath;
SaveLastSelectedPath(fd.SelectedPath);
}
fd.Dispose();
}
示例6: tsmiCopyTo_Click
private void tsmiCopyTo_Click(object sender, EventArgs e)
{
if (lvResultsInDocuments.SelectedItems.Count == 1)
{
string fileSrc = lvResultsInDocuments.SelectedItems[0].SubItems[1].Text;
if (Win32Helper.PathExist(fileSrc))
{
FolderBrowserDialog desFolder = new FolderBrowserDialog();
desFolder.Description = "Select a folder to copy the file";
desFolder.ShowNewFolderButton = true;
if (desFolder.ShowDialog() == DialogResult.OK)
{
try
{
Win32Helper.SHFileCopy(fileSrc + '\0' + '\0', desFolder.SelectedPath + '\0' + '\0');
}
catch { }
}
desFolder.Dispose();
}
}
}
示例7: browseButton_Click
/// <summary>
/// This function is an event handler for the FolderBrowse button
/// It opens a new instance of the folderBrowser to allow
/// the user to select a path
/// </summary>
private void browseButton_Click(object sender, EventArgs e)
{
FolderBrowserDialog fbd = new FolderBrowserDialog();
fbd.ShowDialog();
if (System.IO.Directory.Exists(fbd.SelectedPath))
fileLocationTextBox.Text = fbd.SelectedPath;
saveFileSettingButton.PerformClick();
fbd.Dispose();
fbd = null;
}
示例8: toolStripButton_ImportFloder_Click
private void toolStripButton_ImportFloder_Click(object sender, EventArgs e)
{
TreeNode tSelect = treeView_Main.SelectedNode;
if(tSelect == null || !((FCYResPackageNode)tSelect.Tag).IsFloder())
{
showErr("请选择一个文件夹节点。");
return;
}
string tPath = "";
{
FolderBrowserDialog tDiag = new FolderBrowserDialog();
tDiag.Description = "选择要导入的文件夹";
if (tDiag.ShowDialog() == DialogResult.Cancel)
{
tDiag.Dispose();
return;
}
tPath = tDiag.SelectedPath;
tDiag.Dispose();
}
importFloder(new DirectoryInfo(tPath + "\\"), tSelect);
}
示例9: toolStripButton_ExportFloder_Click
private void toolStripButton_ExportFloder_Click(object sender, EventArgs e)
{
TreeNode tSelect = treeView_Main.SelectedNode;
if (tSelect == null || !((FCYResPackageNode)tSelect.Tag).IsFloder())
{
showErr("请选择一个文件夹节点。");
return;
}
string tPath = "";
{
FolderBrowserDialog tDiag = new FolderBrowserDialog();
tDiag.Description = "选择要导出的目的文件夹";
if (tDiag.ShowDialog() == DialogResult.Cancel)
{
tDiag.Dispose();
return;
}
tPath = tDiag.SelectedPath;
tDiag.Dispose();
}
// 创建一个文件夹
DirectoryInfo tInfo = null;
string tDirName = tPath + "\\";
if(((FCYResPackageFloderNode)tSelect.Tag).Name == "")
{
tDirName += "根节点";
}
else
{
tDirName += ((FCYResPackageFloderNode)tSelect.Tag).Name;
}
if (!Directory.Exists(tDirName))
{
try
{
tInfo = Directory.CreateDirectory(tDirName);
}
catch
{
showErr("创建导出文件夹失败。\n\n文件:" + tDirName);
return;
}
}
else
{
if (MessageBox.Show("导出目录已存在,是否覆盖?", "确认导出", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
{
return;
}
else
tInfo = new DirectoryInfo(tDirName);
}
exportFloder(tInfo, tSelect);
}
示例10: ChooseDirectoryDialog
public static string ChooseDirectoryDialog(string path)
{
FolderBrowserDialog folderDialog = new FolderBrowserDialog();
folderDialog.Description = RED2.Properties.Resources.please_select;
folderDialog.ShowNewFolderButton = false;
if (path != "")
{
DirectoryInfo dir = new DirectoryInfo(path);
if (dir.Exists)
folderDialog.SelectedPath = path;
}
if (folderDialog.ShowDialog() == DialogResult.OK)
path = folderDialog.SelectedPath;
folderDialog.Dispose();
folderDialog = null;
return path;
}