考虑这个类:
public class Thing {
    public string Color { get; set; }
    public bool IsBlue() {
        return this.Color == "Blue";   // redundant "this"
    }
}
我可以省略关键字this,因为Color它是 的属性Thing,并且我在Thing.
如果我现在创建一个扩展方法:
public static class ThingExtensions {
    public static bool TestForBlue(this Thing t) {
        return t.Color == "Blue";
    }
}
我现在可以将我的IsBlue方法更改为:
public class Thing {
    public string Color { get; set; }
    public bool IsBlue() {
        return this.TestForBlue();   // "this" is now required
    }
}
但是,我现在需要包含this关键字。
引用属性和方法时我可以省略this,为什么我不能这样做...?
public bool IsBlue() {
    return TestForBlue();
}