|
8 | 8 | @code { |
9 | 9 | private OnExecuteSorted _executeSorted; |
10 | 10 | private OnExecuteUpdated _executeUpdated; |
| 11 | + private OnExecuteUpdatedAsync _executeUpdatedAsync; |
11 | 12 | private OnExecuteSelected _executeSelected; |
12 | 13 | private OnExecuteDeleted _executeDeleted; |
| 14 | + private OnExecuteDeletedAsync _executeDeletedAsync; |
13 | 15 | private OnExecuteInserted _executeInserted; |
| 16 | + private OnExecuteInsertedAsync _executeInsertedAsync; |
14 | 17 |
|
15 | 18 | [Parameter] |
16 | 19 | public bool AutoSort |
|
93 | 96 | } |
94 | 97 | } |
95 | 98 |
|
| 99 | + [Parameter] |
| 100 | + public OnExecuteUpdatedAsync OnExecuteUpdatedAsync |
| 101 | + { |
| 102 | + get |
| 103 | + { |
| 104 | + return _executeUpdatedAsync; |
| 105 | + } |
| 106 | + set |
| 107 | + { |
| 108 | + if (value != null) |
| 109 | + { |
| 110 | + this.Control.ExecuteUpdatedAsync += InvokeExecuteUpdatedAsync; |
| 111 | + } |
| 112 | + else |
| 113 | + { |
| 114 | + this.Control.ExecuteUpdatedAsync -= InvokeExecuteUpdatedAsync; |
| 115 | + } |
| 116 | + _executeUpdatedAsync = value; |
| 117 | + } |
| 118 | + } |
| 119 | + |
96 | 120 | [Parameter] |
97 | 121 | public EventHandler OnDataSourceChanged |
98 | 122 | { |
|
148 | 172 | } |
149 | 173 | } |
150 | 174 |
|
| 175 | + [Parameter] |
| 176 | + public OnExecuteInsertedAsync OnExecuteInsertedAsync |
| 177 | + { |
| 178 | + get |
| 179 | + { |
| 180 | + return _executeInsertedAsync; |
| 181 | + } |
| 182 | + set |
| 183 | + { |
| 184 | + if (value != null) |
| 185 | + { |
| 186 | + this.Control.ExecuteInsertedAsync += InvokeExecuteInsertedAsync; |
| 187 | + } |
| 188 | + else |
| 189 | + { |
| 190 | + this.Control.ExecuteInsertedAsync -= InvokeExecuteInsertedAsync; |
| 191 | + } |
| 192 | + _executeInsertedAsync = value; |
| 193 | + } |
| 194 | + } |
| 195 | + |
151 | 196 | [Parameter] |
152 | 197 | public OnExecuteDeleted OnExecuteDeleted |
153 | 198 | { |
|
169 | 214 | } |
170 | 215 | } |
171 | 216 |
|
| 217 | + [Parameter] |
| 218 | + public OnExecuteDeletedAsync OnExecuteDeletedAsync |
| 219 | + { |
| 220 | + get |
| 221 | + { |
| 222 | + return _executeDeletedAsync; |
| 223 | + } |
| 224 | + set |
| 225 | + { |
| 226 | + if (value != null) |
| 227 | + { |
| 228 | + this.Control.ExecuteDeletedAsync += InvokeExecuteDeletedAsync; |
| 229 | + } |
| 230 | + else |
| 231 | + { |
| 232 | + this.Control.ExecuteDeletedAsync -= InvokeExecuteDeletedAsync; |
| 233 | + } |
| 234 | + _executeDeletedAsync = value; |
| 235 | + } |
| 236 | + } |
| 237 | + |
172 | 238 | private void InvokeExecuteSorted(object sender, ref IEnumerable enumerable, DataSourceSelectArguments arguments) |
173 | 239 | { |
174 | 240 | _executeSorted.Invoke(sender, ref enumerable, arguments); |
|
179 | 245 | _executeUpdated.Invoke(sender, keys, values, oldValues); |
180 | 246 | } |
181 | 247 |
|
| 248 | + private Task InvokeExecuteUpdatedAsync(object sender, IDictionary keys, IDictionary values, IDictionary oldValues) |
| 249 | + { |
| 250 | + return _executeUpdatedAsync.Invoke(sender, keys, values, oldValues); |
| 251 | + } |
| 252 | + |
182 | 253 | private IEnumerable InvokeExecuteSelected(object sender) |
183 | 254 | { |
184 | 255 | return _executeSelected.Invoke(sender); |
|
189 | 260 | _executeDeleted.Invoke(sender, keys, oldValues); |
190 | 261 | } |
191 | 262 |
|
| 263 | + private Task InvokeExecuteDeletedAsync(object sender, IDictionary keys, IDictionary oldValues) |
| 264 | + { |
| 265 | + return _executeDeletedAsync.Invoke(sender, keys, oldValues); |
| 266 | + } |
| 267 | + |
192 | 268 | private void InvokeExecuteInserted(object sender, IDictionary values) |
193 | 269 | { |
194 | 270 | _executeInserted.Invoke(sender, values); |
195 | 271 | } |
| 272 | + |
| 273 | + private Task InvokeExecuteInsertedAsync(object sender, IDictionary values) |
| 274 | + { |
| 275 | + return _executeInsertedAsync.Invoke(sender, values); |
| 276 | + } |
196 | 277 | } |
0 commit comments