<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="http://syndication.webwiz.co.uk/rss_namespace/">
 <channel>
  <title>DevForce Community Forum : Object Graph Dirty Detection</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2010 : Object Graph Dirty Detection</description>
  <pubDate>Wed, 15 Apr 2026 21:53:59 -700</pubDate>
  <lastBuildDate>Tue, 21 Dec 2010 21:00:51 -700</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 9.69</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>www.ideablade.com/forum/RSS_post_feed.asp?TID=2379</WebWizForums:feedURL>
  <image>
   <title>DevForce Community Forum</title>
   <url>http://www.ideablade.com/forum/forum_images/IdeaBlade_logo_tm.png</url>
   <link>http://www.ideablade.com/forum/</link>
  </image>
  <item>
   <title>Object Graph Dirty Detection : Hi Matt,One solution you could...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2379&amp;PID=9448#9448</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=449" rel="nofollow">smi-mark</a><br /><strong>Subject:</strong> 2379<br /><strong>Posted:</strong> 21-Dec-2010 at 9:00pm<br /><br />Hi Matt,<br><br>One solution you could do is manage the EntityChanged event on the EntityManager. You can then find what entity has changed, and if it is in the list of types you are interested in, you can mark your form as dirty. Once you save/cancel you can reset this flag.<br><br>]]>
   </description>
   <pubDate>Tue, 21 Dec 2010 21:00:51 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2379&amp;PID=9448#9448</guid>
  </item> 
  <item>
   <title>Object Graph Dirty Detection : Hi Silvio,  Thanks for the reply....</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2379&amp;PID=9447#9447</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=889" rel="nofollow">mdcalhoun</a><br /><strong>Subject:</strong> 2379<br /><strong>Posted:</strong> 21-Dec-2010 at 11:46am<br /><br />Hi Silvio,<DIV>&nbsp;</DIV><DIV>Thanks for the reply. Unfortunately&nbsp;your suggestions&nbsp;won't work for my situation.</DIV><DIV>&nbsp;</DIV><DIV>I&nbsp;need to know if any changes have been made to&nbsp;a specific object (and all its sub objects),&nbsp;not the whole manager.&nbsp;So, mgr.HasChanges() won't help me here.</DIV><DIV>&nbsp;</DIV><DIV>As for your second suggestion, that helps to let me know if an object is added/removed from the collection. I want to know if any PROPERTY on any object in the graph has been changed. For example, the CollectionChanged event won't fire if I changed a property on one of the version objects contained in the Version collection. </DIV><DIV>&nbsp;</DIV><DIV>I'm hoping there is a better way than to write code to iterate every object on the graph (and all the child objects and all of the child object's children, etc.) and check to see if it has changes.</DIV><DIV>&nbsp;</DIV><DIV>Thanks,</DIV><DIV>Matt</DIV>]]>
   </description>
   <pubDate>Tue, 21 Dec 2010 11:46:03 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2379&amp;PID=9447#9447</guid>
  </item> 
  <item>
   <title>Object Graph Dirty Detection : Hi Matt,  You could try  mgr.HasChanges();   as...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2379&amp;PID=9446#9446</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=892" rel="nofollow">sbelini</a><br /><strong>Subject:</strong> 2379<br /><strong>Posted:</strong> 21-Dec-2010 at 11:22am<br /><br />Hi Matt,<DIV>&nbsp;</DIV><DIV>You could try</DIV><DIV>&nbsp;</DIV><DIV><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>mgr.HasChanges();</DIV><DIV><DIV></FONT></FONT>&nbsp;</DIV><DIV>as the EntityManager is marked "dirty" when any entity that it manages is changed.</DIV><DIV>&nbsp;</DIV><DIV>Also, you could set events on the collections:</DIV><DIV><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas></FONT></FONT>&nbsp;</DIV><DIV><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>...</FONT></FONT></DIV><DIV><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>myDeal.Versions.CollectionChanged += MakeItDirty;</FONT></FONT></DIV><DIV><FONT size=2 face=C&#111;nsolas>myDeal.Labors.CollectionChanged += MakeItDirty;</FONT></DIV><DIV><FONT size=2 face=C&#111;nsolas>myDeal.Parts.CollectionChanged += MakeItDirty;</FONT></DIV><DIV><FONT size=2 face=C&#111;nsolas>...</FONT></DIV><DIV><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas></FONT></FONT></FONT>&nbsp;</DIV><DIV><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>public</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> </FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>void</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> MakeItDirty(</FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>object</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> sender, </FONT></FONT><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas>NotifyCollectionChangedEventArgs</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> e) {</DIV><DIV><DIV></FONT></FONT><FONT color=#008000 size=2 face=C&#111;nsolas><FONT color=#008000 size=2 face=C&#111;nsolas><FONT color=#008000 size=2 face=C&#111;nsolas>&nbsp; // Make it dirty code</DIV><DIV></FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>}</DIV><DIV></FONT></FONT>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV>I hope it helps.</DIV><DIV>&nbsp;&nbsp; Silvio.</DIV></DIV></DIV>]]>
   </description>
   <pubDate>Tue, 21 Dec 2010 11:22:11 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2379&amp;PID=9446#9446</guid>
  </item> 
  <item>
   <title>Object Graph Dirty Detection : Hello,   I am wondering if there...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2379&amp;PID=9414#9414</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=889" rel="nofollow">mdcalhoun</a><br /><strong>Subject:</strong> 2379<br /><strong>Posted:</strong> 15-Dec-2010 at 1:50pm<br /><br />Hello, <DIV>&nbsp;</DIV><DIV>I am wondering if there is a way to determine if any object in the graph is in a "dirty" state. I have a View that updates multiple levels of the object graph and want to enable/disable the save button as well as display a warning if closing the view without saving (if dirty).</DIV><DIV>&nbsp;</DIV><DIV>As an example, if the graph looked like:</DIV><DIV>&nbsp;</DIV><DIV><DIV>Deal<BR>--Collection of Version Objects<BR>----Collection of Labor Objects<BR>----Collection of Parts Objects</DIV></DIV><DIV>&nbsp;</DIV><DIV>I'm looking for something like myDeal.EntityAspect.HasChanges </DIV><DIV>&nbsp;</DIV><DIV>which would return true if Deal, any Version, Any Labor on Any Version, Any Part on Any&nbsp;Version had changes.</DIV><DIV>&nbsp;</DIV><DIV>Thanks,</DIV><DIV>Matt</DIV>]]>
   </description>
   <pubDate>Wed, 15 Dec 2010 13:50:52 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2379&amp;PID=9414#9414</guid>
  </item> 
 </channel>
</rss>