Пример #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);
 }
Пример #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);
 }
Пример #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);
        }
Пример #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;
 }
Пример #5
0
 internal object GetAutomaticVariable(AutomaticVariable auto)
 {
     return(this.GetValue((int)auto));
 }
Пример #6
0
 internal static void SetAutomaticVariable(AutomaticVariable variable, object value, MutableTuple locals)
 {
     locals.SetValue((int)variable, value);
 }
Пример #7
0
 internal object GetAutomaticVariable(AutomaticVariable auto)
 {
     return this.GetValue((int) auto);
 }
Пример #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;
 }
Пример #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;
        }
Пример #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;
        }