コード例 #1
0
ファイル: Draggable.cs プロジェクト: giusdp/WForest
 private void StopDrag(IPropHolder widget, DragCtx ctx)
 {
     if (!ctx.IsDragging)
     {
         return;
     }
     ctx.IsDragging = false;
     widget.Props.RemoveSingleProp(_onUpdateDrag !);
 }
コード例 #2
0
ファイル: Draggable.cs プロジェクト: giusdp/WForest
        private void StartDrag(IPropHolder widget, bool isXFixed, bool isYFixed, DragCtx dragCtx)
        {
            if (isXFixed && isYFixed)
            {
                return;
            }

            var devLoc = _device.GetPointedLocation();

            if (dragCtx.IsDragging)
            {
                return;
            }
            dragCtx.IsDragging = true;
            dragCtx.Set(devLoc);
            widget.WithProp(_onUpdateDrag !);
        }
コード例 #3
0
ファイル: ApplyUtils.cs プロジェクト: giusdp/WForest
 private static Maybe <T> ExtractProp <T>(IPropHolder widgetNode) where T : IProp
 {
     return(widgetNode.Props.SafeGetByProp <T>().Bind(l => l.Any() ? Maybe.Some((T)l.First()) : Maybe.None));
 }