public StatementSyntax GenerateManagedToNative(CsMarshalBase csElement, bool singleStackFrame)
    {
        const ArrayCopyDirection direction = ArrayCopyDirection.ManagedToNative;

        return(csElement switch
        {
            CsParameter {
                IsLocalManagedReference : true
            } parameter => GenerateCopyBlock(parameter, direction),
            CsField field => GenerateCopyMemory(field, direction),
            _ => null
        });
Ejemplo n.º 2
0
 private static (SyntaxToken destination, SyntaxToken source) CopyDirectionToIdentifiers(
     ArrayCopyDirection direction, SyntaxToken managedName, SyntaxToken nativeName
     ) => direction switch