Domanda

Come posso applicare MarshalAsAttribute al tipo di ritorno del codice seguente?

public ISomething Foo()
{
    return new MyFoo();
}
È stato utile?

Soluzione

Secondo http://msdn.microsoft. com / it-it / library / system.runtime.interopservices.marshalasattribute.aspx :

[return: MarshalAs(<your marshal type>)]
public ISomething Foo()
{
    return new MyFoo();
}

Altri suggerimenti

[return:MarshalAs]
public ISomething Foo()
{
    return new MyFoo();
}
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top