Inheritance: MonoBehaviour
Exemplo n.º 1
0
        public FileViewerInternal()
        {
            InitializeComponent();
            InitializeComplete();

            _currentViewPositionCache = new CurrentViewPositionCache(this);

            TextEditor.TextChanged += (s, e) => TextChanged?.Invoke(s, e);
            TextEditor.ActiveTextAreaControl.VScrollBar.ValueChanged += (s, e) => ScrollPosChanged?.Invoke(s, e);
            TextEditor.ActiveTextAreaControl.TextArea.KeyUp          += (s, e) => KeyUp?.Invoke(s, e);
            TextEditor.ActiveTextAreaControl.TextArea.DoubleClick    += (s, e) => DoubleClick?.Invoke(s, e);
            TextEditor.ActiveTextAreaControl.TextArea.MouseMove      += (s, e) => MouseMove?.Invoke(s, e);
            TextEditor.ActiveTextAreaControl.TextArea.MouseEnter     += (s, e) => MouseEnter?.Invoke(s, e);
            TextEditor.ActiveTextAreaControl.TextArea.MouseLeave     += (s, e) => MouseLeave?.Invoke(s, e);
            TextEditor.ActiveTextAreaControl.TextArea.MouseDown      += (s, e) =>
            {
                SelectedLineChanged?.Invoke(
                    this,
                    new SelectedLineEventArgs(
                        TextEditor.ActiveTextAreaControl.TextArea.TextView.GetLogicalLine(e.Y)));
            };

            HighlightingManager.Manager.DefaultHighlighting.SetColorFor("LineNumbers", new HighlightColor(Color.FromArgb(80, 0, 0, 0), Color.White, false, false));
            TextEditor.ActiveTextAreaControl.TextEditorProperties.EnableFolding = false;

            _lineNumbersControl = new DiffViewerLineNumberControl(TextEditor.ActiveTextAreaControl.TextArea);

            VRulerPosition = AppSettings.DiffVerticalRulerPosition;
        }
Exemplo n.º 2
0
 private void Base_DoubleClick(object sender, EventArgs e)
 {
     if (canClick)
     {
         DoubleClick?.Invoke(this, e);
     }
 }
Exemplo n.º 3
0
 public void HandleDoubleClick(Point clickPosition, Point pan)
 {
     if (Rect.Contains(clickPosition - pan))
     {
         DoubleClick?.Invoke(this, new EventArgs());
     }
 }
Exemplo n.º 4
0
 public void FireDoubleClick(Position pos)
 {
     DoubleClick?.Invoke(this, new EventMapClickedEvent
     {
         Position = pos
     });
 }
Exemplo n.º 5
0
        public void CreateDeal(string dealName, string dealAlias, string currency)
        {
            Wait.For(this.GetWindow <MainWindow>(), window =>
            {
                window.Maximize();

                Click.On(window.MenuButtonPane.Actions);
                DoubleClick.On(window.MenuButtonTreePane.FindTreeItem("Deal"));
            });

            Wait.For(this.GetWindow <DealSelectWindow>(), window =>
            {
                Click.On(window.NewRadioButton);
                Enter.TextInto(window.NameTextBox, StringHelpers.GenerateNameWithSuffix(dealName));
                Enter.TextInto(window.AliasTextBox, StringHelpers.GenerateNameWithSuffix(dealAlias));
                Select.By(window.CurrencyComboBox, currency);
                Select.By(window.DepartmentComboBox, 0);
                Click.On(window.OkButton);

                Wait.For(this.GetWindow <WarningWindow>(), dialog =>
                {
                    Click.On(dialog.YesButton);
                });
            }, WaitToFinish.YES);
        }
        public void SelectAction(string actionItem)
        {
            var mainWindow = Container.GetInstance <WindowFactory <MainWindow> >().Context;

            Click.On(mainWindow.MenuButtonPane.Actions);
            DoubleClick.On(mainWindow.MenuButtonTreePane.FindTreeItem(actionItem));
        }
