コード例 #1
0
ファイル: NameResolver.cs プロジェクト: Timwi/ParseCs
 /// <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
ファイル: NameResolver.cs プロジェクト: Timwi/ParseCs
 /// <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);
 }