FindConstants() public method

Finds the constant with the specified name.
public FindConstants ( String name ) : IConstants
name String /// The symbolic name to retrieve. ///
return IConstants
示例#1
0
        /// <summary>
        /// Finds the constant with the specified name.
        /// </summary>
        /// <param name="name">
        /// The symbolic name to retrieve.
        /// </param>
        /// <returns>The value of the constant.</returns>
        public IConstants FindConstants(String name)
        {
            if (_constants.ContainsKey(name))
            {
                return(_constants[name]);
            }

            if (_parent != null)
            {
                return(_parent.FindConstants(name));
            }

            return(null);
        }
示例#2
0
        /// <summary>
        /// Finds the constant with the specified name.
        /// </summary>
        /// <param name="name">
        /// The symbolic name to retrieve.
        /// </param>
        /// <returns>The value of the constant.</returns>
        public IConstants FindConstants(string name)
        {
            var lname = name.ToLower();

            if (constants.ContainsKey(lname))
            {
                return(constants[lname]);
            }

            if (parent != null)
            {
                return(parent.FindConstants(name));
            }

            return(null);
        }