<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>SeeSharp</title><link>http://www.hightech.ir:80/SeeSharp</link><description>SeeSharp</description><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/SeeSharp" /><feedburner:info uri="seesharp" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item><title>Distributed Transactions Tweaks in NServiceBus</title><link>http://feedproxy.google.com/~r/SeeSharp/~3/uzYurqg6SLI/distributed-transactions-tweaks-in-nservicebus</link><description>&lt;p&gt;While using &lt;a href="http://nservicebus.com/"&gt;NServiceBus&lt;/a&gt; on the first engagement at &lt;a href="http://readify.net/"&gt;Readify&lt;/a&gt;, we had an interesting configuration. Development environment has a shared database which runs on a server but when creating the backend application, we're running NServiceBus on our local developer machines. When handling messages, NServiceBus creates an &lt;a href="http://msdn.microsoft.com/en-us/library/ms172152(v=vs.90).aspx"&gt;ambient transaction&lt;/a&gt; using MSDTC which spans multiple resources/machines and is of course a valuable feature because if an exception is thrown somewhere in your code when a message is being processed, database transactions (or any other DTC enlisted transactions for that matter) will automatically rollback so you won't have to write boilerplate code. This was problematic for us because DTC was not enabled on the database server so we couldn't test the application at all. We needed to tell NServiceBus not to use DTC around message consumers. You gotta love open-source projects because just by &lt;a href="https://github.com/NServiceBus/NServiceBus/blob/master/src/impl/unicast/transport/NServiceBus.Unicast.Transport.Transactional/TransactionalTransport.cs" target="_blank"&gt;looking at the code&lt;/a&gt;&amp;nbsp;we found out there is a property on TransactionalTransport named SuppressDTC which exactly does that, but how to set that? &lt;br /&gt;&lt;br /&gt;You see, NServiceBus uses &lt;a href="http://en.wikipedia.org/wiki/Inversion_of_control" target="_blank"&gt;IoC containers&lt;/a&gt; to find its components, so in this case TransactionalTransport (an ITransport implementation) is created by the container, so we'd have limited access to where it is created or how it is being registered in the container and have no elegant way to set this property, but luckily we were using &lt;a href="http://www.castleproject.org/container/index.html" target="_blank"&gt;Castle Windsor&lt;/a&gt;&amp;nbsp;container we could do much better with its extensibility model.&lt;br /&gt;&lt;br /&gt;In case you don't know, Castle Windsor allows you to tap into &lt;a href="http://stw.castleproject.org/Windsor.Lifecycle.ashx" target="_blank"&gt;creation of an object&lt;/a&gt; using ICommissionConcern (and a similar thing for when destroying an object). So all you needed to do to get called when an object of a certain type is created is to create a class implementing ICommissionConcern, which has only one method to implement. You also need to plug this class in and let the container know which component type is bound to this commission concern. This is done by implementing IContributeComponentModelConstruction interface and checking the interface or concrete type of the component that is being created. Too much said, you can see it all in one piece of code.&lt;/p&gt;
&lt;pre class="brush:c-sharp"&gt;public class TransportTransactionConfig : IContributeComponentModelConstruction
{
    public void ProcessModel(IKernel kernel, ComponentModel model)
    {
        if (model.Implementation != typeof(TransactionalTransport))
            return;
	
        var concern = new TransactionSuppressConcern();
        model.Lifecycle.Add(concern);
    }
	
    private class TransactionSuppressConcern : ICommissionConcern
    {
        public void Apply(ComponentModel model, object component)
        {
            ((TransactionalTransport)component).SupressDTC = ShouldSuppressDTC;
        }

        private bool ShouldSuppressDTC
        {
            get { return bool.Parse(ConfigurationManager.AppSettings["SuppressDTC"]); }
        }
    }
}&lt;/pre&gt;
&lt;pre&gt;&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/SeeSharp/~4/uzYurqg6SLI" height="1" width="1"/&gt;</description><pubDate>Tue, 29 May 2012 02:00:10 GMT</pubDate><guid isPermaLink="false">http://www.hightech.ir:80/SeeSharp/distributed-transactions-tweaks-in-nservicebus</guid><feedburner:origLink>http://www.hightech.ir:80/SeeSharp/distributed-transactions-tweaks-in-nservicebus</feedburner:origLink></item><item><title>Fun with Expression Trees</title><link>http://feedproxy.google.com/~r/SeeSharp/~3/SAkyDExLqb0/fun-with-expression-trees</link><description>&lt;p&gt;Logging is easy. We've all been there and done that, but when how do you log a request/response object of a webservice, specially when the WSDLs are being changed constantly? The requirements were easy, just log all the property names along with their values. The first obvious approach is the good old fashioned style:&lt;/p&gt;
&lt;pre class="brush:c-sharp"&gt;public static string GetRequestLog(this ServiceRequest request)
{
    var sb = new StringBuilder();
    sb.AppendFormat("FirstProperty:{0}", request.FirstProperty);
    sb.AppendFormat("SecondProperty:{0}", request.FirstProperty);
    ... 
    sb.AppendFormat("LastProperty:{0}", request.LastProperty);
    return sb.ToString();
}
&lt;/pre&gt;
&lt;p&gt;&lt;br /&gt;The problem is you code includes name and value of the property in two separate places and when you get an updated WSDL with most of the property names changed, you have to update two places, one of them being the property name in a string which makes it just harder to refactor and rename, but what can you do? You can shrug and say so be it, that is the problem at hand, until the next day you'll be handled the newer version of the WSDL, or you can do something about it.&lt;/p&gt;
&lt;p&gt;If performance is not an issue (well you should know better to turn the debugging on in production), you can get away by passing in an expression of the property. This was you're passing in the property as well as it's value!&lt;/p&gt;
&lt;pre class="brush:c-sharp"&gt;public static string GetRequestLog(this ServiceRequest request) 
{
    var sb = new StringBuilder();
    sb.AppendProperty(() =&amp;gt; request.FirstProperty);
    sb.AppendProperty(() =&amp;gt; request.SecondProperty);
    ...
    sb.AppendProperty(() =&amp;gt; request.HundredthProperty);
    return sb.ToString();
}
    
public static class StringBuilderExtension
{
    public static void AppendProperty&amp;lt;T&amp;gt;(this StringBuilder sb, Expression&amp;lt;Func&amp;lt;T&amp;gt;&amp;gt; property)
    {
        var memberInfo = GetMemberInfo(property);
        sb.AppendFormat("{0}: {1}", memberInfo.Name, SafeToString(property.Compile().Invoke()));
    }

    private static MemberInfo GetMemberInfo(Expression expression)
    {
        var lambda = (LambdaExpression)expression;
        MemberExpression memberExpression;
        if (lambda.Body is UnaryExpression)
        {
            var unaryExpression = (UnaryExpression)lambda.Body;
            memberExpression = (MemberExpression)unaryExpression.Operand;
        }
        else
        {
            memberExpression = (MemberExpression)lambda.Body;
        }
        return memberExpression.Member;
    }

