hMailServer.Administrator.formConnect.Connect C# (CSharp) Method

Connect() private method

private Connect ( Server server ) : bool
server Server
return bool
        private bool Connect(Server server)
        {
            try
             {
            application = APICreator.Create(server.hostName);

            if (application == null)
               return false;

            if (application.Database.RequiresUpgrade)
            {
               string message = string.Format("Your database is not up to date and needs to be upgraded." + Environment.NewLine +
                                              "Please run DBUpdater.exe to update the datatabase." + Environment.NewLine +
                                              Environment.NewLine +
                                              "Current database version: {0}" + Environment.NewLine +
                                              "Required database version: {1}",
                                              application.Database.CurrentVersion,
                                              application.Database.RequiredVersion);

               MessageBox.Show(message, EnumStrings.hMailServerAdministrator, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
               return false;
            }

            if (APICreator.Authenticate(application, server))
            {
               DialogResult = DialogResult.OK;
               _serverName = server.hostName;

               return true;
            }

            return false;
             }
             catch (Exception ex)
             {
            MessageBox.Show(ex.Message, EnumStrings.hMailServerAdministrator, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            return false;
             }
        }

Same methods

formConnect::Connect ( ) : void