void SelectedTabItemChanged(object sender, EventArgs e) { SideTabItem item = (sender as SideTab).ChosenItem; if (item == null) { toolboxService.SetSelectedToolboxItem(null); } else { toolboxService.SetSelectedToolboxItem(item.Tag as ToolboxItem); } }
protected override void OnDragDrop(DragEventArgs de) { base.OnDragDrop(de); IToolboxService it = (IToolboxService)this.GetService(typeof(IToolboxService)); it.SetSelectedToolboxItem(null); }
// Sets the selected item when an item is clicked in the item list. private void UpdateSelectedItem(object sender, System.EventArgs e) { if (toolboxService != null) { if (listBox1.SelectedIndex != -1) { if ((string)listBox1.SelectedItem == toolboxService.SelectedCategory) { toolboxService.SetSelectedToolboxItem(tools[listBox2.SelectedIndex]); } else { UpdateLists(); } } } }
private void OnSelectionChanged(object sender, EventArgs e) { selectedNode = nodeView.NodeSelection.SelectedNode as BaseToolboxNode; if (selectedNode is ToolboxItemToolboxNode) { //get the services DesignerHost host = parentServices.GetService(typeof(IDesignerHost)) as DesignerHost; IToolboxService toolboxService = parentServices.GetService(typeof(IToolboxService)) as IToolboxService; if (toolboxService == null || host == null) { return; } toolboxService.SetSelectedToolboxItem(((ToolboxItemToolboxNode)selectedNode).ToolboxItem); } }
private void OnRowActivated(object sender, RowActivatedArgs e) { ItemToolboxNode activatedNode = store.GetNode(e.Path) as ItemToolboxNode; DesignerHost host = parentServices.GetService(typeof(IDesignerHost)) as DesignerHost; IToolboxService toolboxService = parentServices.GetService(typeof(IToolboxService)) as IToolboxService; //toolboxitem needs to trigger extra events from toolboxService if (selectedNode is ToolboxItemToolboxNode) { if (toolboxService == null || host == null) { return; } toolboxService.SetSelectedToolboxItem(((ToolboxItemToolboxNode)activatedNode).ToolboxItem); activatedNode.Activate(host); toolboxService.SelectedToolboxItemUsed(); } else { activatedNode.Activate(host); } }