Exemplo n.º 7
0
 public void HandleDoubleClick(Point clickPosition, Point pan, float scale = 1)
 {
     if (Rect.Contains(new Point((clickPosition - pan) * (1 / scale))))
     {
         DoubleClick?.Invoke(this, new EventArgs());
     }
 }
Exemplo n.º 8
0
        protected override void Execute(CodeActivityContext context)
        {
            var el = Element.Get(context);

            if (el == null)
            {
                throw new ArgumentException("element cannot be null");
            }
            var doubleclick = false;

            if (DoubleClick != null)
            {
                doubleclick = DoubleClick.Get(context);
            }
            var button       = Button.Get(context);
            var virtualClick = false;

            if (VirtualClick != null)
            {
                virtualClick = VirtualClick.Get(context);
            }
            var _button = (Input.MouseButton)button;

            el.Click(virtualClick, _button, OffsetX, OffsetY, doubleclick);
        }
Exemplo n.º 9
0
        public OutlinePanel()
        {
            View = new OutlineView();
            EnclosingScrollView = new ScrollContainerView(View);

            View.SelectionNodeChanged += (s, e) =>
            {
                if (View.SelectedNode is WidgetNodeView nodeView)
                {
                    RaiseFirstResponder?.Invoke(this, nodeView.Wrapper);
                }
            };

            View.KeyPress += (sender, e) =>
            {
                if (e == DeleteKey)
                {
                    if (View.SelectedNode is WidgetNodeView nodeView)
                    {
                        RaiseDeleteItem?.Invoke(this, nodeView.Wrapper);
                    }
                }
            };

            View.DoubleClick += (sender, e) =>
            {
                DoubleClick?.Invoke(this, (View.SelectedNode as WidgetNodeView)?.Wrapper);
            };

            View.StartDrag += (sender, e) =>
            {
                StartDrag?.Invoke(this, (e as WidgetNodeView)?.Wrapper);
            };
        }
Exemplo n.º 10
0
        protected override void Execute(CodeActivityContext context)
        {
            var el = Element.Get(context);

            if (el == null)
            {
                throw new ArgumentException("element cannot be null");
            }
            var doubleClick = false;

            if (DoubleClick != null)
            {
                doubleClick = DoubleClick.Get(context);
            }
            TimeSpan timeout = TimeSpan.FromSeconds(0);
            //if (Timeout != null) timeout = Timeout.Get(context);
            var button = Button.Get(context);

            var virtualClick = false;

            if (VirtualClick != null)
            {
                virtualClick = VirtualClick.Get(context);
            }
            // if (button != (int)Input.MouseButton.Left) { VirtualClick = false; }

            //var flabuttun = (FlaUI.Core.Input.MouseButton)Enum.Parse(typeof(FlaUI.Core.Input.MouseButton), button.ToString(), true);
            //el.Click(AnimateMouse.Get(context), flabuttun, doubleClick, OffsetX, OffsetY, timeout, virtualClick);
            var _button = (Input.MouseButton)button;

            el.Click(virtualClick, _button, OffsetX, OffsetY);
        }
Exemplo n.º 11
0
        /// <summary>
        /// Handles most events of the control
        /// </summary>
        /// <param name="eventName">Type of event to raise</param>
        /// <remarks></remarks>
        public void DoEvent(LightweightEvents eventName)
        {
            switch (eventName)
            {
            case LightweightEvents.Click:
                DoClick();
                break;

            case LightweightEvents.MouseDown:
                if (canClick)
                {
                    isPressed = true;
                    Redraw();
                }
                MouseDown?.Invoke(this, new MouseEventArgs(MouseButtons.Left, 1, 0, 0, 0));

                break;

            case LightweightEvents.MouseUp:
                if (canClick)
                {
                    isPressed = false;
                    Redraw();
                }
                MouseUp?.Invoke(this, new MouseEventArgs(MouseButtons.Left, 1, 0, 0, 0));

                break;

            case LightweightEvents.MouseEnter:
                Scrolling = true;
                MouseEnter?.Invoke(this, new EventArgs());

                break;

            case LightweightEvents.MouseLeave:
                Scrolling = false;
                MouseLeave?.Invoke(this, new EventArgs());

                break;

            case LightweightEvents.Update:
                Update?.Invoke(this, null);

                break;

            case LightweightEvents.DoubleClick:
                DoubleClick?.Invoke(this, new EventArgs());

                break;

            case LightweightEvents.MouseMove:
                MouseMove?.Invoke(this, new MouseEventArgs(MouseButtons.Left, 1, 0, 0, 0));

                break;

            default:
                throw new NotImplementedException("The requested event for this control does not exist");
            }
        }
