<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: (SPWeb)properties.Feature.Parent no more &#8230; a handy Feature Receiver Base Class</title>
	<atom:link href="http://trentacular.com/2009/04/base-feature-receiver/feed/" rel="self" type="application/rss+xml" />
	<link>http://trentacular.com/2009/04/base-feature-receiver/</link>
	<description>Trent Foley's Spectacular Technical Blog</description>
	<lastBuildDate>Wed, 01 Feb 2012 21:02:45 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
	<item>
		<title>By: Juan</title>
		<link>http://trentacular.com/2009/04/base-feature-receiver/comment-page-1/#comment-2332</link>
		<dc:creator>Juan</dc:creator>
		<pubDate>Thu, 01 Dec 2011 05:02:55 +0000</pubDate>
		<guid isPermaLink="false">http://trentacular.com/?p=104#comment-2332</guid>
		<description>Interesting, I think it&#039;s a bit of overkill, but it might have some other useful applications. I use Lambda functions, and extensions methods for Disposing of SPWeb and SPSite, and also disposing memory leans on traversals of objects. Some might say that is overkill too.</description>
		<content:encoded><![CDATA[<p>Interesting, I think it&#8217;s a bit of overkill, but it might have some other useful applications. I use Lambda functions, and extensions methods for Disposing of SPWeb and SPSite, and also disposing memory leans on traversals of objects. Some might say that is overkill too.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ry</title>
		<link>http://trentacular.com/2009/04/base-feature-receiver/comment-page-1/#comment-1013</link>
		<dc:creator>Ry</dc:creator>
		<pubDate>Thu, 21 Jan 2010 09:45:26 +0000</pubDate>
		<guid isPermaLink="false">http://trentacular.com/?p=104#comment-1013</guid>
		<description>Lovely :D thanks a million.</description>
		<content:encoded><![CDATA[<p>Lovely <img src='http://trentacular.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  thanks a million.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Trent</title>
		<link>http://trentacular.com/2009/04/base-feature-receiver/comment-page-1/#comment-790</link>
		<dc:creator>Trent</dc:creator>
		<pubDate>Mon, 26 Oct 2009 15:07:45 +0000</pubDate>
		<guid isPermaLink="false">http://trentacular.com/?p=104#comment-790</guid>
		<description>@Juozas

Using the generic restraint would work only for the Web and Site scopes.  The SPWebApplication and SPFarm objects do not implement IDisposable.

Also, it is &lt;strong&gt;not&lt;/strong&gt; necessary to dispose the SPWeb or SPSite object referenced by properties.Feature.Parent.  See the following links for more details:
http://solutionizing.net/2009/02/08/do-not-dispose-spfeaturereceiverproperties-feature-parent/
http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/c0f1a05f-f1db-4f37-8f24-5966ab43e73b/</description>
		<content:encoded><![CDATA[<p>@Juozas</p>
<p>Using the generic restraint would work only for the Web and Site scopes.  The SPWebApplication and SPFarm objects do not implement IDisposable.</p>
<p>Also, it is <strong>not</strong> necessary to dispose the SPWeb or SPSite object referenced by properties.Feature.Parent.  See the following links for more details:<br />
<a href="http://solutionizing.net/2009/02/08/do-not-dispose-spfeaturereceiverproperties-feature-parent/" rel="nofollow">http://solutionizing.net/2009/02/08/do-not-dispose-spfeaturereceiverproperties-feature-parent/</a><br />
<a href="http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/c0f1a05f-f1db-4f37-8f24-5966ab43e73b/" rel="nofollow">http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/c0f1a05f-f1db-4f37-8f24-5966ab43e73b/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Juozas</title>
		<link>http://trentacular.com/2009/04/base-feature-receiver/comment-page-1/#comment-788</link>
		<dc:creator>Juozas</dc:creator>
		<pubDate>Mon, 26 Oct 2009 09:43:42 +0000</pubDate>
		<guid isPermaLink="false">http://trentacular.com/?p=104#comment-788</guid>
		<description>I think you can improve BaseFeatureReceiver by adding a generic argument restriction:

class BaseFeatureReceiver : SPFeatureReceiver where T : IDisposable


Then you could implement FeatureActivated and FeatureDeactivating a little better:

    public sealed override void FeatureActivated(SPFeatureReceiverProperties properties)
        {
        using (T parent = (T)properties.Feature.Parent)
            {
            FeatureActivated(parent, properties);
            }
        }</description>
		<content:encoded><![CDATA[<p>I think you can improve BaseFeatureReceiver by adding a generic argument restriction:</p>
<p>class BaseFeatureReceiver : SPFeatureReceiver where T : IDisposable</p>
<p>Then you could implement FeatureActivated and FeatureDeactivating a little better:</p>
<p>    public sealed override void FeatureActivated(SPFeatureReceiverProperties properties)<br />
        {<br />
        using (T parent = (T)properties.Feature.Parent)<br />
            {<br />
            FeatureActivated(parent, properties);<br />
            }<br />
        }</p>
]]></content:encoded>
	</item>
</channel>
</rss>

