我和MyClass [英] Me vs. MyClass

查看:93
本文介绍了我和MyClass的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Me和MyClass关键字有什么区别?我告诉我,它代表了类的特定实例。

当你在对象实例中时,它使用
$引用它自己b $ b Me关键字。什么是MyClass关键字用于?

What is the difference between the Me and the MyClass keywords? I
understand Me that it represents the specific instance of the class.
When you''re inside the object instance, it refers to itself using the
Me keyword. What is the MyClass keyword used for?

推荐答案

MyClass用于当前类(me)覆盖

来自基类(MyBase)的成员。现在,让我们假设在重写成员的基础

类版本中,您要确保子类使用BASE类

成员,你将在BASE类的可重写成员中使用MyClass关键字




最后,当子类调用它自己的版本时可以覆盖

成员,BASE类中标记为MyClass的值仍然使用



Water Cooler v2 <重量***** @ yahoo.com>在消息中写道

news:11 ********************* @ o13g2000cwo.googlegro ups.com ...
MyClass is used in situations where the current class (me) overrides a
member from the base class (MyBase). Now, let''s assume the in the base
class version of the overridden member, you want to ensure that a BASE class
member gets used by the child class, you would use the MyClass keyword in
the BASE class''s overrideable member.

In the end, when the child class calls its own version of an overridable
member, the value from the BASE class that was marked as MyClass still gets
used.
"Water Cooler v2" <wt*****@yahoo.com> wrote in message
news:11*********************@o13g2000cwo.googlegro ups.com...
我和MyClass关键字有什么区别?我理解它代表了类的特定实例。
当你在对象实例中时,它使用
Me关键字引用自己。什么是MyClass关键字用于?
What is the difference between the Me and the MyClass keywords? I
understand Me that it represents the specific instance of the class.
When you''re inside the object instance, it refers to itself using the
Me keyword. What is the MyClass keyword used for?



2005-09-03,Water Cooler v2< wt ***** @ yahoo.com>写道:
On 2005-09-03, Water Cooler v2 <wt*****@yahoo.com> wrote:
我和MyClass关键字有什么区别?我理解它代表了类的特定实例。
当你在对象实例中时,它使用
Me关键字引用自己。什么是MyClass关键字用于?
What is the difference between the Me and the MyClass keywords? I
understand Me that it represents the specific instance of the class.
When you''re inside the object instance, it refers to itself using the
Me keyword. What is the MyClass keyword used for?




MyClass忽略任何派生类重写。这是帮助文件实际上非常有用的那些

实例之一。要么输入MyClass到

帮助,要么退房...

http://msdn.microsoft.com/library/de...keymyclass.asp


(对不起网址中的任何中断)



MyClass ignores any derived class overrides. This is one of those
instances where the help file is actually very helpful. Either type MyClass into
help, or check out...

http://msdn.microsoft.com/library/de...keymyclass.asp

(sorry about any breaks in the url)


2005-09-03,Scott M. < S - *** @ nospam.nospam>写道:
On 2005-09-03, Scott M. <s-***@nospam.nospam> wrote:
MyClass用于当前类(me)覆盖基类(MyBase)中的
成员的情况。现在,让我们假设在重写成员的基类类版本中,您希望确保子类使用BASE类
成员,您将使用MyClass关键字
BASE类的可重写成员。

最后,当子类调用自己的可覆盖的
成员版本时,BASE类中的值被标记因为MyClass仍然被使用。
MyClass is used in situations where the current class (me) overrides a
member from the base class (MyBase). Now, let''s assume the in the base
class version of the overridden member, you want to ensure that a BASE class
member gets used by the child class, you would use the MyClass keyword in
the BASE class''s overrideable member.

In the end, when the child class calls its own version of an overridable
member, the value from the BASE class that was marked as MyClass still gets
used.




我以为我理解这些东西,但我根本不理解。

如何将值标记为MyClass?我认为MyClass是你在调用会员时使用的
,而不是在宣布它时。


和AFAIK,一个孩子班总是会得到它'自己被覆盖的

成员,除非它专门调用基类。基类

可以忽略其自己的函数调用中的覆盖,但不能对子类所进行的函数调用进行任何更改./ br / >

我错过了什么,或者只是对这里的措辞感到困惑?



I thought I understood this stuff, but I don''t follow that at all. How
do you "mark a value as MyClass"? I thought MyClass was something you
used when invoking a member, not when declaring it.

And AFAIK, a child class is always going to get it''s own overridden
members unless it specifically calls into the base class. The base class
can ignore the overrides in its own function calls, but can''t make any
changes to the function calls that the child class makes.

Am I missing something, or just confused by the wording here?


这篇关于我和MyClass的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