MegaBites-AI/Windows-powershell
0372
1/* ****************************************************************************2 *3 * Copyright (c) Microsoft Corporation.4 *5 * This source code is subject to terms and conditions of the Apache License, Version 2.0. A6 * copy of the license can be found in the License.html file at the root of this distribution. If7 * you cannot locate the Apache License, Version 2.0, please send an email to8 * dlr@microsoft.com. By using this source code in any fashion, you are agreeing to be bound9 * by the terms of the Apache License, Version 2.0.10 *11 * You must not remove this notice, or any other, from this software.12 *13 *14 * ***************************************************************************/15 16using System.Runtime.CompilerServices;17 18namespace System.Management.Automation.Interpreter19{20 internal sealed class RuntimeVariables : IRuntimeVariables21 {22 private readonly IStrongBox[] _boxes;23 24 private RuntimeVariables(IStrongBox[] boxes)25 {26 _boxes = boxes;27 }28 29 int IRuntimeVariables.Count30 {31 get32 {33 return _boxes.Length;34 }35 }36 37 object IRuntimeVariables.this[int index]38 {39 get40 {41 return _boxes[index].Value;42 }43 44 set45 {46 _boxes[index].Value = value;47 }48 }49 50 internal static IRuntimeVariables Create(IStrongBox[] boxes)51 {52 return new RuntimeVariables(boxes);53 }54 }55}56 