private void ProcessType(INamedTypeSymbol typeSymbol)
            {
                var isiOSView     = typeSymbol.Is(_iosViewSymbol);
                var ismacOSView   = typeSymbol.Is(_macosViewSymbol);
                var isAndroidView = typeSymbol.Is(_androidViewSymbol);

                if (isiOSView || ismacOSView)
                {
                    Func <IMethodSymbol, bool> predicate = m =>
                                                           !m.Parameters.IsDefaultOrEmpty &&
                                                           (
                        SymbolEqualityComparer.Default.Equals(m.Parameters[0].Type, _intPtrSymbol) ||
                        SymbolEqualityComparer.Default.Equals(m.Parameters[0].Type, _objcNativeHandleSymbol));

                    var nativeCtor = GetNativeCtor(typeSymbol, predicate, considerAllBaseTypes: false);

                    if (nativeCtor == null && GetNativeCtor(typeSymbol.BaseType, predicate, considerAllBaseTypes: true) != null)
                    {
                        _context.AddSource(
                            HashBuilder.BuildIDFromSymbol(typeSymbol),
                            GetGeneratedCode(typeSymbol));
                    }
                }

                if (isAndroidView)
                {
                    Func <IMethodSymbol, bool> predicate = m => m.Parameters.Select(p => p.Type).SequenceEqual(_javaCtorParams ?? Array.Empty <ITypeSymbol?>());
                    var nativeCtor = GetNativeCtor(typeSymbol, predicate, considerAllBaseTypes: false);

                    if (nativeCtor == null && GetNativeCtor(typeSymbol.BaseType, predicate, considerAllBaseTypes: true) != null)
                    {
                        _context.AddSource(
                            HashBuilder.BuildIDFromSymbol(typeSymbol),
                            GetGeneratedCode(typeSymbol));
                    }
                }

                string GetGeneratedCode(INamedTypeSymbol typeSymbol)
                {
                    var builder = new IndentedStringBuilder();

                    builder.AppendLineInvariant("// <auto-generated>");
                    builder.AppendLineInvariant("// *************************************************************");
                    builder.AppendLineInvariant("// This file has been generated by Uno.UI (NativeCtorsGenerator)");
                    builder.AppendLineInvariant("// *************************************************************");
                    builder.AppendLineInvariant("// </auto-generated>");
                    builder.AppendLine();
                    builder.AppendLineInvariant("using System;");
                    builder.AppendLine();
                    var disposables = typeSymbol.AddToIndentedStringBuilder(builder, beforeClassHeaderAction: builder =>
                    {
                        // These will be generated just before `partial class ClassName {`
                        builder.Append("#if __IOS__ || __MACOS__");
                        builder.AppendLine();
                        builder.AppendLineInvariant("[global::Foundation.Register]");
                        builder.Append("#endif");
                        builder.AppendLine();
                    });

                    var syntacticValidSymbolName = SyntaxFacts.GetKeywordKind(typeSymbol.Name) == SyntaxKind.None ? typeSymbol.Name : "@" + typeSymbol.Name;

                    if (NeedsExplicitDefaultCtor(typeSymbol))
                    {
                        builder.AppendLineInvariant("/// <summary>");
                        builder.AppendLineInvariant("/// Initializes a new instance of the class.");
                        builder.AppendLineInvariant("/// </summary>");
                        builder.AppendLineInvariant($"public {syntacticValidSymbolName}() {{{{ }}}}");
                        builder.AppendLine();
                    }

                    builder.Append("#if __ANDROID__");
                    builder.AppendLine();
                    builder.AppendLineInvariant("/// <summary>");
                    builder.AppendLineInvariant("/// Native constructor, do not use explicitly.");
                    builder.AppendLineInvariant("/// </summary>");
                    builder.AppendLineInvariant("/// <remarks>");
                    builder.AppendLineInvariant("/// Used by the Xamarin Runtime to materialize native ");
                    builder.AppendLineInvariant("/// objects that may have been collected in the managed world.");
                    builder.AppendLineInvariant("/// </remarks>");
                    builder.AppendLineInvariant($"public {syntacticValidSymbolName}(IntPtr javaReference, global::Android.Runtime.JniHandleOwnership transfer) : base (javaReference, transfer) {{{{ }}}}");
                    builder.Append("#endif");
                    builder.AppendLine();

                    builder.Append("#if __IOS__ || __MACOS__ || __MACCATALYST__");
                    builder.AppendLine();
                    builder.AppendLineInvariant("/// <summary>");
                    builder.AppendLineInvariant("/// Native constructor, do not use explicitly.");
                    builder.AppendLineInvariant("/// </summary>");
                    builder.AppendLineInvariant("/// <remarks>");
                    builder.AppendLineInvariant("/// Used by the Xamarin Runtime to materialize native ");
                    builder.AppendLineInvariant("/// objects that may have been collected in the managed world.");
                    builder.AppendLineInvariant("/// </remarks>");
                    builder.AppendLineInvariant($"public {syntacticValidSymbolName}(IntPtr handle) : base (handle) {{{{ }}}}");

                    if (_objcNativeHandleSymbol != null)
                    {
                        builder.AppendLineInvariant("/// <summary>");
                        builder.AppendLineInvariant("/// Native constructor, do not use explicitly.");
                        builder.AppendLineInvariant("/// </summary>");
                        builder.AppendLineInvariant("/// <remarks>");
                        builder.AppendLineInvariant("/// Used by the .NET Runtime to materialize native ");
                        builder.AppendLineInvariant("/// objects that may have been collected in the managed world.");
                        builder.AppendLineInvariant("/// </remarks>");
                        builder.AppendLineInvariant($"public {syntacticValidSymbolName}(global::ObjCRuntime.NativeHandle handle) : base (handle) {{{{ }}}}");
                    }

                    builder.Append("#endif");
                    builder.AppendLine();

                    while (disposables.Count > 0)
                    {
                        disposables.Pop().Dispose();
                    }

                    return(builder.ToString());
                }