コード例 #1
0
        /// <summary>
        /// Passes the open request to the current issue repository if available,
        /// otherwise tries to open web browser base on project settings
        /// </summary>
        /// <param name="issueId">Issue Id</param>
        public void OpenIssue(string issueId)
        {
            if (string.IsNullOrEmpty(issueId))
            {
                throw new ArgumentNullException("issueId");
            }

            IssueRepository repository = CurrentIssueRepository;

            if (repository != null)
            {
                try
                {
                    repository.NavigateTo(issueId);
                    return;
                }
                catch { } // connector code
            }

            IAnkhWebBrowser web = GetService <IAnkhWebBrowser>();

            if (web != null)
            {
                Uri uri = CommitSettings.GetIssueTrackerUri(issueId);

                if (uri != null && !uri.IsFile && !uri.IsUnc)
                {
                    web.Navigate(uri);
                }
            }
        }