Пример #1
0
        private static void ListDirectory(TreeView treeView, YnoteProject project)
        {
            treeView.Nodes.Clear();
            var rootDirectoryInfo = new DirectoryInfo(project.Path);

            treeView.Nodes.Add(CreateDirectoryNode(rootDirectoryInfo, project.ExcludeDirectories,
                                                   project.ExcludeFileTypes));
        }
Пример #2
0
 /// <summary>
 ///     Opens a Project
 /// </summary>
 /// <param name="project"></param>
 public void OpenProject(YnoteProject project)
 {
     if (project == null)
     {
         Close();
         return;
     }
     projtree.Nodes.Clear();
     // initialize the node
     if (!Directory.Exists(project.Path))
         MessageBox.Show(string.Format("Error : Can't find directory : {0}", project.Path), "Folder Manager",
             MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
     else
         ListDirectory(projtree, project);
     projtree.Tag = project;
     Globals.ActiveProject = project;
     Expand();
 }
Пример #3
0
 /// <summary>
 ///     Opens a Project
 /// </summary>
 /// <param name="project"></param>
 public void OpenProject(YnoteProject project)
 {
     if (project == null)
     {
         Close();
         return;
     }
     projtree.Nodes.Clear();
     // initialize the node
     if (!Directory.Exists(project.Path))
     {
         MessageBox.Show(string.Format("Error : Can't find directory : {0}", project.Path), "Folder Manager",
                         MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
     }
     else
     {
         ListDirectory(projtree, project);
     }
     projtree.Tag          = project;
     Globals.ActiveProject = project;
     Expand();
 }
Пример #4
0
 private void OpenProject(YnoteProject project)
 {
     if (Globals.ActiveProject == project || project == null)
         return;
     if (projectPanel == null)
         projectPanel = new ProjectPanel();
     if (File.Exists(project.LayoutFile))
     {
         if (dock.Contents.Count != 0)
         {
             var docs = dock.Contents.ToArray();
             for (int i = 0; i < docs.Length; i++)
             {
                 var document = docs[i];
                 document.DockHandler.Close();
             }
         }
         dock.LoadFromXml(project.LayoutFile, GetContentFromPersistString);
     }
     else
     {
         projectPanel.OpenProject(project);
         projectPanel.Show(dock, DockState.DockLeft);
     }
     Text = project.Name + " - Ynote Classic";
 }
Пример #5
0
 private void miaddtoproj_Click(object sender, EventArgs e)
 {
     using (var browser = new FolderBrowserDialogEx())
     {
         browser.ShowEditBox = true;
         browser.ShowFullPathInEditBox = true;
         if (browser.ShowDialog() == DialogResult.OK)
         {
             var proj = new YnoteProject();
             proj.Path = browser.SelectedPath;
             OpenProject(proj);
         }
     }
 }
Пример #6
0
 private static void ListDirectory(TreeView treeView, YnoteProject project)
 {
     treeView.Nodes.Clear();
     var rootDirectoryInfo = new DirectoryInfo(project.Path);
     treeView.Nodes.Add(CreateDirectoryNode(rootDirectoryInfo, project.ExcludeDirectories,
         project.ExcludeFileTypes));
 }