public void WriteGenericConstraint(TrampolineContext context, CSharpCodeWriter writer) { writer.Write("where "); writer.WriteIdentifier(GenericParameterName); writer.Write(" : unmanaged, "); writer.Using(ConstraintInterfaceNamespace); writer.WriteIdentifier(ConstraintInterfaceTypeName); writer.WriteLine(); }
public override void WriteOutputArgument(TrampolineContext context, CSharpCodeWriter writer) { writer.Write('('); context.WriteType(OutputType); writer.Write(')'); if (ByRefKind is not null) { writer.WriteIdentifier(TemporaryName); } else { writer.WriteIdentifier(Name); } }
public override bool WriteBlockBeforeCall(TrampolineContext context, CSharpCodeWriter writer) { if (ByRefKind is not ByRefKind byRefKind) { return(false); } writer.Write("fixed ("); context.WriteType(TemporaryType); writer.Write(' '); writer.WriteIdentifier(TemporaryName); writer.Write(" = "); writer.Write('&'); writer.WriteIdentifier(Name); writer.WriteLine(')'); return(true); }
public void WriteGenericParameter(TrampolineContext context, CSharpCodeWriter writer) => writer.WriteIdentifier(GenericParameterName);
public override void WritePrologue(TrampolineContext context, CSharpCodeWriter writer) { }