Changeset 37171 for lang/csharp/soyText/soyText/ListSyncer.cs
- Timestamp:
- 04/08/10 12:21:52 (3 years ago)
- Files:
-
- 1 modified
-
lang/csharp/soyText/soyText/ListSyncer.cs (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/csharp/soyText/soyText/ListSyncer.cs
r36859 r37171 122 122 cond = SearchCondition.fromExpression(persistentTab.cond); 123 123 } 124 124 public DocumentLabel getLabel(string id) 125 { 126 if (d2r.ContainsKey(id)) return d2r[id]; 127 return null; 128 } 125 129 public bool update(Document d) 126 130 { 127 131 if (contains(d)) return removeUnlessMatch(d); 128 132 else return addIfMatch(d); 133 } 134 public void bringToTop(Document d) 135 { 136 var lb = getLabel(d.id); 137 if (lb == null) return; 138 if (list.Items.IndexOf(lb) == 0) return; 139 list.Items.Remove(lb); 140 _insertAt(list, 0, lb); 141 list.SelectedIndex = 0; 129 142 } 130 143 bool addIfMatch(Document d) { … … 244 257 internal void addAsNewDoc(Document curDoc) 245 258 { 246 if (contains(curDoc)) return; 259 if (contains(curDoc)) 260 { 261 bringToTop(curDoc); 262 return; 263 } 247 264 var r=createRef(curDoc); 248 265 insertAt(0, r);
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)