iSpyApplication.MainForm.ConnectServices C# (CSharp) Method

ConnectServices() private method

private ConnectServices ( bool checkforUpdates = true ) : void
checkforUpdates bool
return void
        internal void ConnectServices(bool checkforUpdates = true)
        {
            if (Conf.ServicesEnabled)
            {
                if (Conf.UseUPNP)
                {
                    NATControl.SetPorts(Conf.ServerPort, Conf.LANPort);
                }

                string[] result =
                    WsWrapper.TestConnection(Conf.WSUsername, Conf.WSPassword, Conf.Loopback);

                if (result.Length > 0 && result[0] == "OK")
                {
                    WsWrapper.Connect();
                    NeedsSync = true;
                    EmailAddress = result[2];
                    MobileNumber = result[4];
                    Conf.Reseller = result[5];

                    Conf.ServicesEnabled = true;
                    Conf.Subscribed = (Convert.ToBoolean(result[1]));

                    Helper.SetTitle(this);

                    if (result[3] == "")
                    {
                        LoopBack = Conf.Loopback;
                        WsWrapper.Connect(Conf.Loopback);
                    }
                    else
                    {
                        LoopBack = false;
                    }
                }
            }
            if (checkforUpdates && Conf.Enable_Update_Check && !SilentStartup)
            {
                UISync.Execute(() => CheckForUpdates(true));
            }
            SilentStartup = false;
        }

Usage Example

Exemplo n.º 1
0
        private void btnCert_Click(object sender, EventArgs e)
        {
            var c   = MainForm.Conf.SSLEnabled;
            var ssl = new SSLConfig();

            ssl.ShowDialog(this);
            ssl.Dispose();
            SetSSLText();
            if (MainForm.Conf.SSLEnabled != c)
            {
                MainClass.ConnectServices(false);
            }
        }
MainForm