Exemplo n.º 1
0
 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);
 }
Exemplo n.º 2
0
 internal void SetAutomaticVariable(AutomaticVariable auto, object value, ExecutionContext context)
 {
     if (context._debuggingMode > 0)
     {
         context.Debugger.CheckVariableWrite(SpecialVariables.AutomaticVariables[(int)auto]);
     }
     SetValue((int)auto, value);
 }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
 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;
 }
Exemplo n.º 5
0
 internal object GetAutomaticVariable(AutomaticVariable auto)
 {
     return(this.GetValue((int)auto));
 }
Exemplo n.º 6
0
 internal static void SetAutomaticVariable(AutomaticVariable variable, object value, MutableTuple locals)
 {
     locals.SetValue((int)variable, value);
 }
Exemplo n.º 7
0
 internal object GetAutomaticVariable(AutomaticVariable auto)
 {
     return this.GetValue((int) auto);
 }
Exemplo n.º 8
0
 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;
 }
Exemplo n.º 9
0
        } // 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;
        }
Exemplo n.º 10
0
        /// <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;
        }