private void btnGroupsAddFolder_Click(object sender, RoutedEventArgs e) { GroupEntry group; int index; bool editGroup; if (tvwGroups.Items.Count == 0) { group = new GroupEntry(QTUtility.TextResourcesDic["Options_Page09_Groups"][6]); CurrentGroups.Add(group); group.IsSelected = true; index = 0; editGroup = true; } else { object sel = tvwGroups.SelectedItem; if (sel == null) { return; } if (sel is FolderEntry) { FolderEntry entry = (FolderEntry)sel; group = (GroupEntry)entry.ParentItem; index = group.Folders.IndexOf(entry) + 1; } else { group = (GroupEntry)sel; index = group.Folders.Count; } editGroup = false; } FolderBrowserDialogEx dlg = new FolderBrowserDialogEx(); if (dlg.ShowDialog() != System.Windows.Forms.DialogResult.OK) { return; } FolderEntry folder = new FolderEntry(dlg.SelectedPath); group.Folders.Insert(index, folder); group.IsExpanded = true; if (editGroup) { group.IsSelected = true; group.IsEditing = true; } else { folder.IsSelected = true; } }
private bool BrowseForFolder() { FolderBrowserDialogEx fbd = new FolderBrowserDialogEx(); if (DialogResult.OK != fbd.ShowDialog()) { return(false); } using (IDLWrapper wrapper = new IDLWrapper(fbd.SelectedIDL)) { if (wrapper.IDL != null) { SelectedIDL = wrapper.IDL; } else { SelectedPath = wrapper.Path; } } return(true); }
private void btnGroupsAddFolder_Click(object sender, RoutedEventArgs e) { GroupEntry group; int index; bool editGroup; if(tvwGroups.Items.Count == 0) { group = new GroupEntry(QTUtility.TextResourcesDic["Options_Page09_Groups"][6]); CurrentGroups.Add(group); group.IsSelected = true; index = 0; editGroup = true; } else { object sel = tvwGroups.SelectedItem; if(sel == null) return; if(sel is FolderEntry) { FolderEntry entry = (FolderEntry)sel; group = (GroupEntry)entry.ParentItem; index = group.Folders.IndexOf(entry) + 1; } else { group = (GroupEntry)sel; index = group.Folders.Count; } editGroup = false; } FolderBrowserDialogEx dlg = new FolderBrowserDialogEx(); if(dlg.ShowDialog() != System.Windows.Forms.DialogResult.OK) return; FolderEntry folder = new FolderEntry(dlg.SelectedPath); group.Folders.Insert(index, folder); group.IsExpanded = true; if(editGroup) { group.IsSelected = true; group.IsEditing = true; } else { folder.IsSelected = true; } }
private bool BrowseForFolder() { FolderBrowserDialogEx fbd = new FolderBrowserDialogEx(); if(DialogResult.OK != fbd.ShowDialog()) { return false; } using(IDLWrapper wrapper = new IDLWrapper(fbd.SelectedIDL)) { if(wrapper.IDL != null) { SelectedIDL = wrapper.IDL; } else { SelectedPath = wrapper.Path; } } return true; }