| | | 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.Threading; |
| | | 8 | | using System.Threading.Tasks; |
| | | 9 | | using CoreWCF.Channels; |
| | | 10 | | using CoreWCF.Collections.Generic; |
| | | 11 | | using CoreWCF.Runtime; |
| | | 12 | | |
| | | 13 | | namespace CoreWCF.Dispatcher |
| | | 14 | | { |
| | | 15 | | // This class is now only used as an OM for configuring the service. |
| | | 16 | | // This class has been kept to enable using existing behaviors. |
| | | 17 | | public class ChannelDispatcher : ChannelDispatcherBase |
| | | 18 | | { |
| | | 19 | | private EndpointDispatcherCollection _endpointDispatchers; |
| | | 20 | | private ServiceHostBase _host; |
| | | 21 | | |
| | | 22 | | //bool isTransactedReceive; |
| | | 23 | | //bool asynchronousTransactedAcceptEnabled; |
| | | 24 | | //int maxTransactedBatchSize; |
| | | 25 | | private MessageVersion _messageVersion; |
| | | 26 | | private bool _receiveSynchronously; |
| | | 27 | | private bool _sendAsynchronously; |
| | | 28 | | private int _maxPendingReceives; |
| | | 29 | | private bool _includeExceptionDetailInFaults; |
| | | 30 | | |
| | | 31 | | //ServiceThrottle serviceThrottle; |
| | | 32 | | // TODO: _session is needed when implementing clean shutdown codepath. See issue #282 |
| | | 33 | | // private readonly bool _session; |
| | | 34 | | private SharedRuntimeState _shared; |
| | | 35 | | private readonly IDefaultCommunicationTimeouts _timeouts; |
| | | 36 | | |
| | | 37 | | //IsolationLevel transactionIsolationLevel = ServiceBehaviorAttribute.DefaultIsolationLevel; |
| | | 38 | | //bool transactionIsolationLevelSet; |
| | | 39 | | //private TimeSpan _transactionTimeout; |
| | | 40 | | // TODO: Implement shutdown service cleanly, see Issue #282 |
| | | 41 | | //private readonly bool _performDefaultCloseInput; |
| | | 42 | | |
| | | 43 | | //EventTraceActivity eventTraceActivity; |
| | | 44 | | private ErrorBehavior _errorBehavior; |
| | | 45 | | |
| | 0 | 46 | | internal ChannelDispatcher(SharedRuntimeState shared) |
| | | 47 | | { |
| | 0 | 48 | | Initialize(shared); |
| | 0 | 49 | | } |
| | | 50 | | |
| | 663 | 51 | | internal ChannelDispatcher(Uri listenUri, Binding binding, string bindingName, IDefaultCommunicationTimeouts tim |
| | | 52 | | { |
| | 663 | 53 | | BindingName = bindingName; |
| | 663 | 54 | | Binding = binding; |
| | 663 | 55 | | ListenUri = listenUri; |
| | 663 | 56 | | SupportedChannelTypes = supportedChannelTypes; |
| | 663 | 57 | | _timeouts = new ImmutableCommunicationTimeouts(timeouts); |
| | 663 | 58 | | Initialize(new SharedRuntimeState(true)); |
| | 663 | 59 | | } |
| | | 60 | | |
| | | 61 | | private void Initialize(SharedRuntimeState shared) |
| | | 62 | | { |
| | 663 | 63 | | _shared = shared; |
| | 663 | 64 | | _endpointDispatchers = new EndpointDispatcherCollection(this); |
| | 663 | 65 | | ChannelInitializers = NewBehaviorCollection<IChannelInitializer>(); |
| | 663 | 66 | | Channels = new CommunicationObjectManager<IChannel>(ThisLock); |
| | 663 | 67 | | PendingChannels = new SynchronizedChannelCollection<IChannel>(ThisLock); |
| | 663 | 68 | | ErrorHandlers = new Collection<IErrorHandler>(); |
| | | 69 | | //this.isTransactedReceive = false; |
| | | 70 | | //this.asynchronousTransactedAcceptEnabled = false; |
| | 663 | 71 | | _receiveSynchronously = false; |
| | 663 | 72 | | _sendAsynchronously = true; |
| | | 73 | | //this.serviceThrottle = null; |
| | | 74 | | //transactionTimeout = TimeSpan.Zero; |
| | 663 | 75 | | _maxPendingReceives = 1; |
| | 663 | 76 | | } |
| | | 77 | | |
| | 0 | 78 | | public string BindingName { get; } |
| | | 79 | | |
| | | 80 | | // TODO: As the channel concept is changing, does it make sense to support IChannelInitializer's? |
| | 1179 | 81 | | public SynchronizedCollection<IChannelInitializer> ChannelInitializers { get; private set; } |
| | | 82 | | |
| | | 83 | | protected override TimeSpan DefaultCloseTimeout |
| | | 84 | | { |
| | | 85 | | get |
| | | 86 | | { |
| | 0 | 87 | | if (_timeouts != null) |
| | | 88 | | { |
| | 0 | 89 | | return _timeouts.CloseTimeout; |
| | | 90 | | } |
| | | 91 | | else |
| | | 92 | | { |
| | 0 | 93 | | return ServiceDefaults.CloseTimeout; |
| | | 94 | | } |
| | | 95 | | } |
| | | 96 | | } |
| | | 97 | | |
| | | 98 | | protected override TimeSpan DefaultOpenTimeout |
| | | 99 | | { |
| | | 100 | | get |
| | | 101 | | { |
| | 1176 | 102 | | if (_timeouts != null) |
| | | 103 | | { |
| | 1176 | 104 | | return _timeouts.OpenTimeout; |
| | | 105 | | } |
| | | 106 | | else |
| | | 107 | | { |
| | 0 | 108 | | return ServiceDefaults.OpenTimeout; |
| | | 109 | | } |
| | | 110 | | } |
| | | 111 | | } |
| | | 112 | | |
| | 3842 | 113 | | internal EndpointDispatcherTable EndpointDispatcherTable { get; private set; } |
| | | 114 | | |
| | 3122 | 115 | | internal CommunicationObjectManager<IChannel> Channels { get; private set; } |
| | | 116 | | |
| | | 117 | | public SynchronizedCollection<EndpointDispatcher> Endpoints |
| | | 118 | | { |
| | 5776 | 119 | | get { return _endpointDispatchers; } |
| | | 120 | | } |
| | | 121 | | |
| | 3348 | 122 | | public Collection<IErrorHandler> ErrorHandlers { get; private set; } |
| | | 123 | | |
| | | 124 | | public MessageVersion MessageVersion |
| | | 125 | | { |
| | 1324 | 126 | | get { return _messageVersion; } |
| | | 127 | | set |
| | | 128 | | { |
| | 664 | 129 | | _messageVersion = value; |
| | 664 | 130 | | ThrowIfDisposedOrImmutable(); |
| | 664 | 131 | | } |
| | | 132 | | } |
| | | 133 | | |
| | | 134 | | public override ServiceHostBase Host |
| | | 135 | | { |
| | 2387 | 136 | | get { return _host; } |
| | | 137 | | } |
| | | 138 | | |
| | | 139 | | internal bool EnableFaults |
| | | 140 | | { |
| | 680 | 141 | | get { return _shared.EnableFaults; } |
| | | 142 | | set |
| | | 143 | | { |
| | 641 | 144 | | ThrowIfDisposedOrImmutable(); |
| | 641 | 145 | | _shared.EnableFaults = value; |
| | 641 | 146 | | } |
| | | 147 | | } |
| | | 148 | | |
| | | 149 | | //public ServiceThrottle ServiceThrottle |
| | | 150 | | //{ |
| | | 151 | | // get |
| | | 152 | | // { |
| | | 153 | | // return this.serviceThrottle; |
| | | 154 | | // } |
| | | 155 | | // set |
| | | 156 | | // { |
| | | 157 | | // this.ThrowIfDisposedOrImmutable(); |
| | | 158 | | // this.serviceThrottle = value; |
| | | 159 | | // } |
| | | 160 | | //} |
| | | 161 | | |
| | | 162 | | public bool ManualAddressing |
| | | 163 | | { |
| | 2980 | 164 | | get { return _shared.ManualAddressing; } |
| | | 165 | | set |
| | | 166 | | { |
| | 664 | 167 | | ThrowIfDisposedOrImmutable(); |
| | 664 | 168 | | _shared.ManualAddressing = value; |
| | 664 | 169 | | } |
| | | 170 | | } |
| | | 171 | | |
| | 663 | 172 | | internal SynchronizedChannelCollection<IChannel> PendingChannels { get; private set; } |
| | | 173 | | |
| | | 174 | | public bool ReceiveSynchronously |
| | | 175 | | { |
| | | 176 | | get |
| | | 177 | | { |
| | 0 | 178 | | return _receiveSynchronously; |
| | | 179 | | } |
| | | 180 | | set |
| | | 181 | | { |
| | 641 | 182 | | ThrowIfDisposedOrImmutable(); |
| | 641 | 183 | | if (value != false) |
| | | 184 | | { |
| | 0 | 185 | | throw new ArgumentException("Only false supported", nameof(ReceiveSynchronously)); |
| | | 186 | | } |
| | | 187 | | |
| | 641 | 188 | | _receiveSynchronously = value; |
| | 641 | 189 | | } |
| | | 190 | | } |
| | | 191 | | |
| | | 192 | | public bool SendAsynchronously |
| | | 193 | | { |
| | | 194 | | get |
| | | 195 | | { |
| | 0 | 196 | | return _sendAsynchronously; |
| | | 197 | | } |
| | | 198 | | set |
| | | 199 | | { |
| | 0 | 200 | | ThrowIfDisposedOrImmutable(); |
| | 0 | 201 | | if (value != true) |
| | | 202 | | { |
| | 0 | 203 | | throw new ArgumentException("Only true supported", nameof(ReceiveSynchronously)); |
| | | 204 | | } |
| | | 205 | | |
| | 0 | 206 | | _sendAsynchronously = value; |
| | 0 | 207 | | } |
| | | 208 | | } |
| | | 209 | | |
| | | 210 | | // TODO: Do we need to worry about this? |
| | | 211 | | public int MaxPendingReceives |
| | | 212 | | { |
| | | 213 | | get |
| | | 214 | | { |
| | 0 | 215 | | return _maxPendingReceives; |
| | | 216 | | } |
| | | 217 | | set |
| | | 218 | | { |
| | 0 | 219 | | ThrowIfDisposedOrImmutable(); |
| | 0 | 220 | | _maxPendingReceives = value; |
| | 0 | 221 | | } |
| | | 222 | | } |
| | | 223 | | |
| | | 224 | | public bool IncludeExceptionDetailInFaults |
| | | 225 | | { |
| | 1361 | 226 | | get { return _includeExceptionDetailInFaults; } |
| | | 227 | | set |
| | | 228 | | { |
| | 660 | 229 | | lock (ThisLock) |
| | | 230 | | { |
| | 660 | 231 | | ThrowIfDisposedOrImmutable(); |
| | 660 | 232 | | _includeExceptionDetailInFaults = value; |
| | 660 | 233 | | } |
| | 660 | 234 | | } |
| | | 235 | | } |
| | | 236 | | |
| | 9988 | 237 | | public Uri ListenUri { get; } |
| | | 238 | | |
| | 459 | 239 | | internal List<Type> SupportedChannelTypes { get; } |
| | | 240 | | |
| | 8599 | 241 | | internal Binding Binding { get; } |
| | | 242 | | |
| | | 243 | | internal bool HandleError(Exception error) |
| | | 244 | | { |
| | 0 | 245 | | ErrorHandlerFaultInfo dummy = new ErrorHandlerFaultInfo(); |
| | 0 | 246 | | return HandleError(error, ref dummy); |
| | | 247 | | } |
| | | 248 | | |
| | | 249 | | internal bool HandleError(Exception error, ref ErrorHandlerFaultInfo faultInfo) |
| | | 250 | | { |
| | | 251 | | ErrorBehavior behavior; |
| | | 252 | | |
| | 4 | 253 | | lock (ThisLock) |
| | | 254 | | { |
| | 4 | 255 | | if (_errorBehavior != null) |
| | | 256 | | { |
| | 4 | 257 | | behavior = _errorBehavior; |
| | | 258 | | } |
| | | 259 | | else |
| | | 260 | | { |
| | 0 | 261 | | behavior = new ErrorBehavior(this); |
| | | 262 | | } |
| | 0 | 263 | | } |
| | | 264 | | |
| | 4 | 265 | | if (behavior != null) |
| | | 266 | | { |
| | 4 | 267 | | return behavior.HandleError(error, ref faultInfo); |
| | | 268 | | } |
| | | 269 | | else |
| | | 270 | | { |
| | 0 | 271 | | return false; |
| | | 272 | | } |
| | | 273 | | } |
| | | 274 | | |
| | | 275 | | internal void InitializeChannel(IClientChannel channel) |
| | | 276 | | { |
| | 516 | 277 | | ThrowIfDisposedOrNotOpen(); |
| | | 278 | | try |
| | | 279 | | { |
| | 1032 | 280 | | for (int i = 0; i < ChannelInitializers.Count; ++i) |
| | | 281 | | { |
| | 0 | 282 | | ChannelInitializers[i].Initialize(channel); |
| | | 283 | | } |
| | 516 | 284 | | } |
| | 0 | 285 | | catch (Exception e) |
| | | 286 | | { |
| | 0 | 287 | | if (Fx.IsFatal(e)) |
| | | 288 | | { |
| | 0 | 289 | | throw; |
| | | 290 | | } |
| | 0 | 291 | | throw DiagnosticUtility.ExceptionUtility.ThrowHelperCallback(e); |
| | | 292 | | } |
| | 516 | 293 | | } |
| | | 294 | | |
| | | 295 | | internal void Init() |
| | | 296 | | { |
| | 663 | 297 | | _errorBehavior = new ErrorBehavior(this); |
| | | 298 | | |
| | 663 | 299 | | EndpointDispatcherTable = new EndpointDispatcherTable(ThisLock); |
| | 2648 | 300 | | for (int i = 0; i < _endpointDispatchers.Count; i++) |
| | | 301 | | { |
| | 664 | 302 | | EndpointDispatcher endpoint = _endpointDispatchers[i]; |
| | | 303 | | |
| | | 304 | | // Force a build of the runtime to catch any unexpected errors before we are done opening. |
| | 664 | 305 | | endpoint.DispatchRuntime.GetRuntime(); |
| | | 306 | | // Lock down the DispatchRuntime. |
| | 661 | 307 | | endpoint.DispatchRuntime.LockDownProperties(); |
| | | 308 | | |
| | 661 | 309 | | EndpointDispatcherTable.AddEndpoint(endpoint); |
| | | 310 | | |
| | | 311 | | //if (DiagnosticUtility.ShouldTraceInformation) |
| | | 312 | | //{ |
| | | 313 | | // this.TraceEndpointLifetime(endpoint, TraceCode.EndpointListenerOpen, SR.Format(SR.TraceCodeEndpoin |
| | | 314 | | //} |
| | | 315 | | } |
| | 660 | 316 | | } |
| | | 317 | | |
| | | 318 | | internal SynchronizedCollection<T> NewBehaviorCollection<T>() |
| | | 319 | | { |
| | 663 | 320 | | return new ChannelDispatcherBehaviorCollection<T>(this); |
| | | 321 | | } |
| | | 322 | | |
| | | 323 | | internal bool HasApplicationEndpoints |
| | | 324 | | { |
| | | 325 | | get |
| | | 326 | | { |
| | 1920 | 327 | | foreach (EndpointDispatcher endpointDispatcher in Endpoints) |
| | | 328 | | { |
| | 640 | 329 | | if (!endpointDispatcher.IsSystemEndpoint) |
| | | 330 | | { |
| | 640 | 331 | | return true; |
| | | 332 | | } |
| | | 333 | | } |
| | 0 | 334 | | return false; |
| | 640 | 335 | | } |
| | | 336 | | } |
| | | 337 | | |
| | | 338 | | private void OnAddEndpoint(EndpointDispatcher endpoint) |
| | | 339 | | { |
| | 664 | 340 | | lock (ThisLock) |
| | | 341 | | { |
| | 664 | 342 | | endpoint.Attach(this); |
| | | 343 | | |
| | 664 | 344 | | if (State == CommunicationState.Opened) |
| | | 345 | | { |
| | 0 | 346 | | EndpointDispatcherTable.AddEndpoint(endpoint); |
| | | 347 | | } |
| | 664 | 348 | | } |
| | 664 | 349 | | } |
| | | 350 | | |
| | | 351 | | private void OnRemoveEndpoint(EndpointDispatcher endpoint) |
| | | 352 | | { |
| | 0 | 353 | | lock (ThisLock) |
| | | 354 | | { |
| | 0 | 355 | | if (State == CommunicationState.Opened) |
| | | 356 | | { |
| | 0 | 357 | | EndpointDispatcherTable.RemoveEndpoint(endpoint); |
| | | 358 | | } |
| | | 359 | | |
| | 0 | 360 | | endpoint.Detach(this); |
| | 0 | 361 | | } |
| | 0 | 362 | | } |
| | | 363 | | |
| | | 364 | | protected override void OnAbort() |
| | | 365 | | { |
| | 0 | 366 | | throw new PlatformNotSupportedException(); |
| | | 367 | | } |
| | | 368 | | |
| | | 369 | | protected override Task OnCloseAsync(CancellationToken token) |
| | | 370 | | { |
| | 0 | 371 | | throw new PlatformNotSupportedException(); |
| | | 372 | | } |
| | | 373 | | |
| | | 374 | | protected override Task OnOpenAsync(CancellationToken token) |
| | | 375 | | { |
| | 660 | 376 | | return Task.CompletedTask; |
| | | 377 | | } |
| | | 378 | | |
| | | 379 | | // TODO: Move this functionality somewhere else as this class is now OM only |
| | | 380 | | internal void ProvideFault(Exception e, FaultConverter faultConverter, ref ErrorHandlerFaultInfo faultInfo) |
| | | 381 | | { |
| | | 382 | | ErrorBehavior behavior; |
| | | 383 | | |
| | 19 | 384 | | lock (ThisLock) |
| | | 385 | | { |
| | 19 | 386 | | if (_errorBehavior != null) |
| | | 387 | | { |
| | 19 | 388 | | behavior = _errorBehavior; |
| | | 389 | | } |
| | | 390 | | else |
| | | 391 | | { |
| | 0 | 392 | | behavior = new ErrorBehavior(this); |
| | | 393 | | } |
| | 0 | 394 | | } |
| | | 395 | | |
| | 19 | 396 | | behavior.ProvideFault(e, faultConverter, ref faultInfo); |
| | 19 | 397 | | } |
| | | 398 | | |
| | | 399 | | protected override void Attach(ServiceHostBase host) |
| | | 400 | | { |
| | 640 | 401 | | if (host == null) |
| | | 402 | | { |
| | 0 | 403 | | throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(host)); |
| | | 404 | | } |
| | | 405 | | |
| | 640 | 406 | | ServiceHostBase serviceHost = host; |
| | | 407 | | |
| | 640 | 408 | | ThrowIfDisposedOrImmutable(); |
| | | 409 | | |
| | 640 | 410 | | if (_host != null) |
| | | 411 | | { |
| | 0 | 412 | | Exception error = new InvalidOperationException(SR.SFxChannelDispatcherMultipleHost0); |
| | 0 | 413 | | throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(error); |
| | | 414 | | } |
| | | 415 | | |
| | 640 | 416 | | _host = serviceHost; |
| | 640 | 417 | | } |
| | | 418 | | |
| | | 419 | | protected override void Detach(ServiceHostBase host) |
| | | 420 | | { |
| | 0 | 421 | | if (host == null) |
| | | 422 | | { |
| | 0 | 423 | | throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(host)); |
| | | 424 | | } |
| | | 425 | | |
| | 0 | 426 | | if (_host != host) |
| | | 427 | | { |
| | 0 | 428 | | Exception error = new InvalidOperationException(SR.SFxChannelDispatcherDifferentHost0); |
| | 0 | 429 | | throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(error); |
| | | 430 | | } |
| | | 431 | | |
| | 0 | 432 | | ThrowIfDisposedOrImmutable(); |
| | | 433 | | |
| | 0 | 434 | | _host = null; |
| | 0 | 435 | | } |
| | | 436 | | |
| | | 437 | | private class EndpointDispatcherCollection : SynchronizedCollection<EndpointDispatcher> |
| | | 438 | | { |
| | | 439 | | private readonly ChannelDispatcher _owner; |
| | | 440 | | |
| | | 441 | | internal EndpointDispatcherCollection(ChannelDispatcher owner) |
| | 663 | 442 | | : base(owner.ThisLock) |
| | | 443 | | { |
| | 663 | 444 | | _owner = owner; |
| | 663 | 445 | | } |
| | | 446 | | |
| | | 447 | | protected override void ClearItems() |
| | | 448 | | { |
| | 0 | 449 | | foreach (EndpointDispatcher item in Items) |
| | | 450 | | { |
| | 0 | 451 | | _owner.OnRemoveEndpoint(item); |
| | | 452 | | } |
| | 0 | 453 | | base.ClearItems(); |
| | 0 | 454 | | } |
| | | 455 | | |
| | | 456 | | protected override void InsertItem(int index, EndpointDispatcher item) |
| | | 457 | | { |
| | 664 | 458 | | if (item == null) |
| | | 459 | | { |
| | 0 | 460 | | throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(item)); |
| | | 461 | | } |
| | | 462 | | |
| | 664 | 463 | | _owner.OnAddEndpoint(item); |
| | 664 | 464 | | base.InsertItem(index, item); |
| | 664 | 465 | | } |
| | | 466 | | |
| | | 467 | | protected override void RemoveItem(int index) |
| | | 468 | | { |
| | 0 | 469 | | EndpointDispatcher item = Items[index]; |
| | 0 | 470 | | base.RemoveItem(index); |
| | 0 | 471 | | _owner.OnRemoveEndpoint(item); |
| | 0 | 472 | | } |
| | | 473 | | |
| | | 474 | | protected override void SetItem(int index, EndpointDispatcher item) |
| | | 475 | | { |
| | 0 | 476 | | Exception error = new InvalidOperationException(SR.SFxCollectionDoesNotSupportSet0); |
| | 0 | 477 | | throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(error); |
| | | 478 | | } |
| | | 479 | | } |
| | | 480 | | |
| | | 481 | | private class ChannelDispatcherBehaviorCollection<T> : SynchronizedCollection<T> |
| | | 482 | | { |
| | | 483 | | private readonly ChannelDispatcher _outer; |
| | | 484 | | |
| | | 485 | | internal ChannelDispatcherBehaviorCollection(ChannelDispatcher outer) |
| | 663 | 486 | | : base(outer.ThisLock) |
| | | 487 | | { |
| | 663 | 488 | | _outer = outer; |
| | 663 | 489 | | } |
| | | 490 | | |
| | | 491 | | protected override void ClearItems() |
| | | 492 | | { |
| | 0 | 493 | | _outer.ThrowIfDisposedOrImmutable(); |
| | 0 | 494 | | base.ClearItems(); |
| | 0 | 495 | | } |
| | | 496 | | |
| | | 497 | | protected override void InsertItem(int index, T item) |
| | | 498 | | { |
| | 0 | 499 | | if (item == null) |
| | | 500 | | { |
| | 0 | 501 | | throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(item)); |
| | | 502 | | } |
| | | 503 | | |
| | 0 | 504 | | _outer.ThrowIfDisposedOrImmutable(); |
| | 0 | 505 | | base.InsertItem(index, item); |
| | 0 | 506 | | } |
| | | 507 | | |
| | | 508 | | protected override void RemoveItem(int index) |
| | | 509 | | { |
| | 0 | 510 | | _outer.ThrowIfDisposedOrImmutable(); |
| | 0 | 511 | | base.RemoveItem(index); |
| | 0 | 512 | | } |
| | | 513 | | |
| | | 514 | | protected override void SetItem(int index, T item) |
| | | 515 | | { |
| | 0 | 516 | | if (item == null) |
| | | 517 | | { |
| | 0 | 518 | | throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(item)); |
| | | 519 | | } |
| | | 520 | | |
| | 0 | 521 | | _outer.ThrowIfDisposedOrImmutable(); |
| | 0 | 522 | | base.SetItem(index, item); |
| | 0 | 523 | | } |
| | | 524 | | } |
| | | 525 | | } |
| | | 526 | | } |