Exemplo n.º 12
0
 public bool PropagateDoubleClick(Point mousePosition)
 {
     if (Visibility == Visibility.Hidden)
     {
         return(false);
     }
     if (mousePosition.X >= AbsolutePosition.X && mousePosition.X <= AbsolutePosition.X + Width &&
         mousePosition.Y >= AbsolutePosition.Y && mousePosition.Y <= AbsolutePosition.Y + Height)
     {
         if (Children.Count > 0)
         {
             bool ret = false;
             for (int i = Children.Count - 1; i >= 0; i--)
             {
                 LogicalNode child = Children[i];
                 if (child.PropagateDoubleClick(mousePosition))
                 {
                     ret = true;
                 }
                 if (ret)
                 {
                     break;
                 }
             }
             if (ret == false)
             {
                 DoubleClick?.Invoke(this, null);
                 foreach (MenuEvent ev in events.Values)
                 {
                     if (ev.EventType == MenuEvent.Type.DoubleClick)
                     {
                         ev.Trigger(this);
                     }
                 }
                 return(true);
             }
             else
             {
                 return(ret);
             }
         }
         else
         {
             DoubleClick?.Invoke(this, null);
             foreach (MenuEvent ev in events.Values)
             {
                 if (ev.EventType == MenuEvent.Type.DoubleClick)
                 {
                     ev.Trigger(this);
                 }
             }
             return(true);
         }
     }
     else
     {
         return(false);
     }
 }
Exemplo n.º 13
0
        protected override void Execute(CodeActivityContext context)
        {
            var el = Element.Get(context);

            if (el == null)
            {
                throw new ArgumentException("element cannot be null");
            }
            var doubleclick = false;

            if (DoubleClick != null)
            {
                doubleclick = DoubleClick.Get(context);
            }
            var button       = Button.Get(context);
            var virtualClick = false;

            if (VirtualClick != null)
            {
                virtualClick = VirtualClick.Get(context);
            }
            var animatemouse = false;

            if (AnimateMouse != null)
            {
                animatemouse = AnimateMouse.Get(context);
            }
            var keymodifiers = "";

            if (KeyModifiers != null)
            {
                keymodifiers = KeyModifiers.Get(context);
            }

            var disposes = new List <IDisposable>();
            var keys     = TypeText.GetKeys(keymodifiers);

            foreach (var vk in keys)
            {
                disposes.Add(FlaUI.Core.Input.Keyboard.Pressing(vk));
            }

            var _button = (Input.MouseButton)button;

            el.Click(virtualClick, _button, OffsetX, OffsetY, doubleclick, animatemouse);

            disposes.ForEach(x => { x.Dispose(); });

            TimeSpan postwait = TimeSpan.Zero;

            if (PostWait != null)
            {
                postwait = PostWait.Get(context);
            }
            if (postwait != TimeSpan.Zero)
            {
                System.Threading.Thread.Sleep(postwait);
            }
        }
Exemplo n.º 14
0
 protected virtual void OnDoubleClick(ButtonHandlerEventArgs e)
 {
     if (!_initialized)
     {
         throw new InvalidOperationException($"Not initialized {_pin}");
     }
     DoubleClick?.Invoke(this, e);
 }
