示例#1
0
        private void PairDeviceToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (adWindow != null)
            {
                return;
            }
            adWindow = new AvailableDevicesWindow();
            var thread = new Thread(new ParameterizedThreadStart(param => { adWindow.ShowDialog(); }));

            thread.SetApartmentState(ApartmentState.STA);
            adWindow.FormClosing += AdWindow_FormClosing;
            thread.Start();
        }
示例#2
0
 private void AdWindow_FormClosing(object sender, FormClosingEventArgs e)
 {
     adWindow = null;
 }