~bratsche/ubuntu/maverick/monodevelop/disable-appmenu

« back to all changes in this revision

Viewing changes to src/addins/MonoDevelop.GtkCore/libsteticui/ApplicationBackend.cs

  • Committer: Bazaar Package Importer
  • Author(s): Stefan Ebner
  • Date: 2009-03-17 17:55:55 UTC
  • mfrom: (1.1.13 sid)
  • Revision ID: james.westby@ubuntu.com-20090317175555-2w5qbmu0l5maq6fq
Tags: 1.9.3+dfsg-1ubuntu1
* FFe for Monodevelop 2 granted by motu-release team :)
* Merge from Debian Unstable , remaining Ubuntu changes:
  + debian/control:
    - Update for Gnome# 2.24

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
using System;
3
3
using System.IO;
4
4
using System.Collections;
 
5
using System.Collections.Generic;
5
6
using System.CodeDom;
6
7
using System.Runtime.Serialization.Formatters.Binary;
7
8
using System.Runtime.Remoting;
22
23
                object targetViewerObject;
23
24
                bool allowInProcLibraries = true;
24
25
                Application appFrontend;
 
26
                string coreLibrary;
25
27
                
26
28
                ProjectBackend activeProject;
27
29
                WidgetEditSession activeDesignSession;
30
32
                public ApplicationBackend (Application app)
31
33
                {
32
34
                        appFrontend = app;
33
 
                        Registry.Initialize (new AssemblyWidgetLibrary (typeof(Registry).Assembly.FullName, typeof(Registry).Assembly));
 
35
                        coreLibrary = Path.GetFullPath (typeof(Registry).Assembly.Location);
 
36
                        Registry.Initialize (new AssemblyWidgetLibrary (coreLibrary, typeof(Registry).Assembly));
34
37
                        WidgetDesignerBackend.DefaultObjectViewer = this;
35
38
                }
36
39
                
167
170
                                // Load required libraries
168
171
                                
169
172
                                Hashtable visited = new Hashtable ();
170
 
                                LoadLibraries (null, visited, libraries);
 
173
                                LoadLibraries (new AssemblyResolver (this), visited, libraries);
171
174
                                
172
175
                                foreach (ProjectBackend project in projects)
173
176
                                        LoadLibraries (project.Resolver, visited, project.WidgetLibraries);
201
204
                        }
202
205
                }
203
206
                
204
 
                internal void LoadLibraries (AssemblyResolver resolver, Hashtable visited, IEnumerable libraries)
 
207
                void LoadLibraries (AssemblyResolver resolver, Hashtable visited, IEnumerable libraries)
205
208
                {
206
 
                        foreach (string s in libraries)
207
 
                                AddLibrary (resolver, visited, s);
 
209
                        // Convert all assembly names to assembly paths before registering the libraries.
 
210
                        // The registry and the library cache will only handle full paths.
 
211
                        foreach (string s in libraries) {
 
212
                                string sr = resolver.Resolve (s, null);
 
213
                                if (sr != null)
 
214
                                        AddLibrary (resolver, visited, sr);
 
215
                        }
 
216
                        Registry.ReloadWidgetLibraries ();
208
217
                }
209
218
                
210
219
                WidgetLibrary AddLibrary (AssemblyResolver resolver, Hashtable visited, string s)
214
223
                                CheckDependencies (resolver, visited, lib);
215
224
                                return lib;
216
225
                        }
 
226
                        
 
227
                        // Avoid registering direct references of libstetic
 
228
                        if (Path.GetFileName (s) == "libstetic.dll" && s != coreLibrary)
 
229
                                return null;
217
230
 
218
231
                        WidgetLibrary alib = CreateLibrary (resolver, s);
219
232
                        if (alib == null)