Exemplo n.º 1
0
        void clientUpdateWS_VersionCompleted(object sender, Remwave.Client.ClientUpdateWS.VersionCompletedEventArgs e)
        {
            try
            {
                if (e.Error != null) return;
                if (e.Result != null)
                {
                    string[] version = e.Result;
                    ClientUpdateWS.Service clientUpdateWS = new Remwave.Client.ClientUpdateWS.Service();
                    if (Application.ProductVersion.CompareTo(version[0]) < 0)
                    {
                        //force update
                        string downloadlink = clientUpdateWS.Software();
                        if (MessageBox.Show(this,
                            Properties.Localization.txtInfoNewVersion,
                            Properties.Localization.txtInfoUpdateAvaliable,
                            MessageBoxButtons.OKCancel,
                            MessageBoxIcon.Information
                            ) == DialogResult.OK)
                        {
                            System.Diagnostics.Process.Start(downloadlink);
                            Application.Exit();
                        };
                    }

                    if (myClientConfiguration.LastNews.CompareTo(version[1]) < 0)
                    {
                        //display news
                        string newsLink = clientUpdateWS.News();
                        System.Diagnostics.Process.Start(newsLink);
                        myClientConfiguration.LastNews = version[1];
                    }
                }
            }
            catch (Exception ex)
            {
#if (TRACE)
                Console.WriteLine("clientUpdateWS_VersionCompleted : " + ex.Message);
#endif
            }
        }
Exemplo n.º 2
0
        //TO DO : STart User Search

























        #endregion

        private void Client_Load(object sender, EventArgs e)
        {
            try
            {
                myClientConfiguration = myClientConfigurationSerializer.LoadClientConfiguration();

                //check the web service for update and newses

                try
                {
                    ClientUpdateWS.Service clientUpdateWS = new Remwave.Client.ClientUpdateWS.Service();
                    clientUpdateWS.VersionCompleted += new Remwave.Client.ClientUpdateWS.VersionCompletedEventHandler(clientUpdateWS_VersionCompleted);
                    clientUpdateWS.VersionAsync();
                }
                catch (Exception ex)
                {
#if (TRACE)
                    Console.WriteLine("Amitelo_Load JOCCOmeWS : " + ex.Message);
#endif
                }

                if (myClientConfiguration.RememberMe)
                {
                    myLoginRememberMeCheckBox.Checked = true;
                    myLoginPasswordInput.Text = myClientConfiguration.Password;
                    myLoginUsernameInput.Text = myClientConfiguration.Username;
                    if (myClientConfiguration.AutoLogin)
                    {
                        myLoginAutoLoginCheckBox.Checked = true;
                    }
                }
            }
            catch (Exception ex)
            {
#if (TRACE)
                Console.WriteLine("Client_Load : " + ex.Message);
#endif
            }
        }