Author: jackson
Date: 2007-07-11 17:20:13 -0400 (Wed, 11 Jul 2007)
New Revision: 81832
Modified:
trunk/moon/src/ChangeLog
trunk/moon/src/collection.cpp
Log:
* collection.cpp: When new objects are added to a
* collection, try
to merge them into the containers namescope.
Modified: trunk/moon/src/ChangeLog
===================================================================
--- trunk/moon/src/ChangeLog 2007-07-11 20:03:05 UTC (rev 81831)
+++ trunk/moon/src/ChangeLog 2007-07-11 21:20:13 UTC (rev 81832)
@@ -1,5 +1,10 @@
2007-07-11 Jackson Harper <[EMAIL PROTECTED]>
+ * collection.cpp: When new objects are added to a collection, try
+ to merge them into the containers namescope.
+
+2007-07-11 Jackson Harper <[EMAIL PROTECTED]>
+
* xaml.cpp: We need to stop parsing if there is an error while
resolving a custom namespace type.
Modified: trunk/moon/src/collection.cpp
===================================================================
--- trunk/moon/src/collection.cpp 2007-07-11 20:03:05 UTC (rev 81831)
+++ trunk/moon/src/collection.cpp 2007-07-11 21:20:13 UTC (rev 81832)
@@ -17,6 +17,7 @@
#include "brush.h"
#include "animation.h"
#include "transform.h"
+#include "namescope.h"
Collection::Node::Node (DependencyObject *dob, DependencyObject *parent)
{
@@ -64,6 +65,13 @@
list->Append (new Collection::Node (data, this));
data->Attach (NULL, this);
+ NameScope *ns = data->FindNameScope ();
+ NameScope *con_ns = ((DependencyObject *) closure)->FindNameScope ();
+ if (ns && con_ns && ns != con_ns) {
+ con_ns->MergeTemporaryScope (ns);
+ NameScope::SetNameScope (data, con_ns);
+ }
+
if (closure)
closure->OnCollectionChanged (this,
CollectionChangeTypeItemAdded, data, NULL);
}
@@ -78,6 +86,13 @@
data->Attach (NULL, this);
+ NameScope *ns = data->FindNameScope ();
+ NameScope *con_ns = ((DependencyObject *) closure)->FindNameScope ();
+ if (ns && con_ns && ns != con_ns) {
+ con_ns->MergeTemporaryScope (ns);
+ NameScope::SetNameScope (data, con_ns);
+ }
+
if (closure)
closure->OnCollectionChanged (this,
CollectionChangeTypeItemAdded, data, NULL);
}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches