Example #1
0
        private void C_CreatedCancelled(object sender, EventArgs e)
        {
            if (!(sender is IToolboxCategory category))
            {
                return;
            }

            category.Created          -= C_Created;
            category.CreatedCancelled -= C_CreatedCancelled;
            _service.RemoveCategory(category);
        }
Example #2
0
 protected override void OnExecute(object parameter)
 {
     if (!(_toolbox.SelectedNode is IToolboxCategory category))
     {
         return;
     }
     if (ToolboxCategory.IsDefaultCategory(category))
     {
         return;
     }
     _service.RemoveCategory(category);
 }
Example #3
0
        private void MoveCategoryUp(IToolboxCategory category)
        {
            if (category == null)
            {
                return;
            }
            var items = _service.GetToolboxItemSource();
            var index = items.IndexOf(x => x.Equals(category));

            _service.RemoveCategory(category, false, true);
            _service.InsertCategory(index - 1, category);
            _toolbox.SelectedNode = category;
        }