SetDescription() public method

public SetDescription ( string pDesc ) : void
pDesc string
return void
Ejemplo n.º 1
0
        private void addNetworkPathToolStripMenuItem_Click(object sender, EventArgs e)
        {
            /*FolderBrowserDialog fbd = new FolderBrowserDialog();
             * fbd.Description = "Select path to include on folder list";
             * fbd.ShowNewFolderButton = false;
             * fbd.ShowDialog();*/

            FolderBrowser fb = new FolderBrowser();

            fb.SetDescription("Select path to include on folder list");
            fb.SetNetworkSelect();

            if (fb.ShowDialog() == DialogResult.OK)
            {
                if (fb.DirectoryPath == "")
                {
                    Error("This network path is not valid for FlickrSync", null, ErrorType.Normal);
                }
                else
                {
                    try
                    {
                        DirectoryInfo di = new DirectoryInfo(fb.DirectoryPath);
                        if (!di.Exists)
                        {
                            Error("Network path is not accesible", null, ErrorType.Normal);
                        }
                        else
                        {
                            PathInfo pi = li.GetPathInfo(fb.DirectoryPath);
                            if (pi == null)
                            {
                                li.AddPath(fb.DirectoryPath, false, true);
                            }
                            else
                            {
                                pi.ManualAdd = true;
                            }

                            treeFolders.AddBaseNode(fb.DirectoryPath);
                        }
                    }
                    catch (Exception ex)
                    {
                        Error("Invalid network path", ex, ErrorType.Normal);
                    }
                }
            }
        }
Ejemplo n.º 2
0
        private void addNetworkPathToolStripMenuItem_Click(object sender, EventArgs e)
        {
            /*FolderBrowserDialog fbd = new FolderBrowserDialog();
            fbd.Description = "Select path to include on folder list";
            fbd.ShowNewFolderButton = false;
            fbd.ShowDialog();*/

            FolderBrowser fb = new FolderBrowser();
            fb.SetDescription("Select path to include on folder list");
            fb.SetNetworkSelect();

            if (fb.ShowDialog() == DialogResult.OK)
                if (fb.DirectoryPath == "")
                    Error("This network path is not valid for FlickrSync", null, ErrorType.Normal);
                else
            {
                try
                {
                    DirectoryInfo di = new DirectoryInfo(fb.DirectoryPath);
                    if (!di.Exists)
                        Error("Network path is not accesible", null, ErrorType.Normal);
                    else
                    {
                        PathInfo pi = li.GetPathInfo(fb.DirectoryPath);
                        if (pi == null)
                            li.AddPath(fb.DirectoryPath, false, true);
                        else
                            pi.ManualAdd = true;

                        treeFolders.AddBaseNode(fb.DirectoryPath);
                    }
                }
                catch (Exception ex)
                {
                    Error("Invalid network path", ex, ErrorType.Normal);
                }
            }
        }