2
// ExtensionAttributeAttribute.cs
5
// Lluis Sanchez Gual <lluis@novell.com>
7
// Copyright (c) 2010 Novell, Inc (http://www.novell.com)
9
// Permission is hereby granted, free of charge, to any person obtaining a copy
10
// of this software and associated documentation files (the "Software"), to deal
11
// in the Software without restriction, including without limitation the rights
12
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
// copies of the Software, and to permit persons to whom the Software is
14
// furnished to do so, subject to the following conditions:
16
// The above copyright notice and this permission notice shall be included in
17
// all copies or substantial portions of the Software.
19
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
32
/// Assigns an attribute value to an extension
35
/// This attribute can be used together with the [Extenion] attribute to specify
36
/// a value for an attribute of the extension.
38
public class ExtensionAttributeAttribute: Attribute
41
string targetTypeName;
47
/// Initializes a new instance of the <see cref="Mono.Addins.ExtensionAttributeAttribute"/> class.
49
/// <param name='name'>
50
/// Name of the attribute
52
/// <param name='value'>
53
/// Value of the attribute
55
public ExtensionAttributeAttribute (string name, string value)
62
/// Initializes a new instance of the <see cref="Mono.Addins.ExtensionAttributeAttribute"/> class.
64
/// <param name='type'>
65
/// Type of the extension for which the attribute value is being set
67
/// <param name='name'>
68
/// Name of the attribute
70
/// <param name='value'>
71
/// Value of the attribute
73
public ExtensionAttributeAttribute (Type type, string name, string value)
81
/// Initializes a new instance of the <see cref="Mono.Addins.ExtensionAttributeAttribute"/> class.
83
/// <param name='path'>
84
/// Path of the extension for which the attribute value is being set
86
/// <param name='name'>
87
/// Name of the attribute
89
/// <param name='value'>
90
/// Value of the attribute
92
public ExtensionAttributeAttribute (string path, string name, string value)
100
/// Name of the attribute
103
get { return this.name; }
104
set { this.name = value; }
108
/// Value of the attribute
110
public string Value {
111
get { return this.val; }
112
set { this.val = value; }
116
/// Path of the extension for which the attribute value is being set
119
get { return this.path; }
120
set { this.path = value; }
124
/// Type of the extension for which the attribute value is being set
127
get { return targetType; }
128
set { targetType = value; targetTypeName = targetType.FullName; }
131
internal string TypeName {
132
get { return targetTypeName ?? string.Empty; }
133
set { targetTypeName = value; }