예제 #1
0
        private void GetGlymaVersionCompleted(object sender, Service.GetApplicationVersionCompletedEventArgs eventArgs)
        {
            ServiceProxy.GetApplicationVersionCompleted -= GetGlymaVersionCompleted;

            Service.GlymaVersion serverVersion = eventArgs.Result;

            if (GlymaClientVersion.RequiresRefresh(serverVersion))
            {
                Proxy.InitialiseMapManagerEventArgs initialisationEventArgs = new Proxy.InitialiseMapManagerEventArgs(false);

                initialisationEventArgs.ErrorMessage = "The version of Glyma your browser is using is out-of-date. Please clear your browser's cache and refresh your browser to download the latest version of Glyma.";

                InitialiseMapManagerCompleted(this, initialisationEventArgs);
            }
            else
            {
                ServiceProxy.GetAllMapTypesCompleted += GetAllMapTypesCompleted;
                ServiceProxy.GetAllMapTypesAsync(System.Windows.Browser.HtmlPage.Document.DocumentUri.ToString());
            }
        }
예제 #2
0
        private void GetGlymaVersionCompleted(object sender, Service.GetApplicationVersionCompletedEventArgs eventArgs)
        {
            if (eventArgs.Error == null)
            {
                ServiceProxy.GetApplicationVersionCompleted -= GetGlymaVersionCompleted;

                Service.GlymaVersion serverVersion = eventArgs.Result;

                if (GlymaClientVersion.RequiresRefresh(serverVersion))
                {
                    InitialiseMapManagerEventArgs initialisationEventArgs = new InitialiseMapManagerEventArgs(false);

                    initialisationEventArgs.ErrorMessage = "The version of Glyma your browser is using is out-of-date. Please clear your browser's cache and refresh your browser to download the latest version of Glyma.";

                    InitialiseMapManagerCompleted(this, initialisationEventArgs);
                }
                else
                {
                    ServiceProxy.GetAllMapTypesCompleted += GetAllMapTypesCompleted;
                    ServiceProxy.GetAllMapTypesAsync(CallingUrl.Url);
                }
            }
            else
            {
                InitialiseMapManagerEventArgs initialisationEventArgs = new InitialiseMapManagerEventArgs(false);

                string errorMsg = eventArgs.Error.ToString();
                if (eventArgs.Error.InnerException != null)
                {
                    //strip off the TargetInvocationException that wraps the real exception
                    errorMsg = eventArgs.Error.InnerException.ToString();
                }
                initialisationEventArgs.ErrorMessage = errorMsg;
                InitialiseMapManagerCompleted(this, initialisationEventArgs);
            }
        }