Exemplo n.º 15
0
        protected void HandleMouseDown(IMouse mouse, MouseButton button)
        {
            MouseDown?.Invoke(mouse, button);

            if (_firstClick || (_firstClickButton != null && _firstClickButton != button))
            {
                // This is the first click with the given mouse button.
                _firstClickTime = null;

                if (!_firstClick && !(_firstClickButton is null))
                {
                    // Only the mouse buttons differ so treat last click as a single click.
                    Click?.Invoke(mouse, _firstClickButton.Value, Position);
                }

                ProcessFirstClick(button);
            }
            else
            {
                // This is the second click with the same mouse button.
                if (_firstClickTime != null &&
                    (DateTime.Now - _firstClickTime.Value).TotalMilliseconds <= DoubleClickTime)
                {
                    // Within the maximum double click time.
                    _firstClickTime = null;

                    var position = Position;
                    if (Math.Abs(position.X - _firstClickPosition.X) < DoubleClickRange &&
                        Math.Abs(position.Y - _firstClickPosition.Y) < DoubleClickRange)
                    {
                        // Second click was in time and in range -> double click.
                        _firstClick = true;
                        DoubleClick?.Invoke(mouse, button, position);
                    }
                    else
                    {
                        // Second click was in time but outside range -> single click.
                        // The second click is another "first click".
                        Click?.Invoke(mouse, button, position);
                        ProcessFirstClick(button);
                    }
                }
                else
                {
                    // The double click time elapsed.

                    // If Update() would have detected the time elapse before,
                    // it would have set _firstClick back to true and we won't be here.
                    // Therefore Update() has not detected time elapse here and we have
                    // to handle it.
                    HandleDoubleClickTimeElapse();

                    // Now process the second click as another "first click".
                    ProcessFirstClick(button);
                }
            }
        }
Exemplo n.º 16
0
 public void OnPointerClick(PointerEventData eventData)
 {
     FirstClick?.Invoke(this, null);
     if (eventData.clickCount == 2 ||
         (Input.touchCount > 0 && Input.GetTouch(0).tapCount == 2))
     {
         DoubleClick?.Invoke(this, null);
     }
 }
Exemplo n.º 17
0
        public static void MaximizeWindow(this Window window)
        {
            if (window.Patterns.Window.Pattern.CanMaximize.Value && window.Patterns.Window.Pattern.WindowVisualState.Value != WindowVisualState.Maximized)
            {
                DoubleClick.On(window.TitleBar);

                var logger = InjectionHelper.GetInstance <DesktopLogger>();
                logger.Write(window, "has been maximized");
            }
        }
Exemplo n.º 18
0
		void DoubleClicked(jQueryMouseEvent evt) {
			var tr = new jQuery(evt.Target).Closest("tr");
			if(tr.Length == 0)
				return;
			var idx = (int) tr.Data("row-id");
			if(!rowBindings.ContainsKey(idx))
				return;
			var obj = rowBindings[idx];
			DoubleClick?.Invoke(this, obj);
		}
Exemplo n.º 19
0
        private void MouseButtonDownHandler(object sender, MouseButtonEventArgs e)
        {
            if (e.ClickCount == 2)
            {
                LabelDoubleClickArgs eventArgs = new LabelDoubleClickArgs();
                eventArgs.Page = TaskPage;

                DoubleClick?.Invoke(sender, eventArgs);
            }
        }
