Cysharp/ObservableCollections をベースにしたUI表示用の同期ビュー
修订版 | 87a8ee4d858ecff8f6b35b7fd7fc72a5882fadbf (tree) |
---|---|
时间 | 2022-10-20 15:32:38 |
作者 | yoshy <yoshy.org.bitbucket@gz.j...> |
Commiter | yoshy |
[MOD] ビュー破棄時のトレースログを無効化
@@ -1,4 +1,5 @@ | ||
1 | -#if DEBUG | |
1 | +//#define TRACE_DISPOSE | |
2 | +#if DEBUG && TRACE_DISPOSE | |
2 | 3 | using NLog; |
3 | 4 | #endif |
4 | 5 | using ObservableCollections; |
@@ -11,7 +12,7 @@ namespace CleanAuLait.ObservableCollectionsMod.Internal | ||
11 | 12 | ISortableSynchronizedCoupleView<T, TKey, TView> |
12 | 13 | where TKey : notnull |
13 | 14 | { |
14 | -#if DEBUG | |
15 | +#if DEBUG && TRACE_DISPOSE | |
15 | 16 | private static readonly ILogger logger = LogManager.GetCurrentClassLogger(); |
16 | 17 | #endif |
17 | 18 |
@@ -120,13 +121,13 @@ namespace CleanAuLait.ObservableCollectionsMod.Internal | ||
120 | 121 | { |
121 | 122 | if (disposing) |
122 | 123 | { |
123 | -#if DEBUG | |
124 | +#if DEBUG && TRACE_DISPOSE | |
124 | 125 | logger.Trace("{0} disposing SortableSynchronizedCoupleView...", GetType().FullName); |
125 | 126 | #endif |
126 | 127 | |
127 | 128 | DisconnectSource(); |
128 | 129 | |
129 | -#if DEBUG | |
130 | +#if DEBUG && TRACE_DISPOSE | |
130 | 131 | logger.Trace("{0} SortableSynchronizedCoupleView disposed.", GetType().FullName); |
131 | 132 | #endif |
132 | 133 | } |
@@ -183,7 +184,7 @@ namespace CleanAuLait.ObservableCollectionsMod.Internal | ||
183 | 184 | |
184 | 185 | lock (this.SyncRoot) |
185 | 186 | { |
186 | -#if DEBUG | |
187 | +#if DEBUG && TRACE_DISPOSE | |
187 | 188 | logger.Trace("{0} disconnect from source.", GetType().FullName); |
188 | 189 | #endif |
189 | 190 |
@@ -191,7 +192,7 @@ namespace CleanAuLait.ObservableCollectionsMod.Internal | ||
191 | 192 | |
192 | 193 | if (this.disposeElement) |
193 | 194 | { |
194 | -#if DEBUG | |
195 | +#if DEBUG && TRACE_DISPOSE | |
195 | 196 | logger.Trace("{0} (T, TView) elements disposing...", GetType().FullName); |
196 | 197 | #endif |
197 | 198 |
@@ -203,7 +204,7 @@ namespace CleanAuLait.ObservableCollectionsMod.Internal | ||
203 | 204 | } |
204 | 205 | } |
205 | 206 | |
206 | -#if DEBUG | |
207 | +#if DEBUG && TRACE_DISPOSE | |
207 | 208 | logger.Trace("{0} (T, TView) elements disposed.", GetType().FullName); |
208 | 209 | #endif |
209 | 210 | } |
@@ -1,4 +1,5 @@ | ||
1 | -#if DEBUG | |
1 | +//#define TRACE_DISPOSE | |
2 | +#if DEBUG && TRACE_DISPOSE | |
2 | 3 | using NLog; |
3 | 4 | #endif |
4 | 5 | using ObservableCollections; |
@@ -10,7 +11,7 @@ namespace CleanAuLait.ObservableCollectionsMod.Internal | ||
10 | 11 | { |
11 | 12 | internal sealed class SynchronizedCoupleView<T, TView> : ISynchronizedCoupleView<T, TView> |
12 | 13 | { |
13 | -#if DEBUG | |
14 | +#if DEBUG && TRACE_DISPOSE | |
14 | 15 | private static readonly ILogger logger = LogManager.GetCurrentClassLogger(); |
15 | 16 | #endif |
16 | 17 |
@@ -117,13 +118,13 @@ namespace CleanAuLait.ObservableCollectionsMod.Internal | ||
117 | 118 | { |
118 | 119 | if (disposing) |
119 | 120 | { |
120 | -#if DEBUG | |
121 | +#if DEBUG && TRACE_DISPOSE | |
121 | 122 | logger.Trace("{0} disposing CoupleView...", GetType().FullName); |
122 | 123 | #endif |
123 | 124 | |
124 | 125 | DisconnectSource(); |
125 | 126 | |
126 | -#if DEBUG | |
127 | +#if DEBUG && TRACE_DISPOSE | |
127 | 128 | logger.Trace("{0} CoupleView disposed.", GetType().FullName); |
128 | 129 | #endif |
129 | 130 | } |
@@ -168,7 +169,7 @@ namespace CleanAuLait.ObservableCollectionsMod.Internal | ||
168 | 169 | |
169 | 170 | lock (this.SyncRoot) |
170 | 171 | { |
171 | -#if DEBUG | |
172 | +#if DEBUG && TRACE_DISPOSE | |
172 | 173 | logger.Trace("{0} disconnect from source.", GetType().FullName); |
173 | 174 | #endif |
174 | 175 |
@@ -176,7 +177,7 @@ namespace CleanAuLait.ObservableCollectionsMod.Internal | ||
176 | 177 | |
177 | 178 | if (this.disposeElement) |
178 | 179 | { |
179 | -#if DEBUG | |
180 | +#if DEBUG && TRACE_DISPOSE | |
180 | 181 | logger.Trace("{0} (T, TView) elements disposing...", this.GetType().FullName); |
181 | 182 | #endif |
182 | 183 |
@@ -187,7 +188,7 @@ namespace CleanAuLait.ObservableCollectionsMod.Internal | ||
187 | 188 | disposable.Dispose(); |
188 | 189 | } |
189 | 190 | } |
190 | -#if DEBUG | |
191 | +#if DEBUG && TRACE_DISPOSE | |
191 | 192 | logger.Trace("{0} (T, TView) elements disposed.", this.GetType().FullName); |
192 | 193 | #endif |
193 | 194 | } |
@@ -1,4 +1,5 @@ | ||
1 | -#if DEBUG | |
1 | +//#define TRACE_DISPOSE | |
2 | +#if DEBUG && TRACE_DISPOSE | |
2 | 3 | using NLog; |
3 | 4 | #endif |
4 | 5 | using ObservableCollections; |
@@ -17,7 +18,7 @@ namespace CleanAuLait.ObservableCollectionsMod.Internal | ||
17 | 18 | |
18 | 19 | class NCCListView : INotifyCollectionChangedListSynchronizedSingleView<T, TView> |
19 | 20 | { |
20 | -#if DEBUG | |
21 | +#if DEBUG && TRACE_DISPOSE | |
21 | 22 | private static readonly ILogger logger = LogManager.GetCurrentClassLogger(); |
22 | 23 | #endif |
23 | 24 |
@@ -125,18 +126,18 @@ namespace CleanAuLait.ObservableCollectionsMod.Internal | ||
125 | 126 | |
126 | 127 | public void Dispose() |
127 | 128 | { |
128 | -#if DEBUG | |
129 | +#if DEBUG && TRACE_DISPOSE | |
129 | 130 | logger.Trace("{0} disposing NCCListSingleView...", this.GetType().FullName); |
130 | 131 | #endif |
131 | 132 | this.parent.RoutingCollectionChanged -= Parent_RoutingCollectionChanged; |
132 | 133 | |
133 | -#if DEBUG | |
134 | +#if DEBUG && TRACE_DISPOSE | |
134 | 135 | logger.Trace("{0} parent disposing...", this.GetType().FullName); |
135 | 136 | #endif |
136 | 137 | |
137 | 138 | parent.Dispose(); |
138 | 139 | |
139 | -#if DEBUG | |
140 | +#if DEBUG && TRACE_DISPOSE | |
140 | 141 | logger.Trace("{0} parent and NCCListSingleView disposed.", this.GetType().FullName); |
141 | 142 | #endif |
142 | 143 | } |
@@ -1,4 +1,5 @@ | ||
1 | -#if DEBUG | |
1 | +//#define TRACE_DISPOSE | |
2 | +#if DEBUG && TRACE_DISPOSE | |
2 | 3 | using NLog; |
3 | 4 | #endif |
4 | 5 | using ObservableCollections; |
@@ -10,7 +11,7 @@ namespace CleanAuLait.ObservableCollectionsMod.Internal | ||
10 | 11 | { |
11 | 12 | internal sealed partial class SynchronizedSingleView<T, TView> : ISynchronizedSingleView<T, TView> |
12 | 13 | { |
13 | -#if DEBUG | |
14 | +#if DEBUG && TRACE_DISPOSE | |
14 | 15 | private static readonly ILogger logger = LogManager.GetCurrentClassLogger(); |
15 | 16 | #endif |
16 | 17 |
@@ -70,7 +71,7 @@ namespace CleanAuLait.ObservableCollectionsMod.Internal | ||
70 | 71 | |
71 | 72 | public void Dispose() |
72 | 73 | { |
73 | -#if DEBUG | |
74 | +#if DEBUG && TRACE_DISPOSE | |
74 | 75 | logger.Trace("{0} disposing SingleView...", this.GetType().FullName); |
75 | 76 | #endif |
76 | 77 |
@@ -78,18 +79,18 @@ namespace CleanAuLait.ObservableCollectionsMod.Internal | ||
78 | 79 | |
79 | 80 | if (this.disposeParent) |
80 | 81 | { |
81 | -#if DEBUG | |
82 | +#if DEBUG && TRACE_DISPOSE | |
82 | 83 | logger.Trace("{0} parent disposing...", this.GetType().FullName); |
83 | 84 | #endif |
84 | 85 | |
85 | 86 | this.parent.Dispose(); |
86 | 87 | |
87 | -#if DEBUG | |
88 | +#if DEBUG && TRACE_DISPOSE | |
88 | 89 | logger.Trace("{0} parent disposed.", this.GetType().FullName); |
89 | 90 | #endif |
90 | 91 | } |
91 | 92 | |
92 | -#if DEBUG | |
93 | +#if DEBUG && TRACE_DISPOSE | |
93 | 94 | logger.Trace("{0} SingleView disposed.", this.GetType().FullName); |
94 | 95 | #endif |
95 | 96 | } |