void Client_Disconnected(object sender, EventArgs e)
        {
            Srp6ClientSocket client = sender as Srp6ClientSocket;

            PrintLine(Strings.UpdateDisconnected);
            SetIsEnabledSafe(true);

            /*
             * if (updateReceived)
             * {
             *  // We received the update (disconnect has already occured)
             *  MessageBox.Show("Update Received");
             * }
             * else if (!client.IsAuthenticated)
             * {
             *  // Disconnect occured without authenticating
             *  MessageBox.Show("Disconnected, without authenticating");
             * }
             * else if (!client.IsUpdateReceived)
             * {
             *  // Disconnect occured without getting the update file
             *  MessageBox.Show("Disconnected, without receiving update");
             * }
             */
        }
Esempio n. 2
0
        public static void StartVersionCheck()
        {
            Srp6ClientSocket client = new Srp6ClientSocket(Username, Password, ZipPath);

            InitializeClientSocket(client);
            ThreadPool.QueueUserWorkItem(ClientStartVersionCheckThread, client);
        }
Esempio n. 3
0
        public static void StartCrashReport(Exception exception)
        {
            Srp6ClientSocket client = new Srp6ClientSocket(Username, Password, exception);

            InitializeClientSocket(client);
            ThreadPool.QueueUserWorkItem(ClientCrashStartThread, client);
        }
Esempio n. 4
0
 private static void InitializeClientSocket(Srp6ClientSocket client)
 {
     client.Connected         += new EventHandler(Client_Connected);
     client.ConnectFailed     += new EventHandler(Client_ConnectFailed);
     client.Disconnected      += new EventHandler(Client_Disconnected);
     client.Authenticated     += new EventHandler(Client_Authenticated);
     client.UpdateReceived    += new EventHandler(Client_UpdateReceived);
     client.ReceivedFileBlock += new EventHandler(Client_ReceivedFileBlock);
     client.ReceivedVersion   += new EventHandler(Client_ReceivedVersion);
     client.Debug             += new TextEventHandler(client_Debug);
 }
        void Client_ReceivedFileBlock(object sender, EventArgs e)
        {
            Srp6ClientSocket client = sender as Srp6ClientSocket;

            // We are receiving the update
            if (client == null)
            {
                return;
            }
            Dispatcher.Invoke((Action)(() =>
            {
                progressBar.Value = client.BytesReceived / (double)client.UpdateFileSize;
            }));
        }
Esempio n. 6
0
        private void Startup()
        {
#if !DEMO
            // Handle an invalid license
            if ((LocalSetting.Values.String["IsAuthorized"] == null) ||
                !LocalSetting.Values.String["IsAuthorized"].Equals("Yes"))
            {
                // Display the Strings.LocalsettingEditor
                if (PromptForConnectionString(false))
                {
                    if (!string.IsNullOrEmpty(LocalSetting.CompanyName) &&
                        !string.IsNullOrEmpty(LocalSetting.ApplicationSerialNumber))
                    {
                        // Check for access to the update server
                        var client = new Srp6ClientSocket(
                            LocalSetting.CompanyName, LocalSetting.ApplicationSerialNumber);
                        client.ConnectFailed += client_ConnectFailed;
                        client.Disconnected  += client_Disconnected;
                        client.Authenticated += client_Authenticated;
                        client.Start();
                        return;
                    }
                }
                BadLicenseShutdown();
            }
            else
#endif
            {
#if !DEMO
                if ((App.StartupArgs.Length == 1) && App.StartupArgs[0].ToLower().Equals(@"/update"))
                {
                    PosDialogWindow window = GeneralSettingsUpdateControl.CreateInDefaultWindow();
                    GeneralSettingsUpdateControl control = window.DockedControl as GeneralSettingsUpdateControl;
                    Hide();
                    window.ShowDialog();
                    UserControlManager.ShowTaskbar(true);
                    Application.Current.Shutdown();
                    return;
                }
#endif
                PosDialogWindow.SetStartupWindow(this);
                BeginStartup();
            }
        }
        void Client_UpdateReceived(object sender, EventArgs e)
        {
            Srp6ClientSocket client = sender as Srp6ClientSocket;

            PrintLine(Strings.UpdateReceived);
        }
Esempio n. 8
0
        private static void ClientStartVersionCheckThread(object clientObject)
        {
            Srp6ClientSocket client = clientObject as Srp6ClientSocket;

            client.BeginVersionCheck();
        }
Esempio n. 9
0
        private static void ClientCrashStartThread(object clientObject)
        {
            Srp6ClientSocket client = clientObject as Srp6ClientSocket;

            client.SendCrashReport();
        }
Esempio n. 10
0
        private static void ClientStartThread(object clientObject)
        {
            Srp6ClientSocket client = clientObject as Srp6ClientSocket;

            client.Start();
        }