我不確定爲什麼我不聲明爲partial interface
,因爲在C#2.0中看起來很完美;當我得到第二個時,我會得到改變,但請注意,您可以在本地應用手動更改 - 只需編輯csharp.xslt文件即可。現在,XSLT是不宜喝茶的每個人的杯子,但它應該是一個1線變化(靠近字interface
) - 事實上,它可能是另外的partial
這裏:
<xsl:template match="ServiceDescriptorProto">
<xsl:if test="($optionClientProxy or $optionDataContract)">
[global::System.ServiceModel.ServiceContract(Name = @"<xsl:value-of select="name"/>")]</xsl:if>
public /* HERE => */ partial /* <= HERE */ interface I<xsl:value-of select="name"/>
{
<xsl:apply-templates select="method"/>
}
<xsl:if test="$optionProtoRpc">
public class <xsl:value-of select="name"/>Client : global::ProtoBuf.ServiceModel.RpcClient
{
public <xsl:value-of select="name"/>Client() : base(typeof(I<xsl:value-of select="name"/>)) { }
<xsl:apply-templates select="method/MethodDescriptorProto" mode="protoRpc"/>
}
</xsl:if>
<xsl:apply-templates select="." mode="clientProxy"/>
</xsl:template>
由於該xslt是可調整的,您應該能夠應用您需要的任何其他更改。
啊,非常感謝馬克。不知道有這些可訪問的模板。這應該做的伎倆。 – 2010-09-14 13:41:58