多重内在 [英] Multi Inherence

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

问题描述

有没有办法超越VN.NET接受多元b $ b遗产的不可能性,即让一个班级继承两个母班?


-

BernardBourée
成为***** @ bouree.net

解决方案

"BernardBourée" <是***** @ bouree.net> schrieb:

有没有办法超越VN.NET接受多种遗产的不可能性,即允许一个类继承两个母类?




不是直接的,但你可以去VB6中使用的委托方式来实现继承。


-

Herfried K. Wagner [MVP]

< URL:http://dotnet.mvps.org/>


No。


从1继承并使用

接口,你必须达到你想要的效果。或者让您的类包含另一个实例作为

私有成员,以及转发方法调用该对象(如果可以为您的情况工作

)。


"BernardBourée" <是***** @ bouree.net>在消息中写道

新闻:eF ************* @ TK2MSFTNGP11.phx.gbl ...

有没有办法通过立交桥VN.NET不可能接受多种遗产,即允许一个班级继承两个母班?

-
BernardBourée
< a href =mailto:be ***** @ bouree.net>是***** @ bouree.net



>>有没有办法超越VN.NET接受

多元遗产的不可能性,即允许一个类继承两个母类?



不是直接的,但你可以采用VB6中使用的委托方式来实现继承。




这是离开场的一个奇怪的想法... C ++可以做多重继承。

可以通过C ++ / Managed Extensions做到,然后从VB使用它吗?

-

Peace&快乐的计算,


Mike Labosh,MCSD

我别无选择,只能相信自由意志。


Is there a way to overpass the impossibility of VN.NET to accept the multi
heritage, that is to allow a class to inherit from TWO mother classes ?

--
Bernard Bourée
be*****@bouree.net

解决方案

"Bernard Bourée" <be*****@bouree.net> schrieb:

Is there a way to overpass the impossibility of VN.NET to accept the multi
heritage, that is to allow a class to inherit from TWO mother classes ?



Not directly, but you can go the delegation way that was used in VB6 to
archieve implementation inheritance.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>


No.

You will have to achieve what you want with inheriting from 1 and using
interfaces. Or having your class contain an instance of another as a
private member, and forwarding method calls to that object (if that can work
for your situation).

"Bernard Bourée" <be*****@bouree.net> wrote in message
news:eF*************@TK2MSFTNGP11.phx.gbl...

Is there a way to overpass the impossibility of VN.NET to accept the multi
heritage, that is to allow a class to inherit from TWO mother classes ?

--
Bernard Bourée
be*****@bouree.net



>> Is there a way to overpass the impossibility of VN.NET to accept the

multi
heritage, that is to allow a class to inherit from TWO mother classes ?



Not directly, but you can go the delegation way that was used in VB6 to
archieve implementation inheritance.



Here''s a bizarre idea from left field... C++ can do multiple inheritance.
Could he do it via C++ / Managed Extensions and then use it from VB?
--
Peace & happy computing,

Mike Labosh, MCSD
"I have no choice but to believe in free will."


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

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