public void TestOutput(string msg) { OView view = this.GetView("Base/Output"); view.SetData("message", msg); view.Display(); }
/// <summary> /// 检查接口返回信息 /// </summary> /// <param name="autoProc">是否自动跳转到登录页面</param> /// <returns></returns> public bool CheckApiResponse(ApiResponse apiRes, bool autoProc) { if (!apiRes.ApiSucc) { if (autoProc) { if (apiRes.ResStatus == ApiResStatus.SESSION_KEY_INVALID) { GotoLogin(); return(false); } OView view = this.GetView("Base/Page500"); view.SetData("title", "系统运行错误"); view.SetData("message", apiRes.ApiMessage); view.Display(); } return(false); } if (!apiRes.ActSucc) { return(false); } return(true); }
public override void AddContent(OView skiaView) { skiaView.Y = Height / 2; skiaView.X = Width / 2; base.AddContent(skiaView); }
public void HandleUp(IList <OView> tappables, Point p) { var tappedView = DetectInteractedViews(tappables, p); if (tappedView != null && tappedView.IsEnabled) { tappedView.InvokeUp(); } _downTappable = null; if (_downPannable != null) { _downPannable.InvokeUp(); _downPannable = null; } }
public void HandleDown(IList <OView> tappables, IList <OView> pannables, Point p) { _previousPan = p; var tappedView = DetectInteractedViews(tappables, p); if (tappedView != null && tappedView.IsEnabled) { _downTappable = tappedView; tappedView.InvokeDown(); } tappedView = DetectInteractedViews(pannables, p); if (tappedView != null && tappedView.IsEnabled) { _downPannable = tappedView; tappedView.InvokeDown(); } }
public void HandlePan(Point p) { X = p.X; Y = p.Y; if (_downPannable != null) { var delta = new Point(p.X - _previousPan.X, p.Y - _previousPan.Y); _previousPan = p; if (_downPannable.HitTheBox(p)) { _downPannable.InvokePan(delta); } else { _downPannable.InvokeDragOut(); _downPannable = null; } } }
public override void Attach(OView oView) { var viewInitialX = oView.X - _xToastRatio * oView.X; var viewInitialY = oView.Y - _yToastRatio * oView.Y; var viewInitialOpacity = oView.Opacity - _opacityToastRatio * oView.Opacity; var viewTargetX = oView.X; var viewTargetY = oView.Y; var viewTargetOpacity = oView.Opacity; _initialX = viewInitialX - viewTargetX; _initialY = viewInitialY - viewTargetY; _initialOpacity = viewInitialOpacity - viewTargetOpacity; _previousAnimatedOpacity = _initialOpacity; _previousAnimatedX = _initialX; _previousAnimatedY = _initialY; oView.X += _initialX; oView.Y += _initialY; oView.Opacity += _initialOpacity; this.Animate("toastY", p => _animatedY = (float)p, _initialY, 0, 4, _positionToastMs, Easing.CubicOut); this.Animate("toastX", p => _animatedX = (float)p, _initialX, 0, 4, _positionToastMs, Easing.CubicOut); this.Animate("toastOpacity", p => _animatedOpacity = (float)p, _initialOpacity, 0, 4, _opacityToastMs, Easing.CubicOut); Task.Run(() => { Task.Delay((int)Math.Max(_opacityToastMs, _positionToastMs)).Wait(); Dispose(); }); base.Attach(oView); }
public virtual void Detach() { View = null; }
public virtual void Attach(OView oView) { View = oView; }
public void AttachCameraTo(OView view, float steeringRatio = 0.1f) { _steeringRatio = steeringRatio; _attachedView = view; }
public virtual void RemoveContentContent(OView skiaView) { RemoveChild(skiaView); }
public virtual void AddContent(OView skiaView) { AddChild(skiaView); }
public void Dispose() { _downTappable = null; _downPannable = null; }
public void AddContent(OView skiaView) { _container.AddContent(skiaView); }