Beispiel #1
0
 public Change[] GetChangesForChangeset(TfsCheckin changeset)
 {
     lock (_lock)
     {
         return(_versionControlServer.GetChangesForChangeset(changeset.ChangesetId, true, 20, null));
     }
 }
        protected ChangesetEventArgs OnChangesetLinkClicked(TfsCheckin changeset)
        {
            if (ChangesetLinkClicked != null)
            {
                var args = new ChangesetEventArgs(changeset.ServerId, changeset.ChangesetId) { CurrentChangeset = changeset };
                ChangesetLinkClicked(this, args);

                return args;
            }

            return null;
        }
        public TfsCheckin GetChangeset(int changesetId)
        {
            TfsCheckin result = null;

            foreach (string folderId in _monitoredItems)
            {
                lock (_lock)
                {
                    var change = _versionControlServer.GetChangeset(changesetId, false, false);

                    if (change != null)
                        result = new TfsCheckin(change, ServerConfiguration.Id, ServerConfiguration.TfsTeamProjectCollection, folderId, _monitoredItems[folderId]);
                }
            }

            return result;
        }
        public ChangesetInfo(SourceControlProject project, TfsCheckin change)
        {
            InitializeComponent();
      
            _changeset = change;
            _project = project;

            if (_changeset == null)
                return;

            var lviLoading = new ListViewItem("Loading...");
            lviLoading.SubItems.Add("Chargement en cours...");
            listView1.Items.Add(lviLoading);

            var x = new Task(() =>
            {
                var changes = project.GetChangesForChangeset(change);

                BeginInvoke(new MethodInvoker(() => listView1.Items.Remove(lviLoading)));

                changes.ToList().ForEach(c =>
                {
                    if (c == null)
                        return;

                    var lvi = new ListViewItem(c.ChangeType.ToString());

                    string name = c.Item.ServerItem;
                    foreach (MonitoredProjectItemConfigurationElement folder in project.ServerConfiguration.Folders)
                        name = name.Replace(folder.MonitoredFolder, "");

                    lvi.SubItems.Add(name);
                    lvi.Tag = c;

                    BeginInvoke(new MethodInvoker(() => listView1.Items.Add(lvi)));
                });
            });            

            lblChangeset.Text = _changeset.ChangesetId.ToString(CultureInfo.InvariantCulture);
            lblUser.Text = _changeset.Committer;
            txtComments.Text = _changeset.Comment;

            x.Start();
        }
Beispiel #5
0
        public TfsCheckin GetChangeset(int changesetId)
        {
            TfsCheckin result = null;

            foreach (string folderId in _monitoredItems)
            {
                lock (_lock)
                {
                    var change = _versionControlServer.GetChangeset(changesetId, false, false);

                    if (change != null)
                    {
                        result = new TfsCheckin(change, ServerConfiguration.Id, ServerConfiguration.TfsTeamProjectCollection, folderId, _monitoredItems[folderId]);
                    }
                }
            }

            return(result);
        }
 private bool IsUserDisplayed(TfsCheckin currentChangeset)
 {
     var ignoredUsers = _configuration.IgnoredUsers.ToList();
     return ignoredUsers.All(c => !c.Id.Equals(currentChangeset.Committer, StringComparison.InvariantCultureIgnoreCase) && !c.Id.Equals(currentChangeset.CommitterDomainName, StringComparison.InvariantCultureIgnoreCase));
 }
        private void AddChangeSet(TfsCheckin currentChangeset, bool insert, bool addToListView, FontStyle fontVariation = FontStyle.Bold)
        {
            if (currentChangeset == null)
                return;

            if (addToListView && IsUserDisplayed(currentChangeset))
            {
                var lvi = new ListViewItem{
                    Font = new Font(Font, fontVariation),
                    ForeColor = String.Compare(currentChangeset.CommitterDomainName, String.Format("{0}\\{1}", Environment.UserDomainName, Environment.UserName), StringComparison.OrdinalIgnoreCase) == 0 ? Color.DarkSlateBlue : Color.DarkSlateGray, 
                    Text = currentChangeset.CreationDate.ToString("[yyyy-MM-dd] - HH:mm", CultureInfo.InvariantCulture), 
                    Tag = currentChangeset
                };

                lvi.SubItems.Add(currentChangeset.ChangesetId.ToString(CultureInfo.InvariantCulture));
                lvi.SubItems.Add(currentChangeset.FolderId);
                lvi.SubItems.Add(currentChangeset.Committer);
                lvi.SubItems.Add(currentChangeset.Comment);
                lvi.Tag = currentChangeset;

                BeginInvoke(new MethodInvoker(() =>
                {
                    if (insert)
                        listView1.Items.Insert(0, lvi);
                    else                    
                        listView1.Items.Add(lvi);                    
                }));
            }

            if (!_changesetIds.ContainsKey(currentChangeset.ChangesetId))
                _changesetIds.Add(currentChangeset.ChangesetId, currentChangeset);
        }
 public Change[] GetChangesForChangeset(TfsCheckin changeset)
 {
     lock (_lock)
     {
         return _versionControlServer.GetChangesForChangeset(changeset.ChangesetId, true, 20, null);
     }
 }