Wednesday, October 17, 2012

Handling Logout on Application Exit in Silverlight with WCF Polling Duplex

Handling Logout on Application Exit in Silverlight with WCF Polling Duplex

I'm trying to call a javascript function to call my shutdown manager class to handle Logoff process but this only works in IE and I'm getting timeout errors in next publish method of my wcf duplex service.

How should I implement a proper logout for my application to handle this?

    function OnClose() {         //alert('asd');         var plugin = document.getElementById("game");         var shutdownManager = plugin.content.ShutdownManager;         var shutdownResult = shutdownManager.Shutdown();         if (shutdownResult) {             event.returnValue = shutdownResult;         }     }  [ScriptableType] public class ShutdownManager {     [ScriptableMember]     public string Shutdown()     {         string result = null;         var page = App.Current.RootVisual;         if (page is MainPage)         {             var messageBoxResult = MessageBox.Show("?",                 "...", MessageBoxButton.OK);             if (messageBoxResult == MessageBoxResult.OK)             {                 var waitingWindow = new WaitingWindow();                 waitingWindow.Show();                 waitingWindow.NoticeText = "Saving work on server. Please wait...";                 ;  

// disconnect method calls ? } result = "result";

        } 

Answers & Comments...




No comments:

Post a Comment

Send us your comment related to the topic mentioned on the blog