Exemple #1
0
        private void _lnkFileName_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            IResource      repository = _changeSet.GetProp(Props.ChangeSetRepository);
            RepositoryType repType    = SccPlugin.GetRepositoryType(repository);
            string         url        = repType.BuildLinkToFile(repository, (FileChange)e.Link.LinkData);

            if (url != null)
            {
                Core.UIManager.OpenInNewBrowserWindow(url);
            }
        }
Exemple #2
0
        public void DisplayResource(IResource resource)
        {
            _changeSet     = resource;
            _changeSetList = resource.ToResourceListLive();
            _changeSetList.ResourceChanged += HandleChangesetChanged;
            _edtDescription.Text            = resource.GetPropText(Core.Props.LongBody);
            HighlightDescriptionLinks();

            IResource      repository = _changeSet.GetProp(Props.ChangeSetRepository);
            RepositoryType repType    = SccPlugin.GetRepositoryType(repository);

            repType.OnChangesetSelected(repository, _changeSet);

            _changedFilesList.BeginUpdate();
            try
            {
                _changedFilesList.Items.Clear();
                foreach (FileChange fileChange in resource.GetLinksOfType(FileChange.ResourceType,
                                                                          Props.Change))
                {
                    if (Settings.HideUnchangedFiles)
                    {
                        if (!fileChange.Binary &&
                            fileChange.ChangeType == "edit" &&
                            String.IsNullOrEmpty(fileChange.Diff))
                        {
                            continue;
                        }
                    }

                    _changedFilesList.Items.Add(fileChange);
                }
            }
            finally
            {
                _changedFilesList.EndUpdate();
            }

            if (_changedFilesList.Items.Count == 0)
            {
                ClearSelectedChange();
                _lnkFileName.Links.Clear();
            }
            else
            {
                FileChange fileChange = (FileChange)_changedFilesList.Items [0];
                _changedFilesList.SelectedItem = fileChange;
                if (repType.BuildLinkToFile(repository, fileChange) == null)
                {
                    _lnkFileName.Links.Clear();
                }
            }
        }