当前位置: 首页>>代码示例>>C#>>正文


C# FolderBrowserDialog.Dispose方法代码示例

本文整理汇总了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;
 }
开发者ID:Knightshade,项目名称:4Hud,代码行数:8,代码来源:OpenFolderDialog.cs

示例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;
 }
开发者ID:RoDaniel,项目名称:featurehouse,代码行数:80,代码来源:GlobalProperties.cs

示例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;
        }
开发者ID:nadar71,项目名称:Krea,代码行数:33,代码来源:AppSettingsManager.cs

示例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();
        }
开发者ID:ksumrall,项目名称:SumDataTierGenerator,代码行数:26,代码来源:MainForm.cs

示例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();
 }
开发者ID:Xenioz,项目名称:qt-labs-vstools,代码行数:12,代码来源:AddQtVersionDialog.cs

示例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();
         }
     }
 }
开发者ID:vineelkovvuri,项目名称:ExtendableDesktopSearch,代码行数:22,代码来源:DocumentsUserControl.cs

示例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;
    }
开发者ID:vantruc,项目名称:skimpt,代码行数:16,代码来源:main.cs

示例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);
        }
开发者ID:socoolch,项目名称:fancy2d,代码行数:27,代码来源:MainForm.cs

示例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);
        }
开发者ID:socoolch,项目名称:fancy2d,代码行数:61,代码来源:MainForm.cs

示例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;
        }
开发者ID:TRI0N,项目名称:Remove-Empty-Directories,代码行数:23,代码来源:SystemFunctions.cs


注:本文中的FolderBrowserDialog.Dispose方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。