| | | 1 | | // Licensed to the .NET Foundation under one or more agreements. |
| | | 2 | | // The .NET Foundation licenses this file to you under the MIT license. |
| | | 3 | | |
| | | 4 | | using System; |
| | | 5 | | using System.Collections.Generic; |
| | | 6 | | using System.Collections.ObjectModel; |
| | | 7 | | using System.ComponentModel; |
| | | 8 | | using System.Xml; |
| | | 9 | | using CoreWCF.Channels; |
| | | 10 | | using CoreWCF.Collections.Generic; |
| | | 11 | | using CoreWCF.Runtime; |
| | | 12 | | using CoreWCF.Security; |
| | | 13 | | |
| | | 14 | | namespace CoreWCF.Dispatcher |
| | | 15 | | { |
| | | 16 | | public sealed class ClientRuntime |
| | | 17 | | { |
| | | 18 | | //bool addTransactionFlowProperties = true; |
| | | 19 | | internal SynchronizedCollection<IClientMessageInspector> _messageInspectors; |
| | | 20 | | internal SynchronizedKeyedCollection<string, ClientOperation> _operations; |
| | | 21 | | private Type _callbackProxyType; |
| | | 22 | | private readonly ProxyBehaviorCollection<IChannelInitializer> _channelInitializers; |
| | | 23 | | private Type _contractProxyType; |
| | | 24 | | private IdentityVerifier _identityVerifier; |
| | | 25 | | private IClientOperationSelector _operationSelector; |
| | | 26 | | private ImmutableClientRuntime _runtime; |
| | 505 | 27 | | private bool _useSynchronizationContext = true; |
| | | 28 | | private Uri _via; |
| | | 29 | | private readonly SharedRuntimeState _shared; |
| | | 30 | | private int _maxFaultSize; |
| | | 31 | | private bool _messageVersionNoneFaultsEnabled; |
| | | 32 | | |
| | | 33 | | internal ClientRuntime(DispatchRuntime dispatchRuntime, SharedRuntimeState shared) |
| | 505 | 34 | | : this(dispatchRuntime.EndpointDispatcher.ContractName, |
| | 505 | 35 | | dispatchRuntime.EndpointDispatcher.ContractNamespace, |
| | 505 | 36 | | shared) |
| | | 37 | | { |
| | 505 | 38 | | DispatchRuntime = dispatchRuntime ?? throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof |
| | 505 | 39 | | _shared = shared; |
| | | 40 | | |
| | | 41 | | Fx.Assert(shared.IsOnServer, "Server constructor called on client?"); |
| | 505 | 42 | | } |
| | | 43 | | |
| | | 44 | | internal ClientRuntime(string contractName, string contractNamespace) |
| | 0 | 45 | | : this(contractName, contractNamespace, new SharedRuntimeState(false)) |
| | | 46 | | { |
| | | 47 | | Fx.Assert(!_shared.IsOnServer, "Client constructor called on server?"); |
| | 0 | 48 | | } |
| | | 49 | | |
| | 505 | 50 | | private ClientRuntime(string contractName, string contractNamespace, SharedRuntimeState shared) |
| | | 51 | | { |
| | 505 | 52 | | ContractName = contractName; |
| | 505 | 53 | | ContractNamespace = contractNamespace; |
| | 505 | 54 | | _shared = shared; |
| | | 55 | | |
| | 505 | 56 | | OperationCollection operations = new OperationCollection(this); |
| | 505 | 57 | | _operations = operations; |
| | 505 | 58 | | _channelInitializers = new ProxyBehaviorCollection<IChannelInitializer>(this); |
| | 505 | 59 | | _messageInspectors = new ProxyBehaviorCollection<IClientMessageInspector>(this); |
| | | 60 | | |
| | 505 | 61 | | UnhandledClientOperation = new ClientOperation(this, "*", MessageHeaders.WildcardAction, MessageHeaders.Wild |
| | 505 | 62 | | { |
| | 505 | 63 | | InternalFormatter = new MessageOperationFormatter() |
| | 505 | 64 | | }; |
| | 505 | 65 | | _maxFaultSize = TransportDefaults.MaxFaultSize; |
| | 505 | 66 | | } |
| | | 67 | | |
| | | 68 | | //internal bool AddTransactionFlowProperties |
| | | 69 | | //{ |
| | | 70 | | // get { return this.addTransactionFlowProperties; } |
| | | 71 | | // set |
| | | 72 | | // { |
| | | 73 | | // lock (this.ThisLock) |
| | | 74 | | // { |
| | | 75 | | // this.InvalidateRuntime(); |
| | | 76 | | // this.addTransactionFlowProperties = value; |
| | | 77 | | // } |
| | | 78 | | // } |
| | | 79 | | //} |
| | | 80 | | |
| | | 81 | | public Type CallbackClientType |
| | | 82 | | { |
| | 516 | 83 | | get { return _callbackProxyType; } |
| | | 84 | | set |
| | | 85 | | { |
| | 2 | 86 | | lock (ThisLock) |
| | | 87 | | { |
| | 2 | 88 | | InvalidateRuntime(); |
| | 2 | 89 | | _callbackProxyType = value; |
| | 2 | 90 | | } |
| | 2 | 91 | | } |
| | | 92 | | } |
| | | 93 | | |
| | | 94 | | public SynchronizedCollection<IChannelInitializer> ChannelInitializers |
| | | 95 | | { |
| | 1 | 96 | | get { return _channelInitializers; } |
| | | 97 | | } |
| | | 98 | | |
| | 1 | 99 | | public string ContractName { get; } |
| | | 100 | | |
| | 1 | 101 | | public string ContractNamespace { get; } |
| | | 102 | | |
| | | 103 | | public Type ContractClientType |
| | | 104 | | { |
| | 516 | 105 | | get { return _contractProxyType; } |
| | | 106 | | set |
| | | 107 | | { |
| | 2 | 108 | | lock (ThisLock) |
| | | 109 | | { |
| | 2 | 110 | | InvalidateRuntime(); |
| | 2 | 111 | | _contractProxyType = value; |
| | 2 | 112 | | } |
| | 2 | 113 | | } |
| | | 114 | | } |
| | | 115 | | |
| | | 116 | | internal IdentityVerifier IdentityVerifier |
| | | 117 | | { |
| | | 118 | | get |
| | | 119 | | { |
| | 0 | 120 | | if (_identityVerifier == null) |
| | | 121 | | { |
| | 0 | 122 | | _identityVerifier = IdentityVerifier.CreateDefault(); |
| | | 123 | | } |
| | | 124 | | |
| | 0 | 125 | | return _identityVerifier; |
| | | 126 | | } |
| | | 127 | | set |
| | | 128 | | { |
| | 0 | 129 | | InvalidateRuntime(); |
| | | 130 | | |
| | 0 | 131 | | _identityVerifier = value ?? throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(val |
| | 0 | 132 | | } |
| | | 133 | | } |
| | | 134 | | |
| | | 135 | | public Uri Via |
| | | 136 | | { |
| | 0 | 137 | | get { return _via; } |
| | | 138 | | set |
| | | 139 | | { |
| | 0 | 140 | | lock (ThisLock) |
| | | 141 | | { |
| | 0 | 142 | | InvalidateRuntime(); |
| | 0 | 143 | | _via = value; |
| | 0 | 144 | | } |
| | 0 | 145 | | } |
| | | 146 | | } |
| | | 147 | | |
| | | 148 | | public bool ValidateMustUnderstand |
| | | 149 | | { |
| | 1 | 150 | | get { return _shared.ValidateMustUnderstand; } |
| | | 151 | | set |
| | | 152 | | { |
| | 0 | 153 | | lock (ThisLock) |
| | | 154 | | { |
| | 0 | 155 | | InvalidateRuntime(); |
| | 0 | 156 | | _shared.ValidateMustUnderstand = value; |
| | 0 | 157 | | } |
| | 0 | 158 | | } |
| | | 159 | | } |
| | | 160 | | |
| | | 161 | | public bool MessageVersionNoneFaultsEnabled |
| | | 162 | | { |
| | | 163 | | get |
| | | 164 | | { |
| | 1 | 165 | | return _messageVersionNoneFaultsEnabled; |
| | | 166 | | } |
| | | 167 | | set |
| | | 168 | | { |
| | 0 | 169 | | InvalidateRuntime(); |
| | 0 | 170 | | _messageVersionNoneFaultsEnabled = value; |
| | 0 | 171 | | } |
| | | 172 | | } |
| | | 173 | | |
| | 585 | 174 | | internal DispatchRuntime DispatchRuntime { get; private set; } |
| | | 175 | | |
| | | 176 | | public DispatchRuntime CallbackDispatchRuntime |
| | | 177 | | { |
| | | 178 | | get |
| | | 179 | | { |
| | 0 | 180 | | if (DispatchRuntime == null) |
| | | 181 | | { |
| | 0 | 182 | | DispatchRuntime = new DispatchRuntime(this, _shared); |
| | | 183 | | } |
| | | 184 | | |
| | 0 | 185 | | return DispatchRuntime; |
| | | 186 | | } |
| | | 187 | | } |
| | | 188 | | |
| | | 189 | | internal bool EnableFaults |
| | | 190 | | { |
| | | 191 | | get |
| | | 192 | | { |
| | 0 | 193 | | if (IsOnServer) |
| | | 194 | | { |
| | 0 | 195 | | return DispatchRuntime.EnableFaults; |
| | | 196 | | } |
| | | 197 | | else |
| | | 198 | | { |
| | 0 | 199 | | return _shared.EnableFaults; |
| | | 200 | | } |
| | | 201 | | } |
| | | 202 | | set |
| | | 203 | | { |
| | 0 | 204 | | lock (ThisLock) |
| | | 205 | | { |
| | 0 | 206 | | if (IsOnServer) |
| | | 207 | | { |
| | 0 | 208 | | string text = SR.SFxSetEnableFaultsOnChannelDispatcher0; |
| | 0 | 209 | | throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(text)); |
| | | 210 | | } |
| | | 211 | | else |
| | | 212 | | { |
| | 0 | 213 | | InvalidateRuntime(); |
| | 0 | 214 | | _shared.EnableFaults = value; |
| | | 215 | | } |
| | 0 | 216 | | } |
| | 0 | 217 | | } |
| | | 218 | | } |
| | | 219 | | |
| | | 220 | | public int MaxFaultSize |
| | | 221 | | { |
| | | 222 | | get |
| | | 223 | | { |
| | 0 | 224 | | return _maxFaultSize; |
| | | 225 | | } |
| | | 226 | | set |
| | | 227 | | { |
| | 0 | 228 | | InvalidateRuntime(); |
| | 0 | 229 | | _maxFaultSize = value; |
| | 0 | 230 | | } |
| | | 231 | | } |
| | | 232 | | |
| | | 233 | | internal bool IsOnServer |
| | | 234 | | { |
| | 1 | 235 | | get { return _shared.IsOnServer; } |
| | | 236 | | } |
| | | 237 | | |
| | | 238 | | public bool ManualAddressing |
| | | 239 | | { |
| | | 240 | | get |
| | | 241 | | { |
| | 1 | 242 | | if (IsOnServer) |
| | | 243 | | { |
| | 1 | 244 | | return DispatchRuntime.ManualAddressing; |
| | | 245 | | } |
| | | 246 | | else |
| | | 247 | | { |
| | 0 | 248 | | return _shared.ManualAddressing; |
| | | 249 | | } |
| | | 250 | | } |
| | | 251 | | set |
| | | 252 | | { |
| | 0 | 253 | | lock (ThisLock) |
| | | 254 | | { |
| | 0 | 255 | | if (IsOnServer) |
| | | 256 | | { |
| | 0 | 257 | | string text = SR.SFxSetManualAddressingOnChannelDispatcher0; |
| | 0 | 258 | | throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(text)); |
| | | 259 | | } |
| | | 260 | | else |
| | | 261 | | { |
| | 0 | 262 | | InvalidateRuntime(); |
| | 0 | 263 | | _shared.ManualAddressing = value; |
| | | 264 | | } |
| | 0 | 265 | | } |
| | 0 | 266 | | } |
| | | 267 | | } |
| | | 268 | | |
| | | 269 | | internal int MaxParameterInspectors |
| | | 270 | | { |
| | | 271 | | get |
| | | 272 | | { |
| | 1 | 273 | | lock (ThisLock) |
| | | 274 | | { |
| | 1 | 275 | | int max = 0; |
| | | 276 | | |
| | 4 | 277 | | for (int i = 0; i < _operations.Count; i++) |
| | | 278 | | { |
| | 1 | 279 | | max = Math.Max(max, _operations[i].ParameterInspectors.Count); |
| | | 280 | | } |
| | | 281 | | |
| | 1 | 282 | | return max; |
| | | 283 | | } |
| | 1 | 284 | | } |
| | | 285 | | } |
| | | 286 | | |
| | | 287 | | public ICollection<IClientMessageInspector> ClientMessageInspectors |
| | | 288 | | { |
| | 0 | 289 | | get { return MessageInspectors; } |
| | | 290 | | } |
| | | 291 | | |
| | | 292 | | internal SynchronizedCollection<IClientMessageInspector> MessageInspectors |
| | | 293 | | { |
| | 1 | 294 | | get { return _messageInspectors; } |
| | | 295 | | } |
| | | 296 | | |
| | | 297 | | public ICollection<ClientOperation> ClientOperations |
| | | 298 | | { |
| | 1 | 299 | | get { return Operations; } |
| | | 300 | | } |
| | | 301 | | |
| | | 302 | | internal SynchronizedKeyedCollection<string, ClientOperation> Operations |
| | | 303 | | { |
| | 8 | 304 | | get { return _operations; } |
| | | 305 | | } |
| | | 306 | | |
| | | 307 | | internal IClientOperationSelector OperationSelector |
| | | 308 | | { |
| | 1 | 309 | | get { return _operationSelector; } |
| | | 310 | | set |
| | | 311 | | { |
| | 2 | 312 | | lock (ThisLock) |
| | | 313 | | { |
| | 2 | 314 | | InvalidateRuntime(); |
| | 2 | 315 | | _operationSelector = value; |
| | 2 | 316 | | } |
| | 2 | 317 | | } |
| | | 318 | | } |
| | | 319 | | |
| | | 320 | | internal object ThisLock |
| | | 321 | | { |
| | 2593 | 322 | | get { return _shared; } |
| | | 323 | | } |
| | | 324 | | |
| | 1 | 325 | | public ClientOperation UnhandledClientOperation { get; } |
| | | 326 | | |
| | | 327 | | internal bool UseSynchronizationContext |
| | | 328 | | { |
| | 1 | 329 | | get { return _useSynchronizationContext; } |
| | | 330 | | set |
| | | 331 | | { |
| | 0 | 332 | | lock (ThisLock) |
| | | 333 | | { |
| | 0 | 334 | | InvalidateRuntime(); |
| | 0 | 335 | | _useSynchronizationContext = value; |
| | 0 | 336 | | } |
| | 0 | 337 | | } |
| | | 338 | | } |
| | | 339 | | |
| | | 340 | | internal T[] GetArray<T>(SynchronizedCollection<T> collection) |
| | | 341 | | { |
| | 0 | 342 | | lock (collection.SyncRoot) |
| | | 343 | | { |
| | 0 | 344 | | if (collection.Count == 0) |
| | | 345 | | { |
| | 0 | 346 | | return Array.Empty<T>(); |
| | | 347 | | } |
| | | 348 | | else |
| | | 349 | | { |
| | 0 | 350 | | T[] array = new T[collection.Count]; |
| | 0 | 351 | | collection.CopyTo(array, 0); |
| | 0 | 352 | | return array; |
| | | 353 | | } |
| | | 354 | | } |
| | 0 | 355 | | } |
| | | 356 | | |
| | | 357 | | internal ImmutableClientRuntime GetRuntime() |
| | | 358 | | { |
| | 1 | 359 | | lock (ThisLock) |
| | | 360 | | { |
| | 1 | 361 | | if (_runtime == null) |
| | | 362 | | { |
| | 1 | 363 | | _runtime = new ImmutableClientRuntime(this); |
| | | 364 | | } |
| | | 365 | | |
| | 1 | 366 | | return _runtime; |
| | | 367 | | } |
| | 1 | 368 | | } |
| | | 369 | | |
| | | 370 | | internal void InvalidateRuntime() |
| | | 371 | | { |
| | 32 | 372 | | lock (ThisLock) |
| | | 373 | | { |
| | 32 | 374 | | _shared.ThrowIfImmutable(); |
| | 32 | 375 | | _runtime = null; |
| | 32 | 376 | | } |
| | 32 | 377 | | } |
| | | 378 | | |
| | | 379 | | internal void LockDownProperties() |
| | | 380 | | { |
| | 0 | 381 | | _shared.LockDownProperties(); |
| | 0 | 382 | | } |
| | | 383 | | |
| | | 384 | | internal SynchronizedCollection<T> NewBehaviorCollection<T>() |
| | | 385 | | { |
| | 1014 | 386 | | return new ProxyBehaviorCollection<T>(this); |
| | | 387 | | } |
| | | 388 | | |
| | | 389 | | internal bool IsFault(ref Message reply) |
| | | 390 | | { |
| | 1 | 391 | | if (reply == null) |
| | | 392 | | { |
| | 0 | 393 | | return false; |
| | | 394 | | } |
| | 1 | 395 | | if (reply.IsFault) |
| | | 396 | | { |
| | 0 | 397 | | return true; |
| | | 398 | | } |
| | 1 | 399 | | if (MessageVersionNoneFaultsEnabled && IsMessageVersionNoneFault(ref reply, MaxFaultSize)) |
| | | 400 | | { |
| | 0 | 401 | | return true; |
| | | 402 | | } |
| | | 403 | | |
| | 1 | 404 | | return false; |
| | | 405 | | } |
| | | 406 | | |
| | | 407 | | internal static bool IsMessageVersionNoneFault(ref Message message, int maxFaultSize) |
| | | 408 | | { |
| | 0 | 409 | | if (message.Version != MessageVersion.None || message.IsEmpty) |
| | | 410 | | { |
| | 0 | 411 | | return false; |
| | | 412 | | } |
| | | 413 | | //HttpResponseMessageProperty prop = message.Properties[HttpResponseMessageProperty.Name] as HttpResponseMes |
| | | 414 | | //if (prop == null || prop.StatusCode != HttpStatusCode.InternalServerError) |
| | | 415 | | //{ |
| | | 416 | | // return false; |
| | | 417 | | //} |
| | 0 | 418 | | using (MessageBuffer buffer = message.CreateBufferedCopy(maxFaultSize)) |
| | | 419 | | { |
| | 0 | 420 | | message.Close(); |
| | 0 | 421 | | message = buffer.CreateMessage(); |
| | 0 | 422 | | using (Message copy = buffer.CreateMessage()) |
| | | 423 | | { |
| | 0 | 424 | | using (XmlDictionaryReader reader = copy.GetReaderAtBodyContents()) |
| | | 425 | | { |
| | 0 | 426 | | return reader.IsStartElement(XD.MessageDictionary.Fault, MessageVersion.None.Envelope.Dictionary |
| | | 427 | | } |
| | | 428 | | } |
| | | 429 | | } |
| | 0 | 430 | | } |
| | | 431 | | |
| | | 432 | | private class ProxyBehaviorCollection<T> : SynchronizedCollection<T> |
| | | 433 | | { |
| | | 434 | | private readonly ClientRuntime _outer; |
| | | 435 | | |
| | | 436 | | internal ProxyBehaviorCollection(ClientRuntime outer) |
| | 2024 | 437 | | : base(outer.ThisLock) |
| | | 438 | | { |
| | 2024 | 439 | | _outer = outer; |
| | 2024 | 440 | | } |
| | | 441 | | |
| | | 442 | | protected override void ClearItems() |
| | | 443 | | { |
| | 0 | 444 | | _outer.InvalidateRuntime(); |
| | 0 | 445 | | base.ClearItems(); |
| | 0 | 446 | | } |
| | | 447 | | |
| | | 448 | | protected override void InsertItem(int index, T item) |
| | | 449 | | { |
| | 0 | 450 | | if (item == null) |
| | | 451 | | { |
| | 0 | 452 | | throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(item)); |
| | | 453 | | } |
| | | 454 | | |
| | 0 | 455 | | _outer.InvalidateRuntime(); |
| | 0 | 456 | | base.InsertItem(index, item); |
| | 0 | 457 | | } |
| | | 458 | | |
| | | 459 | | protected override void RemoveItem(int index) |
| | | 460 | | { |
| | 0 | 461 | | _outer.InvalidateRuntime(); |
| | 0 | 462 | | base.RemoveItem(index); |
| | 0 | 463 | | } |
| | | 464 | | |
| | | 465 | | protected override void SetItem(int index, T item) |
| | | 466 | | { |
| | 0 | 467 | | if (item == null) |
| | | 468 | | { |
| | 0 | 469 | | throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(item)); |
| | | 470 | | } |
| | | 471 | | |
| | 0 | 472 | | _outer.InvalidateRuntime(); |
| | 0 | 473 | | base.SetItem(index, item); |
| | 0 | 474 | | } |
| | | 475 | | } |
| | | 476 | | |
| | | 477 | | private class OperationCollection : SynchronizedKeyedCollection<string, ClientOperation> |
| | | 478 | | { |
| | | 479 | | private readonly ClientRuntime _outer; |
| | | 480 | | |
| | | 481 | | internal OperationCollection(ClientRuntime outer) |
| | 505 | 482 | | : base(outer.ThisLock) |
| | | 483 | | { |
| | 505 | 484 | | _outer = outer; |
| | 505 | 485 | | } |
| | | 486 | | |
| | | 487 | | protected override void ClearItems() |
| | | 488 | | { |
| | 0 | 489 | | _outer.InvalidateRuntime(); |
| | 0 | 490 | | base.ClearItems(); |
| | 0 | 491 | | } |
| | | 492 | | |
| | | 493 | | protected override string GetKeyForItem(ClientOperation item) |
| | | 494 | | { |
| | 4 | 495 | | return item.Name; |
| | | 496 | | } |
| | | 497 | | |
| | | 498 | | protected override void InsertItem(int index, ClientOperation item) |
| | | 499 | | { |
| | 2 | 500 | | if (item == null) |
| | | 501 | | { |
| | 0 | 502 | | throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(item)); |
| | | 503 | | } |
| | | 504 | | |
| | 2 | 505 | | if (item.Parent != _outer) |
| | | 506 | | { |
| | 0 | 507 | | throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgument(SR.SFxMismatchedOperationParent); |
| | | 508 | | } |
| | | 509 | | |
| | 2 | 510 | | _outer.InvalidateRuntime(); |
| | 2 | 511 | | base.InsertItem(index, item); |
| | 2 | 512 | | } |
| | | 513 | | |
| | | 514 | | protected override void RemoveItem(int index) |
| | | 515 | | { |
| | 0 | 516 | | _outer.InvalidateRuntime(); |
| | 0 | 517 | | base.RemoveItem(index); |
| | 0 | 518 | | } |
| | | 519 | | |
| | | 520 | | protected override void SetItem(int index, ClientOperation item) |
| | | 521 | | { |
| | 0 | 522 | | if (item == null) |
| | | 523 | | { |
| | 0 | 524 | | throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(item)); |
| | | 525 | | } |
| | | 526 | | |
| | 0 | 527 | | if (item.Parent != _outer) |
| | | 528 | | { |
| | 0 | 529 | | throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgument(SR.SFxMismatchedOperationParent); |
| | | 530 | | } |
| | | 531 | | |
| | 0 | 532 | | _outer.InvalidateRuntime(); |
| | 0 | 533 | | base.SetItem(index, item); |
| | 0 | 534 | | } |
| | | 535 | | |
| | 0 | 536 | | internal void InternalClearItems() { ClearItems(); } |
| | 0 | 537 | | internal string InternalGetKeyForItem(ClientOperation item) { return GetKeyForItem(item); } |
| | 0 | 538 | | internal void InternalInsertItem(int index, ClientOperation item) { InsertItem(index, item); } |
| | 0 | 539 | | internal void InternalRemoveItem(int index) { RemoveItem(index); } |
| | 0 | 540 | | internal void InternalSetItem(int index, ClientOperation item) { SetItem(index, item); } |
| | | 541 | | } |
| | | 542 | | |
| | | 543 | | private class OperationCollectionWrapper : KeyedCollection<string, ClientOperation> |
| | | 544 | | { |
| | | 545 | | private readonly OperationCollection _inner; |
| | 0 | 546 | | internal OperationCollectionWrapper(OperationCollection inner) { _inner = inner; } |
| | 0 | 547 | | protected override void ClearItems() { _inner.InternalClearItems(); } |
| | 0 | 548 | | protected override string GetKeyForItem(ClientOperation item) { return _inner.InternalGetKeyForItem(item); } |
| | 0 | 549 | | protected override void InsertItem(int index, ClientOperation item) { _inner.InternalInsertItem(index, item) |
| | 0 | 550 | | protected override void RemoveItem(int index) { _inner.InternalRemoveItem(index); } |
| | 0 | 551 | | protected override void SetItem(int index, ClientOperation item) { _inner.InternalSetItem(index, item); } |
| | | 552 | | } |
| | | 553 | | } |
| | | 554 | | } |