示例#1
0
 /// <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);
 }
示例#2
0
 /// <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);
 }