C#相当于Java Class.this

Pro*_*sts 3 c# java this

问题:什么可以是JavaC#等价物? Class.this

原因:假设我在JavaC#中都有相同的Form1类.在Java中我们可以编写,如何用C#编写.Form1.this

Bli*_*ndy 10

There is no equivalent, C# has no nested class support where it also tracks outer instances. If needed you pass a pointer yourself and store it in a field/property.

如果您想要的this只是同一实例中引用成员的正常成员,只需使用this关键字即可.或者甚至更好,不要 - 这是隐含的.