aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Properties/Settings.Designer.cs
blob: 30784c8b09f235ae513b2377e700eec184dd979f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.42000
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace Tango.MachineStudio.RML.Properties
{
    
    
    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
    {
        
        private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
        
        public static Settings Default
        {
            get
            {
                return defaultInstance;
            }
        }
    }
}
an>; namespace Tango.Scripting.Editors.Rendering { /// <summary> /// Encapsulates and adds MouseHover support to UIElements. /// </summary> public class MouseHoverLogic : IDisposable { UIElement target; DispatcherTimer mouseHoverTimer; Point mouseHoverStartPoint; MouseEventArgs mouseHoverLastEventArgs; bool mouseHovering; /// <summary> /// Creates a new instance and attaches itself to the <paramref name="target" /> UIElement. /// </summary> public MouseHoverLogic(UIElement target) { if (target == null) throw new ArgumentNullException("target"); this.target = target; this.target.MouseLeave += MouseHoverLogicMouseLeave; this.target.MouseMove += MouseHoverLogicMouseMove; this.target.MouseEnter += MouseHoverLogicMouseEnter; } void MouseHoverLogicMouseMove(object sender, MouseEventArgs e) { Vector mouseMovement = mouseHoverStartPoint - e.GetPosition(this.target); if (Math.Abs(mouseMovement.X) > SystemParameters.MouseHoverWidth || Math.Abs(mouseMovement.Y) > SystemParameters.MouseHoverHeight) { StartHovering(e); } // do not set e.Handled - allow others to also handle MouseMove } void MouseHoverLogicMouseEnter(object sender, MouseEventArgs e) { StartHovering(e); // do not set e.Handled - allow others to also handle MouseEnter } void StartHovering(MouseEventArgs e) { StopHovering(); mouseHoverStartPoint = e.GetPosition(this.target); mouseHoverLastEventArgs = e; mouseHoverTimer = new DispatcherTimer(SystemParameters.MouseHoverTime, DispatcherPriority.Background, OnMouseHoverTimerElapsed, this.target.Dispatcher); mouseHoverTimer.Start(); } void MouseHoverLogicMouseLeave(object sender, MouseEventArgs e) { StopHovering(); // do not set e.Handled - allow others to also handle MouseLeave } void StopHovering() { if (mouseHoverTimer != null) { mouseHoverTimer.Stop(); mouseHoverTimer = null; } if (mouseHovering) { mouseHovering = false; OnMouseHoverStopped(mouseHoverLastEventArgs); } } void OnMouseHoverTimerElapsed(object sender, EventArgs e) { mouseHoverTimer.Stop(); mouseHoverTimer = null; mouseHovering = true; OnMouseHover(mouseHoverLastEventArgs); } /// <summary> /// Occurs when the mouse starts hovering over a certain location. /// </summary> public event EventHandler<MouseEventArgs> MouseHover; /// <summary> /// Raises the <see cref="MouseHover"/> event. /// </summary> protected virtual void OnMouseHover(MouseEventArgs e) { if (MouseHover != null) { MouseHover(this, e); } } /// <summary> /// Occurs when the mouse stops hovering over a certain location. /// </summary> public event EventHandler<MouseEventArgs> MouseHoverStopped; /// <summary> /// Raises the <see cref="MouseHoverStopped"/> event. /// </summary> protected virtual void OnMouseHoverStopped(MouseEventArgs e) { if (MouseHoverStopped != null) { MouseHoverStopped(this, e); } } bool disposed; /// <summary> /// Removes the MouseHover support from the target UIElement. /// </summary> public void Dispose() { if (!disposed) { this.target.MouseLeave -= MouseHoverLogicMouseLeave; this.target.MouseMove -= MouseHoverLogicMouseMove; this.target.MouseEnter -= MouseHoverLogicMouseEnter; } disposed = true; } } }