2
0

ParameterModifier.cs 849 B

1234567891011121314151617181920212223242526272829303132333435
  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. // See the LICENSE file in the project root for more information.
  4. namespace System.Reflection
  5. {
  6. public readonly struct ParameterModifier
  7. {
  8. private readonly bool[] _byRef;
  9. public ParameterModifier(int parameterCount)
  10. {
  11. if (parameterCount <= 0)
  12. throw new ArgumentException(SR.Arg_ParmArraySize);
  13. _byRef = new bool[parameterCount];
  14. }
  15. public bool this[int index]
  16. {
  17. get
  18. {
  19. return _byRef[index];
  20. }
  21. set
  22. {
  23. _byRef[index] = value;
  24. }
  25. }
  26. #if CORECLR
  27. internal bool[] IsByRefArray => _byRef;
  28. #endif
  29. }
  30. }