    private static string SafeToString(object obj)
    {
        return obj == null ? ("null") : obj.ToString();
    }
}
&lt;/pre&gt;
&lt;p&gt;&lt;br /&gt;This of course is no magic these days, you probably have seen this when raising &lt;a href="http://msdn.microsoft.com/en-us/library/system.componentmodel.inotifypropertychanged.aspx"&gt;NotifyPropertyChange&lt;/a&gt; event in &lt;a href="http://caliburn.codeplex.com/"&gt;Caliburn&lt;/a&gt; or reading my &lt;a href="http://www.hightech.ir/SeeSharp/enhanced-inotifypropertychanged-revisited"&gt;blog post&lt;/a&gt; back in September 2008.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/SeeSharp/~4/SAkyDExLqb0" height="1" width="1"/&gt;</description><pubDate>Mon, 21 May 2012 07:00:21 GMT</pubDate><guid isPermaLink="false">http://www.hightech.ir:80/SeeSharp/fun-with-expression-trees</guid><feedburner:origLink>http://www.hightech.ir:80/SeeSharp/fun-with-expression-trees</feedburner:origLink></item><item><title>God Class and Helpers</title><link>http://feedproxy.google.com/~r/SeeSharp/~3/9ZFFlBGsBu4/god-class-and-helpers</link><description>&lt;p&gt;While code reviewing a client's code base I found this gem.&lt;/p&gt;
&lt;p&gt;&lt;img src="/Media/Default/BlogImages/GodClass.png" alt="" width="890" height="2131" /&gt;&lt;/p&gt;
&lt;p&gt;Enough has been said about &lt;a target="_blank" href="http://en.wikipedia.org/wiki/God_object"&gt;God Classes&lt;/a&gt; and &lt;a target="_blank" href="en.wikipedia.org/wiki/Separation_of_concerns"&gt;Separation of Concerns&lt;/a&gt; but I still wonder how putting everything in one place and call it "Helper" can help you. Their argument? It is easier to find the function we are looking for if everything is in one class.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/SeeSharp/~4/9ZFFlBGsBu4" height="1" width="1"/&gt;</description><pubDate>Tue, 31 Jan 2012 14:29:24 GMT</pubDate><guid isPermaLink="false">http://www.hightech.ir:80/SeeSharp/god-class-and-helpers</guid><feedburner:origLink>http://www.hightech.ir:80/SeeSharp/god-class-and-helpers</feedburner:origLink></item><item><title>My Geek Origin Story</title><link>http://feedproxy.google.com/~r/SeeSharp/~3/N0NT1qXLZJc/my-geek-origin-story</link><description>&lt;p&gt;While spending my last days at my country and not working on an interesting project to blog about, I thought a post about how I happen to be what I am today is in order. While reading a blog post by &lt;a target="_blank" href="http://www.richard-banks.org/"&gt;Richard Banks&lt;/a&gt;, I was inspired to write my Geek Origin Story, a movement initially started by &lt;a target="_blank" href="http://delicategeniusblog.com/?p=1292"&gt;Michael Kordahi&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;My dad used to work in department of power as an engineer as far as I can remember. I used to go with him to all power stations all around the country so eating out with other engineers and playing around gas turbines was something I was used to. Later when personal computers were taking off they grabbed one of the Siemens computers - they already had a lot of contracts with Siemens - and it was sitting there collecting dust in an office at the same floor as my dad's. The curious geek in me was getting itchy.&lt;br /&gt;&lt;br /&gt;When I was only nine years old, on his visit to Italy my father brought home the best gift ever! A Casio PB-700 computer with four 4 KB memory modules, and it was attachable to an extension unit with a tape drive and a printer. With BASIC programming language built-in opportunities seemed endless. Ain't that a beaut?&lt;/p&gt;
&lt;div class="center"&gt;&lt;img src="/Media/Default/BlogImages/GeekStory_Casio.jpg" alt="Cassio PB-700" height="331" width="441" /&gt;&lt;/div&gt;
&lt;p&gt;&lt;br /&gt;&lt;br /&gt;Unfortunately the manual was in Italian, but I started pushing the program samples into it and somehow deciphered how it worked. Soon I was heading to my cousin's computer bookshop - almost one and the only bookshop dedicate to selling computer books in the capital city - to borrow or read a book or two. Around that time ZX-Spectrum were becoming more common and it supported another variation of Basic language. I had very hard time adjusting the samples for ZX-Spectrum books to run on my Casio computer but I managed to do it to some good extent and did a lot of PEEK / POKE in the making.&lt;br /&gt;&lt;br /&gt;My next big computer was an Amiga 500. This one had a lot more juice in it and you could program it with C/C++, various Basic dialects, Pascal or other languages such as Oberon and Fortran - I barely knew any of them - but it also had a giant GPU so it suited very good for graphic applications. You see, personal computers back then mostly had a monochrome display and a command base OS while Amiga 500 had Graphical User Interface (GUI), a very rich music channels and a decent full-color monitor, so I was in for a good ride. This meant lots of Games, Music and Graphics, and did I mention games?&lt;/p&gt;
&lt;div class="center"&gt;&lt;img src="/Media/Default/BlogImages/GeekStory_Amigo.jpg" alt="Amigo 500" height="367" width="438" /&gt;&lt;/div&gt;
&lt;p&gt;&lt;br /&gt;&lt;br /&gt;Once I was in high school my father ordered a 80-386 PC computer, with a 5 &amp;frac14;&amp;rdquo; and 3 &amp;frac12;&amp;rdquo; floppy drives and 10 MB of hard disk! No it didn&amp;rsquo;t even have a mouse and no UI based OS. It ran MS-DOS 3.0 and it looked archaic comparing to my Amiga 500, but from the looks of how things were moving forward it seemed to be the future so I started reading more books and my cousin&amp;rsquo;s bookstore was a more common place. One of the best professional books I read was Dennis Ritchie's C programming language that put some sense into my brain.&lt;br /&gt;&amp;nbsp;&lt;br /&gt;By the time I was finishing high school, I helped the school's network administrator in removing the viruses or setup networking. After high school, being so fond of languages, I decided to study English language at university and learned French and Spanish - although not as good as I intended - in the process. Now although some find it strange and some other find it flat unacceptable, I see studying [real] languages has helped me lean computer languages and achieving my principal goal, which would have been next to impossible otherwise.&lt;br /&gt;&lt;br /&gt;Well that was my geek story&amp;hellip;what is yours?&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/SeeSharp/~4/N0NT1qXLZJc" height="1" width="1"/&gt;</description><pubDate>Thu, 19 Jan 2012 20:16:50 GMT</pubDate><guid isPermaLink="false">http://www.hightech.ir:80/SeeSharp/my-geek-origin-story</guid><feedburner:origLink>http://www.hightech.ir:80/SeeSharp/my-geek-origin-story</feedburner:origLink></item><item><title>Caliburn Meets TPL / Async</title><link>http://feedproxy.google.com/~r/SeeSharp/~3/c67DQ8yT5PQ/caliburn-meets-tpl-async</link><description>&lt;p&gt;With C# and Async integration in the language, you'll wonder how this fits in your current application infrastructure. I have started porting an old application into Silverlight 5.0 which comes with new C# 5.0 and Async features and I needed a way to integrate this with the &lt;a target="_blank" href="caliburn.codeplex.com"&gt;Calibrun&lt;/a&gt; framework I had in place.&lt;/p&gt;
&lt;p&gt;&lt;span class="subtitle"&gt;Caliburn Async Abstractions&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;In Caliburn you could expose your ViewModel actions as IResult / IEnumerable&amp;lt;IResult&amp;gt;. I have &lt;a target="_blank" href="http://www.hightech.ir/SeeSharp/wpf-application-with-caliburn-part-four"&gt;blogged&lt;/a&gt; about this before, but in short, it is a good way to abstract away the whole async stuff you have in your ViewModel and it made testing async actions in the view model much easier. Here's a typical action I had on a ViewModel:&lt;/p&gt;
&lt;pre class="brush:c-sharp"&gt;public IEnumerable&amp;lt;IResult&amp;gt; LoadEmployee()
{
    yield return Show.Busy();

    yield return new ServiceResult().Invoke(new EmployeeServiceClient().GetEmployeeAsync, SelectedEmployee.Id);

    yield return Show.NotBusy();
} 
&lt;/pre&gt;
&lt;p&gt;By using &lt;a target="_blank" href="caliburn.codeplex.com/wikipage?title=IResult"&gt;IResult&lt;/a&gt; we have modified the whole async and continuation into &lt;a target="_blank" href="en.wikipedia.org/wiki/Coroutine"&gt;coroutines&lt;/a&gt; which is much cleaner to read and easier to follow.&lt;/p&gt;
&lt;p&gt;&lt;span class="subtitle"&gt;Hello Async&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Now with async stuff in the horizon, how would async / await fit this scenario? Let's suppose we have the following async method in our View Model:&lt;/p&gt;
&lt;pre class="brush:c-sharp"&gt;private void LoadEmployeeAsync()
{
    var service = new EmployeeServiceClient();
    service.GetEmployeeCompleted += (s, e) =&amp;gt; { CurrentEmployee = e.Result };
    var employee = service.GetEmployee(SelectedEmployee.Id);
}
&lt;/pre&gt;
&lt;p&gt;At first we should convert this service call into the new async pattern:&lt;/p&gt;
&lt;pre class="brush:c-sharp"&gt;private async Task&amp;lt;Employee&amp;gt; LoadEmployeeAsync()
{
    IEmployeeSevice service = new EmployeeServiceClient();

    return await Task.Factory.FromAsync&amp;lt;Employee&amp;gt;(client.BeginGetEmployee(SelectedEmployee.Id, null, null), ar =&amp;gt; client.EndGetEmployee(ar));
}
&lt;/pre&gt;
&lt;p&gt;A couple of things to notice: We are now using the interface of the generated service, which exposes &lt;a target="_blank" href="msdn.microsoft.com/en-us/library/system.iasyncresult.aspx"&gt;IAsyncResult&lt;/a&gt; and we're returning the method call with a Task&amp;lt;TResult&amp;gt;. With the new async pattern, your method should either return void or Task / Task&amp;lt;T&amp;gt; before you can use the async keyword.&lt;/p&gt;
&lt;p&gt;&lt;span class="subtitle"&gt;There's an IResult for that&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Now the question is how to call the async method in a sequence of IResults. This would be the first attempt:&lt;/p&gt;
&lt;pre class="brush:c-sharp"&gt;public IEnumerable&amp;lt;IResult&amp;gt; LoadEmployee()
{
    yield return Show.Busy();

    yield return new ActionResult(() =&amp;gt; LoadEmployeeAsync());

    yield return Show.NotBusy();
} 

public class ActionResult : IResult
{
        public ActionResult(Action action)
        {
            ToExecute = action;
        }

        public Action ToExecute { get; set; }

        public override void Execute(ResultExecutionContext context)
        {
            ToExecute.Invoke();
            RaiseCompleted();
        }
}
&lt;/pre&gt;
&lt;p&gt;Apparently this won't work as expected because as soon as we call the async method it will return and we'll fire the Completed event on IResult which will move to execution of the next IResult in the sequence. What we want to do is to wait for the completion of the Task and then raise the Completed event, so I came up with this implementation:&lt;/p&gt;
&lt;pre class="brush:c-sharp"&gt;public class TaskResult : IResult
{
    public TaskResult(Func&amp;lt;Task&amp;gt; task)
    {
        ToExecute = task;
    }

    public Func&amp;lt;Task&amp;gt; ToExecute { get; set; }

    public override void Execute(ResultExecutionContext context)
    {
        ToExecute.Invoke().ContinueWith(task =&amp;gt; 
         {
             Execute.OnUIThread(() =&amp;gt; RaiseCompleted(task.IsCanceled, task.Exception));
         });
    }
}
&lt;/pre&gt;
&lt;p&gt;This is just the same API that is available today on TPL, so nothing fancy, the only thing worth mentioning here is that we're raising the Completed event on the UI thread using Execute class of Caliburn. The Execute class uses IDispatcher interface that wraps Silverlight / WPF dispatcher object. The final version of the TaskResult can be used like this:&lt;/p&gt;
&lt;pre class="brush:c-sharp"&gt;public IEnumerable&amp;lt;IResult&amp;gt; LoadEmployee()
{
    yield return Show.Busy();

    yield return new TaskResult&amp;lt;Employee&amp;gt;().Invoke(LoadEmployeeAsync).ContinueWith(task =&amp;gt; CurrentEmployee = task.Result);

    yield return Show.NotBusy();
} 
&lt;/pre&gt;
&lt;p&gt;This now fully supports calling Task or Task&amp;lt;T&amp;gt; methods and also has its own continuation support. This works right alongside other IResult implementations. Ideas?&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/SeeSharp/~4/c67DQ8yT5PQ" height="1" width="1"/&gt;</description><pubDate>Tue, 18 Oct 2011 06:35:56 GMT</pubDate><guid isPermaLink="false">http://www.hightech.ir:80/SeeSharp/caliburn-meets-tpl-async</guid><feedburner:origLink>http://www.hightech.ir:80/SeeSharp/caliburn-meets-tpl-async</feedburner:origLink></item><item><title>Introduction to WF Designer Rehosting - Part Three</title><link>http://feedproxy.google.com/~r/SeeSharp/~3/ULjVecYBByM/introduction-to-wf-designer-rehosting-part-three</link><description>&lt;p&gt;In &lt;a href="http://hightech.ir/SeeSharp/introduction-to-wf-designer-rehosting-part-two"&gt;previous posts&lt;/a&gt; we saw how to bind our designer properties to our activity and use VB.NET syntax for more complex values. In this post let's see how to show variables and work with namespaces.&lt;/p&gt;
&lt;p&gt;&lt;span class="subtitle"&gt;Importing Namespaces&lt;/span&gt;&lt;br /&gt; If you want to use certain types in your Xaml, you need to import necessary namespaces, as an example our List&amp;lt;T&amp;gt; type is in Sysem.Collections.Generic namespace which needs to be imported for a valid WF Xaml. Let's see how this is done.  When creating the WorkflowDesigner control, you initially need to create an empty workflow, like an empty &lt;a target="_blank" href="http://msdn.microsoft.com/en-us/library/system.workflow.activities.sequenceactivity%28v=vs.90%29.aspx"&gt;Sequence&lt;/a&gt; or &lt;a target="_blank" href="http://msdn.microsoft.com/en-us/library/system.activities.statements.flowchart.aspx"&gt;Flowchart&lt;/a&gt; and feed it to the Load method of the &lt;a target="_blank" href="http://msdn.microsoft.com/en-us/library/system.activities.presentation.workflowdesigner.aspx"&gt;WorkflowDesigner&lt;/a&gt;:&lt;/p&gt;
&lt;pre class="brush:c-sharp"&gt;private void CreateDesigner()
{
    designer = new WorkflowDesigner();
    designer.Load(CreateDefaultSequence());
    designer.Flush();
}

public Sequence CreateDefaultSequence()
{
    var seq = new Sequence {DisplayName = "Empty Sequence"};
    var settings = new VisualBasicSettings();
    var references = new VisualBasicImportReference {Assembly = "System", Import = "System.Collections.Generic"};
	
    settings.ImportReferences.Add(x));
    VisualBasic.SetSettings(seq, settings);

    return seq;
}
&lt;/pre&gt;
&lt;p&gt;Although user can import necessary namespaces using the designer, it'd be ideal to automatically import mostly used namespaces upon designer startup.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Note: Load method of designer accepts "Object" which is ambiguous as the only type of objects I managed to feed it was ActivityBuilder, Sequence and Flowchart.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="subtitle"&gt;Displaying Variables&lt;/span&gt;&lt;br /&gt; Sometimes you need to allow user to select an existing variable name and bind it to a property of your Activity. How do you do that? Remember the &lt;a target="_blank" href="http://msdn.microsoft.com/en-us/library/system.activities.presentation.model.modelitem.aspx"&gt;ModelItem&lt;/a&gt; property on your designer? The ModelItem property is hierarchical so traversing this you can gain access to the root element of your workflow (here we use a SequenceActivity) where defined variables can be found. ModelItem also has information about the type of the property so you can just select properties of certain type. The following extension method finds all available variables, regardless of their types:&lt;/p&gt;
&lt;pre class="brush:c-sharp"&gt;public static IEnumerable&amp;lt;ModelItem&amp;gt; FindAllVariables(this ModelItem selectedItem)
{
    var variables = new List&amp;lt;ModelItem&amp;gt;();
    while (selectedItem.Parent != null)
    {
        Type parentType = selectedItem.Parent.ItemType;
        if (typeof(System.Activities.Activity).IsAssignableFrom(parentType))
        {
            var mp = selectedItem.Parent.Properties["Variables"];
            if (mp != null &amp;amp;&amp;amp; mp.Collection != null &amp;amp;&amp;amp; mp.PropertyType == typeof(Collection&amp;lt;Variable&amp;gt;))
            {
                mp.Collection.ToList().ForEach(variables.Add);
            }
        }
		
        var dels = selectedItem.Properties.Where(p =&amp;gt; typeof(ActivityDelegate).IsAssignableFrom(p.PropertyType));
        foreach (var actdel in dels)
        {
            if (actdel.Value != null)
            {
                foreach (var innerProp in actdel.Value.Properties)
                {
                    if (typeof(DelegateArgument).IsAssignableFrom(innerProp.PropertyType) &amp;amp;&amp;amp; null != innerProp.Value)
                    {
                        variables.Add(innerProp.Value);
                    }
                }
            }
        }
        selectedItem = selectedItem.Parent;
    }

    return variables;
}
&lt;/pre&gt;
&lt;p&gt;Now to make this easier, let's think what is it that we want to select? We need the name of the variable, along with related ModelItem information, so let's create a Model class to contain this information:&lt;/p&gt;
&lt;pre class="brush:c-sharp"&gt;public class VariableItem : Observable
{
    public VariableItem(string name, ModelItem variable)
    {
        Name = name;
        Variable = variable;
    }

    public string Name { get; set; }

    public ModelItem Variable { get; set; }
}
&lt;/pre&gt;
&lt;p&gt;It is easier now to bind a &lt;a target="_blank" href="http://msdn.microsoft.com/en-us/library/system.windows.controls.combobox.aspx"&gt;ComboBox&lt;/a&gt; to a list of VariableItem instances. All we need to do is to get all the variable of certain types (or all the variables, regardless of their types) as a list of VariableItems and bind it in the designer. This extension method will do the trick for you and has both generic and non-generic flavors:&lt;/p&gt;
&lt;pre class="brush:c-sharp"&gt;public static IEnumerable&amp;lt;VariableItem&amp;gt; FindVariableOfType(this ModelItem selectedItem, Type typeToFind)
{
	var variables = FindAllVariables(selectedItem);
	var found = new Dictionary&amp;lt;string, ModelItem&amp;gt;();

	variables.ForEach(x =&amp;gt;
	{
		var name = x.Properties.GetValue&amp;lt;string&amp;gt;("Name");
		var type = x.Properties.GetValue&amp;lt;Type&amp;gt;("Type");

		if (type == typeToFind)
		{
			found.Add(name, x);
		}
	});

	return found.Select(x =&amp;gt; new VariableItem(x.Key, x.Value));
}

public static IEnumerable&amp;lt;VariableItem&amp;gt; FindVariableOfType&amp;lt;T&amp;gt;(this ModelItem selectedItem)
{
	return FindVariableOfType(selectedItem, typeof (T));
}
&lt;/pre&gt;
&lt;p&gt;Notice ModelItem has information about the variable, like name of the variable and the underlying type of the variable. In next post we'll see how to use complex objects in our activities and how to fill and serialize them to / from xaml from our custom designers.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/SeeSharp/~4/ULjVecYBByM" height="1" width="1"/&gt;</description><pubDate>Mon, 26 Sep 2011 18:06:04 GMT</pubDate><guid isPermaLink="false">http://www.hightech.ir:80/SeeSharp/introduction-to-wf-designer-rehosting-part-three</guid><feedburner:origLink>http://www.hightech.ir:80/SeeSharp/introduction-to-wf-designer-rehosting-part-three</feedburner:origLink></item><item><title>Introduction to WF Designer Rehosting - Part Two</title><link>http://feedproxy.google.com/~r/SeeSharp/~3/JvFbZ6ASIvY/introduction-to-wf-designer-rehosting-part-two</link><description>&lt;p&gt;In &lt;a href="http://hightech.ir/SeeSharp/introduction-to-wf-designer-hosting"&gt;first part&lt;/a&gt; of this serie we saw how to bind our designer properties to activity properties and create a custom designer for our activity. Let's see how to bind to activity properties through the designer and allow user to enter values in the designer.&lt;br /&gt;&lt;br /&gt;If you have some experience with WF Activities you know that input properties are of type &lt;a href="http://msdn.microsoft.com/en-us/library/dd465965.aspx"&gt;InArgument&amp;lt;T&amp;gt;&lt;/a&gt; so how do we convert and bind our regular types to a InArgument&amp;lt;T&amp;gt;?&lt;br /&gt;&lt;br /&gt;Let's go with simple types like String, supposing our SendTo activity has an Enabled property of type InArgument&amp;lt;bool&amp;gt; and we have a CheckBox on our designer. First approach would be to bind directly through ModelItem property of the designer, inherited from the base class by using a &lt;a href="http://msdn.microsoft.com/en-us/library/system.windows.data.ivalueconverter.aspx"&gt;ValueConverter&lt;/a&gt;:&lt;/p&gt;
&lt;pre class="brush:xml"&gt;&amp;lt;CheckBox IsChecked="{Binding Path=ModelItem.IsEnabled, Mode=TwoWay, Converter={StaticResource ValueToInArgumentLiteralConverter}}" /&amp;gt;
&lt;/pre&gt;
&lt;pre class="brush:csharp"&gt;public class ValueToInArgumentLiteralConverter : IValueConverter
{
    public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
    {
        if (value != null)
        {
            var modelItem = value as ModelItem;
            if (modelItem != null)
            {
                var expr = modelItem.Properties["Expression"];
                if(expr != null)
                {
                    return expr.Value;
                }
            }
        }

        return null;
    }

    public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
    {
        if (value == null) return null;

        var type = typeof (InArgument&amp;lt;&amp;gt;);
        var genericArgument = type.MakeGenericType(value.GetType());
        var argument = Activator.CreateInstance(genericArgument, value);
			
        return argument;
    }
}
&lt;/pre&gt;
&lt;p&gt;This approach works fine but only for simple scenarios. If you want more control on selected properties, changing values, having dependent properties or if your designer UI is complex, I advise using a ViewModel instead. You can access current ModelItem from your view:&lt;/p&gt;
&lt;pre class="brush:csharp"&gt;public interface ISendToDesigner
{
    ModelItem ModelItem { get; }
}

public class SendToViewModel 
{
    public virtual dynamic SelectedModelItem
    {
        get { return View != null ? View.ModelItem : null; }
    }

    public virtual bool IsEnabled
    {
        get { return isEnabled; }
        set
        {
            isEnabled = value;
            RaisePropertyChanged(() =&amp;gt; IsEnabled);
            UpdateModelProperties();
        }
    }

