修改客户会话控制源代码(CurrentSessionControl) - 生成错误??? [英] Modifying Customer Session Control Source code (CurrentSessionControl) - Generates Error???

查看:117
本文介绍了修改客户会话控制源代码(CurrentSessionControl) - 生成错误???的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

修改客户会话控制源代码以考虑所需的自定义在使用"关闭会话"按钮关闭当前会话时导致错误工具栏。引发的确切异常是:

在触发主题时发生了一个或多个异常:topic:// RequestActionEvent'Stack:at Microsoft.Practices.CompositeUI.EventBroker.EventTopic.CallSubscriptionHandlers(Object sender,EventArgs e,EventTopicFireDelegate []处理程序)在c:\Ccf \v3.0 \CcfEverest\CcfEverestFull \Sources \ Private \ Mysoft.Ccf \ Microsoft / .Ccf \CAB \ CompositeUI \ EventBroker \ EventTopic。 cs:第331行

位于c:\Ccf \v3.0 \CcfEverest中的Microsoft.Practices.CompositeUI.EventBroker.EventTopic.Fire(Object sender,EventArgs e,WorkItem workItem,PublicationScope范围) \\ ccfEverestFull \Sources \ Private_\\Microsoft.Ccf\Microsoft.Ccf \CAB\CompositeUI \ EventBroker \ EventTopic.cs:第158行

at Microsoft.Practices.CompositeUI.EventBroker。在c:\Ccf \v3.0 \CcfEverest \CcfEve中的EventTopic.Fire(出版物出版物,对象发件人,EventArgs e) restFull \Sources\Private\Microsoft.Ccf\Microsoft.Ccf\CAB\CompositeUI\EventBroker\EventTopic.cs:line 393

at Microsoft.Practices.CompositeUI.EventBroker.Publication .PublicationHandler(Object sender,EventArgs e)位于c:\Ccf \v3.0 \CcfEverest \CcfEverestFull \Sources \ Private \ Microsoft.Ccf \ Mysrosoft.Ccf \CAB \ CompositeUI \ EventBroker\Publication.cs:第86行

位于c:\Ccf \v3.0 \CcfEverest \CcfEverestFull \Sources中的Microsoft.Ccf.Csr.HostedControl.FireRequestAction(RequestActionEventArgs args) \\ Private\Microsoft.Ccf\Microsoft.Ccf\Csr\Aif\HostedApplication\HostedControl.cs:line 886

at Microsoft.Ccf.Samples.Csr.AgentDesktop.Desktop.SessionManager_SessionCloseEvent(会话会话)在C:\Documents and Settings \c00057 \ My Documents\Visual Studio 2008 \Projects\WVO\Microsoft.Ccf.Samples.C sr.AgentDesktop\Microsoft.Ccf.Samples\Csr\AgentDesktop\Desktop.cs:第1623行

在c:中的Microsoft.Ccf.Csr.Sessions.CloseSession(会话会话,布尔强制关闭) \Ccf \v3.0 \CcfEverest\CcfEverestFull \Sources \ Private \ Microsoft.Ccf\Microsoft.Ccf\Csr\Sessions\Sessions.cs:line 396

我所做的唯一更改是对窗体标签控件的自定义 - 添加了一些。如果我将其与原始源代码中的原始标签控件交换回来 - 异常会神奇地消失。不幸的是,定制到外观和感觉这个托管控件很关键,但对于这个例外。

非常感谢任何帮助。谢谢。

推荐答案

所以,经过今天早上的进一步调试后,我尝试将组合框的Visible属性设置为true&神奇的例外消失了:-)

这是一个包含会话对象集合的组合框。
我可以提出上述行为的唯一逻辑原因是当隐藏控件时(尤其是组合框) ) 它不会侦听某些消息& /或导致Session对象永远不会添加到收集&因此,在使用"关闭会话"工具栏按钮关闭会话时,逻辑在尝试删除从未首先添加到列表集合中的会话对象时抛出了内部异常。

如果其他任何人具有更好的理由,请随时回复此主题。总是希望学到新的东西:-)

如果你想知道我是如何解决的 - 好吧,我没有。我设置了Visible但改变了Z顺序,因为它不是我们当前需求的必需控件。或者,您可以将一个布尔条件放到LoadAllSessions&在将Visible属性添加到集合之前检查Visible属性的RemoveSession方法。没有尝试后者,但它可能会起作用。
So, after some further debugging this morning, I tried setting the combo box's Visible property to true & magically the exception went away :-)

This is the same combo box that holds a collection of session objects. 
The only logical reason I could come up for the behavior above is that when a control is hidden (especially a combo box) it does not listen for certain messages &/or events which resulted in the Session object never being added to the Collection & hence on closing the session using the Close Session toolbar button, the logic threw an internal exception when attempting to remove the session object that never got added to the list collection in the first place.

If any one else has a better reason, please feel free to reply back to this thread.  Always hoping to learn something new :-)

If you are wondering as to how did I resolve this - well, I didn't.  I set the Visible but changed the Z order as it is not a required control for our current needs.  Alternatively, you could put a Boolean condition to LoadAllSessions & RemoveSession methods to check for Visible property before adding it to a collection.  Did not try the latter but, it might just work.


这篇关于修改客户会话控制源代码(CurrentSessionControl) - 生成错误???的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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