2008-06-18 Mike Kestner <mkestner@novell.com>

* libstetic/WidgetLibrary.cs: refactor class addition logic from Load
	into a protected AddClass method which subclasses can use to add
	classes marked with [ToolboxItem].

svn path=/trunk/stetic/; revision=106114
This commit is contained in:
Mike Kestner 2008-06-18 14:41:41 +00:00
Родитель 06649d33a8
Коммит d341500a74
2 изменённых файлов: 17 добавлений и 7 удалений

Просмотреть файл

@ -1,3 +1,9 @@
2008-06-18 Mike Kestner <mkestner@novell.com>
* libstetic/WidgetLibrary.cs: refactor class addition logic from Load
into a protected AddClass method which subclasses can use to add
classes marked with [ToolboxItem].
2008-06-18 Mike Kestner <mkestner@novell.com>
* libsteticui/CecilWidgetLibrary.cs: remove timestamp code and reuse

Просмотреть файл

@ -75,13 +75,8 @@ namespace Stetic
enums[enm.Name] = enm;
}
foreach (XmlElement element in objects.SelectNodes ("/objects/object")) {
ClassDescriptor klass = LoadClassDescriptor (element);
if (klass == null) continue;
klass.SetLibrary (this);
classes_by_cname[klass.CName] = klass;
classes_by_csname[klass.WrappedTypeName] = klass;
}
foreach (XmlElement element in objects.SelectNodes ("/objects/object"))
AddClass (LoadClassDescriptor (element));
XmlNamespaceManager nsm = new XmlNamespaceManager (objects.NameTable);
nsm.AddNamespace ("xsl", "http://www.w3.org/1999/XSL/Transform");
@ -97,6 +92,15 @@ namespace Stetic
exportElems [n] = (XmlElement) nodes[n];
}
protected void AddClass (ClassDescriptor klass)
{
if (klass == null)
return;
klass.SetLibrary (this);
classes_by_cname[klass.CName] = klass;
classes_by_csname[klass.WrappedTypeName] = klass;
}
public virtual void Dispose ()
{
}