    private void UpdateModelProperties()
    {
        SelectedModelItem.IsEnabled = IsEnabled.ToInArgument();
    }
}
&lt;/pre&gt;
&lt;p&gt;Did you see SelectedModelItem is of &lt;a href="http://msdn.microsoft.com/en-us/library/dd264736.aspx"&gt;dynamic&lt;/a&gt; type? Exposing underlying ModelItem as dynamic allows us to directly assign properties without going through indexers. This trick results in much cleaner and better maintainable code, supposing you have unit tests for your view models! Also I'm using an extension method named &lt;em&gt;ToInArgument&lt;/em&gt; which converts the primitive values to InArgument. Here's the extension method:&lt;/p&gt;
&lt;pre class="brush:csharp"&gt;public static InArgument&amp;lt;T&amp;gt; ToInArgument&amp;lt;T&amp;gt;(this T value)
{
    return new InArgument&amp;lt;T&amp;gt;(value);
} 
&lt;/pre&gt;
&lt;p&gt;This works for primitive values but what if you have Enums, Guids, Lists or Dictionary properties on your Activity? Unfortunately though this seem to work, it won't and designer shows an error. The alternative would be to use &lt;a href="http://msdn.microsoft.com/en-us/library/dd782058.aspx"&gt;VisualBasicValue&amp;lt;T&amp;gt;&lt;/a&gt; instead. If you are a C# developer, welcome yourself to the world of VB.NET!&lt;br /&gt;&lt;br /&gt;Seems VisualBasicValue&amp;lt;T&amp;gt; can be assigned as InArgument&amp;lt;T&amp;gt; so you just need to convert your values to a VisualBasicValue. This approach works file with Enums as well, too bad you can not create an extension method with Enum constraint. Here's an extension method that converts your enum to VisualBasicValue:&lt;/p&gt;
&lt;pre class="brush:csharp"&gt;public static InArgument&amp;lt;T&amp;gt; ToExpression&amp;lt;T&amp;gt;(this T value)
{
    return new VisualBasicValue&amp;lt;T&amp;gt;(string.Format("{0}.{1}", typeof(T).Name, value));
}
&lt;/pre&gt;
&lt;p&gt;Now List and Dictionaries are a little bit different. Let's see how I convert List&amp;lt;Guid&amp;gt; to a VisualBasicValue and you can use the same approach to make it work for all generic types:&lt;/p&gt;
&lt;pre class="brush:csharp"&gt;public static InArgument&amp;lt;List&amp;lt;Guid&amp;gt;&amp;gt; ToExpression(this List&amp;lt;Guid&amp;gt; list)
{
    var expr = "New List(Of Guid) From {{{0}}}";
    var item = list.Select(i =&amp;gt; string.Format("New Guid(\"{0}\")", i));
    var items = string.Join(",", item);

    return new VisualBasicValue&amp;lt;List&amp;lt;Guid&amp;gt;&amp;gt;(string.Format(expr, items));
}
&lt;/pre&gt;
&lt;p&gt;On the &lt;a href="http://hightech.ir/SeeSharp/introduction-to-wf-designer-rehosting-part-three"&gt;next part&lt;/a&gt; of this post, we'll see how to allow user to select existing variables (of a specific types) and import needed namespaces into our workflow xaml.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/SeeSharp/~4/JvFbZ6ASIvY" height="1" width="1"/&gt;</description><pubDate>Mon, 26 Sep 2011 18:05:53 GMT</pubDate><guid isPermaLink="false">http://www.hightech.ir:80/SeeSharp/introduction-to-wf-designer-rehosting-part-two</guid><feedburner:origLink>http://www.hightech.ir:80/SeeSharp/introduction-to-wf-designer-rehosting-part-two</feedburner:origLink></item><item><title>Introduction to WF Designer Rehosting - Part One</title><link>http://feedproxy.google.com/~r/SeeSharp/~3/--2PDcb6grA/introduction-to-wf-designer-hosting</link><description>&lt;p&gt;I've recently been creating custom designer for Workflow Activities and hosting the whole WF designer in a web application. As there is very limited documentation and guide other than Microsoft Forums, here I'll try to shed some lights to some of the problems I have encountered. &lt;br /&gt;&lt;br /&gt;WF 4.0 designer is a set of WPF controls and classes designed with re-hosting in mind, so hosting the designer in an &lt;a target="_blank" href="http://msdn.microsoft.com/en-us/library/aa970060.aspx"&gt;XBAP application&lt;/a&gt; works to some extent without any pain. To start create a WPF (either browser or desktop) application that will be used as your WF Designer. There are a couple of controls you can add to your main window that make it look like out of the box designer:&lt;br /&gt;&lt;br /&gt;Toolbox Control: Is the toolbox control that contains your activities. You can create Categories and place your own and system activities into separate categories.&lt;br /&gt;&lt;br /&gt;Workflow Designer: Is the control that does all the heavy lifting like hosting the activities, generating xaml, loading and saving, etc.&lt;br /&gt;&lt;br /&gt;Property Editor: Workflow designer has a UIElement that is the property editor you can use to edit properties of the workflow/activity.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;div class="center"&gt;&lt;img src="/Media/Default/BlogImages/WF-Designer.jpg" height="415" width="623" /&gt;&lt;/div&gt;
&lt;p&gt;&lt;br /&gt;Let's say you have a &lt;em&gt;Send&lt;/em&gt; activity that sends out an email to selected recipients. You need to create a custom designer for the activity. The good thing is you don't need to anything to the source code of the activity, thanks to &lt;a target="_blank" href="http://msdn.microsoft.com/en-us/library/microsoft.windows.design.metadata.iregistermetadata(v=vs.90).aspx"&gt;IRegisterMetadata&lt;/a&gt; interface, you can add attributes to your activities from the outside. For those familiar with &lt;a target="_blank" href="http://www.hightech.ir/SeeSharp/wpf-controls-design-time-integration"&gt;WPF Design Time integrations&lt;/a&gt;, this is the same thing. To add necessary designer attribute to your Activity, you should do something like this:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;pre class="brush:c-sharp"&gt;public class SendToRegisterer : IRegisterMetadata
{
    [SecurityCritical]
    public void Register()
    {
        var builder = new AttributeTableBuilder();

        builder.AddCustomAttributes(typeof(SendTo), new DesignerAttribute(typeof(SendToDesigner)));
        builder.AddCustomAttributes(typeof(SendTo), "Receiver", new BrowsableAttribute(false));
        builder.AddCustomAttributes(typeof(SendTo), "Subject", new BrowsableAttribute(false));
			
        MetadataStore.AddAttributeTable(builder.CreateTable());
    }
}
&lt;/pre&gt;
&lt;p&gt;There are two things happening here: First we set the designer of &lt;em&gt;SendTo&lt;/em&gt; activity to &lt;em&gt;SendToDesigner&lt;/em&gt;, then we set &lt;a target="_blank" href="http://msdn.microsoft.com/en-us/library/system.componentmodel.browsableattribute.aspx"&gt;BrowsableAttribute&lt;/a&gt; with &lt;em&gt;False&lt;/em&gt; value to the properties of &lt;em&gt;SendTo&lt;/em&gt;. This makes the properties hidden on the property editor so you can make sure user can only interact with your activity through the designer.&lt;br /&gt;&lt;br /&gt;To create the designer class you need to create a WPF UserControl and make it derive from &lt;a target="_blank" href="http://msdn.microsoft.com/en-us/library/system.workflow.componentmodel.design.activitydesigner.aspx"&gt;ActivityDesigner&lt;/a&gt; in http://schemas.microsoft.com/netfx/2009/xaml/activities/presentation namespace. Among many things, this base class has a &lt;a target="_blank" href="http://msdn.microsoft.com/en-us/library/system.activities.presentation.model.modelitem.aspx"&gt;ModelItem&lt;/a&gt; property that allows interacting with the activity that is being displayed. You can bind activity properties to your designer directly using this property or alternatively bind the designer UI to your ViewModel and update the ModelItem property when you want to replicate the changes to the Model Item and update / generate WF Xaml.&lt;br /&gt;&lt;br /&gt;On the &lt;a href="http://hightech.ir/SeeSharp/introduction-to-wf-designer-rehosting-part-two"&gt;next post&lt;/a&gt;, we'll see how to bind designer UI to our activity properties.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/SeeSharp/~4/--2PDcb6grA" height="1" width="1"/&gt;</description><pubDate>Mon, 15 Aug 2011 17:32:53 GMT</pubDate><guid isPermaLink="false">http://www.hightech.ir:80/SeeSharp/introduction-to-wf-designer-hosting</guid><feedburner:origLink>http://www.hightech.ir:80/SeeSharp/introduction-to-wf-designer-hosting</feedburner:origLink></item><item><title>Installing Microsoft Dynamics on a XP machine</title><link>http://feedproxy.google.com/~r/SeeSharp/~3/nU--UbR04E0/installing-microsoft-dynamics-on-a-xp-machine</link><description>&lt;p&gt;The other day, I was starting a new gig to integrate an in-house sales system with Microsft Dynamics and naturally I needed to install MSDynamics on my machine. The best option was to install it on a VM so that I get rid of it after the project is done. I decided to install it on a Windows XP machine that needs less resource to run, but I bumped into something interesting:&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;div class="center"&gt;&lt;img src="/Media/Default/BlogImages/MSDynamics-Error.png" alt="Error Message" class="center" width="485" height="125" /&gt;&lt;/div&gt;
&lt;p&gt;&lt;br /&gt;It seems Micorosft Dynamics only installs on your machine if you have connected to a domain controller. But I don't have any domain controller, now what?&lt;/p&gt;
&lt;p&gt;The first solution is to download and install a [trial] version of Windows Server 2003/2008, add your XP machine to the domain, install, and then you are free to kill the domain controller altogether, but all these efforts just to install an application seems ridiculous.&lt;br /&gt;&lt;br /&gt;A better solution was to modify registery keys to fool your OS and make it think you are connected to a domain controller, but the server is not reachable at the moment! To do this, go to this registery key:&lt;/p&gt;
&lt;pre class="brush:text"&gt;HKLM\System\CurrentControlSet\Control\ComputerName\ActiveComputerName
&lt;/pre&gt;
&lt;p&gt;Enter any new name e.g. "VM" into this registery key. Now you also need to set an environment variable. You can do this using command prompt or by going to Control Panel, System, System Properties, Environment Variables. Add a new environment variable under System variables. The variable key is "UserDnsDomain" and you need to enter the same value you have entered in the registery key. You are all set. Run the installation and it will work this time. Remember to revert the registery key back to its original value when you are finished installing.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/SeeSharp/~4/nU--UbR04E0" height="1" width="1"/&gt;</description><pubDate>Wed, 06 Jul 2011 09:10:42 GMT</pubDate><guid isPermaLink="false">http://www.hightech.ir:80/SeeSharp/installing-microsoft-dynamics-on-a-xp-machine</guid><feedburner:origLink>http://www.hightech.ir:80/SeeSharp/installing-microsoft-dynamics-on-a-xp-machine</feedburner:origLink></item><item><title>One day in Kanban Land (Farsi)</title><link>http://feedproxy.google.com/~r/SeeSharp/~3/QAGkCupbTYQ/one-day-in-kanban-land-farsi</link><description>&lt;p&gt;If you are into &lt;a href="http://en.wikipedia.org/wiki/Agile_software_development"&gt;agile&lt;/a&gt; methodologies, you probably have seen the comic strips "One Day In Kanban Land" by &lt;a href="http://crisp.se/henrik.kniberg"&gt;Henrik Kniberg&lt;/a&gt;. He discussed it in mode depth with us in his Scrum Master course a while ago. This is the Farsi translated version. If you have seen the &lt;a href="http://blog.crisp.se/henrikkniberg/2009/06/26/1246053060000.html"&gt;original one&lt;/a&gt;, or don't speak Farsi, you may skip this post.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;div class="center"&gt;&lt;img src="/Media/Default/BlogImages/Kanban1.png" width="516" height="636" /&gt;&lt;br /&gt; &lt;img src="/Media/Default/BlogImages/Kanban2.png" /&gt;&lt;br /&gt; &lt;img src="/Media/Default/BlogImages/Kanban3.png" /&gt;&lt;br /&gt; &lt;img src="/Media/Default/BlogImages/Kanban4.png" /&gt;&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/SeeSharp/~4/QAGkCupbTYQ" height="1" width="1"/&gt;</description><pubDate>Mon, 20 Jun 2011 08:39:12 GMT</pubDate><guid isPermaLink="false">http://www.hightech.ir:80/SeeSharp/one-day-in-kanban-land-farsi</guid><feedburner:origLink>http://www.hightech.ir:80/SeeSharp/one-day-in-kanban-land-farsi</feedburner:origLink></item><item><title>WPF Application with Caliburn - Part Four</title><link>http://feedproxy.google.com/~r/SeeSharp/~3/1HgazOHmGMw/wpf-application-with-caliburn-part-four</link><description>&lt;p&gt;This is the next serie in the Caliburn tutorials. You can find previous post: &lt;a href="http://hightech.ir/SeeSharp/wpf-application-with-caliburn-part-one"&gt;Part One&lt;/a&gt;, &lt;a href="http://hightech.ir/SeeSharp/wpf-composite-application-with-caliburn-part-two"&gt;Part Two&lt;/a&gt;, &lt;a href="http://hightech.ir/SeeSharp/wpf-applications-with-caliburn-part-three"&gt;Part Three&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;One of the best features of Caliburn framework that I haven't seen in other MVVM frameworks, is a feature called Coroutines. Coroutines are according to Wikipedia:&lt;/p&gt;
&lt;blockquote&gt;In computer science, coroutines are program components that generalize subroutines to allow multiple entry points for suspending and resuming execution at certain locations. Coroutines are well-suited for implementing more familiar program components such as cooperative tasks, iterators,infinite lists and pipes.&lt;/blockquote&gt;
&lt;p&gt;This feature is extremely useful if you do async programming like accessing data over a webservice or execution of long running tasks on the background thread. Let's take a closer look on how to use this feature and how it helps us developing better applications and results in more maintainable code.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Note: This post will work equally on Caliburn 1.1 and 2.0.&lt;br /&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt; &lt;span class="subtitle"&gt;A Recap on Actions&lt;/span&gt;&lt;br /&gt;If you have seen other parts of Caliburn posts, Caliburn facilitates implementing MVVM by eliminating usage of ICommands. Forget about implementing ICommand interface or using RelayCommands. You can not directly bind your events to public actions on your ViewModel class. You no longer are limited by controls having commands, you can bind any arbitrary event to any public method on your ViewModel. Caliburn also checks for any existing preconditions based on the convention. The precondition, called Filters, are properties name the same as your action, but with a "Can" prefix. Here's how it looks to bind:&lt;/p&gt;
&lt;pre class="brush:xml"&gt;&amp;lt;Button cal:Message.Attach="[Event Click] = [Action ShowCustomers]"&amp;gt;
&lt;/pre&gt;
&lt;pre class="brush:c-sharp"&gt;public virtual bool CanShowOrders 
{
    get { return _canShowOrders; }
    set 
    {
        _canShowOrders = value;
        NotifyOfPropertyChanged(() =&amp;gt; CanShowOrders);    
    }
}

