当前位置: 首页>>代码示例>>C#>>正文


C# Event.Cancel方法代码示例

本文整理汇总了C#中eDriven.Core.Events.Event.Cancel方法的典型用法代码示例。如果您正苦于以下问题:C# Event.Cancel方法的具体用法?C# Event.Cancel怎么用?C# Event.Cancel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在eDriven.Core.Events.Event的用法示例。


在下文中一共展示了Event.Cancel方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ComponentMouseOutHandler

        private void ComponentMouseOutHandler(Event e)
        {
            Debug.Log(string.Format("ComponentMouseOutHandler [{0}, {1}]", e.Phase, e.CurrentTarget));
            
            if (DragManager.IsDragging)
                return;
            
            e.Cancel();

            DragManager.IsDragging = false;

            DoRenderOverlay = false;
        }
开发者ID:groov0v,项目名称:edriven-gui,代码行数:13,代码来源:Draggable.cs

示例2: IdleMouseOutHandler

        /// <summary>
        /// Fires on mouse out when idle
        /// </summary>
        /// <param name="e"></param>
        private void IdleMouseOutHandler(Event e)
        {
            MouseEvent me = (MouseEvent) e;
            if (_component.Bounds.Contains(_component.GlobalToLocal(me.GlobalPosition)))
                return; // still inside

#if DEBUG
            if (DebugMode)
            {
                Debug.Log("IdleMouseOutHandler");
            }
#endif
            if (DragManager.IsDragging)
                return;

            e.Cancel();

            DoRenderOverlay = false;

            HideCursor();
            StopScanning();

            _previousResizeMode = null;
        }
开发者ID:groov0v,项目名称:edriven-gui,代码行数:28,代码来源:Resizable.cs

示例3: ComponentMouseMoveHandler

        /// <summary>
        /// We should listen the mouse move events over the component
        /// If mouse moved over the event, we should check border and draw overlay
        /// </summary>
        /// <param name="e"></param>
        private void ComponentMouseMoveHandler(Event e)
        {
            if (!Enabled)
                return;

            Debug.Log(string.Format("ComponentMouseMoveHandler [{0}, {1}]", e.Phase, e.CurrentTarget));

            if (!(e.Target is DisplayListMember))
                return;

            DisplayListMember dlm = (DisplayListMember)e.Target;

            MouseEvent me = (MouseEvent)e;

            //Container container = _component as Container;

            //Point coordsInComponentSpace = null != container ? 
            //      container.GlobalToContent(dlm.LocalToGlobal(me.LocalPosition)) : 
            //      _component.GlobalToLocal(dlm.LocalToGlobal(me.LocalPosition));

            Point coordsInComponentSpace = _component.GlobalToLocal(dlm.LocalToGlobal(me.LocalPosition));

            // if some component is already being dragged/resized, do not draw borders on hover
            if (DragManager.IsDragging)
                return;

            if (_constraintMode)
            {
                _constrainedRect = _constraintMetrics.GetConstrainedRectangle(_component.Transform.LocalBounds);
                DoRenderOverlay = _constrainedRect.Contains(coordsInComponentSpace);
            }
            else
            {
                DoRenderOverlay = true;
            }

            if (DoRenderOverlay)
            {
                e.Cancel();
            }
        }
开发者ID:groov0v,项目名称:edriven-gui,代码行数:46,代码来源:Draggable.cs


注:本文中的eDriven.Core.Events.Event.Cancel方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。