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()}));"); } }
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()}));"); } } }