【发布时间】:2012-02-07 19:18:53
【问题描述】:
我在使用 Visual C# for Windows Phone 中的某些代码时遇到了一些问题 问题不是它不起作用,因为它起作用,但我不明白如何=P 在静态类中,会创建一个静态方法,该方法将自身作为参数:
public static void MethodONe( this Timeline animation )
{
//this class does not extend the TimeLine class, and is not connected to it in any
//such way.
animation.MethodTwo( );
}
public static void MethodTwo( this Timeline animation )
{
someCode( );
}
这个参数传递是如何调用的,它到底是做什么的?
【问题讨论】:
标签: c# this parameter-passing