[reflection] Coop handles icalls in System.Reflection and System.RuntimeTypeHandle...
[mono.git] / mcs / class / referencesource / System.Activities.Presentation / System.Activities.Presentation / System / Activities / Presentation / View / AnnotationDialog.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.View
8 {
9     using System.Activities.Presentation.Annotations;
10     using System.Windows;
11     using System.Windows.Input;
12
13     internal partial class AnnotationDialog : DialogWindow
14     {
15         public AnnotationDialog()
16         {
17             this.InitializeComponent();
18             this.HelpKeyword = typeof(Annotation).FullName;
19         }
20
21         public string AnnotationText
22         {
23             get
24             {
25                 return this.annotationTextBox.Text;
26             }
27
28             set
29             {
30                 if (value == null)
31                 {
32                     this.annotationTextBox.Text = string.Empty;
33                 }
34                 else
35                 {
36                     this.annotationTextBox.Text = value;
37                 }
38             }
39         }
40
41         protected override void OnKeyDown(Windows.Input.KeyEventArgs e)
42         {
43             if (e.Key == Key.Escape)
44             {
45                 this.DialogResult = false;
46                 e.Handled = true;
47             }
48             else
49             {
50                 base.OnKeyDown(e);
51             }
52         }
53
54         private void OnOkClick(object sender, RoutedEventArgs args)
55         {
56             this.DialogResult = true;
57         }
58
59         private void OnCancelClick(object sender, RoutedEventArgs args)
60         {
61             this.DialogResult = false;
62         }
63     }
64 }