コード例 #1
0
        public TracExplorerControl()
        {
            InitializeComponent();

            // Set handlers
            doubleClickHandlers.Add(typeof(WikiPageNode), WikiPageDoubleClick);
            doubleClickHandlers.Add(typeof(TicketNode), TicketDoubleClick);

            CommonRoot servers = CommonRoot.Instance;

            treeTrac.BeginUpdate();

            foreach (ServerDetails server in servers.Servers)
            {
                ServerNode nodeServer = new ServerNode(server);
                treeTrac.Nodes["nodeServers"].Nodes.Add(nodeServer);
            }

            treeTrac.Nodes["nodeServers"].Expand();

            treeTrac.EndUpdate();

            // captions
            btnDelTracServer.Text = btnDelTracServer.ToolTipText = btnServerDelete.Text = Properties.Resources.MenuDelete;
            btnNewTracServer.Text = btnNewTracServer.ToolTipText = btnNewServer.Text = Properties.Resources.MenuNewServer;
            btnServerRefresh.Text = btnServerRefresh.ToolTipText = Properties.Resources.MenuRefresh;
        }
コード例 #2
0
        private void btnDelQuery_Click(object sender, EventArgs e)
        {
            TicketNode node = treeTrac.SelectedNode as TicketNode;

            node.ServerDetails.TicketQueries.Remove(node.TicketDefinition);
            CommonRoot.SaveInstance();
            node.Remove();
        }
コード例 #3
0
        private void btnDelTracServer_Click(object sender, EventArgs e)
        {
            ServerNode node = treeTrac.SelectedNode as ServerNode;

            if (MessageBox.Show(string.Format(Properties.Resources.ConfirmDelTracServer, node.ServerDetails.Server), Properties.Resources.CaptionConfirmDelete, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
            {
                CommonRoot.Instance.Servers.Remove(node.ServerDetails);
                CommonRoot.SaveInstance();
                node.Remove();
            }
        }
コード例 #4
0
        private void mnuQueryEdit_Click(object sender, EventArgs e)
        {
            TicketNode node = treeTrac.SelectedNode as TicketNode;

            AddNewTicketQueryForm form = new AddNewTicketQueryForm(this._tracConnect, node.TicketDefinition);

            if (form.ShowDialog() == DialogResult.OK)
            {
                CommonRoot.SaveInstance();

                node.Refresh();
            }
        }
コード例 #5
0
        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();
            }
        }
コード例 #6
0
        private void wizardPage3_CloseFromNext(object sender, Gui.Wizard.PageEventArgs e)
        {
            // Add selected ticket queries
            _server.TicketQueries.Clear();
            foreach (TicketQueryDefinition query in lstTicketQueries.CheckedItems)
            {
                _server.TicketQueries.Add(query);
            }

            if (!_editMode)
            {
                CommonRoot.Instance.Servers.Add(_server);
            }
            CommonRoot.SaveInstance();
        }