Exemplo n.º 1
0
        void AddDirectory()
        {
            TreeNode s = selected;

            if (s == null)
            {
                return;
            }
            IBufferDirectory d = s.Tag as IBufferDirectory;

            try
            {
                List <string> l = d.GetDirectoryNames();
                for (int i = 1; ; i++)
                {
                    string n = "New folder" + i;
                    if (!l.Contains(n))
                    {
                        IBufferDirectory ld = d.Create(n, "");
                        TreeNode         nd = ld.CreateNode(true);
                        s.Nodes.Add(nd);
                        return;
                    }
                }
            }
            catch (Exception exception)
            {
                exception.ShowError();
            }
        }