Exemplo n.º 20
0
        private IntPtr HookFunc(int nCode, IntPtr wParam, IntPtr lParam)
        {
            // Parse system messages
            if (nCode >= 0)
            {
                if (MouseMessages.WM_LBUTTONDOWN == (MouseMessages)wParam)
                {
                    LeftButtonDown?.Invoke(
                        (MSLLHOOKSTRUCT)Marshal.PtrToStructure(lParam, typeof(MSLLHOOKSTRUCT)));
                }
                if (MouseMessages.WM_LBUTTONUP == (MouseMessages)wParam)
                {
                    LeftButtonUp?.Invoke(
                        (MSLLHOOKSTRUCT)Marshal.PtrToStructure(lParam, typeof(MSLLHOOKSTRUCT)));
                }
                if (MouseMessages.WM_RBUTTONDOWN == (MouseMessages)wParam)
                {
                    RightButtonDown?.Invoke(
                        (MSLLHOOKSTRUCT)Marshal.PtrToStructure(lParam, typeof(MSLLHOOKSTRUCT)));
                }
                if (MouseMessages.WM_RBUTTONUP == (MouseMessages)wParam)
                {
                    RightButtonUp?.Invoke(
                        (MSLLHOOKSTRUCT)Marshal.PtrToStructure(lParam, typeof(MSLLHOOKSTRUCT)));
                }
                if (MouseMessages.WM_MOUSEMOVE == (MouseMessages)wParam)
                {
                    MouseMove?.Invoke(
                        (MSLLHOOKSTRUCT)Marshal.PtrToStructure(lParam, typeof(MSLLHOOKSTRUCT)));
                }
                if (MouseMessages.WM_MOUSEWHEEL == (MouseMessages)wParam)
                {
                    MouseWheel?.Invoke(
                        (MSLLHOOKSTRUCT)Marshal.PtrToStructure(lParam, typeof(MSLLHOOKSTRUCT)));
                }
                if (MouseMessages.WM_LBUTTONDBLCLK == (MouseMessages)wParam)
                {
                    DoubleClick?.Invoke(
                        (MSLLHOOKSTRUCT)Marshal.PtrToStructure(lParam, typeof(MSLLHOOKSTRUCT)));
                }
                if (MouseMessages.WM_MBUTTONDOWN == (MouseMessages)wParam)
                {
                    MiddleButtonDown?.Invoke(
                        (MSLLHOOKSTRUCT)Marshal.PtrToStructure(lParam, typeof(MSLLHOOKSTRUCT)));
                }
                if (MouseMessages.WM_MBUTTONUP == (MouseMessages)wParam)
                {
                    MiddleButtonUp?.Invoke(
                        (MSLLHOOKSTRUCT)Marshal.PtrToStructure(lParam, typeof(MSLLHOOKSTRUCT)));
                }
            }

            return(CallNextHookEx(_hookId, nCode, wParam, lParam));
        }
Exemplo n.º 21
0
 private void EventsSubscribe()
 {
     foreach (var item in _inventorySlots)
     {
         item.FirstClick  += (obj, e) => SetActiveSlot((InventorySlot)obj);
         item.DoubleClick += (obj, e) => DoubleClick?.Invoke(obj, e);
         item.DragStarted += (obj, e) => DragStarted((InventorySlot)obj, e);
         item.Drag        += (obj, e) => Drag((InventorySlot)obj, e);
         item.DragEnded   += (obj, e) => OnDragEnded((InventorySlot)obj, e);
     }
 }
Exemplo n.º 22
0
            private void ProcessMouseDown(MouseButtons button, bool doubleClick)
            {
                if (doubleClick)
                {
                    DoubleClick?.Invoke(this, new MouseEventArgs(button, 2, 0, 0, 0));
                    MouseDoubleClick?.Invoke(this, new MouseEventArgs(button, 2, 0, 0, 0));

                    _doubleClickDown = true;
                }

                MouseDown?.Invoke(this, new MouseEventArgs(button, doubleClick ? 2 : 1, 0, 0, 0));
            }
Exemplo n.º 23
0
        /// <summary>
        /// Raise event to go forward.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void DragTime(object sender, EventArgs e)
        {
            // Stop the timer
            ((DispatcherTimer)sender).Stop();

            if (!this.CursorIsOver() || Collection.level == Constants.Level.Episode)
            {
                return;
            }

            DoubleClick?.Invoke(this.Index, e);
        }
Exemplo n.º 24
0
        private void MainGrid_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            Selected?.Invoke();

            IsSelected          = true;
            mainGrid.Background = new SolidColorBrush(Color.FromRgb(216, 237, 255));

            if (e.ClickCount == 2)
            {
                DoubleClick?.Invoke();
            }
        }
Exemplo n.º 25
0
        protected override int HookCallbackProcedure(int nCode, int wParam, IntPtr lParam)
        {
            if (nCode > -1 && (MouseDown != null || MouseUp != null || MouseMove != null))
            {
                MouseLLHookStruct mouseHookStruct =
                    (MouseLLHookStruct)Marshal.PtrToStructure(lParam, typeof(MouseLLHookStruct));

                MouseButtons   button    = GetButton(wParam);
                MouseEventType eventType = GetEventType(wParam);

                MouseEventArgs e = new MouseEventArgs(
                    button,
                    (eventType == MouseEventType.DoubleClick ? 2 : 1),
                    mouseHookStruct.pt.x,
                    mouseHookStruct.pt.y,
                    (eventType == MouseEventType.MouseWheel ? (short)((mouseHookStruct.mouseData >> 16) & 0xffff) : 0));

                // Prevent multiple Right Click events (this probably happens for popup menus)
                if (button == MouseButtons.Right && mouseHookStruct.flags != 0)
                {
                    eventType = MouseEventType.None;
                }

                switch (eventType)
                {
                case MouseEventType.MouseDown:
                    MouseDown?.Invoke(this, e);
                    break;

                case MouseEventType.MouseUp:
                    Click?.Invoke(this, new EventArgs());
                    MouseUp?.Invoke(this, e);
                    break;

                case MouseEventType.DoubleClick:
                    DoubleClick?.Invoke(this, new EventArgs());
                    break;

                case MouseEventType.MouseWheel:
                    MouseWheel?.Invoke(this, e);
                    break;

                case MouseEventType.MouseMove:
                    MouseMove?.Invoke(this, e);
                    break;

                default:
                    break;
                }
            }
            return(CallNextHookEx(_handleToHook, nCode, wParam, lParam));
        }
Exemplo n.º 26
0
        private IEnumerator WaitAndInvoke(int clickCount)
        {
            yield return(new WaitForSeconds(0.2f));

            if (clickCount == 1)
            {
                SingleClick?.Invoke();
            }
            else if (clickCount == 2)
            {
                DoubleClick?.Invoke();
            }
            LastClick?.Invoke(clickCount);
        }
Exemplo n.º 27
0
        /*
         * ============================================
         * Event
         * ============================================
         */

        #region Event

        /// <summary>
        /// Double click on the tile.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Tile_DoubleClick(object sender, MouseButtonEventArgs e)
        {
            // Don't do forward when holding the control key
            if (Keyboard.IsKeyDown(Key.LeftCtrl))
            {
                return;
            }

            // The event is itercepeted in MainWindow, giving the order to the TileList to go to the next level
            if (e.ChangedButton == MouseButton.Left)
            {
                DoubleClick?.Invoke(this.Index, e);
            }
        }
Exemplo n.º 28
0
        public FileViewerInternal()
        {
            InitializeComponent();
            InitializeComplete();

            Disposed += (sender, e) =>
            {
                //// _diffHighlightService not disposable
                //// _lineNumbersControl not disposable
                //// _currentViewPositionCache not disposable
                _findAndReplaceForm.Dispose();
            };

            _currentViewPositionCache = new CurrentViewPositionCache(this);
            TextEditor.ActiveTextAreaControl.TextArea.SelectionManager.SelectionChanged += SelectionManagerSelectionChanged;

            TextEditor.ActiveTextAreaControl.TextArea.PreviewKeyDown += (s, e) =>
            {
                if (e.KeyCode == Keys.Escape && !TextEditor.ActiveTextAreaControl.SelectionManager.HasSomethingSelected)
                {
                    EscapePressed?.Invoke();
                }
            };

            TextEditor.TextChanged += (s, e) => TextChanged?.Invoke(s, e);
            TextEditor.ActiveTextAreaControl.HScrollBar.ValueChanged += (s, e) => OnHScrollPositionChanged(EventArgs.Empty);
            TextEditor.ActiveTextAreaControl.VScrollBar.ValueChanged += (s, e) => OnVScrollPositionChanged(EventArgs.Empty);
            TextEditor.ActiveTextAreaControl.TextArea.KeyUp          += (s, e) => KeyUp?.Invoke(s, e);
            TextEditor.ActiveTextAreaControl.TextArea.DoubleClick    += (s, e) => DoubleClick?.Invoke(s, e);
            TextEditor.ActiveTextAreaControl.TextArea.MouseMove      += (s, e) => MouseMove?.Invoke(s, e);
            TextEditor.ActiveTextAreaControl.TextArea.MouseEnter     += (s, e) => MouseEnter?.Invoke(s, e);
            TextEditor.ActiveTextAreaControl.TextArea.MouseLeave     += (s, e) => MouseLeave?.Invoke(s, e);
            TextEditor.ActiveTextAreaControl.TextArea.MouseDown      += (s, e) =>
            {
                SelectedLineChanged?.Invoke(
                    this,
                    new SelectedLineEventArgs(
                        TextEditor.ActiveTextAreaControl.TextArea.TextView.GetLogicalLine(e.Y)));
            };
            TextEditor.ActiveTextAreaControl.TextArea.MouseWheel += TextArea_MouseWheel;

            HighlightingManager.Manager.DefaultHighlighting.SetColorFor("LineNumbers",
                                                                        new HighlightColor(SystemColors.ControlText, SystemColors.Control, false, false));
            TextEditor.ActiveTextAreaControl.TextEditorProperties.EnableFolding = false;

            _lineNumbersControl = new DiffViewerLineNumberControl(TextEditor.ActiveTextAreaControl.TextArea);

            VRulerPosition = AppSettings.DiffVerticalRulerPosition;
        }
Exemplo n.º 29
0
        /// <summary>
        ///     Callback function
        /// </summary>
        private IntPtr HookFunc(int nCode, IntPtr wParam, IntPtr lParam)
        {
            // parse system messages
            if (nCode < 0)
            {
                return(NativeMethods.CallNextHookEx(HookId, nCode, wParam, lParam));
            }
            // ReSharper disable once SwitchStatementMissingSomeCases
            switch ((MouseFlags)wParam)
            {
            case MouseFlags.LeftDown:
                LeftButtonDown?.Invoke((MouseInput)Marshal.PtrToStructure(lParam, typeof(MouseInput)));
                break;

            case MouseFlags.LeftUp:
                LeftButtonUp?.Invoke(MouseInputToStructure(lParam));
                break;

            case MouseFlags.RightDown:
                RightButtonDown?.Invoke(MouseInputToStructure(lParam));
                break;

            case MouseFlags.RightUp:
                RightButtonUp?.Invoke(MouseInputToStructure(lParam));
                break;

            case MouseFlags.Move:
                MouseMove?.Invoke(MouseInputToStructure(lParam));
                break;

            case MouseFlags.Wheel:
                MouseWheel?.Invoke(MouseInputToStructure(lParam));
                break;

            case MouseFlags.DoubleLeftClick:
                DoubleClick?.Invoke(MouseInputToStructure(lParam));
                break;

            case MouseFlags.MiddleDown:
                MiddleButtonDown?.Invoke(MouseInputToStructure(lParam));
                break;

            case MouseFlags.MiddleUp:
                MiddleButtonUp?.Invoke(MouseInputToStructure(lParam));
                break;
            }

            return(NativeMethods.CallNextHookEx(HookId, nCode, wParam, lParam));
        }
Exemplo n.º 30
0
        private void Select(object sender, MouseButtonEventArgs e)
        {
            OnSelect?.Invoke(Task);

            IsSelected = true;
            UpdateBackground();

            OnSelected?.Invoke(Task);
            e.Handled = true;

            if (e.ClickCount == 2)
            {
                DoubleClick?.Invoke(Task);
            }
        }