/// <summary> /// Adds a local name to this name resolver.</summary> /// <param name="name"> /// Specifies the identifier.</param> /// <param name="resolveToType"> /// The type to which the specified identifier should resolve.</param> public void AddLocalName(string name, Type resolveToType) { if (_localNames.ContainsKey(name)) { throw new InvalidOperationException("The type “{0}” cannot be redeclared because it is already used to denote something else.".Fmt(name)); } _localNames[name] = new ResolveContextType(resolveToType); }
/// <summary> /// Adds a local name to this name resolver.</summary> /// <param name="name"> /// Specifies the identifier.</param> /// <param name="resolveToType"> /// The type to which the specified identifier should resolve.</param> public void AddLocalName(string name, Type resolveToType) { if (_localNames.ContainsKey(name)) throw new InvalidOperationException("The type “{0}” cannot be redeclared because it is already used to denote something else.".Fmt(name)); _localNames[name] = new ResolveContextType(resolveToType); }