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 { } } } } }
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; } } } }
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); } } }
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 { } } } } }