System.Xml.Xsl.IlGen.GenerateHelper.DeclareLocal C# (CSharp) Method

DeclareLocal() public method

Generate a new local variable. Add a numeric suffix to name that ensures that all local variable names will be unique (for readability).
public DeclareLocal ( string name, Type type ) : LocalBuilder
name string
type Type
return LocalBuilder
        public LocalBuilder DeclareLocal(string name, Type type)
        {
            LocalBuilder locBldr = _ilgen.DeclareLocal(type);
#if DEBUG
            if (XmlILTrace.IsEnabled) {
                // Set name for internal MS debugging.  This is not the user-defined name--that will be set later
                if (this.isDebug)
                    locBldr.SetLocalSymInfo(name + this.numLocals.ToString(CultureInfo.InvariantCulture));

                this.symbols.Add(locBldr, name + this.numLocals.ToString(CultureInfo.InvariantCulture));
                this.numLocals++;
            }
#endif
            return locBldr;
        }