public virtual void ShowOrders()
{
    CurrentPresenter = ViewModelFactory.Create&amp;lt;IOrderViewModel&amp;gt;();
}
&lt;/pre&gt;
&lt;p&gt;&lt;span class="subtitle"&gt;&lt;br /&gt;Using Coroutines&lt;/span&gt;&lt;br /&gt;Your action that used to return &lt;em&gt;void&lt;/em&gt; can return a special return type that will be handeld by Caliburn upon execution. If your method returns an instance of &lt;em&gt;IResult &lt;/em&gt;interface it will be treated differently. First let us look at IResult interface:&lt;/p&gt;
&lt;pre class="brush:c-sharp"&gt;public interface IResult  
{  
    void Execute(ActionExecutionContext context);  
    event EventHandler&amp;lt;ResultCompletionEventArgs&amp;gt; Completed;  
}
&lt;/pre&gt;
&lt;p&gt;Very simple to implement! Basically, Execute method is called by Caliburn and this is where you implement the execution logic of this action. Caliburn then pauses unitl your action fires "Completed" event at which point it understands that action has compeleted and is finished. Where's the power, you may ask? Well you can send multiple IResults instanced from your action method by returning an IEnumerable&amp;amp;lt;IResult&amp;amp;gt; and since Caliburn waits for each action to fire its Completed event, all IResult instances are processed sequentially. An example is displaying a progress window, firing up a background worker to do a long running process data and stop progress window when the background worker is finished, let's see how:&lt;/p&gt;
&lt;pre class="brush:c-sharp"&gt;public IEnumerable&amp;lt;IResult&amp;gt; LoadOrders()
{
    yield return ProgressResult.Show("Loading Orders");
    yield return new ServiceFetchResult(...);
    yield return ProgressResult.Hide();
}
&lt;/pre&gt;
&lt;p&gt;And the outcome is that the progress window is still showing until ServiceFetchResult has finished the long running procedure.&lt;/p&gt;
&lt;div class="center"&gt;&lt;img src="/Media/Default/BlogImages/iSales-Progress.png" alt="Progress Window" width="516" height="338" /&gt;&lt;/div&gt;
&lt;p&gt;Remember how specially IResults are treated. In the above example, enumerable items are only processed if the previous one's Completed event is fired. This helps a lot when you do async style programming, specially in Silverlight which almost every outgoing request should run asynchronously. &lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="subtitle"&gt;Testability&lt;/span&gt;&lt;br /&gt;If you have used an async service, you know how painful it is when it comes down to testing. The problem is how the Async model works, and the easiest way is the same way you connect to webservices in Silverlight: First you subscribe to the event that is called when operation is completed, then you call the async method and wait for it to call you back on the callback handler. If you want to abstract it in an interface, it'd be something like this:&lt;/p&gt;
&lt;pre class="brush:c-sharp"&gt;public class FetchOrdersCompletedEventArgs : AsyncCompletedEventArgs
{
    public FetchOrdersCompletedEventArgs(Exception error, bool cancelled, object userState) 
        : base(error, cancelled, userState)
    {
    }
}

public class OrdersDataClient
{
    public void FetchOrdersAsync()
    {
        //some stuff
    }

