Esempio n. 1
0
        public void LoadFolders()
        {
            int tabIndex = 0;

            MainTab.TabPages.Clear();
            MainTab.Controls.Clear();
            Folders = new List <NoteFolder>();
            DirectoryInfo rootInfo = new DirectoryInfo(RootFolder);

            foreach (DirectoryInfo tabFolder in rootInfo.EnumerateDirectories())
            {
                string dirName = Path.GetFileName(tabFolder.FullName);

                TabPage tabPage   = new TabPage();
                string  labelText = dirName;
                int     dashIndex = labelText.IndexOf("-");
                if (dashIndex > 0)
                {
                    int dummySortKey;
                    if (int.TryParse(labelText.Substring(0, dashIndex), out dummySortKey))
                    {
                        labelText = labelText.Substring(dashIndex + 1);
                    }
                }
                //tabPage.Size = new System.Drawing.Size(500, 400);
                //tabPage.BorderStyle = BorderStyle.None;
                tabPage.TabIndex = tabIndex++;
                MainTab.Controls.Add(tabPage);

                ListView lvw = new ListView();
                tabPage.Controls.Add(lvw);
                lvw.View          = View.Details;
                lvw.Dock          = DockStyle.Fill;
                lvw.BorderStyle   = BorderStyle.None;
                lvw.FullRowSelect = true;
                lvw.HideSelection = false;
                lvw.DoubleClick  += _ItemDoubleClickHandler;
                lvw.Visible       = true;

                NoteFolder folder = new NoteFolder(this);
                tabPage.Tag      = folder;
                folder.System    = this;
                folder.DirName   = dirName;
                folder.LabelText = labelText;
                folder.Tab       = tabPage;
                folder.LvwFiles  = lvw;
                folder.SetTabName();
                folder.RequestRefresh();
                Folders.Add(folder);
            }
            NeedsRefresh = false;
        }
Esempio n. 2
0
 public void RefreshCurrentFolder()
 {
     CurrentFolder.RequestRefresh();
     CurrentFolder.RefreshIfNeeded();
 }