Пример #1
0
        internal bool TrySetParameter(string name, object value)
        {
            int num;

            name = VariableAnalysis.GetUnaliasedVariableName(name);
            if (this._nameToIndexMap.TryGetValue(name, out num))
            {
                this.SetValue(num, value);
                return(true);
            }
            return(false);
        }
Пример #2
0
        internal PSVariable TrySetVariable(string name, object value)
        {
            int num;

            name = VariableAnalysis.GetUnaliasedVariableName(name);
            if (this._nameToIndexMap.TryGetValue(name, out num))
            {
                this.SetValue(num, value);
                return(new LocalVariable(name, this, num));
            }
            return(null);
        }
Пример #3
0
        internal bool TryGetLocalVariable(string name, bool fromNewOrSet, out PSVariable result)
        {
            int num;

            name = VariableAnalysis.GetUnaliasedVariableName(name);
            if (this._nameToIndexMap.TryGetValue(name, out num) && (fromNewOrSet || this.IsValueSet(num)))
            {
                result = new LocalVariable(name, this, num);
                return(true);
            }
            result = null;
            return(false);
        }