从singleton类问题继承事件两天 [英] Inheriting events from singleton class problem for two days

查看:66
本文介绍了从singleton类问题继承事件两天的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经尝试了两天没有运气来解决这个问题。


我有一个单例类,它声明了一些事件。当我从这个类继承

时,事件似乎不再伴随它。


单例类中的事件总是评估为null甚至当我小心的时候

订阅它。


有没有人有一些如何做到这一点的示例代码,或者这是不可能的。


我可以根据需要发布我的代码。


请帮助!

I have tried for two days to solve this problem with no luck.

I have a singleton class which has some events declared. When I inherit
from this class the events don''t seem to come along with it.

The event in the singleton class always evaluates to null even when I cleary
subscribe to it.

Does anyone have some sample code of how to do this, or is this not possible.

I can post my code if needed.

Please help!

推荐答案

Opa< Op *@discussions.microsoft.com>写道:
Opa <Op*@discussions.microsoft.com> wrote:
我已经尝试了两天没有运气解决这个问题。


发布新帖子的任何理由而不是继续在

之前的帖子?


< snip> ;

如果需要我可以发布我的代码。
I have tried for two days to solve this problem with no luck.
Any reason for posting a new thread rather than continuing in the
previous one?

<snip>
I can post my code if needed.




是的,请做。我已经要求你发一个简短但完整的

程序来证明这个问题...


-

Jon Skeet - < sk *** @ pobox.com>
http: //www.pobox.com/~skeet

如果回复小组,请不要给我发邮件



Yes, please do. I''ve already asked you to post a short but complete
program which demonstrates the problem...

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too


你好Jon,

我不确定它是否会在堆栈中丢失。是的,我仍然有这个问题。

我已经试了好几个小时才弄清楚了。我仍然没有,你能帮忙。


谢谢

Jon Skeet [C#MVP]"写道:
Hi Jon,
I wasn''t sure if it would get lost in the stack. Yes, I am still having
this problem.
I''ve tried for hours to figure it out. I''m still no where, can you help.

Thanks
"Jon Skeet [C# MVP]" wrote:
Opa< Op *@discussions.microsoft.com>写道:
Opa <Op*@discussions.microsoft.com> wrote:
我已经尝试了两天没有运气解决这个问题。
I have tried for two days to solve this problem with no luck.



任何发布新帖子的原因而不是继续在
上一个?

< snip>



Any reason for posting a new thread rather than continuing in the
previous one?

<snip>

我可以根据需要发布我的代码。
I can post my code if needed.



是,请做。我已经要求你发一个简短但完整的
程序来证明这个问题...

-
Jon Skeet - < sk *** @ pobox .com>
http://www.pobox.com/~skeet
如果回复小组,请不要给我发邮件



Yes, please do. I''ve already asked you to post a short but complete
program which demonstrates the problem...

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too



Opa< Op *@discussions.microsoft.com>写道:
Opa <Op*@discussions.microsoft.com> wrote:
我不确定它是否会在堆栈中丢失。


它不会。新帖会一直显示为新帖。

是的,我仍然遇到这个问题。
我已经试了好几个小时才搞清楚。我仍然没有,你能帮忙。
I wasn''t sure if it would get lost in the stack.
It won''t. New posts will always show up as new posts.
Yes, I am still having this problem.
I''ve tried for hours to figure it out. I''m still no where, can you help.




当然。只需发布一个简短但完整的程序,该程序会显示问题,并且我确定它不会太难修复。


- -

Jon Skeet - < sk *** @ pobox.com>
http://www.pobox.com/~skeet

如果回复群组,请不要给我发邮件



Certainly. Just post a short but complete program which demonstrates
the problem, and I''m sure it won''t be too hard to fix.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too


这篇关于从singleton类问题继承事件两天的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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