<?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 for valerio.net</title>
	<atom:link href="http://thevalerios.net/matt/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://thevalerios.net/matt</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Wed, 13 Jan 2010 16:31:08 -0600</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>Comment on A Type-safe BackgroundWorker Wrapper by stefan</title>
		<link>http://thevalerios.net/matt/2008/05/a-type-safe-backgroundworker-wrapper/comment-page-1/#comment-14340</link>
		<dc:creator>stefan</dc:creator>
		<pubDate>Wed, 13 Jan 2010 16:31:08 +0000</pubDate>
		<guid isPermaLink="false">http://thevalerios.net/matt/?p=18#comment-14340</guid>
		<description>hello,

can you post the source code for this example?

Thank you</description>
		<content:encoded><![CDATA[<p>hello,</p>
<p>can you post the source code for this example?</p>
<p>Thank you</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Great IoC and DI Articles by matt</title>
		<link>http://thevalerios.net/matt/2009/12/great-ioc-and-di-articles/comment-page-1/#comment-14324</link>
		<dc:creator>matt</dc:creator>
		<pubDate>Tue, 12 Jan 2010 16:48:12 +0000</pubDate>
		<guid isPermaLink="false">http://thevalerios.net/matt/2009/12/great-ioc-and-di-articles/#comment-14324</guid>
		<description>Thanks, Mark.

I did notice your discussion about the Service Locator (anti)pattern in your upcoming book (MEAP Ch 5).

This brings up some very interesting points.  I need to dig in and learn more.</description>
		<content:encoded><![CDATA[<p>Thanks, Mark.</p>
<p>I did notice your discussion about the Service Locator (anti)pattern in your upcoming book (MEAP Ch 5).</p>
<p>This brings up some very interesting points.  I need to dig in and learn more.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Great IoC and DI Articles by Mark Seemann</title>
		<link>http://thevalerios.net/matt/2009/12/great-ioc-and-di-articles/comment-page-1/#comment-14323</link>
		<dc:creator>Mark Seemann</dc:creator>
		<pubDate>Tue, 12 Jan 2010 16:41:10 +0000</pubDate>
		<guid isPermaLink="false">http://thevalerios.net/matt/2009/12/great-ioc-and-di-articles/#comment-14323</guid>
		<description>FWIW I consider Service Locator to be an anti-pattern, since it is totally opaque to the user of the API which dependencies need to be in place; thus, one could easily invoke methods on objects in a context where the Service Locator would throw, and the API gives you absolutely no clue that this is the case.

Much more about that in my book :)

With that in mind I consider the Common Service Locator redundant at best. Personally, I would never take a depedency on it.</description>
		<content:encoded><![CDATA[<p>FWIW I consider Service Locator to be an anti-pattern, since it is totally opaque to the user of the API which dependencies need to be in place; thus, one could easily invoke methods on objects in a context where the Service Locator would throw, and the API gives you absolutely no clue that this is the case.</p>
<p>Much more about that in my book <img src='http://thevalerios.net/matt/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>With that in mind I consider the Common Service Locator redundant at best. Personally, I would never take a depedency on it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Exception Handling, Queuing, and UI Synchronization for WCF Services Using the CCR by Keith</title>
		<link>http://thevalerios.net/matt/2008/11/exception-handling-queuing-and-ui-synchronization-for-wcf-services-using-the-ccr/comment-page-1/#comment-14217</link>
		<dc:creator>Keith</dc:creator>
		<pubDate>Tue, 05 Jan 2010 20:28:53 +0000</pubDate>
		<guid isPermaLink="false">http://thevalerios.net/matt/2008/11/exception-handling-queuing-and-ui-synchronization-for-wcf-services-using-the-ccr/#comment-14217</guid>
		<description>Any chance that you will be posting a working example of the code from this article?</description>
		<content:encoded><![CDATA[<p>Any chance that you will be posting a working example of the code from this article?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Use ThreadPool.QueueUserWorkItem With Anonymous Types by Drew</title>
		<link>http://thevalerios.net/matt/2008/05/use-threadpoolqueueuserworkitem-with-anonymous-types/comment-page-1/#comment-14192</link>
		<dc:creator>Drew</dc:creator>
		<pubDate>Mon, 04 Jan 2010 20:23:13 +0000</pubDate>
		<guid isPermaLink="false">http://thevalerios.net/matt/?p=14#comment-14192</guid>
		<description>What is the reference &quot;s&quot; in the following?
s =&gt; callback((T)s)

I&#039;m assuming it&#039;s a reference to an anonymous object, but I&#039;m not sure.</description>
		<content:encoded><![CDATA[<p>What is the reference &#8220;s&#8221; in the following?<br />
s =&gt; callback((T)s)</p>
<p>I&#8217;m assuming it&#8217;s a reference to an anonymous object, but I&#8217;m not sure.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Great IoC and DI Articles by Steven</title>
		<link>http://thevalerios.net/matt/2009/12/great-ioc-and-di-articles/comment-page-1/#comment-13687</link>
		<dc:creator>Steven</dc:creator>
		<pubDate>Fri, 11 Dec 2009 12:04:50 +0000</pubDate>
		<guid isPermaLink="false">http://thevalerios.net/matt/2009/12/great-ioc-and-di-articles/#comment-13687</guid>
		<description>I haven&#039;t been able to use it in a production setting yet, but I&#039;ve already advised some of my customers to place their home grown IoC libraries behind the CSL facade.

What&#039;s nice about the CSL is that it is created in collaboration with people from the major IoC frameworks.

There are however still some things that has to be sorted out. Look for instance at this discussion I started: http://commonservicelocator.codeplex.com/Thread/View.aspx?ThreadId=77730. Next to that there are some minor issues, like this one: http://commonservicelocator.codeplex.com/WorkItem/View.aspx?WorkItemId=9676.</description>
		<content:encoded><![CDATA[<p>I haven&#8217;t been able to use it in a production setting yet, but I&#8217;ve already advised some of my customers to place their home grown IoC libraries behind the CSL facade.</p>
<p>What&#8217;s nice about the CSL is that it is created in collaboration with people from the major IoC frameworks.</p>
<p>There are however still some things that has to be sorted out. Look for instance at this discussion I started: <a href="http://commonservicelocator.codeplex.com/Thread/View.aspx?ThreadId=77730" rel="nofollow">http://commonservicelocator.codeplex.com/Thread/View.aspx?ThreadId=77730</a>. Next to that there are some minor issues, like this one: <a href="http://commonservicelocator.codeplex.com/WorkItem/View.aspx?WorkItemId=9676." rel="nofollow">http://commonservicelocator.codeplex.com/WorkItem/View.aspx?WorkItemId=9676.</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Great IoC and DI Articles by matt</title>
		<link>http://thevalerios.net/matt/2009/12/great-ioc-and-di-articles/comment-page-1/#comment-13667</link>
		<dc:creator>matt</dc:creator>
		<pubDate>Thu, 10 Dec 2009 14:56:18 +0000</pubDate>
		<guid isPermaLink="false">http://thevalerios.net/matt/2009/12/great-ioc-and-di-articles/#comment-13667</guid>
		<description>Oh wow, thanks a bunch Steven.  That looks great - I&#039;ll definitely check it out. Have you used it?</description>
		<content:encoded><![CDATA[<p>Oh wow, thanks a bunch Steven.  That looks great &#8211; I&#8217;ll definitely check it out. Have you used it?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Great IoC and DI Articles by Steven</title>
		<link>http://thevalerios.net/matt/2009/12/great-ioc-and-di-articles/comment-page-1/#comment-13658</link>
		<dc:creator>Steven</dc:creator>
		<pubDate>Thu, 10 Dec 2009 07:40:31 +0000</pubDate>
		<guid isPermaLink="false">http://thevalerios.net/matt/2009/12/great-ioc-and-di-articles/#comment-13658</guid>
		<description>Hi Matt,

Have you ever seen the Common Service Locator project? http://commonservicelocator.codeplex.com/. In itself it&#039;s not a DI framework, but it&#039;s a shared interface for plugging in DI frameworks.

Cheers</description>
		<content:encoded><![CDATA[<p>Hi Matt,</p>
<p>Have you ever seen the Common Service Locator project? <a href="http://commonservicelocator.codeplex.com/" rel="nofollow">http://commonservicelocator.codeplex.com/</a>. In itself it&#8217;s not a DI framework, but it&#8217;s a shared interface for plugging in DI frameworks.</p>
<p>Cheers</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on A Type-safe BackgroundWorker Wrapper by Ivan Farkas</title>
		<link>http://thevalerios.net/matt/2008/05/a-type-safe-backgroundworker-wrapper/comment-page-1/#comment-11860</link>
		<dc:creator>Ivan Farkas</dc:creator>
		<pubDate>Wed, 30 Sep 2009 07:20:33 +0000</pubDate>
		<guid isPermaLink="false">http://thevalerios.net/matt/?p=18#comment-11860</guid>
		<description>I liked your cless so much I extended it.
Thx for the inspiration. Cheers, Ivan


using System;
using System.Linq;
using System.Linq.Expressions;
using System.ComponentModel;
using System.Threading;
using System.Collections.Generic;
using System.Text;

namespace DB
{
    public class DoWorkArg
    {
        public T Arg { get; private set; }
        public Action ReportProgress;
        public Action CancelAsync;

        public DoWorkArg(T Arg, Action reportProgress, Action cancelAsync)
        {
            this.Arg = Arg;
            this.ReportProgress = reportProgress;
            this.CancelAsync = cancelAsync;
        }
    }

    public class WorkerResult
    {
        public T Result { get; private set; }
        public Exception Error { get; private set; }
        public bool Cancelled { get; private set; }

        public WorkerResult(T result, Exception error, bool cancelled)
        {
            this.Result = result;
            this.Error = error;
            this.Cancelled = cancelled;
        }
    }

    public class WorkerProgress
    {
        public int ProgressPercentage { get; private set; }
        public Tus UserState { get;  private set; }

        public WorkerProgress(int progressPercentage, Tus userState)
        {
            this.ProgressPercentage = progressPercentage;
            this.UserState = userState;
        }
    }

    public class QueueItem
    {
        public Tin Arg { get; private set; }
        public BackgroundWorker BackgroundWorker { get; private set; }

        public QueueItem(BackgroundWorker backgroundWorker, Tin Arg)
        {
            this.BackgroundWorker = backgroundWorker;
            this.Arg = Arg;
        }
    }

    //public static class QueuedBackgroundWorker
    //{
    //    public static void QueueWorkItem(
    //        Queue&lt;QueueItem&gt; queue,
    //        Tin inputArg,
    //        Func&lt;DoWorkArg, Tout&gt; doWork,
    //        Action&lt;WorkerResult&gt; workerCompleted)
    //    {
    //        if (queue == null)
    //        {
    //            throw new ArgumentNullException(&quot;queue&quot;);
    //        }
    //        BackgroundWorker bw = new BackgroundWorker();

    //        bw.WorkerReportsProgress = true;
    //        bw.WorkerSupportsCancellation = true;
    //        bw.DoWork += (sender, args) =&gt;
    //        {
    //            if (doWork != null)
    //            {
    //                args.Result = doWork(new DoWorkArg((Tin)args.Argument));
    //            }
    //        };

    //        bw.RunWorkerCompleted += (sender, args) =&gt;
    //        {
    //            if (workerCompleted != null)
    //            {
    //                workerCompleted(new WorkerResult((Tout)args.Result, args.Error));
    //            }
    //            queue.Dequeue();
    //            if (queue.Count &gt; 0)
    //            {
    //                QueueItem nextItem = queue.Peek();
    //                nextItem.BackgroundWorker.RunWorkerAsync(nextItem.Arg);
    //            }
    //        };

    //        queue.Enqueue(new QueueItem(bw, inputArg));
    //        if (queue.Count == 1)
    //        {
    //            QueueItem nextItem = queue.Peek();
    //            nextItem.BackgroundWorker.RunWorkerAsync(nextItem.Arg);
    //        }
    //    }
    //}

    public static class BackgroundWorkerHelper
    {
        public static void DoWork(
            Tin inArg,
            Func&lt;DoWorkArg, Tout&gt; doWork,
            Action&lt;WorkerResult&gt; workerCompleted,
            Action&lt;WorkerProgress&gt; progressChanged)
        {
            BackgroundWorker bw = new BackgroundWorker();

            bw.WorkerReportsProgress = true;
            bw.WorkerSupportsCancellation = true;
            bw.DoWork += (sender, args) =&gt;
            {
                if (doWork != null)
                {
                    Action reportProgress = new Action(bw.ReportProgress);
                    Action cancelAsync = new Action(bw.CancelAsync);
                    args.Result = doWork(new DoWorkArg((Tin)args.Argument, reportProgress, cancelAsync));
                }
            };
            bw.RunWorkerCompleted += (sender, args) =&gt;
            {
                if (workerCompleted != null)
                {
                    workerCompleted(new WorkerResult((Tout)args.Result, args.Error, args.Cancelled));
                }
            };
            bw.ProgressChanged += (sender, args) =&gt;
            {
                if (progressChanged != null)
                {
                    progressChanged(new WorkerProgress(args.ProgressPercentage, (Tus)args.UserState));
                }
            };
            bw.RunWorkerAsync(inArg);
        }
    }
}</description>
		<content:encoded><![CDATA[<p>I liked your cless so much I extended it.<br />
Thx for the inspiration. Cheers, Ivan</p>
<p>using System;<br />
using System.Linq;<br />
using System.Linq.Expressions;<br />
using System.ComponentModel;<br />
using System.Threading;<br />
using System.Collections.Generic;<br />
using System.Text;</p>
<p>namespace DB<br />
{<br />
    public class DoWorkArg<br />
    {<br />
        public T Arg { get; private set; }<br />
        public Action ReportProgress;<br />
        public Action CancelAsync;</p>
<p>        public DoWorkArg(T Arg, Action reportProgress, Action cancelAsync)<br />
        {<br />
            this.Arg = Arg;<br />
            this.ReportProgress = reportProgress;<br />
            this.CancelAsync = cancelAsync;<br />
        }<br />
    }</p>
<p>    public class WorkerResult<br />
    {<br />
        public T Result { get; private set; }<br />
        public Exception Error { get; private set; }<br />
        public bool Cancelled { get; private set; }</p>
<p>        public WorkerResult(T result, Exception error, bool cancelled)<br />
        {<br />
            this.Result = result;<br />
            this.Error = error;<br />
            this.Cancelled = cancelled;<br />
        }<br />
    }</p>
<p>    public class WorkerProgress<br />
    {<br />
        public int ProgressPercentage { get; private set; }<br />
        public Tus UserState { get;  private set; }</p>
<p>        public WorkerProgress(int progressPercentage, Tus userState)<br />
        {<br />
            this.ProgressPercentage = progressPercentage;<br />
            this.UserState = userState;<br />
        }<br />
    }</p>
<p>    public class QueueItem<br />
    {<br />
        public Tin Arg { get; private set; }<br />
        public BackgroundWorker BackgroundWorker { get; private set; }</p>
<p>        public QueueItem(BackgroundWorker backgroundWorker, Tin Arg)<br />
        {<br />
            this.BackgroundWorker = backgroundWorker;<br />
            this.Arg = Arg;<br />
        }<br />
    }</p>
<p>    //public static class QueuedBackgroundWorker<br />
    //{<br />
    //    public static void QueueWorkItem(<br />
    //        Queue&lt;QueueItem&gt; queue,<br />
    //        Tin inputArg,<br />
    //        Func&lt;DoWorkArg, Tout&gt; doWork,<br />
    //        Action&lt;WorkerResult&gt; workerCompleted)<br />
    //    {<br />
    //        if (queue == null)<br />
    //        {<br />
    //            throw new ArgumentNullException(&#8221;queue&#8221;);<br />
    //        }<br />
    //        BackgroundWorker bw = new BackgroundWorker();</p>
<p>    //        bw.WorkerReportsProgress = true;<br />
    //        bw.WorkerSupportsCancellation = true;<br />
    //        bw.DoWork += (sender, args) =&gt;<br />
    //        {<br />
    //            if (doWork != null)<br />
    //            {<br />
    //                args.Result = doWork(new DoWorkArg((Tin)args.Argument));<br />
    //            }<br />
    //        };</p>
<p>    //        bw.RunWorkerCompleted += (sender, args) =&gt;<br />
    //        {<br />
    //            if (workerCompleted != null)<br />
    //            {<br />
    //                workerCompleted(new WorkerResult((Tout)args.Result, args.Error));<br />
    //            }<br />
    //            queue.Dequeue();<br />
    //            if (queue.Count &gt; 0)<br />
    //            {<br />
    //                QueueItem nextItem = queue.Peek();<br />
    //                nextItem.BackgroundWorker.RunWorkerAsync(nextItem.Arg);<br />
    //            }<br />
    //        };</p>
<p>    //        queue.Enqueue(new QueueItem(bw, inputArg));<br />
    //        if (queue.Count == 1)<br />
    //        {<br />
    //            QueueItem nextItem = queue.Peek();<br />
    //            nextItem.BackgroundWorker.RunWorkerAsync(nextItem.Arg);<br />
    //        }<br />
    //    }<br />
    //}</p>
<p>    public static class BackgroundWorkerHelper<br />
    {<br />
        public static void DoWork(<br />
            Tin inArg,<br />
            Func&lt;DoWorkArg, Tout&gt; doWork,<br />
            Action&lt;WorkerResult&gt; workerCompleted,<br />
            Action&lt;WorkerProgress&gt; progressChanged)<br />
        {<br />
            BackgroundWorker bw = new BackgroundWorker();</p>
<p>            bw.WorkerReportsProgress = true;<br />
            bw.WorkerSupportsCancellation = true;<br />
            bw.DoWork += (sender, args) =&gt;<br />
            {<br />
                if (doWork != null)<br />
                {<br />
                    Action reportProgress = new Action(bw.ReportProgress);<br />
                    Action cancelAsync = new Action(bw.CancelAsync);<br />
                    args.Result = doWork(new DoWorkArg((Tin)args.Argument, reportProgress, cancelAsync));<br />
                }<br />
            };<br />
            bw.RunWorkerCompleted += (sender, args) =&gt;<br />
            {<br />
                if (workerCompleted != null)<br />
                {<br />
                    workerCompleted(new WorkerResult((Tout)args.Result, args.Error, args.Cancelled));<br />
                }<br />
            };<br />
            bw.ProgressChanged += (sender, args) =&gt;<br />
            {<br />
                if (progressChanged != null)<br />
                {<br />
                    progressChanged(new WorkerProgress(args.ProgressPercentage, (Tus)args.UserState));<br />
                }<br />
            };<br />
            bw.RunWorkerAsync(inArg);<br />
        }<br />
    }<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Exception Handling, Queuing, and UI Synchronization for WCF Services Using the CCR by Eric</title>
		<link>http://thevalerios.net/matt/2008/11/exception-handling-queuing-and-ui-synchronization-for-wcf-services-using-the-ccr/comment-page-1/#comment-11378</link>
		<dc:creator>Eric</dc:creator>
		<pubDate>Fri, 11 Sep 2009 23:27:07 +0000</pubDate>
		<guid isPermaLink="false">http://thevalerios.net/matt/2008/11/exception-handling-queuing-and-ui-synchronization-for-wcf-services-using-the-ccr/#comment-11378</guid>
		<description>Do you have this zipped up? I walked through this but at the end, it kinda falls apart. When reviewing my windows form, I can&#039;t view it in design mode.</description>
		<content:encoded><![CDATA[<p>Do you have this zipped up? I walked through this but at the end, it kinda falls apart. When reviewing my windows form, I can&#8217;t view it in design mode.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
