Ejemplo n.º 1
0
        public void OnExecute(CommandEventArgs e)
        {
            if (_issueService == null)
                _issueService = e.Context.GetService<IAnkhIssueService>();

            if (_issueService == null)
                return;

            switch (e.Command)
            {
                case AnkhCommand.LogOpenIssue:
                    {
                        ISvnLogItem selectedLog = EnumTools.GetSingle(e.Selection.GetSelection<ISvnLogItem>());
                        if (selectedLog == null)
                            return;

                        string issueid = null;
                        IEnumerable<IssueMarker> issues = selectedLog.Issues;
                        if (!EnumTools.IsEmpty<IssueMarker>(issues))
                        {
                            using (Ankh.UI.IssueTracker.IssueSelector dlg = new Ankh.UI.IssueTracker.IssueSelector())
                            {
                                dlg.Context = e.Context;
                                dlg.LoadIssues(issues);
                                if (!dlg.IsSingleIssue(out issueid))
                                {
                                    if (dlg.ShowDialog(e.Context) == System.Windows.Forms.DialogResult.OK)
                                    {
                                        issueid = dlg.SelectedIssue;
                                    }
                                }
                            }
                        }
                        if (!string.IsNullOrEmpty(issueid)) { _issueService.OpenIssue(issueid); }
                    }

                    break;
                case AnkhCommand.PcLogEditorOpenIssue:
                    IssueMarker marker;

                    if (TryGetIssue(e, out marker))
                    {
                        _issueService.OpenIssue(marker.Value);
                    }
                    break;
            }
        }
Ejemplo n.º 2
0
        public void OnExecute(CommandEventArgs e)
        {
            if (_issueService == null)
            {
                _issueService = e.Context.GetService <IAnkhIssueService>();
            }

            if (_issueService == null)
            {
                return;
            }


            ISvnLogItem selectedLog = EnumTools.GetSingle(e.Selection.GetSelection <ISvnLogItem>());

            if (selectedLog == null)
            {
                return;
            }

            string issueid = null;
            IEnumerable <TextMarker> issues = selectedLog.Issues;

            if (!EnumTools.IsEmpty <TextMarker>(issues))
            {
                using (Ankh.UI.IssueTracker.IssueSelector dlg = new Ankh.UI.IssueTracker.IssueSelector())
                {
                    dlg.Context = e.Context;
                    dlg.LoadIssues(issues);
                    if (!dlg.IsSingleIssue(out issueid))
                    {
                        if (dlg.ShowDialog(e.Context) == System.Windows.Forms.DialogResult.OK)
                        {
                            issueid = dlg.SelectedIssue;
                        }
                    }
                }
            }
            if (!string.IsNullOrEmpty(issueid))
            {
                _issueService.OpenIssue(issueid);
            }
        }