Example #1
0
        /// <summary> Initialize the client, and start necessary threads.</summary>
        private void Init()
        {
            login_window       = LoginWindow.getForm(this);
            add_user_window    = AddUserWindow.getForm(this);
            online_user_window = OnlineUserWindow.getForm(this);

            client_ip_addr = GetClientIP();
            server_ip_addr = client_ip_addr; //this needs to be changed if a different computer is used!

            login_window.SetClientIpAddress(client_ip_addr);
            login_window.SetServerAvailability("Server status: Unavailable ");

            SetInitialNetworkStatus();

            NetworkChange.NetworkAvailabilityChanged += new NetworkAvailabilityChangedEventHandler(OnNetworkAvailabilityChanged);

            ClientStart();

            login_window.ShowDialog();
            add_user_window.ShowDialog();
            online_user_window.ShowDialog();

            add_user_window.Visible    = false;
            online_user_window.Visible = false;
        }
 /// <summary>Creates a singleton instance of this class.</summary>
 /// <param name="reference">Reference to the calling client-class.</param>
 /// <returns>Pointer to singleton instance of this class.</returns>
 public static OnlineUserWindow getForm(Client c)
 {
     return(singleton_instance = new OnlineUserWindow(c));
 }