[reflection] Coop handles icalls in System.Reflection and System.RuntimeTypeHandle...
[mono.git] / mcs / class / referencesource / System.Activities.Presentation / System.Activities.Presentation / System / Activities / Presentation / FreeFormEditing / ConnectorWithStartDot.xaml.cs
1 //----------------------------------------------------------------
2 // <copyright company="Microsoft Corporation">
3 //     Copyright (c) Microsoft Corporation.  All rights reserved.
4 // </copyright>
5 //----------------------------------------------------------------
6
7 namespace System.Activities.Presentation.FreeFormEditing
8 {
9     using System.Windows;
10     using System.Windows.Controls;
11     using System.Windows.Input;
12     using System.Windows.Media;
13
14     internal partial class ConnectorWithStartDot : Connector
15     {
16         public ConnectorWithStartDot()
17         {
18             this.InitializeComponent();
19         }
20
21         public override FrameworkElement StartDot
22         {
23             get
24             {
25                 return this.startDotGrid;
26             }
27         }
28
29         public override void SetLabelToolTip(object toolTip)
30         {
31             this.labelTextBlock.ToolTip = toolTip;
32         }
33
34         protected override void OnDragEnter(DragEventArgs e)
35         {
36             if (!this.IsMouseOnStartDot(e))
37             {
38                 base.OnDragEnter(e);
39             }
40         }
41
42         protected override void OnMouseEnter(MouseEventArgs e)
43         {
44             System.Windows.Controls.Panel.SetZIndex(this, 999);
45             base.OnMouseEnter(e);
46         }
47
48         protected override void OnMouseLeave(MouseEventArgs e)
49         {
50             System.Windows.Controls.Panel.SetZIndex(this, 1);
51             base.OnMouseLeave(e);
52         }
53
54         private bool IsMouseOnStartDot(DragEventArgs e)
55         {
56             HitTestResult result = VisualTreeHelper.HitTest(this, e.GetPosition(this));
57             if (result != null && this.startDotGrid.IsAncestorOf(result.VisualHit))
58             {
59                 return true;
60             }
61
62             return false;
63         }
64     }
65 }