/// <summary>
 /// Raises the <see cref="E:Removed"/> event.
 /// </summary>
 /// <param name="e">The <see cref="VisualGit.Scc.PendingChangeEventArgs"/> instance containing the event data.</param>
 void OnRemoved(PendingChangeEventArgs e)
 {
     if (Removed != null)
         Removed(this, e);
 }
 /// <summary>
 /// Raises the <see cref="E:IsActiveChanged"/> event.
 /// </summary>
 /// <param name="e">The <see cref="VisualGit.Scc.PendingChangeEventArgs"/> instance containing the event data.</param>
 private void OnIsActiveChanged(PendingChangeEventArgs e)
 {
     if (IsActiveChanged != null)
         IsActiveChanged(this, e);
 }
 /// <summary>
 /// Raises the <see cref="E:ListFlushed"/> event.
 /// </summary>
 /// <param name="e">The <see cref="VisualGit.Scc.PendingChangeEventArgs"/> instance containing the event data.</param>
 void OnListFlushed(PendingChangeEventArgs e)
 {
     if (ListFlushed != null)
         ListFlushed(this, e);
 }
 /// <summary>
 /// Raises the <see cref="E:Added"/> event.
 /// </summary>
 /// <param name="e">The <see cref="VisualGit.Scc.PendingChangeEventArgs"/> instance containing the event data.</param>
 void OnAdded(PendingChangeEventArgs e)
 {
     if (Added != null)
         Added(this, e);
 }
 /// <summary>
 /// Raises the <see cref="E:Changed"/> event.
 /// </summary>
 /// <param name="e">The <see cref="VisualGit.Scc.PendingChangeEventArgs"/> instance containing the event data.</param>
 void OnChanged(PendingChangeEventArgs e)
 {
     if (Changed != null)
         Changed(this, e);
 }
        public void Clear()
        {
            PendingChangeEventArgs ee = new PendingChangeEventArgs(this, null);
            OnListFlushed(ee);

            lock (_toRefresh)
            {
                _toRefresh.Clear();
                _fullRefresh = false;
                _pendingChanges.Clear();
                _extraFiles.Clear();
            }
        }
        public void FullRefresh(bool clearStateCache)
        {
            if (clearStateCache && Cache != null)
                Cache.ClearCache();

            lock (_toRefresh)
            {
                _pendingChanges.Clear();
            }

            PendingChangeEventArgs ee = new PendingChangeEventArgs(this, null);
            OnListFlushed(ee);

            lock (_toRefresh)
            {
                _fullRefresh = true;
                _toRefresh.Clear();

                ScheduleRefreshPreLocked();
            }
        }
        void InnerRefresh()
        {
            PendingChangeEventArgs pceMe = new PendingChangeEventArgs(this, null);

            OnRefreshStarted(pceMe);

            bool wasClean = (_pendingChanges.Count == 0);
            Dictionary<string, PendingChange> mapped = new Dictionary<string, PendingChange>(StringComparer.OrdinalIgnoreCase);

            IFileStatusCache cache = Cache;

            foreach (string file in Mapper.GetAllFilesOfAllProjects())
            {
                _extraFiles.Remove(file); // If we find it here; it is no longer 'extra'!

                GitItem item = cache[file];

                if (item == null)
                    continue;

                PendingChange pc = UpdatePendingChange(wasClean, item);

                if(pc != null)
                    mapped[pc.FullPath] = pc;
            }

            foreach (string file in new List<string>(_extraFiles))
            {
                GitItem item = cache[file];

                if (item == null)
                {
                    _extraFiles.Remove(file);
                    continue;
                }

                PendingChange pc = UpdatePendingChange(wasClean, item);

                if(pc != null)
                    mapped[pc.FullPath] = pc;
            }

            for (int i = 0; i < _pendingChanges.Count; i++)
            {
                PendingChange pc = _pendingChanges[i];

                if (mapped.ContainsKey(pc.FullPath))
                    continue;

                _pendingChanges.RemoveAt(i--);
                if (!wasClean)
                {
                    OnRemoved(new PendingChangeEventArgs(this, pc));
                }
            }

            if (wasClean && _pendingChanges.Count > 0)
                OnInitialUpdate(pceMe);

            OnRefreshCompleted(pceMe);
        }
 private void OnInitialUpdate(PendingChangeEventArgs e)
 {
     if (InitialUpdate != null)
         InitialUpdate(this, e);
 }
示例#10
0
 void OnPendingChangesListFlushed(object sender, PendingChangeEventArgs e)
 {
     if (_listItems.Count > 0)
     {
         _checkedItems = new HybridCollection<string>(StringComparer.OrdinalIgnoreCase);
         foreach (PendingCommitItem pci in _listItems.Values)
         {
             if (pci.Checked && !_checkedItems.Contains(pci.FullPath))
                 _checkedItems.Add(pci.FullPath);
         }
         _listItems.Clear();
         pendingCommits.ClearItems();
     }
 }
 protected void OnRefreshStarted(PendingChangeEventArgs e)
 {
     if (RefreshStarted != null)
         RefreshStarted(this, e);
 }
示例#12
0
 void OnPendingChangesInitialUpdate(object sender, PendingChangeEventArgs e)
 {
     PerformInitialUpdate(e.Manager);
 }
示例#13
0
        void OnPendingChangesChanged(object sender, PendingChangeEventArgs e)
        {
            PendingCommitItem pci;

            string path = e.Change.FullPath;

            if (!_listItems.TryGetValue(path, out pci))
            {
                pci = new PendingCommitItem(pendingCommits, e.Change);
                _listItems.Add(path, pci);
                pendingCommits.Items.Add(pci);
            }
            else
            {
                pci.RefreshText(Context);
            }
        }
示例#14
0
 void OnPendingChangesActiveChanged(object sender, PendingChangeEventArgs e)
 {
     // Just ignore for now
     Enabled = e.Manager.IsActive;
 }
示例#15
0
        void OnPendingChangeRemoved(object sender, PendingChangeEventArgs e)
        {
            PendingCommitItem pci;

            string path = e.Change.FullPath;

            if (_listItems.TryGetValue(path, out pci))
            {
                _listItems.Remove(path);
                pci.Remove();
                pendingCommits.RefreshGroupsAvailable();
            }
        }
示例#16
0
        void OnPendingChangeAdded(object sender, PendingChangeEventArgs e)
        {
            PendingCommitItem pci;

            string path = e.Change.FullPath;

            if (_listItems.TryGetValue(path, out pci))
            {
                // Should never happend; will refresh checkbox, etc.
                _listItems.Remove(path);
                pci.Remove();
            }

            pci = new PendingCommitItem(pendingCommits, e.Change);
            _listItems.Add(path, pci);
            pendingCommits.Items.Add(pci);

            // TODO: Maybe add something like
            //pendingCommits.AutoResizeColumn(0, ColumnHeaderAutoResizeStyle.ColumnContent);
        }