public TicketNode(ServerDetails serverDetails, TicketQueryDefinition ticketQueryDefinition)
            {
                this.Text       = ticketQueryDefinition.Name;
                this.ImageIndex = this.SelectedImageIndex = 3;

                this.ServerDetails    = serverDetails;
                this.TicketDefinition = ticketQueryDefinition;
            }
示例#2
0
        public AddNewTicketQueryForm(ITracConnect tracConnect, TicketQueryDefinition ticketDefinition)
        {
            this.TicketDefinition = ticketDefinition;
            this.TracConnect      = tracConnect;
            InitializeComponent();

            this.TicketQueryFilter = this.TicketDefinition.Filter;
            this.TicketQueryName   = this.TicketDefinition.Name;
        }
        public AddNewTicketQueryForm(ITracConnect tracConnect, TicketQueryDefinition ticketDefinition)
        {
            this.TicketDefinition = ticketDefinition;
            this.TracConnect = tracConnect;
            InitializeComponent();

            this.TicketQueryFilter = this.TicketDefinition.Filter;
            this.TicketQueryName = this.TicketDefinition.Name;
        }
示例#4
0
        private void AddOnlyNewQuery(List <TicketQueryDefinition> queries, TicketQueryDefinition newQuery)
        {
            TicketQueryDefinition ticketQuery = _server.TicketQueries.Find(delegate(TicketQueryDefinition obj) { return(obj.Name == newQuery.Name); });

            if (ticketQuery == null)
            {
                queries.Add(newQuery);
            }
        }
示例#5
0
        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);
        }
        private void btnNewTicketQuery_Click(object sender, EventArgs e)
        {
            TicketsNode node = treeTrac.SelectedNode as TicketsNode;

            AddNewTicketQueryForm form = new AddNewTicketQueryForm(this._tracConnect);

            if (form.ShowDialog() == DialogResult.OK)
            {
                TicketQueryDefinition ticketQueryDef = form.TicketDefinition;
                node.ServerDetails.TicketQueries.Add(ticketQueryDef);
                CommonRoot.SaveInstance();

                node.Refresh();
            }
        }
示例#7
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            if (!IsValid())
            {
                return;
            }

            if (_ticketDefinition == null)
            {
                _ticketDefinition = new TicketQueryDefinition();
            }
            this.TicketDefinition.Filter = this.TicketQueryFilter;
            this.TicketDefinition.Name   = this.TicketQueryName;

            this.DialogResult = DialogResult.OK;
        }
示例#8
0
        private void cmbTicketQuery_SelectedIndexChanged(object sender, EventArgs e)
        {
            TicketQueryDefinition ticketQueryDef;

            ticketQueryDef = serverDetails.TicketQueries.Find(delegate(TicketQueryDefinition obj) { return(obj.Name == cmbTicketQuery.SelectedItem.ToString()); });

            // Check if query is valid
            if ((ticketQueryDef != null) && (ticketDefinition != ticketQueryDef))
            {
                ticketDefinition = ticketQueryDef;

                if (TicketQueryUpdate != null)
                {
                    TicketQueryUpdate(this, new TicketQueryArgs(ServerDetails, ticketQueryDef));
                }

                RunQuery();
            }
        }
        private void AddOnlyNewQuery(List<TicketQueryDefinition> queries, TicketQueryDefinition newQuery)
        {
            TicketQueryDefinition ticketQuery = _server.TicketQueries.Find(delegate(TicketQueryDefinition obj) { return (obj.Name == newQuery.Name); });

            if (ticketQuery == null)
            {
                queries.Add(newQuery);
            }
        }
            public TicketNode(ServerDetails serverDetails, TicketQueryDefinition ticketQueryDefinition)
            {
                this.Text = ticketQueryDefinition.Name;
                this.ImageIndex = this.SelectedImageIndex = 3;

                this.ServerDetails = serverDetails;
                this.TicketDefinition = ticketQueryDefinition;
            }
示例#11
0
 public TicketQueryArgs(ServerDetails serverDetails, TicketQueryDefinition ticketQuery)
 {
     _ticketQuery = ticketQuery;
     _serverDetails = serverDetails;
 }
示例#12
0
 public TicketQueryArgs(ServerDetails serverDetails, TicketQueryDefinition ticketQuery)
 {
     _ticketQuery   = ticketQuery;
     _serverDetails = serverDetails;
 }
示例#13
0
        private void cmbTicketQuery_SelectedIndexChanged(object sender, EventArgs e)
        {
            TicketQueryDefinition ticketQueryDef;

            ticketQueryDef = serverDetails.TicketQueries.Find(delegate(TicketQueryDefinition obj) { return (obj.Name == cmbTicketQuery.SelectedItem.ToString()); });

            // Check if query is valid
            if ((ticketQueryDef != null) && (ticketDefinition != ticketQueryDef))
            {
                ticketDefinition = ticketQueryDef;

                if (TicketQueryUpdate != null)
                {
                    TicketQueryUpdate(this, new TicketQueryArgs(ServerDetails, ticketQueryDef));
                }

                RunQuery();
            }
        }
示例#14
0
 public void CreateTicketWindow(ServerDetails serverDetails, TicketQueryDefinition ticketDef, string guid)
 {
     // Not implemented!
 }
        private void btnOk_Click(object sender, EventArgs e)
        {
            if (!IsValid())
                return;

            if (_ticketDefinition == null)
            {
                _ticketDefinition = new TicketQueryDefinition();
            }
            this.TicketDefinition.Filter = this.TicketQueryFilter;
            this.TicketDefinition.Name = this.TicketQueryName;

            this.DialogResult = DialogResult.OK;
        }