【发布时间】:2008-09-25 04:19:40
【问题描述】:
如何将 MarshalAsAttribute 应用于下面代码的返回类型?
public ISomething Foo()
{
return new MyFoo();
}
【问题讨论】:
标签: c# .net attributes return-type
如何将 MarshalAsAttribute 应用于下面代码的返回类型?
public ISomething Foo()
{
return new MyFoo();
}
【问题讨论】:
标签: c# .net attributes return-type
根据http://msdn.microsoft.com/en-us/library/system.runtime.interopservices.marshalasattribute.aspx:
[return: MarshalAs(<your marshal type>)]
public ISomething Foo()
{
return new MyFoo();
}
【讨论】:
[return:MarshalAs]
public ISomething Foo()
{
return new MyFoo();
}
【讨论】: