예제 #1
0
 private void FillSpecialFolders()
 {
     if (FillSpecialFoldersEvt != null)
     {
         List <Environment.SpecialFolder> specialFolders = FillSpecialFoldersEvt();
         if (specialFolders != null)
         {
             foreach (Environment.SpecialFolder sf in specialFolders)
             {
                 try
                 {
                     SpecialFolderButton btn = new SpecialFolderButton(sf);
                     tsSpecialFolders.Items.Add(btn);
                 }
                 catch { }
             }
         }
     }
 }
예제 #2
0
        private void tsSpecialFolders_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
        {
            OPMToolStripButton tsb = e.ClickedItem as OPMToolStripButton;

            if (tsb != null)
            {
                foreach (ToolStripItem tsi in tsSpecialFolders.Items)
                {
                    OPMToolStripButton button = tsi as OPMToolStripButton;
                    if (button != null)
                    {
                        button.Checked = (button == tsb);
                    }
                }

                SpecialFolderButton sfb = tsb as SpecialFolderButton;
                if (sfb != null)
                {
                    // TODO fix
                    //SelectDrive(sfb.Path);

                    lvExplorer.Path = sfb.Path;
                }
                else
                {
                    string path = tsb.Tag as string;
                    if (Directory.Exists(path))
                    {
                        // TODO fix
                        //SelectDrive(path);

                        lvExplorer.Path = path;
                    }
                }
            }
        }
예제 #3
0
        void _tmrUpdateUi_Tick(object sender, EventArgs e)
        {
            lblCurrentPath.Text = Translator.Translate("TXT_CURRENT_PATH", lvExplorer.Path);

            foreach (ToolStripItem tsi in tsSpecialFolders.Items)
            {
                OPMToolStripButton btn = tsi as OPMToolStripButton;
                if (btn != null)
                {
                    string path = string.Empty;
                    SpecialFolderButton sfBtn = btn as SpecialFolderButton;
                    if (sfBtn != null)
                    {
                        path = sfBtn.Path;
                    }
                    else
                    {
                        path = btn.Tag as string;
                    }

                    btn.Checked = (path == lvExplorer.Path);
                }
            }
        }
예제 #4
0
 private void FillSpecialFolders()
 {
     if (FillSpecialFoldersEvt != null)
     {
         List<Environment.SpecialFolder> specialFolders = FillSpecialFoldersEvt();
         if (specialFolders != null)
         {
             foreach (Environment.SpecialFolder sf in specialFolders)
             {
                 try
                 {
                     SpecialFolderButton btn = new SpecialFolderButton(sf);
                     tsSpecialFolders.Items.Add(btn);
                 }
                 catch { }
             }
         }
     }
 }