public static void RegisterWidgetLibrary(WidgetLibrary library) { NotifyChanging(); try { if (coreLib != null && library.Name == coreLib.Name) { libraries.Remove(coreLib); InternalUpdate(); coreLib = library; } libraries.Add(library); library.Load(); classes.AddRange(library.AllClasses); UpdateGladeTransform(); } catch (Exception ex) { Console.WriteLine(ex); throw; } finally { NotifyChanged(); } }
void RegisterLibrary(AssemblyResolver resolver, Hashtable visited, WidgetLibrary lib) { if (lib == null || visited.Contains(lib.Name)) { return; } visited [lib.Name] = lib; foreach (string s in lib.GetLibraryDependencies()) { if (!Application.InternalIsWidgetLibrary(resolver, s)) { continue; } AddLibrary(resolver, visited, s); } try { Registry.RegisterWidgetLibrary(lib); } catch (Exception ex) { // Catch errors when loading a library to avoid aborting // the whole update method. After all, that's not a fatal // error (some widgets just won't be shown). // FIXME: return the error somewhere Console.WriteLine(ex); } }
public static void Initialize (WidgetLibrary coreLibrary) { RegisterWidgetLibrary (coreLibrary); coreLib = coreLibrary; }
public override void Load() { canGenerateCode = true; RefreshFromCache(); if (cache_info == null || !File.Exists(filename)) { return; } assembly = AssemblyDefinition.ReadAssembly(filename); objects_dirty = false; Load(cache_info.ObjectsDocument); if (objects_dirty) { cache_info.WriteObjectsFile(); } foreach (string dep in GetLibraryDependencies()) { WidgetLibrary lib = Registry.GetWidgetLibrary(dep); if (lib != null && !lib.CanGenerateCode) { canGenerateCode = false; } } assembly = null; info_changed = false; }
WidgetLibrary AddLibrary(AssemblyResolver resolver, Hashtable visited, string s) { if (Registry.IsRegistered(s)) { WidgetLibrary lib = Registry.GetWidgetLibrary(s); CheckDependencies(resolver, visited, lib); return(lib); } // Avoid registering direct references of libstetic if (Path.GetFileName(s) == "libstetic.dll" && s != coreLibrary) { return(null); } WidgetLibrary alib = CreateLibrary(resolver, s); if (alib == null) { return(null); } RegisterLibrary(resolver, visited, alib); return(alib); }
public static void UnregisterWidgetLibrary (WidgetLibrary library) { if (library == coreLib) return; NotifyChanging (); libraries.Remove (library); library.Dispose (); InternalUpdate (); NotifyChanged (); }
public static void UnregisterWidgetLibrary(WidgetLibrary library) { if (library == coreLib) { return; } NotifyChanging(); libraries.Remove(library); InternalUpdate(); NotifyChanged(); }
public static void RegisterWidgetLibrary(WidgetLibrary library) { NotifyChanging(); try { libraries.Add(library); library.Load(); classes.AddRange(library.AllClasses); UpdateGladeTransform(); } catch (Exception ex) { Console.WriteLine(ex); throw; } finally { NotifyChanged(); } }
void CheckDependencies(AssemblyResolver resolver, Hashtable visited, WidgetLibrary lib) { if (visited.Contains(lib.Name)) { return; } visited [lib.Name] = lib; // foreach (string dep in lib.GetLibraryDependencies ()) { // WidgetLibrary depLib = Registry.GetWidgetLibrary (dep); // if (depLib == null) // AddLibrary (resolver, visited, dep); // else // CheckDependencies (resolver, visited, depLib); // } }
WidgetLibrary AddLibrary(AssemblyResolver resolver, Hashtable visited, string s) { if (Registry.IsRegistered(s)) { WidgetLibrary lib = Registry.GetWidgetLibrary(s); CheckDependencies(resolver, visited, lib); return(lib); } WidgetLibrary alib = CreateLibrary(resolver, s); if (alib == null) { return(null); } RegisterLibrary(resolver, visited, alib); return(alib); }
public override void Load() { LibraryCache.LibraryInfo info = cache [name]; objects_dirty = false; Load(info.ObjectsDocument); if (objects_dirty) { info.WriteObjectsFile(); } canGenerateCode = true; foreach (string dep in GetLibraryDependencies()) { WidgetLibrary lib = Registry.GetWidgetLibrary(dep); if (lib != null && !lib.CanGenerateCode) { canGenerateCode = false; } } }
public static void RegisterWidgetLibrary (WidgetLibrary library) { NotifyChanging (); try { if (coreLib != null && library.Name == coreLib.Name) { libraries.Remove (coreLib); InternalUpdate (); coreLib = library; } libraries.Add (library); library.Load (); classes.AddRange (library.AllClasses); UpdateGladeTransform (); } catch (Exception ex) { Console.WriteLine (ex); throw; } finally { NotifyChanged (); } }
void CheckDependencies(AssemblyResolver resolver, Hashtable visited, WidgetLibrary lib) { if (visited.Contains(lib.Name) || lib.Name == coreLibrary) { return; } visited [lib.Name] = lib; foreach (string dep in lib.GetLibraryDependencies()) { WidgetLibrary depLib = Registry.GetWidgetLibrary(dep); if (depLib == null) { AddLibrary(resolver, visited, dep); } else { CheckDependencies(resolver, visited, depLib); } } }
public static void Initialize(WidgetLibrary coreLibrary) { RegisterWidgetLibrary(coreLibrary); coreLib = coreLibrary; }
internal void SetLibrary (WidgetLibrary library) { this.library = library; }
public static bool IsRegistered(WidgetLibrary library) { return(libraries.Contains(library)); }
public static bool IsRegistered (WidgetLibrary library) { return libraries.Contains (library); }
void CheckDependencies (AssemblyResolver resolver, Hashtable visited, WidgetLibrary lib) { if (visited.Contains (lib.Name) || lib.Name == coreLibrary) return; visited [lib.Name] = lib; foreach (string dep in lib.GetLibraryDependencies ()) { WidgetLibrary depLib = Registry.GetWidgetLibrary (dep); if (depLib == null) AddLibrary (resolver, visited, dep); else CheckDependencies (resolver, visited, depLib); } }
internal void SetLibrary(WidgetLibrary library) { this.library = library; }
void CheckDependencies (AssemblyResolver resolver, Hashtable visited, WidgetLibrary lib) { if (visited.Contains (lib.Name)) return; visited [lib.Name] = lib; // foreach (string dep in lib.GetLibraryDependencies ()) { // WidgetLibrary depLib = Registry.GetWidgetLibrary (dep); // if (depLib == null) // AddLibrary (resolver, visited, dep); // else // CheckDependencies (resolver, visited, depLib); // } }
void RegisterLibrary (AssemblyResolver resolver, Hashtable visited, WidgetLibrary lib) { if (lib == null || visited.Contains (lib.Name)) return; visited [lib.Name] = lib; foreach (string s in lib.GetLibraryDependencies ()) { if (!Application.InternalIsWidgetLibrary (resolver, s)) continue; AddLibrary (resolver, visited, s); } try { Registry.RegisterWidgetLibrary (lib); } catch (Exception ex) { // Catch errors when loading a library to avoid aborting // the whole update method. After all, that's not a fatal // error (some widgets just won't be shown). // FIXME: return the error somewhere Console.WriteLine (ex); } }
public static void RegisterWidgetLibrary(WidgetLibrary library) { NotifyChanging (); try { libraries.Add (library); library.Load (); classes.AddRange (library.AllClasses); UpdateGladeTransform (); } catch (Exception ex) { Console.WriteLine (ex); throw; } finally { NotifyChanged (); } }