Changeset 945
- Timestamp:
- 5/1/2009 3:22:02 AM (4 years ago)
- File:
-
- 1 edited
-
branches/eraser6/Eraser/ToolBar.cs (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eraser6/Eraser/ToolBar.cs
r922 r945 43 43 44 44 //Hook mouse move events to show the currently selected item 45 MouseMove += new MouseEventHandler(ToolBar_MouseMove);46 MouseLeave += new EventHandler(ToolBar_MouseLeave);47 MouseClick += new MouseEventHandler(ToolBar_MouseClick);45 MouseMove += ToolBar_MouseMove; 46 MouseLeave += ToolBar_MouseLeave; 47 MouseClick += ToolBar_MouseClick; 48 48 } 49 49 … … 175 175 { 176 176 get; 177 set;177 private set; 178 178 } 179 179 } … … 284 284 #region ICollection<ToolBarItem> Members 285 285 public void Add(ToolBarItem item) 286 { 287 Insert(Count, item); 288 } 289 290 public void Clear() 291 { 292 foreach (ToolBarItem item in list) 293 item.Window = null; 294 list.Clear(); 295 window.Redraw(); 296 } 297 298 public bool Contains(ToolBarItem item) 299 { 300 return list.Contains(item); 301 } 302 303 public void CopyTo(ToolBarItem[] array, int arrayIndex) 304 { 305 list.CopyTo(array, arrayIndex); 306 } 307 308 public int Count 309 { 310 get { return list.Count; } 311 } 312 313 public bool IsReadOnly 314 { 315 get { return false; } 316 } 317 318 public bool Remove(ToolBarItem item) 319 { 320 int index = IndexOf(item); 321 if (index < 0) 322 return false; 323 324 RemoveAt(index); 325 return true; 326 } 327 #endregion 328 329 #region IEnumerable<ToolBarItem> Members 330 public IEnumerator<ToolBarItem> GetEnumerator() 331 { 332 return list.GetEnumerator(); 333 } 334 #endregion 335 336 #region IEnumerable Members 337 System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() 338 { 339 return list.GetEnumerator(); 340 } 341 #endregion 342 343 #region IList<ToolBarItem> Members 344 public int IndexOf(ToolBarItem item) 345 { 346 return list.IndexOf(item); 347 } 348 349 public void Insert(int index, ToolBarItem item) 286 350 { 287 351 if (item.Window != null) … … 291 355 292 356 item.Window = window; 293 list. Add(item);357 list.Insert(index, item); 294 358 window.Redraw(); 295 359 } 296 360 297 public void Clear()298 { 299 foreach (ToolBarItem item in list)300 item.Window = null;301 list. Clear();361 public void RemoveAt(int index) 362 { 363 ToolBarItem item = list[index]; 364 item.Window = null; 365 list.RemoveAt(index); 302 366 window.Redraw(); 303 367 } 304 368 305 public bool Contains(ToolBarItem item)306 {307 return list.Contains(item);308 }309 310 public void CopyTo(ToolBarItem[] array, int arrayIndex)311 {312 list.CopyTo(array, arrayIndex);313 }314 315 public int Count316 {317 get { return list.Count; }318 }319 320 public bool IsReadOnly321 {322 get { return false; }323 }324 325 public bool Remove(ToolBarItem item)326 {327 item.Window = null;328 bool result = list.Remove(item);329 window.Redraw();330 return result;331 }332 #endregion333 334 #region IEnumerable<ToolBarItem> Members335 public IEnumerator<ToolBarItem> GetEnumerator()336 {337 return list.GetEnumerator();338 }339 #endregion340 341 #region IEnumerable Members342 System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()343 {344 return list.GetEnumerator();345 }346 #endregion347 348 #region IList<ToolBarItem> Members349 public int IndexOf(ToolBarItem item)350 {351 return list.IndexOf(item);352 }353 354 public void Insert(int index, ToolBarItem item)355 {356 throw new NotImplementedException();357 }358 359 public void RemoveAt(int index)360 {361 throw new NotImplementedException();362 }363 364 369 public ToolBarItem this[int index] 365 370 { 366 371 get 367 372 { 368 throw new NotImplementedException();373 return list[index]; 369 374 } 370 375 set 371 376 { 372 throw new NotImplementedException(); 377 list[index] = value; 378 if (window != null) 379 window.Redraw(); 373 380 } 374 381 }
Note: See TracChangeset
for help on using the changeset viewer.
