コード例 #1
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));
            }
        }
コード例 #2
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;
        }
コード例 #3
0
        private async void b_connect_Click(object sender, RoutedEventArgs e)
        {
            TClientProfile selected = (TClientProfile)l_profiles.SelectedItem;

            b_connect.IsEnabled = false;

            await client.CancelScanningAsync();

            if (selected.State == ConnectionState.Disconnected)
            {
                await client.ConnectAsync(selected.LastIPAddress);
            }
            appbar.IsOpen       = false;
            b_connect.IsEnabled = true;
        }