ParameterModifier.cs 760 B

1234567891011121314151617181920212223242526272829
  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 => _byRef[index];
  18. set => _byRef[index] = value;
  19. }
  20. #if CORECLR
  21. internal bool[] IsByRefArray => _byRef;
  22. #endif
  23. }
  24. }