public void CreateTicketWindow(ServerDetails serverDetails, TicketQueryDefinition ticketDef, string guid) { Windows2 windows2 = (Windows2)_applicationObject.Windows; Assembly asm = Assembly.GetExecutingAssembly(); object customControl = null; string className = "TracExplorer.Common.TicketView"; string caption = ticketDef.Name; if (guid == null) { // Generate new guid guid = Guid.NewGuid().ToString("B"); } string asmLocation = asm.Location; asmLocation = asmLocation.Replace("VSTrac.dll", "Common.dll"); Window toolWindow = windows2.CreateToolWindow2(_addInInstance, asmLocation, className, caption, guid, ref customControl); Image customToolWindowTabImage = GetCustomToolWindowTabImage(); toolWindow.SetTabPicture(Support.ImageToIPicture(customToolWindowTabImage)); if (customControl != null) { ((TicketView)customControl).TicketQueryUpdate += new TicketView.TicketQueryUpdateEvent(Connect_TicketQueryUpdate); ((TicketView)customControl).TracConnect = this; ((TicketView)customControl).ServerDetails = serverDetails; ((TicketView)customControl).TicketDefinition = ticketDef; ((TicketView)customControl).ParentWindow = toolWindow; ((TicketView)customControl).RunQuery(); } toolWindow.Visible = true; // Add TicketWindow informations to reload window after restart if (_ticketWindowList == null) { _ticketWindowList = new List <TicketWindowDefinition>(); } TicketWindowDefinition definition = new TicketWindowDefinition(); definition.Guid = guid; definition.ServerName = serverDetails.Server; definition.TicketQueryName = ticketDef.Name; definition.ToolWindow = toolWindow; _ticketWindowList.Add(definition); }
public void CreateTicketWindow(ServerDetails serverDetails, TicketQueryDefinition ticketDef, string guid) { Windows2 windows2 = (Windows2)_applicationObject.Windows; Assembly asm = Assembly.GetExecutingAssembly(); object customControl = null; string className = "TracExplorer.Common.TicketView"; string caption = ticketDef.Name; if (guid == null) { // Generate new guid guid = Guid.NewGuid().ToString("B"); } string asmLocation = asm.Location; asmLocation = asmLocation.Replace("VSTrac.dll", "Common.dll"); Window toolWindow = windows2.CreateToolWindow2(_addInInstance, asmLocation, className, caption, guid, ref customControl); Image customToolWindowTabImage = GetCustomToolWindowTabImage(); toolWindow.SetTabPicture(Support.ImageToIPicture(customToolWindowTabImage)); if (customControl != null) { ((TicketView)customControl).TicketQueryUpdate += new TicketView.TicketQueryUpdateEvent(Connect_TicketQueryUpdate); ((TicketView)customControl).TracConnect = this; ((TicketView)customControl).ServerDetails = serverDetails; ((TicketView)customControl).TicketDefinition = ticketDef; ((TicketView)customControl).ParentWindow = toolWindow; ((TicketView)customControl).RunQuery(); } toolWindow.Visible = true; // Add TicketWindow informations to reload window after restart if (_ticketWindowList == null) { _ticketWindowList = new List<TicketWindowDefinition>(); } TicketWindowDefinition definition = new TicketWindowDefinition(); definition.Guid = guid; definition.ServerName = serverDetails.Server; definition.TicketQueryName = ticketDef.Name; definition.ToolWindow = toolWindow; _ticketWindowList.Add(definition); }