Ejemplo n.º 1
0
 /// <summary>
 /// Raises the <see cref="E:Removed"/> event.
 /// </summary>
 /// <param name="e">The <see cref="Ankh.Scc.PendingChangeEventArgs"/> instance containing the event data.</param>
 void OnRemoved(PendingChangeEventArgs e)
 {
     if (Removed != null)
         Removed(this, e);
 }
Ejemplo n.º 2
0
 protected void OnRefreshStarted(PendingChangeEventArgs e)
 {
     if (RefreshStarted != null)
         RefreshStarted(this, e);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Raises the <see cref="E:IsActiveChanged"/> event.
 /// </summary>
 /// <param name="e">The <see cref="Ankh.Scc.PendingChangeEventArgs"/> instance containing the event data.</param>
 private void OnIsActiveChanged(PendingChangeEventArgs e)
 {
     if (IsActiveChanged != null)
         IsActiveChanged(this, e);
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Raises the <see cref="E:ListFlushed"/> event.
 /// </summary>
 /// <param name="e">The <see cref="Ankh.Scc.PendingChangeEventArgs"/> instance containing the event data.</param>
 void OnListFlushed(PendingChangeEventArgs e)
 {
     if (ListFlushed != null)
         ListFlushed(this, e);
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Raises the <see cref="E:Added"/> event.
 /// </summary>
 /// <param name="e">The <see cref="Ankh.Scc.PendingChangeEventArgs"/> instance containing the event data.</param>
 void OnAdded(PendingChangeEventArgs e)
 {
     if (Added != null)
         Added(this, e);
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Raises the <see cref="E:Changed"/> event.
 /// </summary>
 /// <param name="e">The <see cref="Ankh.Scc.PendingChangeEventArgs"/> instance containing the event data.</param>
 void OnChanged(PendingChangeEventArgs e)
 {
     if (Changed != null)
         Changed(this, e);
 }
Ejemplo n.º 7
0
        public void Clear()
        {
            PendingChangeEventArgs ee = new PendingChangeEventArgs(this, null);
            OnListFlushed(ee);

            lock (_toRefresh)
            {
                _toRefresh.Clear();
                _fullRefresh = false;
                _pendingChanges.Clear();
                _extraFiles.Clear();
            }
        }
Ejemplo n.º 8
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);

            OnPendingChangeActivity(sender, e);
        }
Ejemplo n.º 9
0
 void OnPendingChangesInitialUpdate(object sender, PendingChangeEventArgs e)
 {
     PerformInitialUpdate(e.Manager);
 }
Ejemplo n.º 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();
     }
 }
Ejemplo n.º 11
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
            {
                if (PendingChange.IsIgnoreOnCommitChangeList(pci.PendingChange.ChangeList)
                    && pci.Checked)
                {
                    // Uncheck items that were moved to the ignore list
                    if (!PendingChange.IsIgnoreOnCommitChangeList(pci.LastChangeList))
                        pci.Checked = false; // Uncheck items that weren't on the ignore list before

                    // Note: We don't check items that were previously ignored, as the user didn't
                    // ask us to do that.
                }

                pci.RefreshText(Context);
            }
            OnPendingChangeActivity(sender, e);
        }
Ejemplo n.º 12
0
 void OnPendingChangesActiveChanged(object sender, PendingChangeEventArgs e)
 {
     // Just ignore for now
     Enabled = e.Manager.IsActive;
 }
Ejemplo n.º 13
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();
            }
            OnPendingChangeActivity(sender, e);
        }
Ejemplo n.º 14
0
        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'!

                SvnItem 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))
            {
                SvnItem 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);
        }
Ejemplo n.º 15
0
        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();
            }
        }
Ejemplo n.º 16
0
 private void OnInitialUpdate(PendingChangeEventArgs e)
 {
     if (InitialUpdate != null)
         InitialUpdate(this, e);
 }
Ejemplo n.º 17
0
 void OnPendingChangeActivity(object sender, PendingChangeEventArgs args)
 {
     IAnkhSolutionSettings settings = null;
     if (true
         && args.Change != null
         && (settings = Context.GetService<IAnkhSolutionSettings>()) != null
         && string.Equals(settings.ProjectRoot, args.Change.FullPath)
         // TODO add filter for property changes
         )
     {
         IAnkhIssueService iService = Context.GetService<IAnkhIssueService>();
         if (iService != null)
         {
             iService.MarkDirty();
         }
     }
 }