예제 #1
0
 private static void WriteTypeUsage(IBootstrapCodeBuilder builder, string name, Type type, bool isFullName)
 {
     if (AddTypeUsage(builder, name))
     {
         builder.Append("TypeCache",
                        $"{typeof(TypeCache<TType>).GetPrettyName()}.{nameof(Instance)}.{(isFullName ? nameof(AddFullName) : nameof(AddName))}(\"{name}\", typeof({type.GetPrettyName()}));");
     }
 }
예제 #2
0
 private static void WriteTypeUsage(IBootstrapCodeBuilder builder, string name, Type type, bool isFullName)
 {
     if (builder != null)
     {
         if (_usedTypes == null)
         {
             _usedTypes = new HashSet <string>(StringComparer.OrdinalIgnoreCase);
         }
         if (_usedTypes.Add(name))
         {
             builder.Append("TypeCache",
                            $"{typeof(TypeCache<TType>).GetPrettyName()}.{nameof(Instance)}.{(isFullName ? nameof(AddFullName) : nameof(AddName))}(\"{name}\", typeof({type.GetPrettyName()}));");
         }
     }
 }