~ubuntu-branches/ubuntu/trusty/mono-addins/trusty-proposed

« back to all changes in this revision

Viewing changes to Mono.Addins/Mono.Addins.Description/ModuleDescription.cs

  • Committer: Bazaar Package Importer
  • Author(s): Jo Shields
  • Date: 2011-04-25 11:11:33 UTC
  • mfrom: (4.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20110425111133-t05u5p7o5fxx70fu
Tags: 0.6-2
Upload to Unstable

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
 
37
37
namespace Mono.Addins.Description
38
38
{
 
39
        /// <summary>
 
40
        /// A module definition.
 
41
        /// </summary>
 
42
        /// <remarks>
 
43
        /// Optional modules can be used to declare extensions which will be registered only if some
 
44
        /// specified add-in dependencies can be satisfied.
 
45
        /// </remarks>
39
46
        public class ModuleDescription: ObjectDescription
40
47
        {
41
48
                StringCollection assemblies;
44
51
                DependencyCollection dependencies;
45
52
                ExtensionCollection extensions;
46
53
                
 
54
                // Used only at run time
 
55
                internal RuntimeAddin RuntimeAddin;
 
56
                
47
57
                internal ModuleDescription (XmlElement element)
48
58
                {
49
59
                        Element = element;
50
60
                }
51
61
 
 
62
                /// <summary>
 
63
                /// Initializes a new instance of the <see cref="Mono.Addins.Description.ModuleDescription"/> class.
 
64
                /// </summary>
52
65
                public ModuleDescription ()
53
66
                {
54
67
                }
55
68
 
 
69
                /// <summary>
 
70
                /// Checks if this module depends on the specified add-in.
 
71
                /// </summary>
 
72
                /// <returns>
 
73
                /// <c>true</c> if there is a dependency.
 
74
                /// </returns>
 
75
                /// <param name='addinId'>
 
76
                /// Identifier of the add-in
 
77
                /// </param>
56
78
                public bool DependsOnAddin (string addinId)
57
79
                {
58
80
                        AddinDescription desc = Parent as AddinDescription;
68
90
                        return false;
69
91
                }
70
92
                
 
93
                /// <summary>
 
94
                /// Gets the list of paths to be ignored by the add-in scanner.
 
95
                /// </summary>
71
96
                public StringCollection IgnorePaths {
72
97
                        get {
73
98
                                if (ignorePaths == null)
76
101
                        }
77
102
                }
78
103
                
 
104
                /// <summary>
 
105
                /// Gets all external files
 
106
                /// </summary>
 
107
                /// <value>
 
108
                /// All files.
 
109
                /// </value>
 
110
                /// <remarks>
 
111
                /// External files are data files and assemblies explicitly referenced in the Runtime section of the add-in manifest.
 
112
                /// </remarks>
79
113
                public StringCollection AllFiles {
80
114
                        get {
81
115
                                StringCollection col = new StringCollection ();
89
123
                        }
90
124
                }
91
125
                
 
126
                /// <summary>
 
127
                /// Gets the list of external assemblies used by this module.
 
128
                /// </summary>
92
129
                public StringCollection Assemblies {
93
130
                        get {
94
131
                                if (assemblies == null) {
101
138
                        }
102
139
                }
103
140
                
 
141
                /// <summary>
 
142
                /// Gets the list of external data files used by this module
 
143
                /// </summary>
104
144
                public StringCollection DataFiles {
105
145
                        get {
106
146
                                if (dataFiles == null) {
113
153
                        }
114
154
                }
115
155
                
 
156
                /// <summary>
 
157
                /// Gets the dependencies of this module
 
158
                /// </summary>
116
159
                public DependencyCollection Dependencies {
117
160
                        get {
118
161
                                if (dependencies == null) {
138
181
                        }
139
182
                }
140
183
                
 
184
                /// <summary>
 
185
                /// Gets the extensions of this module
 
186
                /// </summary>
141
187
                public ExtensionCollection Extensions {
142
188
                        get {
143
189
                                if (extensions == null) {
151
197
                        }
152
198
                }
153
199
                
 
200
                /// <summary>
 
201
                /// Adds an extension node to the module.
 
202
                /// </summary>
 
203
                /// <returns>
 
204
                /// The extension node.
 
205
                /// </returns>
 
206
                /// <param name='path'>
 
207
                /// Path that identifies the extension point.
 
208
                /// </param>
 
209
                /// <param name='nodeName'>
 
210
                /// Node name.
 
211
                /// </param>
 
212
                /// <remarks>
 
213
                /// This method creates a new Extension object for the provided path if none exist.
 
214
                /// </remarks>
154
215
                public ExtensionNodeDescription AddExtensionNode (string path, string nodeName)
155
216
                {
156
217
                        ExtensionNodeDescription node = new ExtensionNodeDescription (nodeName);
158
219
                        return node;
159
220
                }
160
221
                
 
222
                /// <summary>
 
223
                /// Gets an extension instance.
 
224
                /// </summary>
 
225
                /// <returns>
 
226
                /// The extension instance.
 
227
                /// </returns>
 
228
                /// <param name='path'>
 
229
                /// Path that identifies the extension point that the extension extends.
 
230
                /// </param>
 
231
                /// <remarks>
 
232
                /// This method creates a new Extension object for the provided path if none exist.
 
233
                /// </remarks>
161
234
                public Extension GetExtension (string path)
162
235
                {
163
236
                        foreach (Extension e in Extensions) {
215
288
                        }
216
289
                }
217
290
                
 
291
                /// <summary>
 
292
                /// Adds an add-in reference (there is a typo in the method name)
 
293
                /// </summary>
 
294
                /// <param name='id'>
 
295
                /// Identifier of the add-in.
 
296
                /// </param>
 
297
                /// <param name='version'>
 
298
                /// Version of the add-in.
 
299
                /// </param>
218
300
                public void AddAssemblyReference (string id, string version)
219
301
                {
220
302
                        XmlElement deps = GetDependenciesElement ();