OLD | NEW |
| (Empty) |
1 /// Copyright (c) Microsoft Corporation. All rights reserved. | |
2 | |
3 using System; | |
4 using System.ComponentModel; | |
5 using System.Diagnostics; | |
6 using System.Globalization; | |
7 | |
8 namespace Microsoft.VisualStudio.Project | |
9 { | |
10 /// <summary> | |
11 /// Defines a type converter. | |
12 /// </summary> | |
13 /// <remarks>This is needed to get rid of the type TypeConverter type th
at could not give back the Type we were passing to him. | |
14 /// We do not want to use reflection to get the type back from the Conv
erterTypeName. Also the GetType methos does not spwan converters from other asse
mblies.</remarks> | |
15 [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA
1019:DefineAccessorsForAttributeArguments"), AttributeUsage(AttributeTargets.Cla
ss | AttributeTargets.Enum | AttributeTargets.Property | AttributeTargets.Field)
] | |
16 public sealed class PropertyPageTypeConverterAttribute : Attribute | |
17 { | |
18 #region fields | |
19 Type converterType; | |
20 #endregion | |
21 | |
22 #region ctors | |
23 public PropertyPageTypeConverterAttribute(Type type) | |
24 { | |
25 this.converterType = type; | |
26 } | |
27 #endregion | |
28 | |
29 #region properties | |
30 public Type ConverterType | |
31 { | |
32 get | |
33 { | |
34 return this.converterType; | |
35 } | |
36 } | |
37 #endregion | |
38 } | |
39 | |
40 [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | Att
ributeTargets.Field, Inherited = false, AllowMultiple = false)] | |
41 internal sealed class LocDisplayNameAttribute : DisplayNameAttribute | |
42 { | |
43 #region fields | |
44 string name; | |
45 #endregion | |
46 | |
47 #region ctors | |
48 public LocDisplayNameAttribute(string name) | |
49 { | |
50 this.name = name; | |
51 } | |
52 #endregion | |
53 | |
54 #region properties | |
55 public override string DisplayName | |
56 { | |
57 get | |
58 { | |
59 string result = SR.GetString(this.name, CultureI
nfo.CurrentUICulture); | |
60 if(result == null) | |
61 { | |
62 Debug.Assert(false, "String resource '"
+ this.name + "' is missing"); | |
63 result = this.name; | |
64 } | |
65 return result; | |
66 } | |
67 } | |
68 #endregion | |
69 } | |
70 } | |
OLD | NEW |