示例#1
0
            public object FindName(string name)
            {
                LocationReference result;

                if (LocationReferenceEnvironment.TryGetLocationReference(name, out result))
                {
                    return(result);
                }

                throw FxTrace.Exception.AsError(new InvalidOperationException(SR.VariableOrArgumentDoesNotExist(name)));
            }
        private LocationReference FindLocationReference(string name)
        {
            LocationReference returnValue = null;

            LocationReferenceEnvironment current = this.accessor.ActivityMetadata.Environment;

            while (current != null)
            {
                if (current.TryGetLocationReference(name, out returnValue))
                {
                    return(returnValue);
                }
                current = current.Parent;
            }

            return(returnValue);
        }