void OnControlEnter(object sender, EventArgs e) { if (ignoreFocusChange) { return; } bool ctrl = (ModifierKeys & Keys.Control) == Keys.Control; if ((ModifierKeys & Keys.Shift) == Keys.Shift && sender != oldFocus) { bool sel = false; foreach (AddInControl ctl in splitContainer.Panel1.Controls) { if (!ctl.Visible) { continue; } if (ctl == sender || ctl == oldFocus) { sel = !sel; ctl.Selected = true; } else { if (sel || !ctrl) { ctl.Selected = sel; } } } } else if (ctrl) { foreach (AddInControl ctl in splitContainer.Panel1.Controls) { if (ctl == sender) { ctl.Selected = !ctl.Selected; } } oldFocus = (AddInControl)sender; } else { foreach (AddInControl ctl in splitContainer.Panel1.Controls) { ctl.Selected = ctl == sender; } oldFocus = (AddInControl)sender; } UpdateActionBox(); }
void CreateAddInList() { Stack <AddInControl> stack = new Stack <AddInControl>(); int index = 0; AddInControl addInControl; List <AddIn> addInList = new List <AddIn>(AddInTree.AddIns); addInList.Sort(delegate(AddIn a, AddIn b) { return(a.Name.CompareTo(b.Name)); }); bool hasPreinstalledAddIns = false; foreach (AddIn addIn in addInList) { if (string.Equals(addIn.Properties["addInManagerHidden"], "true", StringComparison.OrdinalIgnoreCase) && IsInstalledInApplicationRoot(addIn)) { hasPreinstalledAddIns = true; continue; } addInControl = new AddInControl(addIn); addInControl.Dock = DockStyle.Top; addInControl.TabIndex = index++; stack.Push(addInControl); addInControl.Enter += OnControlEnter; addInControl.Click += OnControlClick; } while (stack.Count > 0) { splitContainer.Panel1.Controls.Add(stack.Pop()); } ShowPreinstalledAddInsCheckBoxCheckedChanged(null, null); if (!hasPreinstalledAddIns) { showPreinstalledAddInsCheckBox.Visible = false; } splitContainer.Panel2Collapsed = true; }
void CreateAddInList() { Stack <AddInControl> stack = new Stack <AddInControl>(); int index = 0; AddInControl addInControl; List <AddIn> addInList = new List <AddIn>(AddInTree.AddIns); addInList.Sort(delegate(AddIn a, AddIn b) { return(a.Name.CompareTo(b.Name)); }); foreach (AddIn addIn in addInList) { string identity = addIn.Manifest.PrimaryIdentity; if (identity == null || addIn.Properties["addInManagerHidden"] == "true") { continue; } addInControl = new AddInControl(addIn); addInControl.Dock = DockStyle.Top; addInControl.TabIndex = index++; stack.Push(addInControl); addInControl.Enter += OnControlEnter; addInControl.Click += OnControlClick; } while (stack.Count > 0) { splitContainer.Panel1.Controls.Add(stack.Pop()); } ShowPreinstalledAddInsCheckBoxCheckedChanged(null, null); #if SHOWALLADDINS showPreinstalledAddInsCheckBox.Visible = false; showPreinstalledAddInsCheckBox.Checked = true; #endif splitContainer.Panel2Collapsed = true; }
void ShowPreinstalledAddInsCheckBoxCheckedChanged(object sender, EventArgs e) { visibleAddInCount = 0; foreach (AddInControl ctl in splitContainer.Panel1.Controls) { ctl.Selected = false; bool visible; if (showPreinstalledAddInsCheckBox.Checked) { visible = true; } else { if (ctl == oldFocus) oldFocus = null; visible = !FileUtility.IsBaseDirectory(FileUtility.ApplicationRootPath, ctl.AddIn.FileName); } if (visible) visibleAddInCount += 1; ctl.Visible = visible; } UpdateActionBox(); }
void OnControlEnter(object sender, EventArgs e) { if (ignoreFocusChange) return; bool ctrl = (ModifierKeys & Keys.Control) == Keys.Control; if ((ModifierKeys & Keys.Shift) == Keys.Shift && sender != oldFocus) { bool sel = false; foreach (AddInControl ctl in splitContainer.Panel1.Controls) { if (!ctl.Visible) continue; if (ctl == sender || ctl == oldFocus) { sel = !sel; ctl.Selected = true; } else { if (sel || !ctrl) { ctl.Selected = sel; } } } } else if (ctrl) { foreach (AddInControl ctl in splitContainer.Panel1.Controls) { if (ctl == sender) ctl.Selected = !ctl.Selected; } oldFocus = (AddInControl)sender; } else { foreach (AddInControl ctl in splitContainer.Panel1.Controls) { ctl.Selected = ctl == sender; } oldFocus = (AddInControl)sender; } UpdateActionBox(); }
void CreateAddInList() { Stack<AddInControl> stack = new Stack<AddInControl>(); int index = 0; AddInControl addInControl; List<AddIn> addInList = new List<AddIn>(AddInTree.AddIns); addInList.Sort(delegate(AddIn a, AddIn b) { return a.Name.CompareTo(b.Name); }); foreach (AddIn addIn in addInList) { string identity = addIn.Manifest.PrimaryIdentity; if (identity == null || addIn.Properties["addInManagerHidden"] == "true") continue; addInControl = new AddInControl(addIn); addInControl.Dock = DockStyle.Top; addInControl.TabIndex = index++; stack.Push(addInControl); addInControl.Enter += OnControlEnter; addInControl.Click += OnControlClick; } while (stack.Count > 0) { splitContainer.Panel1.Controls.Add(stack.Pop()); } ShowPreinstalledAddInsCheckBoxCheckedChanged(null, null); #if SHOWALLADDINS showPreinstalledAddInsCheckBox.Visible = false; showPreinstalledAddInsCheckBox.Checked = true; #endif splitContainer.Panel2Collapsed = true; }
void CreateAddInList() { Stack<AddInControl> stack = new Stack<AddInControl>(); int index = 0; AddInControl addInControl; List<AddIn> addInList = new List<AddIn>(AddInTree.AddIns); addInList.Sort(delegate(AddIn a, AddIn b) { return a.Name.CompareTo(b.Name); }); bool hasPreinstalledAddIns = false; foreach (AddIn addIn in addInList) { if (string.Equals(addIn.Properties["addInManagerHidden"], "true", StringComparison.OrdinalIgnoreCase) && IsInstalledInApplicationRoot(addIn)) { hasPreinstalledAddIns = true; continue; } addInControl = new AddInControl(addIn); addInControl.Dock = DockStyle.Top; addInControl.TabIndex = index++; stack.Push(addInControl); addInControl.Enter += OnControlEnter; addInControl.Click += OnControlClick; } while (stack.Count > 0) { splitContainer.Panel1.Controls.Add(stack.Pop()); } ShowPreinstalledAddInsCheckBoxCheckedChanged(null, null); if (!hasPreinstalledAddIns) { showPreinstalledAddInsCheckBox.Visible = false; } splitContainer.Panel2Collapsed = true; }