FindConstants() public method

Finds the constant with the specified name.
public FindConstants ( String name ) : IConstants
name String /// The symbolic name to retrieve. ///
return IConstants
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }