Widow – Diff between revs 11 and 12

Subversion Repositories:
Rev:
Show entire fileIgnore whitespace
Rev 11 Rev 12
Line 25... Line 25...
25 { 25 {
26 return; 26 return;
27 } 27 }
Line 28... Line 28...
28   28  
29 _window.CollectionChanged -= Window_CollectionChanged; -  
Line -... Line 29...
-   29 _window.CollectionChanged -= Window_CollectionChanged;
30 _window.Clear(); 30  
31   31 _window.Clear();
32 _windows.Clear(); 32 _windows.Clear();
33 foreach (var window in value) 33 foreach (var window in value)
Line 34... Line 34...
34 { 34 {
35 _window.Add(window); 35 _window.Add(window);
36   36  
37 if (_windows.Contains(window.Title)) 37 if (_windows.ContainsKey(window.Title))
Line 38... Line 38...
38 { 38 {
39 continue; 39 continue;
Line 40... Line 40...
40 } 40 }
41   41  
42 _windows.Add(window.Title); 42 _windows.Add(window.Title, window);
Line 51... Line 51...
51   51  
Line 52... Line 52...
52 #region Private Delegates, Events, Enums, Properties, Indexers and Fields 52 #region Private Delegates, Events, Enums, Properties, Indexers and Fields
Line 53... Line 53...
53   53  
Line 54... Line 54...
54 private readonly ObservableCollection<Window> _window = new ObservableCollection<Window>(); 54 private readonly ObservableCollection<Window> _window = new ObservableCollection<Window>();
Line 55... Line 55...
55   55  
Line 84... Line 84...
84 { 84 {
85 if (e.OldItems != null) 85 if (e.OldItems != null)
86 { 86 {
87 foreach (var window in e.OldItems.OfType<Window>()) 87 foreach (var window in e.OldItems.OfType<Window>())
88 { 88 {
89 if (_windows.Contains(window.Title)) 89 if (_windows.ContainsKey(window.Title))
90 { 90 {
91 _windows.Remove(window.Title); 91 _windows.Remove(window.Title);
92 } 92 }
93 } 93 }
94 } 94 }
Line 96... Line 96...
96   96  
97 if (e.NewItems != null) 97 if (e.NewItems != null)
98 { 98 {
99 foreach (var window in e.NewItems.OfType<Window>()) 99 foreach (var window in e.NewItems.OfType<Window>())
100 { 100 {
101 if (!_windows.Contains(window.Title)) 101 if (!_windows.ContainsKey(window.Title))
102 { 102 {
103 _windows.Add(window.Title); 103 _windows.Add(window.Title, window);
104 } 104 }
105 } 105 }
106 } 106 }
Line 107... Line 107...
107 } 107 }
Line 108... Line 108...
108   108  
Line 109... Line 109...
109 #endregion 109 #endregion
110   110  
111 #region Public Methods 111 #region Public Methods
112   112  
Line 113... Line 113...
113 public bool Contains(string hash) 113 public bool TryGetWindow(string title, out Window window)
Line 114... Line 114...
114 { 114 {