예제 #1
0
        private void b_disconnect_Click(object sender, RoutedEventArgs e)
        {
            TClientProfile selected = (TClientProfile)l_profiles.SelectedItem;

            if (selected.State == ConnectionState.Connected ||
                selected.State == ConnectionState.LackOfResponse)
            {
                client.Close(selected);
            }
            appbar.IsOpen = false;
        }
예제 #2
0
        public void Disconnect()
        {
            TClient.Client.Disconnect(false); // Disconnect the client
            TClient.Close();                  // Close the client

            Stream = null;                    // Remove the stream

            PacketThread.Abort();             // Abort the packet update thread

            Variables.MainForm.IsClientConnected = false;
        }
예제 #3
0
        private void l_profiles_ItemClick(object sender, ItemClickEventArgs e)
        {
            TClientProfile profile = (TClientProfile)e.ClickedItem;

            if (profile.State == ConnectionState.Disconnected)
            {
                Task.Run(() => client.ConnectAsync(profile.LastIPAddress));
            }
            else
            {
                client.Close(profile);
            }
        }