internal void SetAutomaticVariable(AutomaticVariable auto, object value, System.Management.Automation.ExecutionContext context) { if (context._debuggingMode > 0) { context.Debugger.CheckVariableWrite(SpecialVariables.AutomaticVariables[(int)auto]); } this.SetValue((int)auto, value); }
internal void SetAutomaticVariable(AutomaticVariable auto, object value, ExecutionContext context) { if (context._debuggingMode > 0) { context.Debugger.CheckVariableWrite(SpecialVariables.AutomaticVariables[(int)auto]); } SetValue((int)auto, value); }
internal object GetAutomaticVariableValue(AutomaticVariable variable) { int index = (int)variable; foreach (MutableTuple tuple in this._dottedScopes) { if (tuple.IsValueSet(index)) { return(tuple.GetValue(index)); } } if ((this.LocalsTuple != null) && this.LocalsTuple.IsValueSet(index)) { return(this.LocalsTuple.GetValue(index)); } return(AutomationNull.Value); }
internal object GetAutomaticVariableValue(AutomaticVariable variable) { int index = (int) variable; foreach (MutableTuple tuple in this._dottedScopes) { if (tuple.IsValueSet(index)) { return tuple.GetValue(index); } } if ((this.LocalsTuple != null) && this.LocalsTuple.IsValueSet(index)) { return this.LocalsTuple.GetValue(index); } return AutomationNull.Value; }
internal object GetAutomaticVariable(AutomaticVariable auto) { return(this.GetValue((int)auto)); }
internal static void SetAutomaticVariable(AutomaticVariable variable, object value, MutableTuple locals) { locals.SetValue((int)variable, value); }
internal object GetAutomaticVariable(AutomaticVariable auto) { return this.GetValue((int) auto); }
internal object GetAutomaticVariableValue(AutomaticVariable variable) { SessionStateScopeEnumerator enumerator = new SessionStateScopeEnumerator(this.CurrentScope); object automaticVariableValue = AutomationNull.Value; foreach (SessionStateScope scope in (IEnumerable<SessionStateScope>) enumerator) { automaticVariableValue = scope.GetAutomaticVariableValue(variable); if (automaticVariableValue != AutomationNull.Value) { return automaticVariableValue; } } return automaticVariableValue; }
} // GetVariableValueAtScope internal object GetAutomaticVariableValue(AutomaticVariable variable) { var scopeEnumerator = new SessionStateScopeEnumerator(CurrentScope); object result = AutomationNull.Value; foreach (var scope in scopeEnumerator) { result = scope.GetAutomaticVariableValue(variable); if (result != AutomationNull.Value) { break; } } return result; }
/// <summary> /// /// </summary> /// <param name="variable"></param> /// <returns></returns> internal object GetAutomaticVariableValue(AutomaticVariable variable) { int index = (int)variable; foreach (var dottedScope in _dottedScopes) { if (dottedScope.IsValueSet(index)) { return dottedScope.GetValue(index); } } // LocalsTuple should not be null, but the test infrastructure creates scopes // and doesn't set LocalsTuple if (LocalsTuple != null && LocalsTuple.IsValueSet(index)) { return LocalsTuple.GetValue(index); } return AutomationNull.Value; }