~ubuntu-branches/ubuntu/oneiric/monodevelop/oneiric-updates

« back to all changes in this revision

Viewing changes to contrib/Mono.Cecil/Mono.Cecil/Mono.Cecil/GenericParameter.cs

  • Committer: Bazaar Package Importer
  • Author(s): Jo Shields
  • Date: 2009-02-18 08:40:51 UTC
  • mfrom: (1.2.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20090218084051-gh8m6ukvokbwj7cf
Tags: 1.9.2+dfsg-1ubuntu1
* Merge from Debian Experimental (LP: #330519), remaining Ubuntu changes:
  + debian/control:
    - Update for Gnome# 2.24
    - Add libmono-cairo1.0-cil to build-deps to fool pkg-config check

Show diffs side-by-side

added added

removed removed

Lines of Context:
169
169
                        m_owner = owner;
170
170
                }
171
171
 
 
172
                internal static void CloneInto (IGenericParameterProvider old, IGenericParameterProvider np, ImportContext context)
 
173
                {
 
174
                        foreach (GenericParameter gp in old.GenericParameters) {
 
175
                                GenericParameter ngp = Clone (gp, context);
 
176
                                np.GenericParameters.Add (ngp);
 
177
                                CloneConstraints (gp, ngp, context);
 
178
                        }
 
179
                }
 
180
 
172
181
                internal static GenericParameter Clone (GenericParameter gp, ImportContext context)
173
182
                {
174
183
                        GenericParameter ngp;
182
191
                        ngp.Position = gp.Owner.GenericParameters.IndexOf (gp);
183
192
                        ngp.Attributes = gp.Attributes;
184
193
 
185
 
                        foreach (TypeReference constraint in gp.Constraints)
186
 
                                ngp.Constraints.Add (context.Import (constraint));
187
194
                        foreach (CustomAttribute ca in gp.CustomAttributes)
188
195
                                ngp.CustomAttributes.Add (CustomAttribute.Clone (ca, context));
189
196
 
190
197
                        return ngp;
191
198
                }
 
199
 
 
200
                static void CloneConstraints (GenericParameter gp, GenericParameter ngp, ImportContext context)
 
201
                {
 
202
                        foreach (TypeReference constraint in gp.Constraints)
 
203
                                ngp.Constraints.Add (context.Import (constraint));
 
204
                }
192
205
        }
193
206
}