protected override void OnMouseDown(MouseEventArgs e) { base.OnMouseDown(e); if (e.Button == MouseButtons.Left) { DetailsTemplateTypeService detailsTemplateTypeService = (DetailsTemplateTypeService)this.GetService(typeof(DetailsTemplateTypeService)); if (detailsTemplateTypeService != null && detailsTemplateTypeService.TemplateType.Equals("Mailbox Agent")) { return; } int tabAt = this.GetTabAt(e.Location); if (tabAt == -1) { return; } TabPage tabPage = base.TabPages[tabAt]; if (tabPage != null) { this.hoverTabRectangle = base.GetTabRect(tabAt); base.DoDragDrop(tabPage, DragDropEffects.Move); if (base.TabPages.IndexOf(tabPage) != tabAt) { IComponentChangeService componentChangeService = this.GetService(typeof(IComponentChangeService)) as IComponentChangeService; if (componentChangeService != null) { componentChangeService.OnComponentChanged(tabPage, null, null, null); } } } } }
internal void Initialize() { DetailsTemplateTypeService detailsTemplateTypeService = (DetailsTemplateTypeService)this.GetService(typeof(DetailsTemplateTypeService)); if (detailsTemplateTypeService != null) { this.dataSource = new DataTable(); this.dataSource.Columns.Add(Toolbox.ToolNameColumn, typeof(string)); if (!detailsTemplateTypeService.TemplateType.Equals("Mailbox Agent")) { foreach (KeyValuePair <string, Type[]> keyValuePair in Toolbox.toolboxControls) { if (!detailsTemplateTypeService.TemplateType.Equals("Search Dialog") || !Toolbox.forbiddenSearchDialogTools.Contains(keyValuePair.Key)) { DataRow dataRow = this.dataSource.NewRow(); dataRow[Toolbox.ToolNameColumn] = keyValuePair.Key; this.dataSource.Rows.Add(dataRow); } } } this.toolList = new DataListView(); this.toolList.AutoGenerateColumns = false; this.toolList.AvailableColumns.Add(Toolbox.ToolNameColumn, Strings.ToolNameColumnName, true); this.toolList.IconLibrary = Toolbox.iconLibrary; this.toolList.ImagePropertyName = Toolbox.ToolNameColumn; this.toolList.IdentityProperty = Toolbox.ToolNameColumn; this.toolList.MultiSelect = false; this.toolList.ShowSelectionPropertiesCommand = null; this.toolList.SelectionNameProperty = Toolbox.ToolNameColumn; this.toolList.DataSource = this.dataSource.DefaultView; this.toolList.Dock = DockStyle.Fill; base.Controls.Add(this.toolList); this.toolList.MouseDown += this.toolList_MouseDown; this.toolList.MouseUp += this.toolList_MouseUp; this.toolList.SelectionChanged += this.toolList_SelectionChanged; } }