コード例 #1
0
        /// <summary>
        /// 警员信息内容解析
        /// </summary>
        /// <param name="value"></param>
        private void AnalyzePoliceInfos(string value, MsgType msgType)
        {
            App.Current.Dispatcher.Invoke(new Action(() =>
            {
                FingerInfos policeInfos = XmlUnityConvert.XmlDeserialize <FingerInfos>(value);

                policeInfos = FilterFingerInfoByUserType(policeInfos);

                ResultWindow resultWindow = CheckResultMsg(msgType);
                if (resultWindow == null)
                {
                    return;
                }

                if (policeInfos.ResultCode == 0)
                {
                    resultWindow.SuccessCloseWindow();

                    FingerViewModel.PageIndex  = policeInfos.PageIndex;
                    FingerViewModel.IsMoreData = policeInfos.UserInfoList.Count == AppConfigInfos.AppStateInfos.SearchPageCount;
                    if (policeInfos.PageIndex == 1)
                    {
                        FingerViewModel.SearchPoliceInfos(policeInfos.UserInfoList);
                    }
                    else
                    {
                        FingerViewModel.AddPoliceInfos(policeInfos.UserInfoList);
                    }
                }
                else
                {
                    resultWindow.FailedCloseWindow(policeInfos);
                }
            }));
        }
コード例 #2
0
        void EmitFingerEvents(FingerModel finger, FingerViewModel viewModel, bool wasPinching)
        {
            // Pinch events
            if (finger.isPinching != wasPinching)
            {
                if (finger.isPinching)
                {
                    viewModel.onPinch.Invoke();
                }
                else
                {
                    viewModel.onUnpinch.Invoke();
                }
            }

            // Pinch intention events
            if (finger.pinchIntentionLerp == 1.0f && !finger.isIntentionallyPinching)
            {
                finger.isIntentionallyPinching = true;
                viewModel.onLongPinch.Invoke();
            }
            else if (finger.pinchIntentionLerp == 0.0f && finger.isIntentionallyPinching)
            {
                finger.isIntentionallyPinching = false;
                viewModel.onLongUnpinch.Invoke();
            }
        }
コード例 #3
0
 public void UpdateEvents(FingerViewModel finger)
 {
     onPinchLerpUpdate.Invoke(finger.pinchLerp);
     onPinchSpeedUpdate.Invoke(finger.pinchSpeed);
     onBaseRotationUpdate.Invoke(finger.baseRotationLerp);
     onFlexUpdate.Invoke(finger.flexLerp);
     onStrengthUpdate.Invoke(finger.strengthLerp);
     onPalmLineUpdate.Invoke(finger.palmLineLerp);
 }
コード例 #4
0
 /// <summary>
 /// 采集指纹保存
 /// </summary>
 /// <param name="value"></param>
 /// <param name="msgType"></param>
 private void AnalyzeSaveFingerPrint(string value, MsgType msgType)
 {
     App.Current.Dispatcher.Invoke(new Action(() =>
     {
         FingerResult fingerResult = XmlUnityConvert.XmlDeserialize <FingerResult>(value);
         ResultWindow resultWindow = CheckResultMsg(msgType);
         if (resultWindow == null)
         {
             return;
         }
         if (fingerResult.ResultCode == 0)
         {
             resultWindow.SuccessCloseWindow();
             FingerViewModel.AddFingerPrintByUser(fingerResult);
         }
         else
         {
             resultWindow.FailedCloseWindow(fingerResult);
         }
     }));
 }