~ubuntu-branches/ubuntu/trusty/monodevelop/trusty-proposed

« back to all changes in this revision

Viewing changes to external/mono-addins/Mono.Addins/Mono.Addins/AddinAttribute.cs

  • Committer: Package Import Robot
  • Author(s): Jo Shields
  • Date: 2013-05-12 09:46:03 UTC
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20130512094603-mad323bzcxvmcam0
Tags: upstream-4.0.5+dfsg
ImportĀ upstreamĀ versionĀ 4.0.5+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//
 
2
// AddinAttribute.cs
 
3
//
 
4
// Author:
 
5
//   Lluis Sanchez Gual
 
6
//
 
7
// Copyright (C) 2007 Novell, Inc (http://www.novell.com)
 
8
//
 
9
// Permission is hereby granted, free of charge, to any person obtaining
 
10
// a copy of this software and associated documentation files (the
 
11
// "Software"), to deal in the Software without restriction, including
 
12
// without limitation the rights to use, copy, modify, merge, publish,
 
13
// distribute, sublicense, and/or sell copies of the Software, and to
 
14
// permit persons to whom the Software is furnished to do so, subject to
 
15
// the following conditions:
 
16
// 
 
17
// The above copyright notice and this permission notice shall be
 
18
// included in all copies or substantial portions of the Software.
 
19
// 
 
20
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 
21
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 
22
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 
23
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
 
24
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
 
25
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 
26
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
27
//
 
28
 
 
29
 
 
30
using System;
 
31
using Mono.Addins.Description;
 
32
 
 
33
namespace Mono.Addins
 
34
{
 
35
        /// <summary>
 
36
        /// Marks an assembly as being an add-in.
 
37
        /// </summary>
 
38
        [AttributeUsage (AttributeTargets.Assembly)]
 
39
        public class AddinAttribute: Attribute
 
40
        {
 
41
                string id;
 
42
                string version;
 
43
                string ns;
 
44
                string category;
 
45
                bool enabledByDefault = true;
 
46
                AddinFlags flags;
 
47
                string compatVersion;
 
48
                string url;
 
49
                
 
50
                /// <summary>
 
51
                /// Initializes an add-in marker attribute
 
52
                /// </summary>
 
53
                public AddinAttribute ()
 
54
                {
 
55
                }
 
56
                
 
57
                /// <summary>
 
58
                /// Initializes an add-in marker attribute
 
59
                /// </summary>
 
60
                /// <param name="id">
 
61
                /// Identifier of the add-in
 
62
                /// </param>
 
63
                public AddinAttribute (string id)
 
64
                {
 
65
                        this.id = id;
 
66
                }
 
67
                
 
68
                /// <summary>
 
69
                /// Initializes an add-in marker attribute
 
70
                /// </summary>
 
71
                /// <param name="id">
 
72
                /// Identifier of the add-in
 
73
                /// </param>
 
74
                /// <param name="version">
 
75
                /// Version of the add-in
 
76
                /// </param>
 
77
                public AddinAttribute (string id, string version)
 
78
                {
 
79
                        this.id = id;
 
80
                        this.version = version;
 
81
                }
 
82
                
 
83
                /// <summary>
 
84
                /// Identifier of the add-in.
 
85
                /// </summary>
 
86
                public string Id {
 
87
                        get { return id != null ? id : string.Empty; }
 
88
                        set { id = value; }
 
89
                }
 
90
                
 
91
                /// <summary>
 
92
                /// Version of the add-in.
 
93
                /// </summary>
 
94
                public string Version {
 
95
                        get { return version != null ? version : string.Empty; }
 
96
                        set { version = value; }
 
97
                }
 
98
                
 
99
                /// <summary>
 
100
                /// Version of the add-in with which this add-in is backwards compatible.
 
101
                /// </summary>
 
102
                public string CompatVersion {
 
103
                        get { return compatVersion != null ? compatVersion : string.Empty; }
 
104
                        set { compatVersion = value; }
 
105
                }
 
106
                
 
107
                /// <summary>
 
108
                /// Namespace of the add-in
 
109
                /// </summary>
 
110
                public string Namespace {
 
111
                        get { return ns != null ? ns : string.Empty; }
 
112
                        set { ns = value; }
 
113
                }
 
114
                
 
115
                /// <summary>
 
116
                /// Category of the add-in
 
117
                /// </summary>
 
118
                public string Category {
 
119
                        get { return category != null ? category : string.Empty; }
 
120
                        set { category = value; }
 
121
                }
 
122
                
 
123
                /// <summary>
 
124
                /// Url to a web page with more information about the add-in
 
125
                /// </summary>
 
126
                public string Url {
 
127
                        get { return url != null ? url : string.Empty; }
 
128
                        set { url = value; }
 
129
                }
 
130
                
 
131
                /// <summary>
 
132
                /// When set to True, the add-in will be automatically enabled after installing.
 
133
                /// It's True by default.
 
134
                /// </summary>
 
135
                public bool EnabledByDefault {
 
136
                        get { return this.enabledByDefault; }
 
137
                        set { this.enabledByDefault = value; }
 
138
                }
 
139
                
 
140
                /// <summary>
 
141
                /// Add-in flags
 
142
                /// </summary>
 
143
                public AddinFlags Flags {
 
144
                        get { return this.flags; }
 
145
                        set { this.flags = value; }
 
146
                }
 
147
        }
 
148
}