private void Reload() { PendingChange.RefreshContext rc = new PendingChange.RefreshContext(Context); Dictionary<string, bool> checkedCache = new Dictionary<string, bool>(StringComparer.OrdinalIgnoreCase); foreach (PendingCommitItem pci in pendingList.Items) { checkedCache[pci.FullPath] = pci.Checked; } pendingList.ClearItems(); foreach (SvnItem i in _allItems) { if (_filter != null && !_filter(i)) continue; PendingChange pc = new PendingChange(rc, i); PendingCommitItem pci = new PendingCommitItem(pendingList, pc); bool chk; if (checkedCache.TryGetValue(i.FullPath, out chk)) pci.Checked = chk; else if (_checkedFilter != null && !_checkedFilter(i)) pci.Checked = false; pendingList.Items.Add(pci); } }
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); }
void PerformInitialUpdate(IPendingChangesManager manager) { if (manager == null) throw new ArgumentNullException("manager"); pendingCommits.BeginUpdate(); _listItems.Clear(); // Make sure we are clear pendingCommits.ClearItems(); try { foreach (PendingChange pc in manager.GetAll()) { PendingCommitItem pi = new PendingCommitItem(pendingCommits, pc); _listItems.Add(pc.FullPath, pi); if (_checkedItems != null) pi.Checked = _checkedItems.Contains(pc.FullPath); pendingCommits.Items.Add(pi); } _checkedItems = null; } finally { pendingCommits.EndUpdate(); pendingCommits.Invalidate(); } }
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); }