public virtual void Process(LinkContext context) { Context = context; Corlib = context.GetAssembly("mscorlib"); if (I18n.HasFlag(I18nAssemblies.MidEast)) { PreserveCalendar("UmAlQuraCalendar"); PreserveCalendar("HijriCalendar"); } if (I18n.HasFlag(I18nAssemblies.Other)) { PreserveCalendar("ThaiBuddhistCalendar"); } PreserveResourceSet(); }
MethodReference GetBlockSetupImpl(MethodDefinition caller, Instruction ins) { if (setupblock_def == null) { var type = LinkContext.GetAssembly(Driver.GetProductAssembly(LinkContext.Target.App)).MainModule.GetType(Namespaces.ObjCRuntime, "BlockLiteral"); foreach (var method in type.Methods) { if (method.Name != "SetupBlockImpl") { continue; } setupblock_def = method; setupblock_def.IsPublic = true; // Make sure the method is callable from the optimized code. break; } if (setupblock_def == null) { throw ErrorHelper.CreateError(Options.Application, 99, caller, ins, $"Internal error: could not find the method {Namespaces.ObjCRuntime}.BlockLiteral.SetupBlockImpl. Please file a bug report with a test case (https://github.com/xamarin/xamarin-macios/issues/new)."); } } return(caller.Module.ImportReference(setupblock_def)); }
public static TypeDefinition GetType(this LinkContext context, string assemblyName, string typeName) { AssemblyDefinition ad = context.GetAssembly(assemblyName); return(ad == null ? null : GetType(ad, typeName)); }