public override void Dispose()
 {
     base.Dispose();
     if (cache_info != null)
     {
         cache_info.Changed -= OnCacheInfoChanged;
         cache_info          = null;
     }
 }
Exemplo n.º 2
0
        void LoadDependencies()
        {
            LibraryCache.LibraryInfo info = cache.Refresh(resolver, name);
            XmlElement elem = info.ObjectsDocument.DocumentElement ["dependencies"];
            ArrayList  list = new ArrayList();

            foreach (XmlElement dep in elem.SelectNodes("dependency"))
            {
                list.Add(dep.InnerText);
            }
            dependencies = (string[])list.ToArray(typeof(string));
        }
 void RefreshFromCache()
 {
     LibraryCache.LibraryInfo newInfo = cache.Refresh(resolver, filename);
     if (newInfo != cache_info)
     {
         if (cache_info != null)
         {
             cache_info.Changed -= OnCacheInfoChanged;
         }
         cache_info          = newInfo;
         cache_info.Changed += OnCacheInfoChanged;
     }
 }
        public static List <ComponentType> GetComponentTypes(Application app, string filename)
        {
            List <ComponentType> list = new List <ComponentType> ();

            LibraryCache.LibraryInfo info = cache.Refresh(new AssemblyResolver(app.Backend), filename);
            if (info.ObjectsDocument == null)
            {
                return(list);
            }

            string defTargetGtkVersion = info.ObjectsDocument.DocumentElement.GetAttribute("gtk-version");

            if (defTargetGtkVersion.Length == 0)
            {
                defTargetGtkVersion = "2.4";
            }

            AssemblyDefinition adef = AssemblyDefinition.ReadAssembly(filename);

            foreach (XmlElement elem in info.ObjectsDocument.SelectNodes("objects/object"))
            {
                if (elem.GetAttribute("internal") == "true" || elem.HasAttribute("deprecated") || !elem.HasAttribute("palette-category"))
                {
                    continue;
                }

                string     iconname = elem.GetAttribute("icon");
                Gdk.Pixbuf icon     = GetEmbeddedIcon(adef, iconname);

                string targetGtkVersion = elem.GetAttribute("gtk-version");
                if (targetGtkVersion.Length == 0)
                {
                    targetGtkVersion = defTargetGtkVersion;
                }

                ComponentType ct = new ComponentType(app,
                                                     elem.GetAttribute("type"),
                                                     elem.GetAttribute("label"),
                                                     elem.GetAttribute("type"),
                                                     elem.GetAttribute("palette-category"),
                                                     targetGtkVersion,
                                                     filename,
                                                     icon);

                list.Add(ct);
            }

            return(list);
        }
Exemplo n.º 5
0
        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;
                }
            }
        }
		void UpdateCache ()
		{
			Cache.Refresh (resolver, assembly.Location);
			cache_info = Cache [assembly.Location];
		}
Exemplo n.º 7
0
 void UpdateCache()
 {
     Cache.Refresh(resolver, assembly.Location);
     cache_info = Cache [assembly.Location];
 }
		public override void Dispose ()
		{
			base.Dispose ();
			if (cache_info != null) {
				cache_info.Changed -= OnCacheInfoChanged;
				cache_info = null;
			}
		}
		void RefreshFromCache ()
		{
			LibraryCache.LibraryInfo newInfo = cache.Refresh (resolver, filename);
			if (newInfo != cache_info) {
				if (cache_info != null)
					cache_info.Changed -= OnCacheInfoChanged;
				cache_info = newInfo;
				cache_info.Changed += OnCacheInfoChanged;
			}
		}