protected void CheckConstructors(params Type[] skipTypes) { var adapterTypes = _adapterTypes .Where(t => !ExcludedTypes.Contains(t) && !(ExcludeTypeCallback?.Invoke(t) ?? false)) .ToList(); foreach (var types in GetTypes().Where(t => t.Abstraction != null)) { if (types.Abstraction != null && types.Original != null && !IsStatic(types.Original) && !skipTypes.Contains(types.Original)) { var adapter = FindAdapters(adapterTypes, types.Abstraction).FirstOrDefault(); if (adapter != null && !skipTypes.Contains(adapter)) { var adapterConstructors = adapter.GetConstructors(); var wrapperConstructor = FindConstructor(adapterConstructors, types.Original); wrapperConstructor.Should().NotBeNull($"The adapter {adapter.Name} of abstraction {types.Abstraction.Name} must have a ctor({types.Original.Name})"); var originalConstructors = types.Original.GetConstructors(); foreach (var originalCtor in originalConstructors) { if (originalCtor.GetCustomAttribute <ObsoleteAttribute>() == null) { var orginalParams = originalCtor.GetParameters().Select(p => p.ParameterType).ToArray(); var adapterCtor = FindConstructor(adapterConstructors, orginalParams); adapterCtor.Should().NotBeNull($"The adapter {adapter.Name} of abstraction {types.Abstraction.Name} must have a ctor({String.Join(", ", orginalParams.Select(p => p.Name))})"); } } } } } }
public IntegrityTests() : base("Threading.Tasks") { ExcludedTypes.Add(typeof(AsyncTaskMethodBuilder)); ExcludedTypes.Add(typeof(AsyncVoidMethodBuilder)); ExcludedTypes.Add(typeof(ConfiguredTaskAwaitable)); ExcludedTypes.Add(typeof(ConfiguredTaskAwaitable <>)); ExcludedTypes.Add(typeof(TaskAwaiter)); ExcludedTypes.Add(typeof(TaskAwaiter <>)); ExcludedTypes.Add(typeof(YieldAwaitable)); ExcludedTypes.Add(typeof(CancellationToken)); ExcludedTypes.Add(typeof(CancellationTokenRegistration)); ExcludedTypes.Add(typeof(CancellationTokenSource)); ExcludedTypes.Add(typeof(ConcurrentExclusiveSchedulerPair)); ExcludedTypes.Add(typeof(TaskCompletionSource <>)); ExcludedTypes.Add(typeof(TaskScheduler)); ExcludedTypes.Add(typeof(UnobservedTaskExceptionEventArgs)); ExcludedTypes.Add(typeof(AsyncTaskMethodBuilder <>)); ExcludedTypes.Add(typeof(IAsyncTaskMethodBuilder <>)); ExcludedTypes.Add(typeof(IAsyncTaskMethodBuilder <,>)); CustomTypeMappings.Add(typeof(System.Threading.Tasks.TaskExtensions), typeof(TaskExtensions)); CustomTypeMappings.Add(typeof(Task), typeof(ITask), typeof(ITaskGlobals)); CustomTypeMappings.Add(typeof(Task <>), typeof(ITask <>), typeof(ITaskGlobals <>)); ExcludeMemberCallback = ExcludeMember; }
public IntegrityTests() : base("IO") { ExcludedTypes.Add(typeof(EndOfStreamException)); ExcludedTypes.Add(typeof(FileNotFoundException)); ExcludedTypes.Add(typeof(InvalidDataException)); ExcludedTypes.Add(typeof(IOException)); ExcludeMember <IndentedTextWriter>(nameof(IndentedTextWriter.DefaultTabString)); ExcludeMember <TextWriter>(nameof(TextWriter.Synchronized)); ExcludeMember <TextReader>(nameof(TextReader.Synchronized)); #if NET5_0 ExcludeMember <BinaryReader>("Read7BitEncodedInt"); ExcludeMember <BinaryReader>("Read7BitEncodedInt64"); ExcludeMember <BinaryWriter>("Write7BitEncodedInt"); ExcludeMember <BinaryWriter>("Write7BitEncodedInt64"); #endif ExcludeMember <Stream>(nameof(Stream.Synchronized)); ExcludeMember <Stream>(nameof(Stream.BeginRead)); ExcludeMember <Stream>(nameof(Stream.EndRead)); ExcludeMember <Stream>(nameof(Stream.BeginWrite)); ExcludeMember <Stream>(nameof(Stream.EndWrite)); ExcludeMember <BufferedStream>(nameof(BufferedStream.BeginRead)); ExcludeMember <BufferedStream>(nameof(BufferedStream.EndRead)); ExcludeMember <BufferedStream>(nameof(BufferedStream.BeginWrite)); ExcludeMember <BufferedStream>(nameof(BufferedStream.EndWrite)); ExcludeMemberCallback = Exclude; }
private IEnumerable <(Type Original, Type Abstraction)> GetTypes() { foreach (var originalType in _originalTypes) { if (CustomTypeMappings.TryGet(originalType, out var abstractionTypes)) { foreach (var abstractionType in abstractionTypes) { yield return(originalType, abstractionType); } } else { if (ExcludedTypes.Contains(originalType)) { continue; } if (ExcludeTypeCallback?.Invoke(originalType) == true) { continue; } var abstractionTypeName = BuildAbstractionTypeName(originalType); var abstractionType = _abstractionTypes.FirstOrDefault(t => t.FullName == abstractionTypeName); yield return(originalType, abstractionType); } } }
public IntegrityTests() : base("IO.Pipes") { ExcludedTypes.Add(typeof(PipeStreamImpersonationWorker)); ExcludedTypes.Add(typeof(SafePipeHandle)); ExcludeTypeCallback = type => type.FullName == "System.IO.Pipes.PipeAccessRule" || type.FullName == "System.IO.Pipes.PipeAuditRule" || type.FullName == "System.IO.Pipes.PipesAclExtensions" || type.FullName == "System.IO.Pipes.PipeSecurity" || type.FullName == "System.IO.Pipes.AnonymousPipeServerStreamAcl" || type.FullName == "System.IO.Pipes.NamedPipeServerStreamAcl"; ExcludeMembers <PipeStream>(nameof(PipeStream.BeginRead)); ExcludeMembers <PipeStream>(nameof(PipeStream.EndRead)); ExcludeMembers <PipeStream>(nameof(PipeStream.BeginWrite)); ExcludeMembers <PipeStream>(nameof(PipeStream.EndWrite)); ExcludeMembers <NamedPipeServerStream>(nameof(NamedPipeServerStream.BeginWaitForConnection)); ExcludeMembers <NamedPipeServerStream>(nameof(NamedPipeServerStream.EndWaitForConnection)); ExcludeMembers <NamedPipeServerStream>(nameof(NamedPipeServerStream.MaxAllowedServerInstances)); ExcludeMembers <Stream>(nameof(Stream.Synchronized)); ExcludeMembers <Stream>(nameof(Stream.Null)); }
public IntegrityTests() : base("Net.NetworkInformation") { ExcludedTypes.Add(typeof(IcmpV4Statistics)); // abstract class ExcludedTypes.Add(typeof(IcmpV6Statistics)); // abstract class ExcludedTypes.Add(typeof(IPGlobalProperties)); // abstract class ExcludedTypes.Add(typeof(IPGlobalStatistics)); // abstract class ExcludedTypes.Add(typeof(IPv4InterfaceStatistics)); // abstract class ExcludedTypes.Add(typeof(TcpConnectionInformation)); // abstract class ExcludedTypes.Add(typeof(TcpStatistics)); // abstract class ExcludedTypes.Add(typeof(UdpStatistics)); // abstract class ExcludedTypes.Add(typeof(NetworkInformationException)); CustomTypeMappings.Add(typeof(NetworkAddressChangedEventHandler), typeof(EventHandler)); CustomTypeMappings.Add(typeof(NetworkAvailabilityChangedEventHandler), typeof(EventHandler <INetworkAvailabilityEventArgs>)); CustomTypeMappings.Add(typeof(NetworkInterface), new List <Type> { typeof(INetworkInterface), typeof(INetworkInterfaceGlobals) }); CustomTypeMappings.Add(typeof(PhysicalAddress), new List <Type> { typeof(IPhysicalAddress), typeof(IPhysicalAddressGlobals) }); ExcludeMember <EventArgs>(nameof(EventArgs.Empty)); ExcludeMember <NetworkChange>("RegisterNetworkChange"); // deprecated ExcludeMemberCallback = ExcludeMember; }
public IntegrityTests() : base("Console") { CustomTypeMappings.Add(typeof(ConsoleCancelEventHandler), typeof(EventHandler <IConsoleCancelEventArgs>)); ExcludedTypes.Add(typeof(ConsoleKeyInfo)); // struct ExcludeMember <EventArgs>(nameof(EventArgs.Empty)); }
protected void CheckTypes() { var types = _originalTypes .Where(t => !ExcludedTypes.Contains(t) && !(ExcludeTypeCallback?.Invoke(t) ?? false)) .ToList(); var abstractions = _abstractionTypes .Where(t => !ExcludedTypes.Contains(t) && !(ExcludeTypeCallback?.Invoke(t) ?? false)) .ToList(); var missingAbstractions = new List <Type>(); foreach (var t in GetTypes()) { types.Remove(t.Original); if (t.Abstraction == null) { missingAbstractions.Add(t.Original); } else { abstractions.Remove(t.Abstraction); } } missingAbstractions.Should().BeEmpty($"abstraction for following {missingAbstractions.Count} type(s) not found: {String.Join(", ", missingAbstractions.Select(t => t.FullName))}"); types.Should().BeEmpty(); abstractions.Should().BeEmpty(); }
public IntegrityTests() : base("Net.Primitives") { ExcludedTypes.Add(typeof(CookieException)); ExcludedTypes.Add(typeof(SocketException)); ExcludedTypes.Add(typeof(HttpVersion)); ExcludedTypes.Add(Type.GetType("System.Net.PathList, System.Net.Primitives, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")); // exists in netcoreapp only CustomTypeMappings.Add(typeof(IPAddress), new List <Type> { typeof(IIPAddress), typeof(IIPAddressGlobals) }); CustomTypeMappings.Add(typeof(IPEndPoint), new List <Type> { typeof(IIPEndPoint), typeof(IIPEndPointGlobals) }); ExcludeMember <CookieContainer>(nameof(CookieContainer.DefaultCookieLimit)); ExcludeMember <CookieContainer>(nameof(CookieContainer.DefaultPerDomainCookieLimit)); ExcludeMember <CookieContainer>(nameof(CookieContainer.DefaultCookieLengthLimit)); ExcludeMember <CredentialCache>(nameof(CredentialCache.DefaultCredentials)); ExcludeMember <CredentialCache>(nameof(CredentialCache.DefaultNetworkCredentials)); ExcludeMember <IPEndPoint>(nameof(IPEndPoint.MinPort)); ExcludeMember <IPEndPoint>(nameof(IPEndPoint.MaxPort)); #pragma warning disable 618 ExcludeMember <IPAddress>(nameof(IPAddress.Address)); // deprecated #pragma warning restore 618 ExcludeMemberCallback = Exclude; }
/// <summary> /// 建造蓝图。 /// </summary> /// <param name="predicate">筛选器。</param> /// <param name="selector">选择器。</param> /// <returns>项集合。</returns> public IEnumerable <T> BuildBlueprint <T>(Func <Type, bool> predicate, Func <Type, Feature, T> selector) { return(Features.SelectMany( feature => feature.ExportedTypes .Where(predicate) .Where(type => !ExcludedTypes.Contains(type.FullName)) .Select(type => selector(type, feature))) .ToArray()); }
/// <summary> /// A list of <see cref="Type" />s to ignore in the assembly scanning. /// </summary> public void ExcludeTypes(params Type[] types) { Guard.AgainstNull(nameof(types), types); if (types.Any(x => x == null)) { throw new ArgumentException("Passed in a null or empty type.", nameof(types)); } ExcludedTypes.AddRange(types); }
private bool IsIncluded(SpacialElement e) { if (ExcludedTypes == null) { return(true); } else { return(ExcludedTypes.Contains(e.GetType()) == false); } }
public IntegrityTests() : base("Runtime.Extensions") { ExcludedTypes.Add(typeof(AssemblyLoadEventArgs)); ExcludedTypes.Add(typeof(AssemblyLoadEventHandler)); ExcludedTypes.Add(typeof(MathF)); ExcludedTypes.Add(typeof(Progress <>)); ExcludedTypes.Add(typeof(ResolveEventHandler)); ExcludedTypes.Add(typeof(StringComparer)); ExcludedTypes.Add(typeof(AppDomain)); ExcludedTypes.Add(typeof(ApplicationId)); ExcludedTypes.Add(typeof(ContextBoundObject)); ExcludedTypes.Add(typeof(ContextStaticAttribute)); ExcludedTypes.Add(typeof(LoaderOptimizationAttribute)); ExcludedTypes.Add(typeof(OperatingSystem)); ExcludedTypes.Add(typeof(StringNormalizationExtensions)); ExcludedTypes.Add(typeof(SecurityElement)); ExcludedTypes.Add(typeof(CodeAccessSecurityAttribute)); ExcludedTypes.Add(typeof(SecurityAttribute)); ExcludedTypes.Add(typeof(SecurityPermissionAttribute)); ExcludedTypes.Add(typeof(ArrayList)); ExcludedTypes.Add(typeof(Comparer)); ExcludedTypes.Add(typeof(Hashtable)); ExcludedTypes.Add(typeof(FrameworkName)); ExcludedTypes.Add(typeof(ComponentGuaranteesAttribute)); ExcludedTypes.Add(typeof(ResourceConsumptionAttribute)); ExcludedTypes.Add(typeof(ResourceExposureAttribute)); ExcludedTypes.Add(typeof(VersioningHelper)); ExcludedTypes.Add(typeof(AssemblyNameProxy)); ExcludedTypes.Add(typeof(GlobalizationExtensions)); ExcludedTypes.Add(typeof(BinaryReader)); // IO ExcludedTypes.Add(typeof(BinaryWriter)); // IO ExcludedTypes.Add(typeof(MemoryStream)); // IO ExcludedTypes.Add(typeof(BufferedStream)); // IO ExcludedTypes.Add(typeof(IndentedTextWriter)); // IO ExcludedTypes.Add(typeof(StreamReader)); // IO ExcludedTypes.Add(typeof(StreamWriter)); // IO ExcludedTypes.Add(typeof(StringReader)); // IO ExcludedTypes.Add(typeof(StringWriter)); // IO ExcludedTypes.Add(typeof(TextReader)); // IO ExcludedTypes.Add(typeof(TextWriter)); // IO CustomTypeMappings.Add(typeof(Stopwatch), new List <Type> { typeof(IStopwatch), typeof(IStopwatchGlobals) }); #pragma warning disable 618 ExcludeMembers(typeof(Path), nameof(Path.InvalidPathChars)); // deprecated #pragma warning restore 618 ExcludeMemberCallback = ExcludeMember; }
public IntegrityTests() : base("IO.FileSystem.Watcher") { ExcludedTypes.Add(typeof(ErrorEventArgs)); ExcludedTypes.Add(typeof(ErrorEventHandler)); ExcludedTypes.Add(typeof(FileSystemEventArgs)); ExcludedTypes.Add(typeof(FileSystemEventHandler)); ExcludedTypes.Add(typeof(InternalBufferOverflowException)); ExcludedTypes.Add(typeof(RenamedEventArgs)); ExcludedTypes.Add(typeof(RenamedEventHandler)); ExcludedTypes.Add(typeof(WaitForChangedResult)); }
public void ExcludedTypesByDefault() { object[] expected = { typeof(Step), typeof(SubProcess) }; _excludedTypes = () => base.ExcludedTypes; ExcludedTypes.Should().BeEquivalentTo(expected); }
protected void CheckAdapters() { var abstractions = _abstractionTypes .Where(t => !ExcludedTypes.Contains(t) && !(ExcludeTypeCallback?.Invoke(t) ?? false)) .ToList(); var adapterTypes = _adapterTypes .Where(t => !ExcludedTypes.Contains(t) && !(ExcludeTypeCallback?.Invoke(t) ?? false)) .ToList(); foreach (var abstractionType in abstractions) { var adapters = FindAdapters(adapterTypes, abstractionType); adapters.Should().HaveCount(1, $"abstraction {abstractionType.Name} must have an adapter."); } }
public IntegrityTests() : base("Text.Encoding") { ExcludedTypes.Add(typeof(DecoderFallback)); ExcludedTypes.Add(typeof(DecoderFallbackBuffer)); ExcludedTypes.Add(typeof(DecoderReplacementFallback)); ExcludedTypes.Add(typeof(DecoderExceptionFallback)); ExcludedTypes.Add(typeof(EncoderFallback)); ExcludedTypes.Add(typeof(EncoderFallbackBuffer)); ExcludedTypes.Add(typeof(EncoderReplacementFallback)); ExcludedTypes.Add(typeof(EncoderExceptionFallback)); ExcludedTypes.Add(typeof(EncodingProvider)); CustomTypeMappings.Add(typeof(Encoding), new List <Type> { typeof(IEncoding), typeof(IEncodingGlobals) }); ExcludeMemberCallback = ExcludeMember; }
public IntegrityTests() : base("IO.FileSystem") { ExcludedTypes.Add(typeof(EnumerationOptions)); ExcludedTypes.Add(typeof(FileSystemEntry)); // struct ExcludedTypes.Add(typeof(FileSystemEnumerable <>)); // IEnumerable ExcludedTypes.Add(typeof(FileSystemEnumerator <>)); // Enumerator ExcludeMembers(typeof(FileStream), nameof(FileStream.BeginRead)); ExcludeMembers(typeof(FileStream), nameof(FileStream.EndRead)); ExcludeMembers(typeof(FileStream), nameof(FileStream.BeginWrite)); ExcludeMembers(typeof(FileStream), nameof(FileStream.EndWrite)); ExcludeMembers(typeof(Stream), nameof(Stream.Synchronized)); ExcludeMembers(typeof(Stream), nameof(Stream.Null)); #pragma warning disable 618 ExcludeMembers(typeof(FileStream), nameof(FileStream.Handle)); // deprecated #pragma warning restore 618 }
private List <ITypescriptObject> CollectTypes() { var types = new Dictionary <Type, ITypescriptObject>(); var typeQueue = new Queue <Type>(IncludedTypes.Distinct().Except(ExcludedTypes)); var classConverter = CreateTypescriptClassToInterfaceConverter(); var enumConverter = new TypescriptEnumConverter(EnumSettings, NamespaceSettings); while (typeQueue.Count > 0) { var type = typeQueue.Dequeue(); if (type.IsEnum) { var typescriptEnum = enumConverter.Convert(type); types.Add(type, typescriptEnum); } else { var typescriptInterface = classConverter.Convert(type); types.Add(type, typescriptInterface); foreach (var dependency in typescriptInterface.DirectDependencies) { if (types.ContainsKey(dependency)) { continue; } if (typeQueue.Contains(dependency)) { continue; } if (ExcludedTypes.Contains(dependency)) { continue; } typeQueue.Enqueue(dependency); } } } return(types.Values.ToList()); }
public override void Init(XElement xmlTask) { base.Init(xmlTask); PathFrom = xmlTask.Attribute("PathFrom").Value; PathTo = xmlTask.Attribute("PathTo").Value; if (!String.IsNullOrWhiteSpace(xmlTask.Attribute("IncludedTypes").Value.Trim())) { IncludedTypes.AddRange(xmlTask.Attribute("IncludedTypes").Value.Trim().Replace(",", "").Split(',')); } if (!String.IsNullOrWhiteSpace(xmlTask.Attribute("ExcludedTypes").Value.Trim())) { ExcludedTypes.AddRange(xmlTask.Attribute("ExcludedTypes").Value.Trim().Replace(",", "").Split(',')); } IncludedRegex = xmlTask.Attribute("IncludedRegex").Value; ExcludedRegex = xmlTask.Attribute("ExcludedRegex").Value; if (!String.IsNullOrWhiteSpace(xmlTask.Attribute("ReplaceIfExists").Value)) { ReplaceIfExists = bool.Parse(xmlTask.Attribute("ReplaceIfExists").Value); } if (!String.IsNullOrWhiteSpace(xmlTask.Attribute("Recursive").Value)) { Recursive = bool.Parse(xmlTask.Attribute("Recursive").Value); } }
public IManagerOptions Exclude(Type type) { ExcludedTypes.Add(type); return(this); }
public IntegrityTests() : base("Runtime") { ExcludedTypes.Add(typeof(GCHandle)); ExcludedTypes.Add(typeof(CriticalHandleMinusOneIsInvalid)); ExcludedTypes.Add(typeof(CriticalHandleZeroOrMinusOneIsInvalid)); ExcludedTypes.Add(typeof(SafeHandleMinusOneIsInvalid)); ExcludedTypes.Add(typeof(SafeHandleZeroOrMinusOneIsInvalid)); ExcludedTypes.Add(typeof(object)); ExcludedTypes.Add(typeof(string)); ExcludedTypes.Add(typeof(Enum)); ExcludedTypes.Add(typeof(Array)); ExcludedTypes.Add(typeof(Nullable)); ExcludedTypes.Add(typeof(Lazy <>)); ExcludedTypes.Add(typeof(Lazy <,>)); ExcludedTypes.Add(typeof(Pointer)); #pragma warning disable 618 ExcludedTypes.Add(typeof(TimeZone)); // deprecated #pragma warning restore 618 ExcludedTypes.Add(typeof(Activator)); ExcludedTypes.Add(typeof(AppContext)); ExcludedTypes.Add(typeof(ArraySegment <>)); ExcludedTypes.Add(typeof(AsyncCallback)); ExcludedTypes.Add(typeof(Buffer)); ExcludedTypes.Add(typeof(CharEnumerator)); ExcludedTypes.Add(typeof(KeyValuePair)); ExcludedTypes.Add(typeof(Collection <>)); ExcludedTypes.Add(typeof(ReadOnlyCollection <>)); ExcludedTypes.Add(typeof(DBNull)); ExcludedTypes.Add(typeof(FormattableString)); ExcludedTypes.Add(typeof(FileStyleUriParser)); ExcludedTypes.Add(typeof(FtpStyleUriParser)); ExcludedTypes.Add(typeof(GenericUriParser)); ExcludedTypes.Add(typeof(GC)); ExcludedTypes.Add(typeof(CharUnicodeInfo)); ExcludedTypes.Add(typeof(CompareInfo)); ExcludedTypes.Add(typeof(CultureInfo)); ExcludedTypes.Add(typeof(DateTimeFormatInfo)); ExcludedTypes.Add(typeof(DaylightTime)); ExcludedTypes.Add(typeof(IdnMapping)); ExcludedTypes.Add(typeof(NumberFormatInfo)); ExcludedTypes.Add(typeof(RegionInfo)); ExcludedTypes.Add(typeof(SortKey)); ExcludedTypes.Add(typeof(SortVersion)); ExcludedTypes.Add(typeof(NumberFormatInfo)); ExcludedTypes.Add(typeof(NumberFormatInfo)); ExcludedTypes.Add(typeof(StringInfo)); ExcludedTypes.Add(typeof(TextElementEnumerator)); ExcludedTypes.Add(typeof(TextInfo)); ExcludedTypes.Add(typeof(GopherStyleUriParser)); ExcludedTypes.Add(typeof(HttpStyleUriParser)); ExcludedTypes.Add(typeof(LdapStyleUriParser)); ExcludedTypes.Add(typeof(MarshalByRefObject)); ExcludedTypes.Add(typeof(NetPipeStyleUriParser)); ExcludedTypes.Add(typeof(NetTcpStyleUriParser)); ExcludedTypes.Add(typeof(NewsStyleUriParser)); ExcludedTypes.Add(typeof(Assembly)); ExcludedTypes.Add(typeof(AssemblyName)); ExcludedTypes.Add(typeof(Binder)); ExcludedTypes.Add(typeof(ConstructorInfo)); ExcludedTypes.Add(typeof(CustomAttributeData)); ExcludedTypes.Add(typeof(CustomAttributeExtensions)); ExcludedTypes.Add(typeof(EventInfo)); ExcludedTypes.Add(typeof(ExceptionHandlingClause)); ExcludedTypes.Add(typeof(FieldInfo)); ExcludedTypes.Add(typeof(IntrospectionExtensions)); ExcludedTypes.Add(typeof(LocalVariableInfo)); ExcludedTypes.Add(typeof(ManifestResourceInfo)); ExcludedTypes.Add(typeof(MemberInfo)); ExcludedTypes.Add(typeof(MethodBase)); ExcludedTypes.Add(typeof(MethodBody)); ExcludedTypes.Add(typeof(MethodInfo)); ExcludedTypes.Add(typeof(Missing)); ExcludedTypes.Add(typeof(Module)); ExcludedTypes.Add(typeof(ParameterInfo)); ExcludedTypes.Add(typeof(PropertyInfo)); ExcludedTypes.Add(typeof(ReflectionContext)); ExcludedTypes.Add(typeof(StrongNameKeyPair)); ExcludedTypes.Add(typeof(TypeDelegator)); ExcludedTypes.Add(typeof(TypeInfo)); ExcludedTypes.Add(typeof(ResolveEventArgs)); ExcludedTypes.Add(typeof(ConditionalWeakTable <,>)); ExcludedTypes.Add(typeof(FormattableStringFactory)); ExcludedTypes.Add(typeof(IsConst)); ExcludedTypes.Add(typeof(IsVolatile)); ExcludedTypes.Add(typeof(RuntimeFeature)); ExcludedTypes.Add(typeof(RuntimeHelpers)); ExcludedTypes.Add(typeof(StrongBox <>)); ExcludedTypes.Add(typeof(CriticalFinalizerObject)); ExcludedTypes.Add(typeof(ExceptionDispatchInfo)); ExcludedTypes.Add(typeof(FirstChanceExceptionEventArgs)); ExcludedTypes.Add(typeof(GCSettings)); ExcludedTypes.Add(typeof(CriticalHandle)); ExcludedTypes.Add(typeof(MemoryFailPoint)); ExcludedTypes.Add(typeof(SafeSerializationEventArgs)); ExcludedTypes.Add(typeof(SerializationInfo)); ExcludedTypes.Add(typeof(SerializationInfoEnumerator)); ExcludedTypes.Add(typeof(Decoder)); ExcludedTypes.Add(typeof(DecoderExceptionFallback)); ExcludedTypes.Add(typeof(DecoderExceptionFallbackBuffer)); ExcludedTypes.Add(typeof(DecoderFallback)); ExcludedTypes.Add(typeof(DecoderFallbackBuffer)); ExcludedTypes.Add(typeof(DecoderReplacementFallback)); ExcludedTypes.Add(typeof(DecoderReplacementFallbackBuffer)); ExcludedTypes.Add(typeof(EncoderExceptionFallback)); ExcludedTypes.Add(typeof(EncoderExceptionFallbackBuffer)); ExcludedTypes.Add(typeof(EncoderFallback)); ExcludedTypes.Add(typeof(EncoderFallbackBuffer)); ExcludedTypes.Add(typeof(EncoderReplacementFallback)); ExcludedTypes.Add(typeof(EncoderReplacementFallbackBuffer)); ExcludedTypes.Add(typeof(EncodingInfo)); ExcludedTypes.Add(typeof(EncodingProvider)); ExcludedTypes.Add(typeof(TaskScheduler)); ExcludedTypes.Add(typeof(UnobservedTaskExceptionEventArgs)); ExcludedTypes.Add(typeof(Timeout)); ExcludedTypes.Add(typeof(WaitHandle)); ExcludedTypes.Add(typeof(TimeZoneInfo)); ExcludedTypes.Add(typeof(Type)); ExcludedTypes.Add(typeof(UnhandledExceptionEventArgs)); ExcludedTypes.Add(typeof(Uri)); ExcludedTypes.Add(typeof(UriParser)); ExcludedTypes.Add(typeof(ValueType)); ExcludedTypes.Add(typeof(Version)); ExcludedTypes.Add(typeof(WeakReference)); ExcludedTypes.Add(typeof(WeakReference <>)); ExcludedTypes.Add(typeof(WaitHandleExtensions)); ExcludedTypes.Add(typeof(RuntimeReflectionExtensions)); ExcludedTypes.Add(typeof(Calendar)); ExcludedTypes.Add(typeof(ChineseLunisolarCalendar)); ExcludedTypes.Add(typeof(EastAsianLunisolarCalendar)); ExcludedTypes.Add(typeof(GregorianCalendar)); ExcludedTypes.Add(typeof(HebrewCalendar)); ExcludedTypes.Add(typeof(HijriCalendar)); ExcludedTypes.Add(typeof(JapaneseCalendar)); ExcludedTypes.Add(typeof(JapaneseLunisolarCalendar)); ExcludedTypes.Add(typeof(JulianCalendar)); ExcludedTypes.Add(typeof(KoreanCalendar)); ExcludedTypes.Add(typeof(KoreanLunisolarCalendar)); ExcludedTypes.Add(typeof(PersianCalendar)); ExcludedTypes.Add(typeof(TaiwanCalendar)); ExcludedTypes.Add(typeof(TaiwanLunisolarCalendar)); ExcludedTypes.Add(typeof(ThaiBuddhistCalendar)); ExcludedTypes.Add(typeof(UmAlQuraCalendar)); ExcludedTypes.Add(typeof(Task)); // Threading.Tasks ExcludedTypes.Add(typeof(Task <>)); // Threading.Tasks ExcludedTypes.Add(typeof(TaskFactory)); // Threading.Tasks ExcludedTypes.Add(typeof(TaskFactory <>)); // Threading.Tasks ExcludedTypes.Add(typeof(FileStream)); // IO.FileSystem ExcludedTypes.Add(typeof(Stream)); // IO ExcludedTypes.Add(typeof(SafeFileHandle)); // IO.FileSystem ExcludedTypes.Add(typeof(SafeWaitHandle)); // Runtime.Handles ExcludedTypes.Add(typeof(SafeHandle)); ExcludedTypes.Add(typeof(Encoding)); // Text.Encoding ExcludedTypes.Add(typeof(Encoder)); // Text.Encoding ExcludedTypes.Add(typeof(MemoryManager <>)); CustomTypeMappings.Add(typeof(DateTime), typeof(IDateTimeGlobals)); CustomTypeMappings.Add(typeof(Guid), typeof(IGuidGlobals)); ExcludeMember <EventArgs>(nameof(EventArgs.Empty)); ExcludeTypeCallback = ExcludeType; ExcludeMemberCallback = ExcludeMember; }
private static bool StatementIsBlock(StatementSyntax st) => ExcludedTypes.Any(bType => bType.IsInstanceOfType(st));
private bool IsTypeOrNameNotExcluded(Type memberType, string memberTypeName) { return(!ExcludedTypes.Contains(memberType) && !ExcludedFieldNames.Contains(memberTypeName)); }
public IntegrityTests() : base("Net.Sockets") { ExcludedTypes.Add(typeof(SocketReceiveFromResult)); ExcludedTypes.Add(typeof(SocketReceiveMessageFromResult)); ExcludedTypes.Add(typeof(SocketInformation)); ExcludedTypes.Add(typeof(IPPacketInformation)); ExcludedTypes.Add(typeof(UdpReceiveResult)); ExcludedTypes.Add(typeof(MulticastOption)); ExcludedTypes.Add(typeof(IPv6MulticastOption)); ExcludedTypes.Add(typeof(SafeSocketHandle)); CustomTypeMappings.Add(typeof(SocketTaskExtensions), typeof(SocketExtensions)); CustomTypeMappings.Add(typeof(Socket), new List <Type> { typeof(ISocket), typeof(ISocketGlobals) }); ExcludeMember <NetworkStream>(nameof(NetworkStream.BeginRead)); ExcludeMember <NetworkStream>(nameof(NetworkStream.EndRead)); ExcludeMember <NetworkStream>(nameof(NetworkStream.BeginWrite)); ExcludeMember <NetworkStream>(nameof(NetworkStream.EndWrite)); ExcludeMembers <Socket>(nameof(Socket.BeginReceive)); ExcludeMembers <Socket>(nameof(Socket.EndReceive)); ExcludeMembers <Socket>(nameof(Socket.BeginAccept)); ExcludeMembers <Socket>(nameof(Socket.EndAccept)); ExcludeMembers <Socket>(nameof(Socket.BeginConnect)); ExcludeMembers <Socket>(nameof(Socket.EndConnect)); ExcludeMember <Socket>(nameof(Socket.BeginReceiveMessageFrom)); ExcludeMember <Socket>(nameof(Socket.EndReceiveMessageFrom)); ExcludeMember <Socket>(nameof(Socket.BeginDisconnect)); ExcludeMember <Socket>(nameof(Socket.EndDisconnect)); ExcludeMember <Socket>(nameof(Socket.BeginReceiveFrom)); ExcludeMember <Socket>(nameof(Socket.EndReceiveFrom)); ExcludeMembers <Socket>(nameof(Socket.BeginSend)); ExcludeMembers <Socket>(nameof(Socket.EndSend)); ExcludeMember <Socket>(nameof(Socket.BeginSendTo)); ExcludeMember <Socket>(nameof(Socket.EndSendTo)); ExcludeMembers <Socket>(nameof(Socket.BeginSendFile)); ExcludeMembers <Socket>(nameof(Socket.EndSendFile)); ExcludeMembers <TcpClient>(nameof(TcpClient.BeginConnect)); ExcludeMembers <TcpClient>(nameof(TcpClient.EndConnect)); ExcludeMembers <TcpListener>(nameof(TcpListener.BeginAcceptSocket)); ExcludeMembers <TcpListener>(nameof(TcpListener.EndAcceptSocket)); ExcludeMembers <TcpListener>(nameof(TcpListener.BeginAcceptTcpClient)); ExcludeMembers <TcpListener>(nameof(TcpListener.EndAcceptTcpClient)); ExcludeMembers <UdpClient>(nameof(UdpClient.BeginSend)); ExcludeMembers <UdpClient>(nameof(UdpClient.EndSend)); ExcludeMembers <UdpClient>(nameof(UdpClient.BeginReceive)); ExcludeMembers <UdpClient>(nameof(UdpClient.EndReceive)); #pragma warning disable 618 ExcludeMembers <Socket>(nameof(Socket.SupportsIPv4)); // deprecated ExcludeMembers <Socket>(nameof(Socket.SupportsIPv6)); // deprecated #pragma warning restore 618 ExcludeMember <Stream>(nameof(Stream.Synchronized)); ExcludeMember <Stream>(nameof(Stream.Null)); ExcludeMember <EventArgs>(nameof(EventArgs.Empty)); ExcludeMemberCallback = Exclude; }
public IntegrityTests() : base("Runtime.Handles") { ExcludedTypes.Add(typeof(CriticalHandle)); ExcludedTypes.Add(typeof(WaitHandleExtensions)); }
public IntegrityTests() : base("Runtime") { ExcludedTypes.Add(typeof(GCHandle)); ExcludedTypes.Add(typeof(CriticalHandleMinusOneIsInvalid)); ExcludedTypes.Add(typeof(CriticalHandleZeroOrMinusOneIsInvalid)); ExcludedTypes.Add(typeof(SafeHandleMinusOneIsInvalid)); ExcludedTypes.Add(typeof(SafeHandleZeroOrMinusOneIsInvalid)); ExcludedTypes.Add(typeof(object)); ExcludedTypes.Add(typeof(string)); ExcludedTypes.Add(typeof(Enum)); ExcludedTypes.Add(typeof(Array)); ExcludedTypes.Add(typeof(Nullable)); ExcludedTypes.Add(typeof(Lazy <>)); ExcludedTypes.Add(typeof(Lazy <,>)); ExcludedTypes.Add(typeof(Pointer)); #pragma warning disable 618, SYSLIB0003 ExcludedTypes.Add(typeof(TimeZone)); // deprecated ExcludedTypes.Add(typeof(System.Security.PermissionSet)); // obsolete #pragma warning restore 618, SYSLIB0003 ExcludedTypes.Add(typeof(Activator)); ExcludedTypes.Add(typeof(AppContext)); ExcludedTypes.Add(typeof(ArraySegment <>)); ExcludedTypes.Add(typeof(AsyncCallback)); ExcludedTypes.Add(typeof(Buffer)); ExcludedTypes.Add(typeof(CharEnumerator)); ExcludedTypes.Add(typeof(KeyValuePair)); ExcludedTypes.Add(typeof(Collection <>)); ExcludedTypes.Add(typeof(ReadOnlyCollection <>)); ExcludedTypes.Add(typeof(DBNull)); ExcludedTypes.Add(typeof(FormattableString)); ExcludedTypes.Add(typeof(FileStyleUriParser)); ExcludedTypes.Add(typeof(FtpStyleUriParser)); ExcludedTypes.Add(typeof(GenericUriParser)); ExcludedTypes.Add(typeof(GC)); ExcludedTypes.Add(typeof(CharUnicodeInfo)); ExcludedTypes.Add(typeof(CompareInfo)); ExcludedTypes.Add(typeof(CultureInfo)); ExcludedTypes.Add(typeof(DateTimeFormatInfo)); ExcludedTypes.Add(typeof(DaylightTime)); ExcludedTypes.Add(typeof(IdnMapping)); ExcludedTypes.Add(typeof(NumberFormatInfo)); ExcludedTypes.Add(typeof(RegionInfo)); ExcludedTypes.Add(typeof(SortKey)); ExcludedTypes.Add(typeof(SortVersion)); ExcludedTypes.Add(typeof(NumberFormatInfo)); ExcludedTypes.Add(typeof(NumberFormatInfo)); ExcludedTypes.Add(typeof(StringInfo)); ExcludedTypes.Add(typeof(TextElementEnumerator)); ExcludedTypes.Add(typeof(TextInfo)); ExcludedTypes.Add(typeof(GopherStyleUriParser)); ExcludedTypes.Add(typeof(HttpStyleUriParser)); ExcludedTypes.Add(typeof(LdapStyleUriParser)); ExcludedTypes.Add(typeof(MarshalByRefObject)); ExcludedTypes.Add(typeof(NetPipeStyleUriParser)); ExcludedTypes.Add(typeof(NetTcpStyleUriParser)); ExcludedTypes.Add(typeof(NewsStyleUriParser)); ExcludedTypes.Add(typeof(Assembly)); ExcludedTypes.Add(typeof(AssemblyName)); ExcludedTypes.Add(typeof(Binder)); ExcludedTypes.Add(typeof(ConstructorInfo)); ExcludedTypes.Add(typeof(CustomAttributeData)); ExcludedTypes.Add(typeof(CustomAttributeExtensions)); ExcludedTypes.Add(typeof(EventInfo)); ExcludedTypes.Add(typeof(ExceptionHandlingClause)); ExcludedTypes.Add(typeof(FieldInfo)); ExcludedTypes.Add(typeof(IntrospectionExtensions)); ExcludedTypes.Add(typeof(LocalVariableInfo)); ExcludedTypes.Add(typeof(ManifestResourceInfo)); ExcludedTypes.Add(typeof(MemberInfo)); ExcludedTypes.Add(typeof(MethodBase)); ExcludedTypes.Add(typeof(MethodBody)); ExcludedTypes.Add(typeof(MethodInfo)); ExcludedTypes.Add(typeof(Missing)); ExcludedTypes.Add(typeof(Module)); ExcludedTypes.Add(typeof(ParameterInfo)); ExcludedTypes.Add(typeof(PropertyInfo)); ExcludedTypes.Add(typeof(ReflectionContext)); ExcludedTypes.Add(typeof(StrongNameKeyPair)); ExcludedTypes.Add(typeof(TypeDelegator)); ExcludedTypes.Add(typeof(TypeInfo)); ExcludedTypes.Add(typeof(ResolveEventArgs)); ExcludedTypes.Add(typeof(ConditionalWeakTable <,>)); ExcludedTypes.Add(typeof(FormattableStringFactory)); ExcludedTypes.Add(typeof(IsConst)); ExcludedTypes.Add(typeof(IsVolatile)); ExcludedTypes.Add(typeof(RuntimeFeature)); ExcludedTypes.Add(typeof(RuntimeHelpers)); ExcludedTypes.Add(typeof(StrongBox <>)); ExcludedTypes.Add(typeof(CriticalFinalizerObject)); ExcludedTypes.Add(typeof(ExceptionDispatchInfo)); ExcludedTypes.Add(typeof(FirstChanceExceptionEventArgs)); ExcludedTypes.Add(typeof(GCSettings)); ExcludedTypes.Add(typeof(CriticalHandle)); ExcludedTypes.Add(typeof(MemoryFailPoint)); ExcludedTypes.Add(typeof(SafeSerializationEventArgs)); ExcludedTypes.Add(typeof(SerializationInfo)); ExcludedTypes.Add(typeof(SerializationInfoEnumerator)); ExcludedTypes.Add(typeof(Decoder)); ExcludedTypes.Add(typeof(DecoderExceptionFallback)); ExcludedTypes.Add(typeof(DecoderExceptionFallbackBuffer)); ExcludedTypes.Add(typeof(DecoderFallback)); ExcludedTypes.Add(typeof(DecoderFallbackBuffer)); ExcludedTypes.Add(typeof(DecoderReplacementFallback)); ExcludedTypes.Add(typeof(DecoderReplacementFallbackBuffer)); ExcludedTypes.Add(typeof(EncoderExceptionFallback)); ExcludedTypes.Add(typeof(EncoderExceptionFallbackBuffer)); ExcludedTypes.Add(typeof(EncoderFallback)); ExcludedTypes.Add(typeof(EncoderFallbackBuffer)); ExcludedTypes.Add(typeof(EncoderReplacementFallback)); ExcludedTypes.Add(typeof(EncoderReplacementFallbackBuffer)); ExcludedTypes.Add(typeof(EncodingInfo)); ExcludedTypes.Add(typeof(EncodingProvider)); ExcludedTypes.Add(typeof(TaskScheduler)); ExcludedTypes.Add(typeof(UnobservedTaskExceptionEventArgs)); ExcludedTypes.Add(typeof(Timeout)); ExcludedTypes.Add(typeof(WaitHandle)); ExcludedTypes.Add(typeof(TimeZoneInfo)); ExcludedTypes.Add(typeof(Type)); ExcludedTypes.Add(typeof(UnhandledExceptionEventArgs)); ExcludedTypes.Add(typeof(Uri)); ExcludedTypes.Add(typeof(UriParser)); ExcludedTypes.Add(typeof(ValueType)); ExcludedTypes.Add(typeof(Version)); ExcludedTypes.Add(typeof(WeakReference)); ExcludedTypes.Add(typeof(WeakReference <>)); ExcludedTypes.Add(typeof(WaitHandleExtensions)); ExcludedTypes.Add(typeof(RuntimeReflectionExtensions)); ExcludedTypes.Add(typeof(Calendar)); ExcludedTypes.Add(typeof(ChineseLunisolarCalendar)); ExcludedTypes.Add(typeof(EastAsianLunisolarCalendar)); ExcludedTypes.Add(typeof(GregorianCalendar)); ExcludedTypes.Add(typeof(HebrewCalendar)); ExcludedTypes.Add(typeof(HijriCalendar)); ExcludedTypes.Add(typeof(JapaneseCalendar)); ExcludedTypes.Add(typeof(JapaneseLunisolarCalendar)); ExcludedTypes.Add(typeof(JulianCalendar)); ExcludedTypes.Add(typeof(KoreanCalendar)); ExcludedTypes.Add(typeof(KoreanLunisolarCalendar)); ExcludedTypes.Add(typeof(PersianCalendar)); ExcludedTypes.Add(typeof(TaiwanCalendar)); ExcludedTypes.Add(typeof(TaiwanLunisolarCalendar)); ExcludedTypes.Add(typeof(ThaiBuddhistCalendar)); ExcludedTypes.Add(typeof(UmAlQuraCalendar)); ExcludedTypes.Add(typeof(Task)); // Threading.Tasks ExcludedTypes.Add(typeof(Task <>)); // Threading.Tasks ExcludedTypes.Add(typeof(TaskFactory)); // Threading.Tasks ExcludedTypes.Add(typeof(TaskFactory <>)); // Threading.Tasks ExcludedTypes.Add(typeof(FileStream)); // IO.FileSystem ExcludedTypes.Add(typeof(Stream)); // IO ExcludedTypes.Add(typeof(SafeFileHandle)); // IO.FileSystem ExcludedTypes.Add(typeof(SafeWaitHandle)); // Runtime.Handles ExcludedTypes.Add(typeof(SafeHandle)); ExcludedTypes.Add(typeof(Encoding)); // Text.Encoding ExcludedTypes.Add(typeof(Encoder)); // Text.Encoding ExcludedTypes.Add(typeof(MemoryManager <>)); ExcludedTypes.Add(typeof(AssemblyLoadEventArgs)); ExcludedTypes.Add(typeof(BitConverter)); ExcludedTypes.Add(typeof(ArrayPool <>)); ExcludedTypes.Add(typeof(System.CodeDom.Compiler.IndentedTextWriter)); ExcludedTypes.Add(typeof(System.Collections.ArrayList)); ExcludedTypes.Add(typeof(System.Collections.Comparer)); ExcludedTypes.Add(typeof(System.Collections.Hashtable)); ExcludedTypes.Add(typeof(ContextBoundObject)); ExcludedTypes.Add(typeof(Convert)); ExcludedTypes.Add(typeof(System.Diagnostics.Debug)); ExcludedTypes.Add(typeof(System.Diagnostics.Debugger)); ExcludedTypes.Add(typeof(System.Diagnostics.Stopwatch)); ExcludedTypes.Add(typeof(Environment)); ExcludedTypes.Add(typeof(GlobalizationExtensions)); ExcludedTypes.Add(typeof(ISOWeek)); ExcludedTypes.Add(typeof(BinaryReader)); ExcludedTypes.Add(typeof(BinaryWriter)); ExcludedTypes.Add(typeof(BufferedStream)); ExcludedTypes.Add(typeof(MemoryStream)); ExcludedTypes.Add(typeof(Path)); ExcludedTypes.Add(typeof(StreamReader)); ExcludedTypes.Add(typeof(StreamWriter)); ExcludedTypes.Add(typeof(StringReader)); ExcludedTypes.Add(typeof(StringWriter)); ExcludedTypes.Add(typeof(TextReader)); ExcludedTypes.Add(typeof(TextWriter)); ExcludedTypes.Add(typeof(UnmanagedMemoryStream)); ExcludedTypes.Add(typeof(Math)); ExcludedTypes.Add(typeof(MathF)); ExcludedTypes.Add(typeof(System.Net.WebUtility)); ExcludedTypes.Add(typeof(System.Numerics.BitOperations)); ExcludedTypes.Add(typeof(OperatingSystem)); ExcludedTypes.Add(typeof(Progress <>)); ExcludedTypes.Add(typeof(Random)); ExcludedTypes.Add(typeof(AssemblyNameProxy)); ExcludedTypes.Add(typeof(System.Resources.ResourceManager)); ExcludedTypes.Add(typeof(System.Resources.ResourceReader)); ExcludedTypes.Add(typeof(System.Resources.ResourceSet)); ExcludedTypes.Add(typeof(CallConvCdecl)); ExcludedTypes.Add(typeof(CallConvFastcall)); ExcludedTypes.Add(typeof(CallConvStdcall)); ExcludedTypes.Add(typeof(CallConvThiscall)); ExcludedTypes.Add(typeof(IsExternalInit)); ExcludedTypes.Add(typeof(SafeBuffer)); ExcludedTypes.Add(typeof(ProfileOptimization)); ExcludedTypes.Add(typeof(System.Runtime.Remoting.ObjectHandle)); ExcludedTypes.Add(typeof(System.Runtime.Versioning.FrameworkName)); ExcludedTypes.Add(typeof(System.Runtime.Versioning.VersioningHelper)); ExcludedTypes.Add(typeof(System.Security.SecurityElement)); ExcludedTypes.Add(typeof(StringComparer)); ExcludedTypes.Add(typeof(StringNormalizationExtensions)); ExcludedTypes.Add(typeof(System.Text.Unicode.Utf8)); ExcludedTypes.Add(typeof(CancellationTokenSource)); ExcludedTypes.Add(typeof(ConcurrentExclusiveSchedulerPair)); ExcludedTypes.Add(typeof(TaskAsyncEnumerableExtensions)); ExcludedTypes.Add(typeof(TaskCompletionSource <>)); ExcludedTypes.Add(typeof(TaskExtensions)); ExcludedTypes.Add(typeof(Timer)); ExcludedTypes.Add(typeof(UriBuilder)); ExcludedTypes.Add(typeof(AppDomainSetup)); ExcludedTypes.Add(typeof(ApplicationId)); ExcludedTypes.Add(typeof(AssemblyLoadEventArgs)); ExcludedTypes.Add(typeof(BitConverter)); ExcludedTypes.Add(typeof(ArrayPool <>)); ExcludedTypes.Add(typeof(System.CodeDom.Compiler.IndentedTextWriter)); ExcludedTypes.Add(typeof(System.Collections.ArrayList)); ExcludedTypes.Add(typeof(System.Collections.Comparer)); ExcludedTypes.Add(typeof(System.Collections.Hashtable)); ExcludedTypes.Add(typeof(ContextBoundObject)); ExcludedTypes.Add(typeof(Convert)); ExcludedTypes.Add(typeof(System.Diagnostics.Debug)); ExcludedTypes.Add(typeof(System.Diagnostics.Debugger)); ExcludedTypes.Add(typeof(System.Diagnostics.Stopwatch)); ExcludedTypes.Add(typeof(Environment)); ExcludedTypes.Add(typeof(GlobalizationExtensions)); ExcludedTypes.Add(typeof(ISOWeek)); ExcludedTypes.Add(typeof(BinaryReader)); ExcludedTypes.Add(typeof(BinaryWriter)); ExcludedTypes.Add(typeof(BufferedStream)); ExcludedTypes.Add(typeof(MemoryStream)); ExcludedTypes.Add(typeof(Path)); ExcludedTypes.Add(typeof(StreamReader)); ExcludedTypes.Add(typeof(StreamWriter)); ExcludedTypes.Add(typeof(StringReader)); ExcludedTypes.Add(typeof(StringWriter)); ExcludedTypes.Add(typeof(TextReader)); ExcludedTypes.Add(typeof(TextWriter)); ExcludedTypes.Add(typeof(UnmanagedMemoryStream)); ExcludedTypes.Add(typeof(Math)); ExcludedTypes.Add(typeof(MathF)); ExcludedTypes.Add(typeof(AppDomain)); #if NET5_0 ExcludedTypes.Add(typeof(TaskCompletionSource)); #endif CustomTypeMappings.Add(typeof(DateTime), typeof(IDateTimeGlobals)); CustomTypeMappings.Add(typeof(Guid), typeof(IGuidGlobals)); ExcludeMember <EventArgs>(nameof(EventArgs.Empty)); ExcludeTypeCallback = ExcludeType; ExcludeMemberCallback = ExcludeMember; }