Esempio n. 1
0
        protected override void OnInit(QFramework.IUIData uiData)
        {
            mData = uiData as DeviceStatusPanelData ?? new DeviceStatusPanelData();
            Meteors.transform.DOLocalMoveX(-2370, 5f).SetLoops(-1, LoopType.Restart);
            Meteors.transform.DOLocalMoveY(-470, 5f).SetLoops(-1, LoopType.Restart);
            ResquestDeviceStatus(-1);

            BtnConnect.OnClickAsObservable().Subscribe(_ =>
            {
                AudioManager.PlaySound("Button_Audio");
                UIMgr.OpenPanel <BindConfirmBootPanel>(new BindConfirmBootPanelData(), UITransitionType.CIRCLE, this);
            }).AddTo(this);

            BtnBack.OnClickAsObservable().Subscribe(_ =>
            {
                AudioManager.PlaySound("Button_Audio");
                Back();
            }).AddTo(this);
            SimpleEventSystem.GetEvent <UpdateVol>()
            .Subscribe(_ =>
            {
                if (_.Message.IsNotNullAndEmpty())
                {
                    DeviceConnectStatus(true);
                    DeviceVolModel model = SerializeHelper.FromJson <DeviceVolModel>(_.Message);
                    if (model.isUpdate)
                    {
                        SliderDeviceVoice.Slider.value = model.progress;
                        TextProgress.text = string.Format("{0}%", model.progress);
                    }
                    else
                    {
                        UIMgr.OpenPanel <TipPanel>(new TipPanelData()
                        {
                            action                = TipAction.DeviceLostControl,
                            message               = "家庭组内" + model.babyRelation + "正在控制此设备",
                            isHideCancelButton    = true,
                            removeConfirmCallback = true,
                            strConfirm            = "知道了"
                        });
                    }
                }
            }).AddTo(this);
            if (Application.platform == RuntimePlatform.Android)
            {
                AndroidForUnity.CallAndroidForQueryVol();
            }
            else if (Application.platform == RuntimePlatform.IPhonePlayer)
            {
                Dictionary <string, object> param    = new Dictionary <string, object>();
                Dictionary <string, object> subParam = new Dictionary <string, object>();
                param.Add("method", IOSClientUtil.QueryDeviceVolume);
                param.Add("params", subParam);
                Debug.Log("params ========" + subParam);
                IOSClientUtil.CommonMethodCallIOSClient(param.ToJson());
            }
            SliderDeviceVoice.setIOnValueChange(this);
        }
Esempio n. 2
0
 private void FrmServerConnection_Load(object sender, EventArgs e)
 {
     // System.Diagnostics.Debug.WriteLine(KeyData);
     _ServerName            = Properties.Settings.Default.ServerName;
     TxtServerName.Text     = Properties.Settings.Default.ServerName;
     TxtServerUserName.Text = Properties.Settings.Default.ServeUserName;
     TxtPassword.Text       = Properties.Settings.Default.ServerPassword;
     if (!string.IsNullOrEmpty(TxtServerName.Text))
     {
         BtnConnect.PerformClick();
     }
     TxtServerName.Focus();
 }
Esempio n. 3
0
 public MainWindow()
 {
     InitializeComponent();
     BtnConnect.Focus();
 }