<?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 : Get/Set Interceptors</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2009 : Get/Set Interceptors</description>
  <pubDate>Sat, 11 Apr 2026 22:18:54 -700</pubDate>
  <lastBuildDate>Tue, 10 Mar 2009 10:36:21 -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=1118</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>Get/Set Interceptors : Excellent. Thanks! </title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1118&amp;PID=4011#4011</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=452" rel="nofollow">ken.nelson</a><br /><strong>Subject:</strong> 1118<br /><strong>Posted:</strong> 10-Mar-2009 at 10:36am<br /><br />Excellent.&nbsp; Thanks!]]>
   </description>
   <pubDate>Tue, 10 Mar 2009 10:36:21 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1118&amp;PID=4011#4011</guid>
  </item> 
  <item>
   <title>Get/Set Interceptors : Property interceptors in a nested...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1118&amp;PID=4010#4010</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=11" rel="nofollow">kimj</a><br /><strong>Subject:</strong> 1118<br /><strong>Posted:</strong> 10-Mar-2009 at 9:48am<br /><br /><P>Property interceptors in a nested public class will still automatically be discovered and applied to properties in the parent class, so you can do something like the following to lessen Intellisense clutter:</P><DIV>public partial class&nbsp;Employee {</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;&nbsp; public class NestedPropertyInterceptors {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#091;BeforeGet(EntityPropertyNames.LastName)&#093;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public static void BeforeGetLastName(IPropertyInterceptorArgs args) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var emp = args.Instance as Employee;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Console.Writeline("emp:BeforeGetLastName");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp; }</DIV><DIV>}</DIV><DIV>&nbsp;</DIV><DIV>You can also define interception methods in a separate class, being sure to provide the TargetType of the interceptor, and then call the DiscoverInterceptorsFromAttributes method of the PropertyInterceptorManager to force discovery, like this:</DIV><DIV>&nbsp;</DIV><DIV>PropertyInterceptorManager.CurrentInstance.DiscoverInterceptorsFromAttributes(</DIV><DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; typeof(EmployeeInterceptorExtensions));</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;&nbsp;&nbsp; public class EmployeeInterceptorExtensions {</DIV><DIV>&nbsp;</DIV><DIV>&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#091;BeforeSet( Employee.EntityPropertyNames.Country, TargetType=typeof(Employee))&#093;<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; public static void LowercaseCountry(IPropertyInterceptorArgs&lt;Employee, String&gt; args) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var country = args.Value;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!String.IsNullOrEmpty(country)) {<BR>&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; args.Value = country.ToLower();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp; }<BR></DIV>]]>
   </description>
   <pubDate>Tue, 10 Mar 2009 09:48:14 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1118&amp;PID=4010#4010</guid>
  </item> 
  <item>
   <title>Get/Set Interceptors : Thanks for the info.    I...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1118&amp;PID=4007#4007</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=452" rel="nofollow">ken.nelson</a><br /><strong>Subject:</strong> 1118<br /><strong>Posted:</strong> 10-Mar-2009 at 7:59am<br /><br />Thanks for the info.<DIV>&nbsp;</DIV><DIV><DIV></DIV><DIV></DIV>I have one follow on question regarding Property Interceptors.&nbsp; It appears that any method defined as a Property Interceptor must have public scope.&nbsp; When&nbsp;I tried private and internal the method never executes.&nbsp; While it's not a huge problem to have these methods be public, it really dirties up Intellisense.</DIV><DIV>&nbsp;</DIV><DIV>I've tried using the System.ComponentModel attribute: <FONT color=#dfdfbf>&#091;</FONT><FONT color=#e1795b>EditorBrowsable</FONT><FONT color=#dfdfbf>(</FONT><FONT color=#2b91af>EditorBrowsableState</FONT><FONT color=#dfdfbf>.Never)&#093; </FONT><FONT color=#000000>but it still does not hide the method from displaying in Intellisense.</FONT></DIV><DIV>&nbsp;</DIV><DIV>The only other 'solution' I could find to the problem was to prefix all of my Property&nbsp;Interceptors with an underline "_", to force them to move out of the way in Intellisense, but this is more of a hack than a real solution, and they're still visible in Intellisense, they're just not mixed in with real properties and methods.</DIV><DIV>&nbsp;</DIV><DIV>Do you have a workaround for this?</DIV><DIV>&nbsp;</DIV><DIV>Thanks,</DIV><DIV>Ken</DIV>]]>
   </description>
   <pubDate>Tue, 10 Mar 2009 07:59:19 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1118&amp;PID=4007#4007</guid>
  </item> 
  <item>
   <title>Get/Set Interceptors : Ken,  You&amp;#039;re not doing...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1118&amp;PID=3989#3989</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=11" rel="nofollow">kimj</a><br /><strong>Subject:</strong> 1118<br /><strong>Posted:</strong> 05-Mar-2009 at 1:59pm<br /><br />Ken,<DIV>&nbsp;</DIV><DIV>You're not doing anything wrong.&nbsp; We didn't get the documentation completely&nbsp;synchronized with the current functionality, and as you've found still have some old information.&nbsp; We'll fix this ASAP.</DIV><DIV>&nbsp;</DIV><DIV>In version 4.3.0 the get/set interceptors are always available and not controlled via the Object Mapper.&nbsp; See the new chapter on Property Interceptors in the Dev Guide for information on how to use them.</DIV>]]>
   </description>
   <pubDate>Thu, 05 Mar 2009 13:59:35 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1118&amp;PID=3989#3989</guid>
  </item> 
  <item>
   <title>Get/Set Interceptors : Hi, I&amp;#039;m using DevForceEF...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1118&amp;PID=3986#3986</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=452" rel="nofollow">ken.nelson</a><br /><strong>Subject:</strong> 1118<br /><strong>Posted:</strong> 05-Mar-2009 at 12:37pm<br /><br />Hi, I'm using DevForceEF version 4.3.0 and am a little confused about Get/Set interceptors.&nbsp; Mostly because I can't seem to find them anywhere.&nbsp; In previous versions of DevForceEF, in the Object Mapper I was able to choose from Get/Set Interceptor modes, and it's still in the current documentation that this is still supported (around page 119 of the Developers Guide), but the options simply aren't there for me.&nbsp; Any idea what&nbsp;I'm doing wrong? <DIV><DIV></DIV><img src="http://www.ideablade.com/forum/uploads/452/what.png" height="575" width="958" border="0" style="20HEIGHT:%20%20400px" /></DIV><span style="font-size:10px"><br /><br />Edited by ken.nelson - 05-Mar-2009 at 12:38pm</span>]]>
   </description>
   <pubDate>Thu, 05 Mar 2009 12:37:40 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1118&amp;PID=3986#3986</guid>
  </item> 
 </channel>
</rss>