[reflection] Coop handles icalls in System.Reflection and System.RuntimeTypeHandle...
[mono.git] / mcs / class / referencesource / System.Activities.Presentation / System.Activities.Presentation / System / Activities / Presentation / Base / Core / Internal / PropertyEditing / Resources / PropertyInspectorResources.cs
1 //----------------------------------------------------------------
2 // Copyright (c) Microsoft Corporation.  All rights reserved.
3 //----------------------------------------------------------------
4 namespace System.Activities.Presentation.Internal.PropertyEditing.Resources 
5 {
6     using System;
7     using System.Windows;
8     using System.Diagnostics;
9     using System.Diagnostics.CodeAnalysis;
10     using System.Globalization;
11     using System.Runtime;
12
13     // <summary>
14     // Helper class that knows how to look up, load, and return PropertyInspector-specific
15     // ResourceDictionary
16     // </summary>
17
18     [SuppressMessage("Microsoft.Performance", "CA1812:AvoidUninstantiatedInternalClasses")]
19     internal class PropertyInspectorResources 
20     {
21         private static ResourceDictionary sharedResources;
22
23         // <summary>
24         // Wrapper around System.Activities.Presentation.Internal.Properties.Resources.PropertyEditing_DefaultCollectionStringValue,
25         // which is internal and, hence, cannot be referenced from Xaml.  We use this property to
26         // display "(Collection)" string in Xaml, rather than hard-coding it within Xaml, to make sure
27         // all of the translations of "(Collection)" string is the same, regardless whether the string
28         // comes from code or whether it comes from Xaml.
29         // </summary>
30         public static string DefaultCollectionStringValue 
31         {
32             get {
33                 return System.Activities.Presentation.Internal.Properties.Resources.PropertyEditing_DefaultCollectionStringValue;
34             }
35         }
36
37         // <summary>
38         // Getter for the header representing the NameProperty.  We don't want to hard-code that value in Xaml,
39         // because then it would get localized and, since it's technically a property name, we don't
40         // want it to get localized.
41         // </summary>
42         public static string NamePropertyHeader 
43         {
44             get {
45                 return string.Format(
46                     CultureInfo.CurrentCulture,
47                     System.Activities.Presentation.Internal.Properties.Resources.PropertyEditing_NamePropertyDisplayFormat,
48                     FrameworkElement.NameProperty.Name);
49             }
50         }
51
52         // <summary>
53         // Wrapper around PropertyEditing_AlphabeticalCaption resource accessible from Xaml
54         // </summary>
55         public static string PropertyEditing_AlphabeticalCaption 
56         {
57             get {
58                 return System.Activities.Presentation.Internal.Properties.Resources.PropertyEditing_AlphabeticalCaption;
59             }
60         }
61
62         // <summary>
63         // Wrapper around PropertyEditing_AlphabeticalCaption resource accessible from Xaml
64         // </summary>
65         public static string PropertyEditing_CategorizedCaption 
66         {
67             get {
68                 return System.Activities.Presentation.Internal.Properties.Resources.PropertyEditing_CategorizedCaption;
69             }
70         }
71
72         // <summary>
73         // Wrapper around PropertyEditing_AlphabeticalCaption resource accessible from Xaml
74         // </summary>
75         public static string PropertyEditing_ClearButtonCaption 
76         {
77             get {
78                 return System.Activities.Presentation.Internal.Properties.Resources.PropertyEditing_ClearButtonCaption;
79             }
80         }
81
82         // <summary>
83         // Gets the PropertyInspector-specific ResourceDictionary
84         // </summary>
85         // <returns></returns>
86         public static ResourceDictionary GetResources()
87         {
88             if (sharedResources == null)
89             {
90                 Uri resourceLocator = new Uri(
91                 string.Concat(
92                 typeof(PropertyInspectorResources).Assembly.GetName().Name,
93                 @";component/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Resources/StylesCore.xaml"),
94                 UriKind.RelativeOrAbsolute);
95
96                 sharedResources = (ResourceDictionary)Application.LoadComponent(resourceLocator);
97             }
98
99             Fx.Assert(sharedResources != null, "Could not load PropertyInspector shared resources.");
100             
101             return sharedResources;
102         }
103     }
104 }