<?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 : Entity Refetch and PropertyChanged</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2010 : Entity Refetch and PropertyChanged</description>
  <pubDate>Sun, 26 Jul 2026 17:31:06 -700</pubDate>
  <lastBuildDate>Mon, 18 Jul 2011 12:06:27 -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=2830</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>Entity Refetch and PropertyChanged :   Thanks Silvio! </title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2830&amp;PID=11252#11252</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1112" rel="nofollow">samir</a><br /><strong>Subject:</strong> 2830<br /><strong>Posted:</strong> 18-Jul-2011 at 12:06pm<br /><br />Thanks Silvio!]]>
   </description>
   <pubDate>Mon, 18 Jul 2011 12:06:27 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2830&amp;PID=11252#11252</guid>
  </item> 
  <item>
   <title>Entity Refetch and PropertyChanged :    Hi Samir,DevForce will raise...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2830&amp;PID=11251#11251</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> 2830<br /><strong>Posted:</strong> 18-Jul-2011 at 12:01pm<br /><br />Hi Samir,<div>&nbsp;</div><div>DevForce will raise PropertyChanged on an entity when it´s first loaded only if you set it the event handler in the constructor. </div><div>However, this&nbsp;will not work in n-tier because serialization does not use the constructor.</div><div>&nbsp;</div><div>In the PropertyChanged handler you will not be able to detect if the entity is being refetched or rolledback, but you could do it by using the EntityChanged handler instead. It has EntityActions that would help you determine these events:</div><div>&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">void</font></font></font><font size="2" face="C&#111;nsolas"><font size="2" face="C&#111;nsolas"> mgr_EntityChanged(</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">EntityChangedEventArgs</font></font></font><font size="2" face="C&#111;nsolas"><font size="2" face="C&#111;nsolas"> e) {</font></font></div><div><font size="2" face="C&#111;nsolas">&nbsp; <font color="#0000ff"><font color="#0000ff"><font color="#0000ff">if</font></font></font> (e.Action == <font color="#2b91af"><font color="#2b91af"><font color="#2b91af">EntityAction</font></font></font>.ChangeCurrentAndOriginal || e.Action == <font color="#2b91af"><font color="#2b91af"><font color="#2b91af">EntityAction</font></font></font>.ChangeOriginal) {</font></div><div><font size="2" face="C&#111;nsolas">&nbsp;&nbsp;&nbsp; <font color="#2b91af"><font color="#2b91af"><font color="#2b91af">MessageBox</font></font></font>.Show(<font color="#a31515"><font color="#a31515"><font color="#a31515">"Refetch"</font></font></font>);</font></div><div><font size="2"><font face="C&#111;nsolas">&nbsp; </font><font face="C&#111;nsolas">}</font></font></div><div><font size="2" face="C&#111;nsolas">&nbsp; <font color="#0000ff"><font color="#0000ff"><font color="#0000ff">if</font></font></font> (e.Action == <font color="#2b91af"><font color="#2b91af"><font color="#2b91af">EntityAction</font></font></font>.Rollback) {</font></div><div><font size="2" face="C&#111;nsolas">&nbsp;&nbsp;&nbsp; <font color="#2b91af"><font color="#2b91af"><font color="#2b91af">MessageBox</font></font></font>.Show(<font color="#a31515"><font color="#a31515"><font color="#a31515">"RejectChanges"</font></font></font>);</font></div><div><font size="2" face="C&#111;nsolas">&nbsp; }</font></div><div><font size="2" face="C&#111;nsolas">}</font></div><div>&nbsp;</div><div>Regards,</div><div>&nbsp;&nbsp; Silvio.</div><span style="font-size:10px"><br /><br />Edited by sbelini - 18-Jul-2011 at 12:02pm</span>]]>
   </description>
   <pubDate>Mon, 18 Jul 2011 12:01:16 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2830&amp;PID=11251#11251</guid>
  </item> 
  <item>
   <title>Entity Refetch and PropertyChanged :   Hi.From what I was able to...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2830&amp;PID=11237#11237</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1112" rel="nofollow">samir</a><br /><strong>Subject:</strong> 2830<br /><strong>Posted:</strong> 14-Jul-2011 at 4:05pm<br /><br />Hi.<div>&nbsp;</div><div>From what I was able to verify, DevForce raises PropertyChanged on an entity with e.PropertyName="" when it´s first loaded, when it´s refetched and also when we call RejectChanges().</div><div>&nbsp;</div><div>Is there any way to know in&nbsp;my PropertyChanged handler if the entity is being first loaded, refetched or RejectChanges() has been called?</div><div>&nbsp;</div><div>Thanks,<br>Samir</div>]]>
   </description>
   <pubDate>Thu, 14 Jul 2011 16:05:01 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2830&amp;PID=11237#11237</guid>
  </item> 
 </channel>
</rss>