ee168adddc3fdb15a2de90767249e32b7fe3f63b
[mono.git] / mcs / class / referencesource / mscorlib / system / reflection / parametermodifier.cs
1 using System.Diagnostics.Contracts;
2 // ==++==
3 // 
4 //   Copyright (c) Microsoft Corporation.  All rights reserved.
5 // 
6 // ==--==
7 // <OWNER>Microsoft</OWNER>
8 // 
9
10 namespace System.Reflection 
11 {  
12     using System;
13
14     [Serializable]
15 [System.Runtime.InteropServices.ComVisible(true)]
16     public struct ParameterModifier 
17     {
18         #region Private Data Members
19         private bool[] _byRef;
20         #endregion
21
22         #region Constructor
23         public ParameterModifier(int parameterCount) 
24         {
25             if (parameterCount <= 0)
26                 throw new ArgumentException(Environment.GetResourceString("Arg_ParmArraySize"));
27             Contract.EndContractBlock();
28
29             _byRef = new bool[parameterCount];
30         }
31         #endregion
32
33         #region Internal Members
34         internal bool[] IsByRefArray { get { return _byRef; } }
35         #endregion
36
37         #region Public Members
38         public bool this[int index] 
39         {
40             get 
41             {
42                 return _byRef[index]; 
43             }
44             set 
45             {
46                 _byRef[index] = value;
47             }
48         }
49         #endregion
50     }
51 }