    public event EventHandler&amp;lt;FetchOrdersCompletedEventArgs&amp;gt; FetchOrdersCompleted;
}&lt;/pre&gt;
&lt;p&gt;The problem with this code which makes it unsuitable for testing is that you usually generate proxies for your services and this piece of generated code has numerous problems: there's no clean interface and even generated methods are not virtual, making the whole thing unreplaceable in testing (at least by conventional tools). Notice that this implemnentation of async pattern which uses events is much cleaner than the one using IAsyncResult and callbacks, but still not much good in unit testing.&lt;/p&gt;
&lt;p&gt;Now lets sit back and see what is it that we want to test? Let's suppose we want to test that LoadOrders will load orders from the correct service operation, how would we do that?&lt;/p&gt;
&lt;pre class="brush:c-sharp"&gt;[Test]
public void Orders_Are_Loaded_From_Service()
{
    var mockService = Mock&amp;lt;OrdersServiceClient&amp;gt;();

    var vm = new OrderViewModel(mockService);

    vm.LoadOrders();

    mockService.AssertWasCalled(x =&amp;gt; x.FetchOrdersAsync());
}
&lt;/pre&gt;
&lt;p&gt;This code would have worked unless you can't mocked out the service that easily, remember? Now here's how using IResult would help you test the same thing, but with a changed mindset:&lt;/p&gt;
&lt;pre class="brush:c-sharp"&gt;[Test]
public void Orders_Are_Loaded_From_Service()
{
    var vm = new OrderViewModel();

    var results = vm.LoadOrders().ToList();
    var fetchRequest = results[1] as ServiceFetchResult;
            
    Assert.NotNull(fetchRequest);
    Assert.That(fetchRequest.Action.Method.Name, Is.EqualTo("FetchOrdersAsync"));
}
&lt;/pre&gt;
&lt;p&gt;&lt;span class="subtitle"&gt;&lt;br /&gt;Conclusion&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;If you need to go through this in more detail, feel free to grab the &lt;a target="_blank" href="/Files/iSales - Using IResults.zip"&gt;source code&lt;/a&gt; of this part from here. This one uses the latest Caliburn 2.x version. We'll cover how to migrate from version 1.5 in the next post.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/SeeSharp/~4/1HgazOHmGMw" height="1" width="1"/&gt;</description><pubDate>Mon, 06 Jun 2011 05:27:30 GMT</pubDate><guid isPermaLink="false">http://www.hightech.ir:80/SeeSharp/wpf-application-with-caliburn-part-four</guid><feedburner:origLink>http://www.hightech.ir:80/SeeSharp/wpf-application-with-caliburn-part-four</feedburner:origLink></item><item><title>Farsi Library - Version 2.0 now available</title><link>http://feedproxy.google.com/~r/SeeSharp/~3/pYtDjnZBMYQ/farsi-library-version-20-now-available</link><description>&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_Z5KTIfnfuNs/SAM_56lN6GI/AAAAAAAAACU/DdSClSDHBkc/s1600-h/FAMonthView.png"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer;" src="http://2.bp.blogspot.com/_Z5KTIfnfuNs/SAM_56lN6GI/AAAAAAAAACU/DdSClSDHBkc/s320/FAMonthView.png" id="BLOGGER_PHOTO_ID_5189061459871393890" border="0" /&gt;&lt;/a&gt;Version 2.0 of FarsiLibrary is now available. The following changes are made in this release :&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style="color: #ff0000;"&gt;Modified &lt;/span&gt;: Migrated to Visual Studio .NET 2008. Still using .NET Framework 2.0, so you just need the new IDE to compile. Might affect clients using old .NET Framework 2.0 (without the new SP Installed).&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="color: #ff0000;"&gt;Modified &lt;/span&gt;: IComparer and IComparer
&lt;persiandate&gt; are converted to explicit implementation in PersianDate class.&lt;/persiandate&gt;&lt;br /&gt;
&lt;persiandate&gt;&lt;br /&gt;&lt;/persiandate&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="color: #ff0000;"&gt;Modified &lt;/span&gt;: ICloneable interface implementation is converted to explicit implementation in PersianDate class.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="color: #ff0000;"&gt;Modified &lt;/span&gt;: Assign method of PersianDate to internal.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="color: #ff0000;"&gt;Modified &lt;/span&gt;: Changed the Day/Month/Year change eventhandler type to EventHandler&lt;datechangedeventargs&gt;. You can use the New/Old value properties to access the underlying values.&lt;br /&gt;&lt;br /&gt;&lt;/datechangedeventargs&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="color: #ff0000;"&gt;Modified &lt;/span&gt;: FALocalizeManager now is a singleton class. Use the Instance property instead of static methods.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="color: #ff0000;"&gt;Modified &lt;/span&gt;: FAMessageBoxManager.Delete method now returns boolean value based on whether the delete operation was successful or not.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="color: #3366ff;"&gt;Added &lt;/span&gt;: Implementation of IsLeapMonth method in PersianCalendar.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="color: #3366ff;"&gt;Added &lt;/span&gt;: Solution Items folder.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="color: #3366ff;"&gt;Added &lt;/span&gt;: Partial Office 2007 Blue theme. Drawing of dropdown buttons of FADatePicker control need a better visualization.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="color: #3366ff;"&gt;Added &lt;/span&gt;: PainterFactory to create painters based on the state of BaseStyledControl.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="color: #3366ff;"&gt;Added &lt;/span&gt;: FAMessageBox now implementes IDisposable interface explicitly. Dispose method is made internal.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="color: #006600;"&gt;Fixed &lt;/span&gt;: When changing the culture, Year value didn't change, e.g. when in Farsi culture in year 1385 culture is set to english, the year remain 1385 (which was a valid year in English calendar).&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="color: #006600;"&gt;Fixed &lt;/span&gt;: When changing the DefaultCulture property, Day and Month properties did not return the culture-specific values.&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style="color: #006600;"&gt;Fixed&lt;/span&gt;&lt;span style="color: #006600;"&gt; &lt;/span&gt;: A bug when accessing Now property of PersianDate class.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;br /&gt;Please report any bug you might encounter. You can download the source code from &lt;a href="http://blog.hightech.ir/BlogFiles/FarsiLibrary_2.0_Src.zip"&gt;here&lt;/a&gt; and the binary (including test project executables) from &lt;a href="http://blog.hightech.ir/BlogFiles/FarsiLibrary_2.0_Release.zip"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;More information about this project can be found on my Code Project article at &lt;a href="http://www.codeproject.com/KB/selection/FarsiLibrary.aspx"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;div class="blogger-post-footer"&gt;&lt;img src="https://blogger.googleusercontent.com/tracker/6069495622049300789-5588888989458478956?l=heskandari.blogspot.com" height="1" width="1" /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SeeSharp/~4/pYtDjnZBMYQ" height="1" width="1"/&gt;</description><pubDate>Fri, 27 May 2011 12:08:12 GMT</pubDate><guid isPermaLink="false">http://www.hightech.ir:80/SeeSharp/farsi-library-version-20-now-available</guid><feedburner:origLink>http://www.hightech.ir:80/SeeSharp/farsi-library-version-20-now-available</feedburner:origLink></item><item><title>Resharper 4.0 Released</title><link>http://feedproxy.google.com/~r/SeeSharp/~3/uVnz5Piaq4E/resharper-40-released</link><description>&lt;p&gt;You need to wait no longer! Resharper 4.0 is here.&lt;br /&gt;&lt;br /&gt;Besides Support for C# 3.0, LINQ and XAML, which is great, there are lots of other enhancements in this release which makes it a "Must Have". Did I mention my little favorite feature, &lt;a href="http://www.jetbrains.com/resharper/features/newfeatures.html"&gt;CamelHumps&lt;/a&gt; is also there? To get your hands dirty and know what's new in this release, check the Product's overview page &lt;a href="http://www.jetbrains.com/resharper/"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;div class="blogger-post-footer"&gt;&lt;img src="https://blogger.googleusercontent.com/tracker/6069495622049300789-5424385764723577835?l=heskandari.blogspot.com" height="1" width="1" /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SeeSharp/~4/uVnz5Piaq4E" height="1" width="1"/&gt;</description><pubDate>Fri, 27 May 2011 11:57:18 GMT</pubDate><guid isPermaLink="false">http://www.hightech.ir:80/SeeSharp/resharper-40-released</guid><feedburner:origLink>http://www.hightech.ir:80/SeeSharp/resharper-40-released</feedburner:origLink></item><item><title>NHibernate 2.0 Released</title><link>http://feedproxy.google.com/~r/SeeSharp/~3/xWz9Fs1l6NE/nhibernate-20-released</link><description>&lt;p&gt;The good news, after not-so-good news about &lt;a href="http://www.simple-talk.com/the_future_of_reflector" target="_blank"&gt;Reflector&lt;/a&gt;, is that NHibernate 2.0 is finally released. This version's feature is comparable with Java Hibernate 3.2 so, this might be a giant step forward. If you're new to NHibernate, you definitely want to check out the &lt;a href="http://www.summerofnhibernate.com"&gt;http://www.summerofnhibernate.com&lt;/a&gt; web site, which contains screencasts that will minimize your learning curve. There'll be some sessions regarding new features of NHibernate 2.0, so keep an eye out.&lt;/p&gt;
&lt;div class="blogger-post-footer"&gt;&lt;img src="https://blogger.googleusercontent.com/tracker/6069495622049300789-2482576446643553449?l=heskandari.blogspot.com" height="1" width="1" /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SeeSharp/~4/xWz9Fs1l6NE" height="1" width="1"/&gt;</description><pubDate>Fri, 27 May 2011 11:56:43 GMT</pubDate><guid isPermaLink="false">http://www.hightech.ir:80/SeeSharp/nhibernate-20-released</guid><feedburner:origLink>http://www.hightech.ir:80/SeeSharp/nhibernate-20-released</feedburner:origLink></item><item><title>Enhanced INotifyPropertyChanged - Revisited</title><link>http://feedproxy.google.com/~r/SeeSharp/~3/fOpIGLJ4sBA/enhanced-inotifypropertychanged-revisited</link><description>&lt;p&gt;A while a go, I had a post regarding how to implement the INotifyPropertyChanged event in a more proper fashion. You didn't have to hard-code the property name, and could instead use a linq expression, which with a help of an extension method, the name of the property is easily extracted, and passed to raise the PropertyChanged event. Simple, right?&lt;/p&gt;
&lt;pre class="code"&gt;&lt;span style="color: blue;"&gt;public static class &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;EventExtension&lt;br /&gt;&lt;/span&gt;{&lt;br /&gt;  &lt;span style="color: blue;"&gt;public static void &lt;/span&gt;Notify&amp;lt;T, TValue&amp;gt;(&lt;span style="color: blue;"&gt;this &lt;/span&gt;T instance, &lt;span style="color: #2b91af;"&gt;PropertyChangedEventHandler &lt;/span&gt;handler, &lt;span style="color: #2b91af;"&gt;Expression&lt;/span&gt;&amp;lt;&lt;span style="color: #2b91af;"&gt;Func&lt;/span&gt;&amp;lt;T, TValue&amp;gt;&amp;gt; selector)&lt;br /&gt;     &lt;span style="color: blue;"&gt;where &lt;/span&gt;T : &lt;span style="color: #2b91af;"&gt;INotifyPropertyChanged&lt;br /&gt;  &lt;/span&gt;{&lt;br /&gt;      &lt;span style="color: blue;"&gt;if &lt;/span&gt;(handler != &lt;span style="color: blue;"&gt;null&lt;/span&gt;)&lt;br /&gt;      {&lt;br /&gt;          &lt;span style="color: blue;"&gt;var &lt;/span&gt;memberExpression = selector.Body &lt;span style="color: blue;"&gt;as &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;MemberExpression&lt;/span&gt;;&lt;br /&gt;          &lt;span style="color: blue;"&gt;if &lt;/span&gt;(memberExpression == &lt;span style="color: blue;"&gt;null&lt;/span&gt;)&lt;br /&gt;              &lt;span style="color: blue;"&gt;throw new &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;InvalidOperationException&lt;/span&gt;(&lt;span style="color: #a31515;"&gt;"selector should be a MemberExpression."&lt;/span&gt;);&lt;br /&gt;&lt;br /&gt;          handler(instance, &lt;span style="color: blue;"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;PropertyChangedEventArgs&lt;/span&gt;(memberExpression.Member.Name));&lt;br /&gt;      }&lt;br /&gt;  }&lt;br /&gt;}&lt;/pre&gt;
&lt;pre class="code"&gt;&lt;span style="color: blue;"&gt;public abstract class &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;NotificationAwareBase &lt;/span&gt;: &lt;span style="color: #2b91af;"&gt;INotifyPropertyChanged&lt;br /&gt;&lt;/span&gt;{&lt;br /&gt;  &lt;span style="color: blue;"&gt;public event &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;PropertyChangedEventHandler &lt;/span&gt;PropertyChanged;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;public class &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;Customer &lt;/span&gt;: &lt;span style="color: #2b91af;"&gt;NotificationAwareBase&lt;br /&gt;&lt;/span&gt;{&lt;br /&gt;  &lt;span style="color: blue;"&gt;private string &lt;/span&gt;_Name;&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: blue;"&gt;public string &lt;/span&gt;Name&lt;br /&gt;  {&lt;br /&gt;      &lt;span style="color: blue;"&gt;get &lt;/span&gt;{ &lt;span style="color: blue;"&gt;return &lt;/span&gt;_Name; }&lt;br /&gt;      &lt;span style="color: blue;"&gt;set&lt;br /&gt;      &lt;/span&gt;{&lt;br /&gt;          _Name = &lt;span style="color: blue;"&gt;value&lt;/span&gt;;&lt;br /&gt;          &lt;span style="color: blue;"&gt;this&lt;/span&gt;.Notify(base.PropertyChanged, o =&amp;gt; o.Name);&lt;br /&gt;      }&lt;br /&gt;  }&lt;br /&gt;}&lt;/pre&gt;
&lt;p&gt;Should work like a charm, right? WRONG! you'll end up with a compile time error. It is like the extension method does not like my inherited PropertyChanged event. The drawback to the latter method was that you could not use it in inheritance context.&lt;/p&gt;
&lt;p&gt;I need to implement INotifyPropertyChanged only once (&lt;a href="http://www.martinfowler.com/eaaCatalog/layerSupertype.html"&gt;Layer Supertype&lt;/a&gt;, anyone?). I had to come up with something to be able to work in inheritance context. Finally, here's it :&lt;/p&gt;
&lt;pre class="code"&gt;&lt;span style="color: blue;"&gt;public abstract class &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;NotificationAware &lt;/span&gt;: &lt;span style="color: #2b91af;"&gt;INotifyPropertyChanged&lt;br /&gt;&lt;/span&gt;{&lt;br /&gt;  &lt;span style="color: blue;"&gt;private event &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;PropertyChangedEventHandler &lt;/span&gt;propertyChangedEvent;&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: blue;"&gt;public event &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;PropertyChangedEventHandler &lt;/span&gt;PropertyChanged&lt;br /&gt;  {&lt;br /&gt;      &lt;span style="color: blue;"&gt;add&lt;br /&gt;      &lt;/span&gt;{&lt;br /&gt;          propertyChangedEvent += &lt;span style="color: blue;"&gt;value&lt;/span&gt;;&lt;br /&gt;      }&lt;br /&gt;      &lt;span style="color: blue;"&gt;remove&lt;br /&gt;      &lt;/span&gt;{&lt;br /&gt;          propertyChangedEvent -= &lt;span style="color: blue;"&gt;value&lt;/span&gt;;&lt;br /&gt;      }&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;&lt;span style="color: gray;"&gt;   &lt;/span&gt;&lt;span style="color: blue;"&gt;protected void &lt;/span&gt;Notify&amp;lt;T&amp;gt;(T obj, &lt;span style="color: #2b91af;"&gt;Expression&lt;/span&gt;&amp;lt;&lt;span style="color: #2b91af;"&gt;Func&lt;/span&gt;&amp;lt;T, &lt;span style="color: blue;"&gt;object&lt;/span&gt;&amp;gt;&amp;gt; selector)&lt;br /&gt;  {&lt;br /&gt;      &lt;span style="color: blue;"&gt;if &lt;/span&gt;(propertyChangedEvent != &lt;span style="color: blue;"&gt;null&lt;/span&gt;)&lt;br /&gt;      {&lt;br /&gt;          &lt;span style="color: #2b91af;"&gt;MemberExpression &lt;/span&gt;memberExpression = selector.Body &lt;span style="color: blue;"&gt;as &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;MemberExpression&lt;/span&gt;;&lt;br /&gt;          &lt;span style="color: blue;"&gt;if &lt;/span&gt;(memberExpression == &lt;span style="color: blue;"&gt;null&lt;/span&gt;)&lt;br /&gt;          {&lt;br /&gt;              &lt;span style="color: #2b91af;"&gt;UnaryExpression &lt;/span&gt;unary = selector.Body &lt;span style="color: blue;"&gt;as &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;UnaryExpression&lt;/span&gt;;&lt;br /&gt;              &lt;span style="color: blue;"&gt;if &lt;/span&gt;(unary != &lt;span style="color: blue;"&gt;null&lt;/span&gt;)&lt;br /&gt;              {&lt;br /&gt;                  memberExpression = unary.Operand &lt;span style="color: blue;"&gt;as &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;MemberExpression&lt;/span&gt;;&lt;br /&gt;              }&lt;br /&gt;          }&lt;br /&gt;&lt;br /&gt;          &lt;span style="color: blue;"&gt;if&lt;/span&gt;(memberExpression == &lt;span style="color: blue;"&gt;null&lt;/span&gt;)&lt;br /&gt;              &lt;span style="color: blue;"&gt;throw new &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;ArgumentException&lt;/span&gt;(&lt;span style="color: #a31515;"&gt;"member should be of MemberExpression type"&lt;/span&gt;, &lt;span style="color: #a31515;"&gt;"selector"&lt;/span&gt;);&lt;br /&gt;        &lt;br /&gt;&lt;br /&gt;          propertyChangedEvent(&lt;span style="color: blue;"&gt;this&lt;/span&gt;, &lt;span style="color: blue;"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;PropertyChangedEventArgs&lt;/span&gt;(memberExpression.Member.Name));&lt;br /&gt;      }&lt;br /&gt;  }&lt;br /&gt;}&lt;/pre&gt;
&lt;pre class="code"&gt;&lt;span style="color: blue;"&gt;public class &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;Customer &lt;/span&gt;: &lt;span style="color: #2b91af;"&gt;NotificationAware&lt;br /&gt;&lt;/span&gt;{&lt;br /&gt;  &lt;span style="color: blue;"&gt;private string &lt;/span&gt;_Name;&lt;br /&gt;  &lt;span style="color: blue;"&gt;public string &lt;/span&gt;Name&lt;br /&gt;  {&lt;br /&gt;      &lt;span style="color: blue;"&gt;get &lt;/span&gt;{ &lt;span style="color: blue;"&gt;return &lt;/span&gt;_Name; }&lt;br /&gt;      &lt;span style="color: blue;"&gt;set&lt;br /&gt;      &lt;/span&gt;{&lt;br /&gt;          _Name = &lt;span style="color: blue;"&gt;value&lt;/span&gt;;&lt;br /&gt;          Notify(&lt;span style="color: blue;"&gt;this&lt;/span&gt;, o =&amp;gt; o.Name);&lt;br /&gt;      }&lt;br /&gt;  }&lt;br /&gt;}&lt;/pre&gt;
&lt;p&gt;&lt;br /&gt;Happy coding!&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div class="blogger-post-footer"&gt;&lt;img src="https://blogger.googleusercontent.com/tracker/6069495622049300789-2182640116127663255?l=heskandari.blogspot.com" height="1" width="1" /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SeeSharp/~4/fOpIGLJ4sBA" height="1" width="1"/&gt;</description><pubDate>Fri, 27 May 2011 11:55:02 GMT</pubDate><guid isPermaLink="false">http://www.hightech.ir:80/SeeSharp/enhanced-inotifypropertychanged-revisited</guid><feedburner:origLink>http://www.hightech.ir:80/SeeSharp/enhanced-inotifypropertychanged-revisited</feedburner:origLink></item><item><title>L2S : Tale of an abandoned project</title><link>http://feedproxy.google.com/~r/SeeSharp/~3/q67DCIGHt4k/l2s-tale-of-abandoned-project</link><description>&lt;p&gt;ADO.NET team &lt;a href="http://blogs.msdn.com/adonet/archive/2008/10/29/update-on-linq-to-sql-and-linq-to-entities-roadmap.aspx"&gt;announced&lt;/a&gt; that there will be no further development on Linq2Sql and investments on data access solution with Linq technology will be made on Entity Framework instead. The irony is that the Linq2Sql probably will not be removed from the next release of .NET Framework, because of backward compatibility, so it will not be completely dead! More users are likely switch to open-source ORM solutions like NHibernate, specially with Linq for NHibernate in the horizon.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/SeeSharp/~4/q67DCIGHt4k" height="1" width="1"/&gt;</description><pubDate>Fri, 27 May 2011 11:51:11 GMT</pubDate><guid isPermaLink="false">http://www.hightech.ir:80/SeeSharp/l2s-tale-of-abandoned-project</guid><feedburner:origLink>http://www.hightech.ir:80/SeeSharp/l2s-tale-of-abandoned-project</feedburner:origLink></item><item><title>Farsi Library 2.1 RC 2</title><link>http://feedproxy.google.com/~r/SeeSharp/~3/6zIwtTwe5DI/farsi-library-21-rc-2</link><description>&lt;p&gt;Farsi Library RC 1 which released a few days ago, contains a new functionality : PersianCultueInfo. You can run your application setting an instance of this culture info on your application thread and you get the benefit of having a correct calendar for your application. Why is this important, you might say? Well, you'll have all the date related controls rendered to you in correct dates! Take a look :&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;div class="center"&gt;&lt;a href="http://www.hightech.ir/images/BlogPics/DXScheduler-With-PersianCulture.jpg"&gt;&lt;img alt="Scheduler" src="http://www.hightech.ir/images/BlogPics/DXScheduler-With-PersianCulture.jpg" height="418" width="629" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;Now, there was a bug in RC 1 regarding mapped week days in PersianCalendar, that is fixed in RC 2. So, if you intend using PersianCultureInfo, you're strongly advised to use RC 2. For more info about Persian Calendar problem see &lt;a href="http://blog.hightech.ir/2008/10/persian-calendar-problem.html" target="_blank"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Like before you can grab the files &lt;a href="http://cid-4962b6ceabc2cbd7.skydrive.live.com/browse.aspx/BlogFiles/Farsi%20Library"&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/SeeSharp/~4/6zIwtTwe5DI" height="1" width="1"/&gt;</description><pubDate>Fri, 27 May 2011 11:49:18 GMT</pubDate><guid isPermaLink="false">http://www.hightech.ir:80/SeeSharp/farsi-library-21-rc-2</guid><feedburner:origLink>http://www.hightech.ir:80/SeeSharp/farsi-library-21-rc-2</feedburner:origLink></item><item><title>Farsi Library - FAQ</title><link>http://feedproxy.google.com/~r/SeeSharp/~3/NF2r2MCj4sI/farsi-library-faq</link><description>&lt;p&gt;A lot of people keep asking me to provide a VB.NET Sample on how to use Farsi Library component. The library is written in C# after all and no sample code is provided to demonstrate VB.NET usage. This post is not a tutorial to Farsi Library per se. I'm answering some of the question regarding VB.NET usage, and some common questions about Farsi Library you've kept asking.&lt;/p&gt;
&lt;p&gt;Yet, there are still some people don't know how to create an explicit Main method in VB.NET, so if this post is a low-level for you professionals, just skip this post ;)&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Q : I'm using VB.NET but there's no main method to set my thread's culture!&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;A : Since everything supposed to be easier in VB.NET, you normally do not create an entry point for an application written in VB.NET, but only select a form which is the startup form of your application. To have more control on application initializations, you need to write the application entry method as well. Simply add a new Module (e.g. Named Program) and add a method to initialize and run the main form :&lt;/p&gt;
&lt;pre class="brush:vb"&gt;Public Module Program
&amp;lt;STAThread()&amp;gt; _
Public Sub Main()
    Application.SetCompatibleTextRenderingDefault(True)
    Application.EnableVisualStyles()
    Application.Run(New MainForm())
End Sub
End Module
&lt;/pre&gt;
&lt;p&gt;To actually use this Main method, open the Project's properties by double-clicking on "My Project" in solution explorer and in the Application Tab, uncheck the check box that reads "Enable Application Framework" and set your startup object as "Sub Main".&lt;/p&gt;
&lt;p&gt;Now when running your application, the main form is created through the Main method in Program class. You can set a breakpoint to check if it is working. Easily add any additional initialization logic to the Main method. To set the running thread's Culture use this code :&lt;/p&gt;
&lt;pre class="brush:vb"&gt;Imports System.Threading
Imports System.Globalization

Public Class Program
&amp;lt;STAThread()&amp;gt; _
Public Shared Sub Main()
    Thread.CurrentThread.CurrentUICulture = New CultureInfo("fa-ir")
    Thread.CurrentThread.CurrentCulture = New CultureInfo("fa-ir")

    Application.Run(New MainForm())
End Sub
End Class
&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Q : I'm running a form with Farsi Library controls. All the dates are in Gregorian calendar.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;A : You need to set the running thread's culture information to "fa-ir" culture to see the Persian Calendar information. For Arabic calendar, use "ar-sa" culture.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Q : I've downloaded the source files but it won't compile. When compiling the sources VS.NET says the license key is missing.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;A : Farsi Library is an open source project. There's no such thing as license key in this project. To be able to use the compiled dll in certain scenarios (Putting them in GAC, etc.) you need to specify a key which VS.NET uses to sign the built assemblies. If you get the latest version of the source code, the key file is included.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Q : How can I use the Farsi Library on a Web Site or Web Project?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;A : I was going to provide an ASP.NET Server control in one of the first releases, but since my web project was canceled, there's no ASP.NET control available. However, you can use the FarsiLibrary.Utils project to convert dates on a web project.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Q : I have downloaded the binary files. What should I do with them? How can I use the controls?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;A : First, put the dll files somewhere near your solution / project (e.g. in a Lib folder). Then, you should add controls to VS.NET Toolbox. To do this, open the Toolbox window, right-click and select "Choose Items..." from the menu. On the next dialog, select "Browse..." button and select the "FarsiLibrary.Win.dll" file (or "FarsiLibrary.WPF" if you're working on a WPF project). All the controls will be added to your toolbox. You can simply drag-and-drop them on your form.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Q : I'm working on an application that uses a Database to store dates. On the UI I need to display dates in Persian Calendar. What should I do?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;A : Since you only need to "display" the dates in Persian Calendar, you can use DateTime data type on your entities as well as in your database designs. On the front-end, you can use FarsiLibrary controls which will bind to Business Entities, or DataSets, to display the DateTime value in Persian Calendar. You don't need to (and you're strongly advised not to!) use string data type (or other types) to support dates in Persian or other Calendars.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Q : What type of look and feel does the control support?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;A : Controls support System Theme (Windows XP, Vista, etc.) plus Office 2000, Office 2003, and partial Office 2007 themes. You can set each control's theme using Theme property, or use the global theme manager :&lt;/p&gt;
&lt;pre class="brush:vb"&gt;FAThemeManager.Theme = ThemeTypes.Office2007
&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Q : How do I change the strings used in controls? How can I localize the strings?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;A : Create a class and inherit from one of the available Localizer classes in FarsiLibrary.Resources namespace. Override GetLocalizedString method and provide a suitable representation for StringIDs you want. Later set the instance of your localizer on FALocalizeManager :&lt;/p&gt;
&lt;pre class="brush:vb"&gt;Public Class ESLocalizer
Inherits ENLocalizer

Public Overrides Function GetLocalizedString(ByVal id As Resources.StringID) As String
    Select Case id
        Case StringID.Validation_NullText
            Return "&amp;lt;Ningun fecha esta seleccionada&amp;gt;"
        Case StringID.FAMonthView_None
            Return "Nada"
        Case StringID.FAMonthView_Today
            Return "&amp;Acirc;&amp;iexcl;Hoy!"
    End Select

    Return MyBase.GetLocalizedString(id)
End Function
End Class

FALocalizeManager.Instance.CustomLocalizer = New ESLocalizer()
&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Q : I want to use the controls in another calendar. Can I use other cultures (e.g. "es-ES" culture) when using these controls?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;A : To globally change the culture set an instance of your culture on CustomCulture property of FALocalizeManager :&lt;/p&gt;
&lt;pre class="brush:vb"&gt;FALocalizeManager.Instance.CustomCulture = New CultureInfo("es-ES")
&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Q : How can I do validation to check if a selected date is correct? How do I restrict the selection to a specific date range?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;A : Use the SelectedDateTimeChanging event and set the e.Cancel to true. You can also set an error message on e.Message :&lt;/p&gt;
&lt;pre class="brush:vb"&gt;Private Sub faDatePicker_SelectedDateTimeChanging(ByVal sender As System.Object, ByVal e As FarsiLibrary.Win.Events.SelectedDateTimeChangingEventArgs) Handles faDatePicker2.SelectedDateTimeChanging
Dim pd As PersianDate = e.NewValue

If pd.Day &amp;lt;&amp;gt; 20 And Not faDatePicker2.IsNull Then
   e.Message = "Invalid date. Default Date is applied."
   e.NewValue = New DateTime(2010, 1, 20, 0, 0, 0)
End If
End Sub
&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Q : How can I custom draw a certain day in calendar? How can I draw the holidays in red?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;A : You need to plug-in your drawing logic on DrawCurrentDay event. You have access to Day / Month / Year values as well as Graphics object. A Rectange representing date bounds is also available. Remember to set the IsHandled to true if you want to override the base class drawing logic :&lt;/p&gt;
&lt;pre class="brush:vb"&gt;Private Sub faMonthView_DrawCurrentDay(ByVal sender As System.Object, ByVal e As FarsiLibrary.Win.Events.CustomDrawDayEventArgs) Handles faMonthView.DrawCurrentDay
If e.Date.DayOfWeek = DayOfWeek.Friday Then
    Dim br1 As New SolidBrush(Color.Wheat)
    Dim br2 As New LinearGradientBrush(e.Rectangle, Color.PaleVioletRed, Color.DarkRed, 45, True)
    Dim fnt As New Font("Tahoma", 8, FontStyle.Bold)
    Dim fmt As New StringFormat
    Dim dayNo As String = e.Day

    fmt.Alignment = StringAlignment.Center
    fmt.LineAlignment = StringAlignment.Center

    e.Graphics.FillRectangle(br2, e.Rectangle)
    e.Graphics.DrawString(dayNo, fnt, br1, e.Rectangle, fmt)

    br1.Dispose()
    br2.Dispose()
    fnt.Dispose()
    fmt.Dispose()

    e.Handled = True
End If
End Sub
&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Q : How do I convert dates from / to PersianCalendar to / from Gregorian Calendar?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;A : You can convert instances of DateTime directly to PersianDate values, which represents their equivalance in PersianCalendar :&lt;/p&gt;
&lt;pre class="brush:vb"&gt;Dim pd As PersianDate = CType(DateTime.Now, PersianDate)
lblCastTo.Text = pd.ToString("G")

Dim dt As DateTime = CType(PersianDate.Now, DateTime)
lblCastFrom.Text = dt.ToString("G")
&lt;/pre&gt;
&lt;p&gt;If you're using PersianCultureInfo (which uses standard .NET Framework Persian Calendar), you have access to all standard DateTime formattings as well. See MSDN page for &lt;a href="http://msdn.microsoft.com/en-us/library/az4se3k1.aspx" target="_blank"&gt;standard&lt;/a&gt; and &lt;a href="http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx" target="_blank"&gt;custom&lt;/a&gt; date formattings.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Q : I need to do calculations in Persian Calendar. I need to add / remove days to / from specific day in the Persian Calendar.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;A : You can use the PersianCalendar class provided in .NET Framework to do so. There's an internal implementation of PersianCalendar in FarsiLibrary.Utils namespace which originally was historically developed before PersianCalendar appearing in .NET 2 :&lt;/p&gt;
&lt;pre class="brush:vb"&gt;Dim calendar As New PersianCalendar()
Dim pd = New PersianDate(calendar.AddYears(DateTime.Now, 10))
lblMessage.Text = pd.ToString()
lblToWritten.Text = pd.ToWritten()
&lt;/pre&gt;
&lt;p&gt;You can download VB.NET code related to this FAQ from &lt;a href="http://cid-4962b6ceabc2cbd7.skydrive.live.com/self.aspx/BlogFiles/Farsi%20Library/FarsiLibrary%7C_FAQ%7C_VBNET%7C_Demo.zip"&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/SeeSharp/~4/NF2r2MCj4sI" height="1" width="1"/&gt;</description><pubDate>Fri, 27 May 2011 11:47:42 GMT</pubDate><guid isPermaLink="false">http://www.hightech.ir:80/SeeSharp/farsi-library-faq</guid><feedburner:origLink>http://www.hightech.ir:80/SeeSharp/farsi-library-faq</feedburner:origLink></item><item><title>Resharper : The Most frequently used feature</title><link>http://feedproxy.google.com/~r/SeeSharp/~3/PcR7KpDfJM8/resharper-most-frequently-used-feature</link><description>&lt;p&gt;A while a go, &lt;a href="http://rorybecker.blogspot.com/"&gt;Rory&lt;/a&gt; asked me to blog about Resharper add-in for Visual Studio.NET and which shortcut keys I use the most. This one has been waiting on my draft list for a couple of weeks now. This post is about Resharper shortcuts I mostly use.&lt;br /&gt;&lt;br /&gt;Resharper is &lt;a target="_blank" href="http://devexpress.com/CodeRush"&gt;one&lt;/a&gt; the most advanced and useful add-in available for Visual Studio .NET. I've started using the tool when they published their release for Visual Studi 2003. Back then, Resharper added lots of feature and brought productivity to the IDE which without them, your programming life would have been a nightmare.&lt;/p&gt;
&lt;p&gt;The problem with Resharper though, is that it has become so big and featureful, that is won't be possible to use it in large scale projects. We have a bloated Solution containing about 80 projects that started back in 2003 with only 10-12 projects. When I open the project in VS with Resharper running, the files with 2-3K LOC make Resharper run out of memory. 2-3K LOC might sound unrealistic to you, but automatically generated codes like DataSets or Forms code behinds are usually this large. So, it'd be a good idea if we could disable some Resharper features to gain some more speed, e.g. disabling code analysis in .Designer files, disabling XAML analysis, etc.&lt;/p&gt;
&lt;p&gt;As said before, there are a lot of features in Resharper, which makes your programming experience a pleasant one. Here I'm only pointing to some of the ShortCut keys I mostly use.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;span class="subtitle"&gt;Find Usage Window (Alt + F7)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;I'm Sure you've tried to figure out how / where an interface is implemented, or where instance of a certain class is being used, or other similar scenarios. If you use plain VS, you have no other choice than to use "Find All References". That will work, but it takes time every time you do a search like this. This is due to the fact that VS does not keep an index of your application structure, but since Resharper does, you'll gain a lot of speed when doing these kind of operation.&lt;/p&gt;
&lt;p&gt;Also, the "Find Usage Window" is more rich in Resharper than VS. You can sort and group the results based on Namespace, Usage, File, Folder, etc. and filter by Read, Writer, Invocation, etc. but in VS all you see is a flat search result. One of the great things about Find Usage function is that it actually finds the usage in Xaml code too!&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.hightech.ir/images/BlogPics/Resharper_FindUsageResults.jpg"&gt;&lt;img alt="Resharper-FindUsageResults" src="http://www.hightech.ir/images/BlogPics/Resharper_FindUsageResults.jpg" height="360" width="516" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="subtitle"&gt;Using Hints and Red / Yellow Bulb (Alt + Enter)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Resharper has a good way of letting you know that you can do something better, by displaying "Hints". Hints let you know if you've forgotten to import a namespace, if there's a refactoring available or suggest a context action. There are lots of things you can do in Resharper, just by pressing Alt + Enter! Some of them are :&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Change scope of the Class or Method &lt;/li&gt;
&lt;li&gt;Create overload for a method / Check if the variable is null &lt;/li&gt;
&lt;li&gt;Create derived types &lt;/li&gt;
&lt;li&gt;Import missing namespace / remove unused namespace &lt;/li&gt;
&lt;li&gt;Implement an interface / abstract class &lt;/li&gt;
&lt;li&gt;Change property to Automated property and vice versa &lt;/li&gt;
&lt;li&gt;Invert if statement / Convert to conditional statement and vice versa &lt;/li&gt;
&lt;li&gt;Join / Split declaration and assignment of the variable &lt;/li&gt;
&lt;li&gt;Introduce variable / use var keyword &lt;/li&gt;
&lt;li&gt;Generate body of the switch statement &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;...and a lot more. Depending on where the cursor is in the editor, where you click and the code you have written, you may get different options.&lt;/p&gt;
&lt;p&gt;&lt;span class="subtitle"&gt;Goto Type / File (Ctrl + N, Ctrl + Shift + N)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;If you're looking for a specific file in your large project or if you're using multiple class per file strategy, you might get lost easily. If you need to know where that file is located, or in which file you class resides, you can use these shortcuts to get you there. The "Goto Type" function has support for a feature called CammleHumps. Using this feature, if you're looking for OrderApprovalService, you can search for OAS instead and Resharper will find it for you.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.hightech.ir/images/BlogPics/Resharper_FindByType.jpg"&gt;&lt;img alt="FindByType" src="http://www.hightech.ir/images/BlogPics/Resharper_FindByType.jpg" height="175" width="441" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="subtitle"&gt;Code Completion and Type Lookup (Ctrl + Space, Ctrl + Alt + Space)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;When you're working with large libraries you may easily get lost. Sometimes you know the name of type you're going to use, but can't remember the darn namespace! This shortcut will help you find the type you are looking for in ALL the namespaces in an easy to use fasion.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.hightech.ir/images/BlogPics/Resharper_FindByCtrlSpace.jpg"&gt;&lt;img alt="FindByCtrlSpace" src="http://www.hightech.ir/images/BlogPics/Resharper_FindByCtrlSpace.jpg" height="188" width="427" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="subtitle"&gt;Code Generation (ALT + Ins, Ctrl + J)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;The code generation feature in Resharper is just great. You can use the primary code generation function by ALT + Ins that will let you generate :&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Constructors &lt;/li&gt;
&lt;li&gt;Properties / Readonly Properties from backing fields &lt;/li&gt;
&lt;li&gt;Implement Method / Property stubs for an Interface &lt;/li&gt;
&lt;li&gt;Override base class Methods &lt;/li&gt;
&lt;li&gt;Provide equality implementation (Equality Operators, IEquatable&amp;lt;T&amp;gt; interface, overriding Equals and GetHashCode methods) &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;While this is great, Resharper gives you the power to write your own snippets! A lot of people have already created snippet templates for Resharper to create Unit tests, Mocks, NHibernate, ActiveRecord and WPF stuff, etc.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.hightech.ir/images/BlogPics/Resharper_CodeGeneration.jpg"&gt;&lt;img alt="Resharper-CodeGeneration" src="http://www.hightech.ir/images/BlogPics/Resharper_CodeGeneration.jpg" height="267" width="255" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;You can download Resharper templates on Joey Beninghove's &lt;a target="_blank" href="http://joeydotnet.com/blog/archive/2007/04/14/ReSharper-Template-Library---Updated.aspx"&gt;blog&lt;/a&gt;, or see what other people use on StackOverflow &lt;a target="_blank" href="http://stackoverflow.com/questions/186970/what-resharper-40-live-templates-for-c-do-you-use"&gt;page&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;span class="subtitle"&gt;Summary&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;There is a &lt;a target="_blank" href="http://www.jetbrains.com/resharper/docs/ReSharper40DefaultKeymap.pdf"&gt;document&lt;/a&gt; on JetBrain's website that shows all the ShortCut keys you'll ever need to know. Intense Resharper users might need to hang it on their wall. There are lots of other features I use like Unit Test Runner, Stack Trace browser, File Structure window, and ToDo List, but that's for another post. Do you use productivity tools too? Which one? Which feature do you use the most?&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/SeeSharp/~4/PcR7KpDfJM8" height="1" width="1"/&gt;</description><pubDate>Fri, 27 May 2011 11:44:19 GMT</pubDate><guid isPermaLink="false">http://www.hightech.ir:80/SeeSharp/resharper-most-frequently-used-feature</guid><feedburner:origLink>http://www.hightech.ir:80/SeeSharp/resharper-most-frequently-used-feature</feedburner:origLink></item><item><title>Java &amp; .NET Integration : Who is Who?</title><link>http://feedproxy.google.com/~r/SeeSharp/~3/sD-Es1xW1ps/java-net-integration-who-is-who</link><description>&lt;p&gt;There's a new kid on the block! An effort to port Java frameworks to .NET is not a new thing and it's been around since the early days of .NET 1, but integration of .NET Framework and Java Development Kit (JDK) is something I'm not used to see everyday! The new project named &lt;em&gt;&lt;a target="_blank" href="http://www.janetdev.org/"&gt;Ja.NET&lt;/a&gt;&lt;/em&gt; enables you to use first class development and runtime environment for .NET in which you use supposedly can use your existing Java SE code base and knowledge but also leverage existing functionalities available .NET Framework!&lt;/p&gt;
&lt;p&gt;Ja.NET provides you with equivalence of Java 5 SE SDK implemented from scratch, JDK tools, class libraries and .NET CLR runtime environment. Also you can use available functionalities in .NET world such as Custom Attributes, Value Types, Extension Methods, etc. The question is : Are we back on J# days? Definetly no. I'm talking about an open-source community here and the roadmap says there will be release comparable to J2ME and J2EE sometime in the future.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/SeeSharp/~4/sD-Es1xW1ps" height="1" width="1"/&gt;</description><pubDate>Fri, 27 May 2011 11:43:48 GMT</pubDate><guid isPermaLink="false">http://www.hightech.ir:80/SeeSharp/java-net-integration-who-is-who</guid><feedburner:origLink>http://www.hightech.ir:80/SeeSharp/java-net-integration-who-is-who</feedburner:origLink></item></channel></rss>

