コード例 #1
0
ファイル: ConnectModel.cs プロジェクト: Zenfold/Files
 public void SwitchChannel()
 {
     this.StartSwitchChannelTimer();
     this.switchedChannel = "";
     this.currentChannel = "";
     AnimationModel.ConnectAnimateionPause();
     new Thread(new ThreadStart(this.getCurrentChannel)).Start();
 }
コード例 #2
0
        private static void StartBackgroundCheckControlThreadStart()
        {
            int status = 0;

            while (LoopCheckModel.isLinked)
            {
                status = UsbIPUtil.isUsbLinked();
                if (status == 0)
                {
                    LoopCheckModel.isLinked = true;
                }
                else if (status == -1000 || status == -2000)
                {
                    LoopCheckModel.isLinked = false;
                    break;
                }
                Thread.Sleep(5000);
            }
            if (status == -1000)
            {
                if (ChannelUtil.pingRouterConnect())
                {
                    if (UsbIPUtil.isHostLinked())
                    {
                        if (UsbIPUtil.isCableLinked())
                        {
                            status = -1000;
                        }
                        else
                        {
                            status = -3000;
                        }
                    }
                    else
                    {
                        status = -1002;
                    }
                }
                else
                {
                    status = -1001;
                }
            }
            else if (status == -2000)
            {
                UsbIPUtil.RebootService();
                status = -1000;
            }
            AnimationModel.ConnectAnimateionPause();
            LoopCheckModel.ControlInterrupt(status);
        }