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

« back to all changes in this revision

Viewing changes to Mono.Addins/Mono.Addins.Description/AddinDependency.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:
35
35
 
36
36
namespace Mono.Addins.Description
37
37
{
 
38
        /// <summary>
 
39
        /// Definition of a dependency of an add-in on another add-in.
 
40
        /// </summary>
38
41
        [XmlType ("AddinReference")]
39
42
        public class AddinDependency: Dependency
40
43
        {
41
44
                string id;
42
45
                string version;
43
46
                
 
47
                /// <summary>
 
48
                /// Initializes a new instance of the <see cref="Mono.Addins.Description.AddinDependency"/> class.
 
49
                /// </summary>
44
50
                public AddinDependency ()
45
51
                {
46
52
                }
47
53
                
 
54
                /// <summary>
 
55
                /// Initializes a new instance of the <see cref="Mono.Addins.Description.AddinDependency"/> class.
 
56
                /// </summary>
 
57
                /// <param name='fullId'>
 
58
                /// Full identifier of the add-in (includes version)
 
59
                /// </param>
48
60
                public AddinDependency (string fullId)
49
61
                {
50
62
                        Addin.GetIdParts (fullId, out id, out version);
51
63
                        id = "::" + id;
52
64
                }
53
65
                
 
66
                /// <summary>
 
67
                /// Initializes a new instance of the <see cref="Mono.Addins.Description.AddinDependency"/> class.
 
68
                /// </summary>
 
69
                /// <param name='id'>
 
70
                /// Identifier of the add-in.
 
71
                /// </param>
 
72
                /// <param name='version'>
 
73
                /// Version of the add-in.
 
74
                /// </param>
54
75
                public AddinDependency (string id, string version)
55
76
                {
56
77
                        this.id = id;
76
97
                        Element.SetAttribute ("version", Version);
77
98
                }
78
99
                
 
100
                /// <summary>
 
101
                /// Gets the full addin identifier.
 
102
                /// </summary>
 
103
                /// <value>
 
104
                /// The full addin identifier.
 
105
                /// </value>
 
106
                /// <remarks>
 
107
                /// Includes namespace and version number. For example: MonoDevelop.TextEditor,1.0
 
108
                /// </remarks>
79
109
                public string FullAddinId {
80
110
                        get {
81
111
                                AddinDescription desc = ParentAddinDescription;
86
116
                        }
87
117
                }
88
118
                
 
119
                /// <summary>
 
120
                /// Gets or sets the addin identifier.
 
121
                /// </summary>
 
122
                /// <value>
 
123
                /// The addin identifier.
 
124
                /// </value>
89
125
                public string AddinId {
90
126
                        get { return id != null ? id : string.Empty; }
91
127
                        set { id = value; }
92
128
                }
93
129
                
 
130
                /// <summary>
 
131
                /// Gets or sets the version.
 
132
                /// </summary>
 
133
                /// <value>
 
134
                /// The version.
 
135
                /// </value>
94
136
                public string Version {
95
137
                        get { return version != null ? version : string.Empty; }
96
138
                        set { version = value; }
97
139
                }
98
140
                
 
141
                /// <summary>
 
142
                /// Display name of the dependency.
 
143
                /// </summary>
 
144
                /// <value>
 
145
                /// The name.
 
146
                /// </value>
99
147
                public override string Name {
100
148
                        get { return AddinId + " v" + version; }
101
149
                }
102
150
                
103
 
                internal override bool CheckInstalled ()
 
151
                internal override bool CheckInstalled (AddinRegistry registry)
104
152
                {
105
 
                        Addin[] addins = AddinManager.Registry.GetAddins ();
 
153
                        Addin[] addins = registry.GetAddins ();
106
154
                        foreach (Addin addin in addins) {
107
155
                                if (addin.Id == id && addin.SupportsVersion (version)) {
108
156
                                        return true;