Exemplo n.º 1
0
        // --------------------------------------------------
        //        Server's Connection Added / Removed
        // --------------------------------------------------
        private static void Server_ConnectionAdded(object sender, ConnectionAddedEventArgs e)
        {
            //Forward the connection's messages to the message handler
            //>> It is possible to directly add our MessageReceived method to it
            //>> but then it would block the network message receiving thread
            e.Connection.RawMessageReceived += messageHandler.RawMessageReceived;

            //Write some info out
            Console.WriteLine($"Client connected! UniqueID: {e.Connection.RemoteId}, IP Address: {e.Connection.RemoteEndPoint}");
        }
Exemplo n.º 2
0
        // --------------------------------------------------
        //        Client's Connection Added / Removed
        // --------------------------------------------------
        private static void Client_ConnectionAdded(object sender, ConnectionAddedEventArgs e)
        {
            //Forward the connection's messages to the message handler
            //>> It is possible to directly add our MessageReceived method to it
            //>> but then it would block the network message receiving thread
            e.Connection.RawMessageReceived += messageHandler.RawMessageReceived;

            //Write some info out
            Console.WriteLine("Connected to server!");
        }
Exemplo n.º 3
0
        private async void ConnPane_OnConnectionAdded(object sender, ConnectionAddedEventArgs e)
        {
            bool gotPlugins = await GetPlugins(e.AddedConnection.ConnectionString);

            if (!gotPlugins)
            {
                Customizations.IsEnabled = false;
                Solutions.IsEnabled      = false;
                return;
            }

            Customizations.IsEnabled = true;
            Solutions.IsEnabled      = true;
        }
        private async void ConnPane_OnConnectionAdded(object sender, ConnectionAddedEventArgs e)
        {
            bool gotSolutions = await GetSolutions(e.AddedConnection.ConnectionString);

            if (!gotSolutions)
            {
                Customizations.IsEnabled = false;
                Solutions.IsEnabled      = false;
                SetDownloadManagedEnabled(false);
                return;
            }

            Customizations.IsEnabled = true;
            Solutions.IsEnabled      = true;
            SetDownloadManagedEnabled(true);
        }