Example #1
0
        private static void EventsOnOnConnect(object sender, EventArgs eventArgs)
        {
            // We need an XID and Password to connect to the server.
            if (String.IsNullOrEmpty(Settings.Password))
            {
                Events.Error(null, ErrorType.MissingPassword, ErrorSeverity.Fatal,
                             "Must have a password in the settings to connect to a server.");
                return;
            }

            if (String.IsNullOrEmpty(Settings.Id))
            {
                Events.Error(null, ErrorType.MissingId, ErrorSeverity.Fatal,
                             "Must set the ID in the settings to connect to a server.");
                return;
            }

            // Set the current state to connecting and start the process.
            State = new ConnectingState();
            State.Execute();
        }
Example #2
0
        private static void EventsOnOnConnect(object sender, EventArgs eventArgs)
        {
            // We need an XID and Password to connect to the server.
            if (String.IsNullOrEmpty(Settings.Password))
            {
                Events.Error(null, ErrorType.MissingPassword, ErrorSeverity.Fatal,
                    "Must have a password in the settings to connect to a server.");
                return;
            }

            if (String.IsNullOrEmpty(Settings.Id))
            {
                Events.Error(null, ErrorType.MissingId, ErrorSeverity.Fatal,
                    "Must set the ID in the settings to connect to a server.");
                return;
            }

            // Set the current state to connecting and start the process.
            State = new ConnectingState();
            State.Execute();
        }