コード例 #1
0
        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);
            }
        }
コード例 #2
0
        protected override void OnDragDrop(DragEventArgs de)
        {
            base.OnDragDrop(de);
            IToolboxService it = (IToolboxService)this.GetService(typeof(IToolboxService));

            it.SetSelectedToolboxItem(null);
        }
コード例 #3
0
 // 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();
             }
         }
     }
 }
コード例 #4
0
ファイル: Toolbox.cs プロジェクト: deck05/aspeditor
        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);
            }
        }
コード例 #5
0
ファイル: Toolbox.cs プロジェクト: deck05/aspeditor
        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);
            }
        }