none
Modifying Customer Session Control Source code (CurrentSessionControl) - Generates Error??? RRS feed

  • Question

  • Modifying the Customer session control source code to account for the customization desired is resulting in a error when closing the current session using the Close Session button on the toolbar.  The exact exception thrown is:

    One or more exceptions occurred while firing the topic 'topic://RequestActionEvent'Stack:   at Microsoft.Practices.CompositeUI.EventBroker.EventTopic.CallSubscriptionHandlers(Object sender, EventArgs e, EventTopicFireDelegate[] handlers) in c:\Ccf\v3.0\CcfEverest\CcfEverestFull\Sources\Private\Microsoft.Ccf\Microsoft.Ccf\CAB\CompositeUI\EventBroker\EventTopic.cs:line 331

       at Microsoft.Practices.CompositeUI.EventBroker.EventTopic.Fire(Object sender, EventArgs e, WorkItem workItem, PublicationScope scope) in c:\Ccf\v3.0\CcfEverest\CcfEverestFull\Sources\Private\Microsoft.Ccf\Microsoft.Ccf\CAB\CompositeUI\EventBroker\EventTopic.cs:line 158

       at Microsoft.Practices.CompositeUI.EventBroker.EventTopic.Fire(Publication publication, Object sender, EventArgs e) in c:\Ccf\v3.0\CcfEverest\CcfEverestFull\Sources\Private\Microsoft.Ccf\Microsoft.Ccf\CAB\CompositeUI\EventBroker\EventTopic.cs:line 393

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

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

       at Microsoft.Ccf.Samples.Csr.AgentDesktop.Desktop.SessionManager_SessionCloseEvent(Session session) in C:\Documents and Settings\c00057\My Documents\Visual Studio 2008\Projects\WVO\Microsoft.Ccf.Samples.Csr.AgentDesktop\Microsoft.Ccf.Samples\Csr\AgentDesktop\Desktop.cs:line 1623

       at Microsoft.Ccf.Csr.Sessions.CloseSession(Session session, Boolean forceClose) in c:\Ccf\v3.0\CcfEverest\CcfEverestFull\Sources\Private\Microsoft.Ccf\Microsoft.Ccf\Csr\Sessions\Sessions.cs:line 396

    The only changes I have made is the customization to the windows Forms Label controls - added a few more.  If I swap it back with the original label controls that was part of the original source code - the exception magically disappears.  Unfortunately, customization to the look & feel of this Hosted control is critical, but for this exception.

    Any help with this is greatly appreciated.  Thanks.
    Saturday, November 15, 2008 8:53 PM

All replies

  • 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.
    • Proposed as answer by Brian_Garnica Wednesday, April 29, 2009 4:44 PM
    Monday, November 17, 2008 9:04 PM