private 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();
        }
        private 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 (addIn.Properties["addInManagerHidden"] == "true") //NOXLATE
                {
                    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);

            showPreinstalledAddInsCheckBox.Checked = true;

            splitContainer.Panel2Collapsed = true;
        }
Beispiel #3
0
 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();
 }
Beispiel #4
0
 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();
 }
Beispiel #5
0
        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 (addIn.Properties["addInManagerHidden"] == "true") //NOXLATE
                    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);

            showPreinstalledAddInsCheckBox.Checked = true;

            splitContainer.Panel2Collapsed = true;
        }