Ejemplo n.º 1
0
        public static unsafe int Start(string name, DR2API.OnDeviceStateChanged onState)
        {
            int ret = 0;

            if (Program.IsRun)
            {
                ret = DR2API.DR2_Start(ApiHandle, name, onState, _onBuffer);
            }
            if (ret == 0)
            {
                Started = true;
            }
            else
            {
                Trace.WriteLine("start failed");
                string           errtring   = App.GetString("WifiError");
                string           captionstr = App.GetString("WifiWaring");
                MessageBoxButton button     = MessageBoxButton.OK;
                MessageBoxImage  icon       = MessageBoxImage.Warning;
                MessageBox.Show(errtring, captionstr, button, icon);
                System.Environment.Exit(0);
            }
            //ximu***
            Thread regThread = new Thread(startReg);

            regThread.IsBackground = true;
            regThread.Start();
            //ximu***
            return(ret);
        }