<?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 : RelatedEntityList events</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2009 : RelatedEntityList events</description>
  <pubDate>Sun, 12 Apr 2026 02:48:38 -700</pubDate>
  <lastBuildDate>Mon, 25 Jan 2010 11:22:07 -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=1618</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>RelatedEntityList events : Thanks for sharing this, Paul. ...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1618&amp;PID=6130#6130</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=21" rel="nofollow">IdeaBlade</a><br /><strong>Subject:</strong> 1618<br /><strong>Posted:</strong> 25-Jan-2010 at 11:22am<br /><br />Thanks for sharing this, Paul.]]>
   </description>
   <pubDate>Mon, 25 Jan 2010 11:22:07 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1618&amp;PID=6130#6130</guid>
  </item> 
  <item>
   <title>RelatedEntityList events : Hi Greg,   Your right. In the...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1618&amp;PID=6110#6110</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=472" rel="nofollow">Sinnema</a><br /><strong>Subject:</strong> 1618<br /><strong>Posted:</strong> 23-Jan-2010 at 3:27am<br /><br />Hi Greg, <DIV>&nbsp;</DIV><DIV>Your right. In the mean time we've cooked up a solution. Below's (part of)&nbsp;our code. We attach to the ListChanged event and act accordingly. This class is base on a class we call the ObservableList&lt;T&gt; which already has an implementation of the OnListChanged event (override). The class uses the RelatedEntityList&lt;T&gt; of DevForce and maintains its own list (that's why there is a RefillList()). The class is build using the principal: 'First make it work, than make it better and than make it fast'. We've proved it works.</DIV><DIV>&nbsp;</DIV><DIV>Regards,</DIV><DIV>Paul Sinnema</DIV><DIV>Diartis AG</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;&nbsp; public override void OnListChanged(object sender, ObservableListChangedEventArgs e)<BR>&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;if (m_SuspendItemChangedEvents == 0)<BR>&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;switch (e.Action)<BR>&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case ObservableListChangedAction.Add:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;base.OnListChanged(sender, e);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;AttachPropertyChangedEvents(e.NewItems);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break;</DIV><DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case ObservableListChangedAction.Remove:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DetachPropertyChangedEvents(e.OldItems);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;base.OnListChanged(sender, e);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break;</DIV><DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case ObservableListChangedAction.Replace:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case ObservableListChangedAction.Move:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DetachPropertyChangedEvents(e.OldItems);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;base.OnListChanged(sender, e);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;AttachPropertyChangedEvents(e.NewItems);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break;</DIV><DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case ObservableListChangedAction.None:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case ObservableListChangedAction.Reset:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case ObservableListChangedAction.Resync:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;base.OnListChanged(sender, e);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break;</DIV><DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;default:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;throw new InvalidArgumentException("e.Action", e.Action);<BR>&nbsp;&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;}<BR></DIV><DIV>private void AttachChangedEvents()<BR>&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;if (m_RelatedEntityList != null)<BR>&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;m_RelatedEntityList.CollectionChanged += RelatedEntityListCollectionChanged;</DIV><DIV>&nbsp;&nbsp;&nbsp;&nbsp;AttachPropertyChangedEvents(m_RelatedEntityList);<BR>&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;}</DIV><DIV>&nbsp;&nbsp;private void AttachPropertyChangedEvents(IList list)<BR>&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;foreach (T item in list)<BR>&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;item.PropertyChanged += ItemPropertyChanged;<BR>&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;}</DIV><DIV>&nbsp;&nbsp;private void DetachChangedEvents()<BR>&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;if (m_RelatedEntityList != null)<BR>&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;m_RelatedEntityList.CollectionChanged -= RelatedEntityListCollectionChanged;</DIV><DIV>&nbsp;&nbsp;&nbsp;&nbsp;DetachPropertyChangedEvents(m_RelatedEntityList);<BR>&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;}</DIV><DIV>&nbsp;&nbsp;private void DetachPropertyChangedEvents(IList list)<BR>&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;foreach (T item in list)<BR>&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;item.PropertyChanged -= ItemPropertyChanged;<BR>&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;}</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;&nbsp; private void ItemPropertyChanged(object sender, PropertyChangedEventArgs e)<BR>&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;if (sender is T)<BR>&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;int index = IndexOf((T)sender);<BR>&nbsp;&nbsp;&nbsp;&nbsp;if (index &gt;= 0)<BR>&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.OnItemChanged(sender, new ItemPropertyChangedEventArgs(this, sender, index, e.PropertyName));<BR>&nbsp;&nbsp;&nbsp;&nbsp;}</DIV><DIV>&nbsp;&nbsp;&nbsp;&nbsp;RefillList();<BR>&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;}</DIV><span style="font-size:10px"><br /><br />Edited by Sinnema - 23-Jan-2010 at 3:28am</span>]]>
   </description>
   <pubDate>Sat, 23 Jan 2010 03:27:46 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1618&amp;PID=6110#6110</guid>
  </item> 
  <item>
   <title>RelatedEntityList events : It is the entity itself that must...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1618&amp;PID=6102#6102</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=4" rel="nofollow">GregD</a><br /><strong>Subject:</strong> 1618<br /><strong>Posted:</strong> 21-Jan-2010 at 9:29am<br /><br />It is the entity itself that must provide the initial notification that it has been changed; so it seems to me that any wrapper list class you create that is supposed to forward this notification must set up handlers for the individual entities' PropertyChanged events so that it (the wrapper list) can know this has occurred and so forward this information to its own event subscribers. This would be true no matter how you get the entities with which your wrapper list will be populated. <br>]]>
   </description>
   <pubDate>Thu, 21 Jan 2010 09:29:58 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1618&amp;PID=6102#6102</guid>
  </item> 
  <item>
   <title>RelatedEntityList events : In our Entities (the partial class)...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1618&amp;PID=6099#6099</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=472" rel="nofollow">Sinnema</a><br /><strong>Subject:</strong> 1618<br /><strong>Posted:</strong> 20-Jan-2010 at 10:54pm<br /><br />In our Entities (the partial class) we use&nbsp;an ObservableProperty.&nbsp;This class notifies other of changes to its value. Our classes register with these properties and act accordingly. We use the AfterSet&nbsp;interceptor of DevForce to set the values in our properties. All this code for propagating etc. is generated using T4.&nbsp;At the moment we don't use any other sources than the entities of DevForce and I don't think that is going to change soon. <span style="font-size:10px"><br /><br />Edited by Sinnema - 20-Jan-2010 at 10:55pm</span>]]>
   </description>
   <pubDate>Wed, 20 Jan 2010 22:54:14 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1618&amp;PID=6099#6099</guid>
  </item> 
  <item>
   <title>RelatedEntityList events : I&amp;#039;m not quite understanding...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1618&amp;PID=6092#6092</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=21" rel="nofollow">IdeaBlade</a><br /><strong>Subject:</strong> 1618<br /><strong>Posted:</strong> 19-Jan-2010 at 1:36pm<br /><br />I'm not quite understanding what your specific issue is with the RelatedEntityList. How do you provide the functionality you desire (specifically, notice about internal changes to the contained items) when you get your data from other sources?<br><br>]]>
   </description>
   <pubDate>Tue, 19 Jan 2010 13:36:09 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1618&amp;PID=6092#6092</guid>
  </item> 
  <item>
   <title>RelatedEntityList events : Hi,  We&amp;#039;ve constructed...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1618&amp;PID=6088#6088</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=472" rel="nofollow">Sinnema</a><br /><strong>Subject:</strong> 1618<br /><strong>Posted:</strong> 15-Jan-2010 at 11:55pm<br /><br />Hi,<DIV>&nbsp;</DIV><DIV>We've constructed a pretty nifty bunch of classes that we call ObservableLists. These lists can do the following:</DIV><UL><LI>One can add new items to the lists.</LI><LI>The list than observes changes to the items in the list and tells all subscribed clients (using several mechanisms like INotifyProperyChanged, OnValueChanged, OnItemChanged, OnListChanged, etc.).</LI><LI>The different flavors are needed because there are incompatibilities&nbsp;between the different&nbsp;assemblies we use (like DevForce, WPF and .NET Collections).</LI></UL><P>The Classes we've written so far are:</P><UL><LI>ObservableList</LI><LI>FilteredObservableList</LI><LI>RelatedList</LI><LI>RelatedEntityList</LI><LI>AbstractSequenceHistoryList</LI><LI>AbstractIntersectingHistoryList</LI></UL><P>And there ViewModel counterparts. The list is still growing.</P><DIV></DIV><DIV></DIV>Now we have a problem with the RelatedEntityList of DevForce. It does a fine job of maintaining items correctly in the list but it does not tell our lists when changes in items of the list take place, other than CollectionChanged (items added, moved, deleted, etc) and PropertyChanged (a property of the list was changed).<DIV></DIV><DIV>&nbsp;</DIV><DIV>We could add &#091;AfterSet&#093; interceptors for all properties of the items in the list but that would be like shooting a fly with a canon. Our ObservableLists depend on getting ValueChanged, ItemChanged, ListChanged and PropertyChanged events (overrides). Is there a way to get these kinds of events from the RelatedEntityList?</DIV><DIV>&nbsp;</DIV><DIV>Regards,</DIV><DIV>Paul Sinnema</DIV><DIV>Diartis AG</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Fri, 15 Jan 2010 23:55:08 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1618&amp;PID=6088#6088</guid>
  </item> 
 </channel>
</rss>