[reflection] Coop handles icalls in System.Reflection and System.RuntimeTypeHandle...
[mono.git] / mcs / class / referencesource / System.Activities.Presentation / System.Activities.Presentation / System / Activities / Presentation / DesignerConfigurationServiceUtilities.cs
1 // <copyright>
2 //   Copyright (c) Microsoft Corporation.  All rights reserved.
3 // </copyright>
4
5 namespace System.Activities.Presentation
6 {
7     using System.Runtime;
8
9     internal static class DesignerConfigurationServiceUtilities
10     {
11         public static bool IsAnnotationEnabled(EditingContext editingContext)
12         {
13             Fx.Assert(editingContext != null, "editingContext should not be null");
14             DesignerConfigurationService config = editingContext.Services.GetService<DesignerConfigurationService>();
15
16             if (config != null)
17             {
18                 return config.AnnotationEnabled;
19             }
20
21             return false;
22         }
23
24         public static bool IsBackgroundValidationEnabled(EditingContext editingContext)
25         {
26             Fx.Assert(editingContext != null, "editingContext should not be null");
27             DesignerConfigurationService config = editingContext.Services.GetService<DesignerConfigurationService>();
28
29             if (config != null)
30             {
31                 return config.BackgroundValidationEnabled;
32             }
33
34             return false;
35         }
36     }
37 }