<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress.com" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>net-framework &amp;laquo; WordPress.com Tag Feed</title>
	<link>http://en.wordpress.com/tag/net-framework/</link>
	<description>Feed of posts on WordPress.com tagged "net-framework"</description>
	<pubDate>Thu, 10 Dec 2009 08:16:01 +0000</pubDate>

	<generator>http://en.wordpress.com/tags/</generator>
	<language>en</language>

<item>
<title><![CDATA[Chuyển lowercase v&agrave; UPPERCASE sang TitleCase trong .NET]]></title>
<link>http://dinhnguyenngoc.wordpress.com/2009/12/09/chuy%e1%bb%83n-lowercase-v-uppercase-sang-titlecase-trong-net/</link>
<pubDate>Wed, 09 Dec 2009 16:13:23 +0000</pubDate>
<dc:creator>dinhnguyenngoc</dc:creator>
<guid>http://dinhnguyenngoc.wordpress.com/2009/12/09/chuy%e1%bb%83n-lowercase-v-uppercase-sang-titlecase-trong-net/</guid>
<description><![CDATA[Lớp String có 2 phương thức ToLower() và ToUpper() để chuyển 1 chuỗi sang lowercase và UPPERCASE tươ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Lớp String có 2 phương thức ToLower() và ToUpper() để chuyển 1 chuỗi sang lowercase và UPPERCASE tương ứng. Khi chuyển từ lowercase và UPPERCASE, phương thức ToTitleCase() của lớp TextInfo trở nên có ích, xem ví dụ:</p>
<pre class="code"><span style="color:blue;">using </span>System;

<span style="color:green;">// import Globalization namespace
</span><span style="color:blue;">using </span>System.Globalization;

<span style="color:blue;">namespace </span>TitleCase_CS
{
    <span style="color:blue;">class </span><span style="color:#2b91af;">Program
    </span>{
        <span style="color:blue;">static void </span>Main(<span style="color:blue;">string</span>[] args)
        {
            <span style="color:blue;">string </span>strLow = <span style="color:#a31515;">&#34;lower case&#34;</span>;
            <span style="color:blue;">string </span>strT = <span style="color:#2b91af;">CultureInfo</span>.CurrentCulture.TextInfo.ToTitleCase(strLow);
            <span style="color:#2b91af;">Console</span>.WriteLine(<span style="color:#a31515;">&#34;lower case to Title Case: &#34; </span>+ strT);

            <span style="color:blue;">string </span>strCap = <span style="color:#a31515;">&#34;UPPER CASE&#34;</span>;
            strT = <span style="color:#2b91af;">CultureInfo</span>.CurrentCulture.TextInfo.ToTitleCase(strCap.ToLower());
            <span style="color:#2b91af;">Console</span>.WriteLine(<span style="color:#a31515;">&#34;UPPER CASE to Title Case: &#34; </span>+ strT);

            <span style="color:#2b91af;">Console</span>.ReadLine();
        }
    }
}</pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<p>Dùng thuộc tính CurrentCulture.TextInfo để truy xuất 1 thể hiện của lớp TextInfo dựa trên culture hiện tại.</p>
<p>Chú ý: phương thức này không chuyển 1 từ hoàn toàn UPPERCASE, như là từ viết tắt sang TitleCase. Vì lý do đó, phải chuyển sang lowercase trước:</p>
<p>Kết quả:</p>
<p><a href="http://dinhnguyenngoc.files.wordpress.com/2009/12/image.png"><img title="image" style="display:inline;border-width:0;" height="300" alt="image" src="http://dinhnguyenngoc.files.wordpress.com/2009/12/image_thumb.png?w=602&#038;h=300" width="602" border="0" /></a></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Let’s Learn Remoting in .NET 3.5]]></title>
<link>http://jyotsnakalambe.wordpress.com/2009/12/04/let%e2%80%99s-learn-remoting-in-net-3-5/</link>
<pubDate>Fri, 04 Dec 2009 09:56:22 +0000</pubDate>
<dc:creator>jyotsnakalambe</dc:creator>
<guid>http://jyotsnakalambe.wordpress.com/2009/12/04/let%e2%80%99s-learn-remoting-in-net-3-5/</guid>
<description><![CDATA[Remoting is very important part of WCF (Windows Communication Foundation) Here we are going to write]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Remoting is very important part of WCF (Windows Communication Foundation)</p>
<p>Here we are going to write code for retrieving remote machine process details.</p>
<ol>
<li>First we need create a <strong>class</strong> i.e. .dll where we will write the functionality of the project.</li>
<li>Secondly we will create a Windows project as <strong>Server.<br />
</strong></li>
<li>And finally we will create a Windows project as <strong>Client.</strong></li>
</ol>
<p><span style="color:#ff0000;"><strong>Step 1:</strong></span></p>
<p>Create project New Class Library Project which will create .dll file.</p>
<p><strong><a href="http://jyotsnakalambe.wordpress.com/files/2009/12/r1.jpg"><img class="aligncenter size-full wp-image-253" title="r1" src="http://jyotsnakalambe.wordpress.com/files/2009/12/r1.jpg" alt="" width="467" height="286" /></a></strong></p>
<p>Add below code.</p>
<pre><span style="color:#ff9900;">using System;
</span><span style="color:#ff9900;">using System.Collections.Generic;
</span><span style="color:#ff9900;">using System.Text;
</span><span style="color:#ff9900;">using System.Data ;
using Microsoft.Win32;</span>
<span style="color:#ff9900;">namespace RemoteClass</span>
<span style="color:#00ccff;"> </span><span style="color:#ff9900;">{</span>
<span style="color:#ff9900;">public class Remote:MarshalByRefObject {</span>
<span style="color:#ff9900;">  public DataTable Remoteprocesses()</span>
<span style="color:#ff9900;">        {</span>
<span style="color:#ff9900;">            DataTable ProcessTable = new DataTable();</span>
<span style="color:#ff9900;">            ProcessTable.Columns.Add("processno");</span>
<span style="color:#ff9900;">            ProcessTable.Columns.Add("ProcessId");</span>
<span style="color:#ff9900;">            ProcessTable.Columns.Add("ProcessName");</span>
<span style="color:#ff9900;">            int i = 1;</span>
<span style="color:#ff9900;">            foreach (System.Diagnostics.Process winProc in
            System.Diagnostics.Process.GetProcesses())
            {</span>
<span style="color:#ff9900;">                DataRow myNewRow;</span>
<span style="color:#ff9900;">                myNewRow = ProcessTable.NewRow();</span>
<span style="color:#ff9900;">                myNewRow["processno"] = i;</span>
<span style="color:#ff9900;">                myNewRow["ProcessId"] = winProc.Id;</span>
<span style="color:#ff9900;">                myNewRow["ProcessName"] = winProc.ProcessName;</span>
<span style="color:#ff9900;">                ProcessTable.Rows.Add(myNewRow);</span>
<span style="color:#ff9900;">                i++;</span>
<span style="color:#ff9900;">            }</span>
<span style="color:#ff9900;">            return ProcessTable;
        }</span>
<span style="color:#ff9900;">    }</span>
<span style="color:#ff9900;">}</span></pre>
<p><img title="r2" src="http://jyotsnakalambe.wordpress.com/files/2009/12/r2.jpg" alt="" width="468" height="351" /></p>
<p>Build this project. Once your have build Project successfully the .dll file will be generated at bin/debug folder location.</p>
<p><span style="color:#ff0000;"><strong>Step 2:</strong></span></p>
<p>Now create a windows application project for developing a “SERVER”. Add reference of Remote class (.dll file) in the project. Add a button and label control on the windows form. As shown in the picture</p>
<p><strong><a href="http://jyotsnakalambe.wordpress.com/files/2009/12/r3.jpg"><img class="aligncenter size-full wp-image-256" title="r3" src="http://jyotsnakalambe.wordpress.com/files/2009/12/r3.jpg" alt="" width="468" height="351" /></a></strong></p>
<p>Now add below code in the .CS file . don’t forget to add Remoting related namespaces in the project and Add the names space System.Runtime.Remoting from References</p>
<p><strong><a href="http://jyotsnakalambe.wordpress.com/files/2009/12/addref.jpg"><img class="aligncenter size-full wp-image-257" title="addref" src="http://jyotsnakalambe.wordpress.com/files/2009/12/addref.jpg" alt="" width="468" height="398" /></a></strong></p>
<pre><span style="color:#ff9900;">using System;</span>
<span style="color:#ff9900;">using System.Collections.Generic;</span>
<span style="color:#ff9900;">using System.ComponentModel;</span>
<span style="color:#ff9900;">using System.Data;</span>
<span style="color:#ff9900;">using System.Drawing;</span>
<span style="color:#ff9900;">using System.Text;</span>
<span style="color:#ff9900;">using System.Windows.Forms;</span>
<span style="color:#ff9900;">using System.Runtime.Remoting;</span>
<span style="color:#ff9900;">using System.Runtime.Remoting.Channels;</span>
<span style="color:#ff9900;">using System.Runtime.Remoting.Channels.Tcp;</span>
<span style="color:#ff9900;">namespace Server</span>
<span style="color:#ff9900;">{</span>
<span style="color:#ff9900;">    public partial class Form1 : Form</span>
<span style="color:#ff9900;">    {</span>
<span style="color:#ff9900;">        public Form1()</span>
<span style="color:#ff9900;">        {</span>
<span style="color:#ff9900;">            InitializeComponent();</span>
<span style="color:#ff9900;">        }</span>
<span style="color:#ff9900;">        private void button1_Click(object sender, EventArgs e)</span>
<span style="color:#ff9900;">        {</span>
<span style="color:#ff9900;">            TcpChannel tcpChannel = new TcpChannel(8010);</span>
<span style="color:#ff9900;">            ChannelServices.RegisterChannel(tcpChannel,false);</span>
<span style="color:#ff9900;">            RemotingConfiguration.
            RegisterWellKnownServiceType(typeof(RemoteClass.Remote),
             "abc",WellKnownObjectMode.SingleCall);</span>
<span style="color:#ff9900;">            label1.Text = "Server is running";</span>
<span style="color:#ff9900;">        }</span>
<span style="color:#ff9900;">    }</span>
<span style="color:#ff9900;">}</span></pre>
<p>Build this project.</p>
<p><span style="color:#ff0000;"><strong>Step 3:</strong></span></p>
<p>Now create a windows application project for developing a “CLIENT”. Add reference of Remote class (.dll file) in the project.</p>
<p>Add a button, datagridview and label control on the windows form. As shown in the picture</p>
<p><strong><a href="http://jyotsnakalambe.wordpress.com/files/2009/12/r4.jpg"><img class="aligncenter size-full wp-image-258" title="r4" src="http://jyotsnakalambe.wordpress.com/files/2009/12/r4.jpg" alt="" width="468" height="351" /></a></strong></p>
<p>Now add below code in the .CS file . don’t forget to add Remoting related namespaces in the project and Add it namesspace System.Runtime.Remoting from Reference. Just like Server project. Now on View Button Click add below Code.</p>
<p><span style="font-family:Consolas, Monaco, 'Courier New', Courier, monospace;line-height:18px;font-size:12px;color:#ff9900;white-space:pre;">using System;</span></p>
<pre><span style="color:#ff9900;">using System.Collections.Generic;</span>
<span style="color:#ff9900;">using System.ComponentModel;</span>
<span style="color:#ff9900;">using System.Data;</span>
<span style="color:#ff9900;">using System.Drawing;</span>
<span style="color:#ff9900;">using System.Text;</span>
<span style="color:#ff9900;">using System.Windows.Forms;</span>
<span style="color:#ff9900;">using System.Runtime.Remoting;</span>
<span style="color:#ff9900;">using System.Runtime.Remoting.Channels;</span>
<span style="color:#ff9900;">using System.Runtime.Remoting.Channels.Tcp;</span>
<span style="color:#ff9900;">//Adding the names space System.Runtime.Remoting from References</span><span style="color:#ff9900;"> </span>
<span style="color:#ff9900;">namespace Client</span>
<span style="color:#ff9900;">{</span>
<span style="color:#ff9900;">        public partial class Form1 : Form</span><span style="color:#ff9900;">   {</span>
<span style="color:#ff9900;">        RemoteClass.Remote RemoteObject = new RemoteClass.Remote();</span>
<span style="color:#ff9900;">        public Form1()</span>
<span style="color:#ff9900;">        {</span>
<span style="color:#ff9900;">            InitializeComponent();</span>
<span style="color:#ff9900;">        }</span>
<span style="color:#ff9900;">         private void button1_Click(object sender, EventArgs e)</span>
<span style="color:#ff9900;">        {</span>
<span style="color:#ff9900;">          RemoteObject = (RemoteClass.Remote)Activator.GetObject
         (typeof(RemoteClass.Remote), "tcp://192.168.16.51:8010/abc");</span>
<span style="color:#ff9900;">            DataTable a = RemoteObject.Remoteprocesses();</span>
<span style="color:#ff9900;">            dataGridView1.DataSource = a;</span>
<span style="color:#ff9900;">        }    }</span>
<span style="color:#ff9900;">}</span></pre>
<p>Build this project.</p>
<p>Now let’s test the project. By pressing F5 in Server and Client project…</p>
<p><a href="http://jyotsnakalambe.wordpress.com/files/2009/12/final.jpg"><img class="aligncenter size-full wp-image-259" title="final" src="http://jyotsnakalambe.wordpress.com/files/2009/12/final.jpg" alt="" width="468" height="351" /></a></p>
<p>Here if you are having two machines namely X &#38; Y and you want view the process details of X machine then simply you need to install the Server on the X machine and from Y machine Client you can monitor it.</p>
<p>i Hope u all understand a small example of remoting..if you like this example comment me..</p>
<p><strong><span style="text-decoration:underline;">n joy Diving in .NET World&#8230; </span></strong></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[OFF SHORE WEB DEVELOPMENT &amp; SEO]]></title>
<link>http://whizpeter.wordpress.com/2009/12/01/off-shore-web-development-seo/</link>
<pubDate>Tue, 01 Dec 2009 12:06:56 +0000</pubDate>
<dc:creator>whizpeter</dc:creator>
<guid>http://whizpeter.wordpress.com/2009/12/01/off-shore-web-development-seo/</guid>
<description><![CDATA[We offer a widespread web development service, specializing in PHP websites. In a very short span of]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>We offer a widespread web development service, specializing in PHP websites.<br /> In a very short span of time Development India has had the opportunity to work with a different range of industries and clients. We optimally utilize technology as the perfect means to an end. The current focus area includes but is not limited to.NET Technologies, XML, SQL Server, PHP, MySQL &#38; SEO.<br /> Development India offers staff intensification services to clients enabling them to extend their staff to our offshore website development center in India. We Offer IT staffing for assets such as &#8211; Graphic Designers, ASP .Net Developers, PHP Programmers, SEO Executive, Website-developers/Website Builders in India etc.</p>
<p>Web Development is a combination of many skills &#8211; including design, programming, search engine optimization, content development and user experience. All elements are important, and successful websites will use all of the above elements.<br /> Intellectual programming of a site can mechanize repetitive processes and help keep your site stable. Good programming is essential for managing large sites, where maintaining hundreds of pages manually is not an option.<br /> Development India is a software development &#38; web application development outsourcing company, with highlighting on high quality, well-timed delivery and lucrative offshore software &#38; offshore web development services. We have worked with clients across multiple continents and are very aware of the challenges associated with offshore software development.</p>
<p>By adjusting to modern web development standards, and carefully choosing the right keywords for each page, you can increase your site&#8217;s rankings in the search engines, in particular MSN, Google, Bing &#38; Yahoo.<br /> Healthy written content is appealing and useful to your clients. If you sell a product or service, providing useful and original free content will keep the visitors coming back (in the hope of purchasing at some point). Unique and well crafted content is also important for SEO, as other webmasters will link to good content.<br /> A forgotten practice among many designers and developers, designing a site for the user is critical for keeping annoyance at bay. This means having uncomplicated routing, logical content placement and a clear point to the site &#8211; what does the user want from you.<br /> For More Information<br /> Web Design<br /> PHP<br /> SEO<br /> DOT NET<br /> OUTSOURCING<br /> The Author is an Executive with www.whizkraft.com</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[.Net Framework interview questions ]]></title>
<link>http://alldotnetstuff.wordpress.com/2009/11/30/net-framework-interview-questions-2/</link>
<pubDate>Mon, 30 Nov 2009 15:59:24 +0000</pubDate>
<dc:creator>Srinivas Dontula</dc:creator>
<guid>http://alldotnetstuff.wordpress.com/2009/11/30/net-framework-interview-questions-2/</guid>
<description><![CDATA[Explain the .Net Framework. Answer &#8211; The .Net framework allows infrastructural services to all]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Explain the .Net Framework.<br />
Answer &#8211; The .Net framework allows infrastructural services to all the applications developed in .net compliant language. It is an engine that provides runtime services using its component like Common Runtime Language. It consists of two main components such as Common Language Runtime and Framework Class Library.</p>
<p>Describe the .Net Framework Architecture.<br />
Answer &#8211; The .Net Framework has two main components:<br />
.Net Framework Class Library: It provides common types such as data types and object types that can be shared by all .Net compliant language.<br />
The Common language Runtime: It provides services like code execution, type safety, security, thread management, interoperability services.</p>
<p>What are the components of the .Net Framework?<br />
Answer &#8211; Class Loader, Compiler, Garbage Collection, Type checker, Debug engine, Exception Manager, Security engine, Thread manager, COM Marshallar, Class Library. </p>
<p>Explain the role of assembly in the .Net Framework.<br />
Answer &#8211; .Net Framework keeps executable code or DLL in the form of assembly. .Net Framework maintains multiple versions of the application in the system through assembly. The assemblies have MSIL code and manifest that contains metadata. The metadata contains version information of the assembly. </p>
<p>Describe the GAC in the .Net Framework.<br />
Answer &#8211; .Net Framework provides Global Assembly cache, a machine-wide cache. It stores shared assemblies that can be accessed by multiple languages. </p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[How to run or deploy a .Net application without .Net framework installed?]]></title>
<link>http://csharptips.wordpress.com/2009/11/29/how-to-run-or-deploy-a-net-application-without-net-framework-installed/</link>
<pubDate>Sun, 29 Nov 2009 07:13:04 +0000</pubDate>
<dc:creator>SkilledDeveloper</dc:creator>
<guid>http://csharptips.wordpress.com/2009/11/29/how-to-run-or-deploy-a-net-application-without-net-framework-installed/</guid>
<description><![CDATA[Sometimes you may need to let user run your .Net application without installing .Net framework. Ther]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Sometimes you may need to let user run your .Net application without installing .Net framework.<br />
There are several tools called “.Net Linker” which pack a .Net application with all needed files into a single package.</p>
<p>Here are some of them:<br />
•	<a href="http://www.vmware.com/products/thinapp/">http://www.vmware.com/products/thinapp/</a><br />
•	<a href="http://www.xenocode.com/Products/Postbuild-for-NET/">http://www.xenocode.com/Products/Postbuild-for-NET/</a><br />
•	<a href="http://www.remotesoft.com/linker/">http://www.remotesoft.com/linker/</a></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Silverlight Bits&amp;Pieces - Part 9: A MessageBox replacement]]></title>
<link>http://ajdotnet.wordpress.com/2009/11/28/silverlight-bitspieces-part-9-a-messagebox-replacement/</link>
<pubDate>Sat, 28 Nov 2009 18:01:47 +0000</pubDate>
<dc:creator>ajdotnet</dc:creator>
<guid>http://ajdotnet.wordpress.com/2009/11/28/silverlight-bitspieces-part-9-a-messagebox-replacement/</guid>
<description><![CDATA[OK, let’s put the brand new service provider model to some good use. Whenever a service call reports]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>OK, let’s put the <a href="http://ajdotnet.wordpress.com/2009/11/14/silverlight-bitspieces-part-8-application-extensions/" target="_blank">brand new service provider model</a> to some good use.</p>
<p>Whenever a service call reports an error I want some message box telling me about it (rather than simply swallowing it, which is the default behavior). Whenever the user does something potentially devastating I want some explicit confirmation, read message box, that he knows what he’s doing. <a href="http://msdn.microsoft.com/en-us/library/ms598690(VS.95).aspx" target="_blank"><em>MessageBox.Show</em></a> does all I need (well, it is restricted to OK and OK/Cancel, but one can live with that). Only&#8230; these system message boxes are dull, boring, and not at all a shiny example for a Silverlight application. <em>Enter the message box service provider…</em></p>
<p><strong>Basic implementation of a message box service</strong></p>
<p>The basic implementation will get the infrastructure up and running.</p>
<p>The first step is defining the service contract. Show this and that and a query method. The first (and naive) version looks like this:</p>
<p><img src="http://ajdotnet.files.wordpress.com/2009/11/code_interface1.jpg" /> </p>
<p>The default implementation of our <em>application extension service turned service provider</em> (AES/SP) would use the dull system message boxes to implement that. The code is actually quite straight forward:</p>
<p><img src="http://ajdotnet.files.wordpress.com/2009/11/code_messageboxservice.jpg" /> </p>
<p>Now, I could demand that the app.xaml has this one (or any other service implementing my interface) registered. However, I like to be <a href="http://en.wikipedia.org/wiki/Convention_over_Code" target="_blank">correct by default</a>, thus my accessor will fall back on this implementation if none is registered – and I can be sure that there will <em>always </em>be a respective service. </p>
<p><img src="http://ajdotnet.files.wordpress.com/2009/11/code_zugriff2.jpg" /> </p>
<p>All that is left is a search&#38;replace for all calls to <a href="http://msdn.microsoft.com/en-us/library/ms598690(VS.95).aspx" target="_blank"><em>MessageBox.Show</em></a>&#8230; E.g. to show an error:</p>
<p><img src="http://ajdotnet.files.wordpress.com/2009/11/code_verwendung_error.jpg" /> </p>
<p>… and to get confirmation, in this case to return a book:</p>
<p><img src="http://ajdotnet.files.wordpress.com/2009/11/code_verwendung_confirm.jpg" /> </p>
<p>And, of course, it works as expected:</p>
<p><img src="http://ajdotnet.files.wordpress.com/2009/11/app_messagebox.jpg" /> </p>
<p><strong>Replacing the Dialog </strong></p>
<p>Second act. Get rid of those dull things.</p>
<p>Create a new “Silverlight Child Window” and style it to look like a message box. I „borrowed“ the images from the Visual Studio Image Library (on my machine under <em>C:\Program Files\Microsoft Visual Studio 9.0\Common7\VS2008ImageLibrary\1033\VS2008ImageLibrary\Objects\png_format\WinVista\</em>) and simply placed all possible images in the dialog. A textbox, two buttons, that’s it. Here is the styled XAML:</p>
<h3><a href="http://ajdotnet.files.wordpress.com/2009/11/xaml_messagebox_new.jpg" target="_blank"><img src="http://ajdotnet.files.wordpress.com/2009/11/xaml_messagebox_new.jpg" /></a> </h3>
<p>Some code is needed for the initialization. The message has to be set, the correct image made visible, etc.. I could probably have done this with less coding, using some tricks and elaborate databinding. But who cares, it’s straight forward and comprehensible (unlike what I probably would have come up with).</p>
<p><img src="http://ajdotnet.files.wordpress.com/2009/11/code_dialog.jpg" /> </p>
<p>Setting the <a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.childwindow.dialogresult(VS.95).aspx" target="_blank"><em>DialogResult </em>property</a> also closes the dialog (sik!).</p>
<p>Finally I need a replacement AES/SP. The main method to show the dialog looks like this:</p>
<p><img src="http://ajdotnet.files.wordpress.com/2009/11/code_messageboxservice_new.jpg" /> </p>
<p>Great? Great! &#8230; GOT YOU! (Fell into the trap myself, actually&#8230; :-/ )</p>
<p><strong>Fixing the Bug</strong></p>
<p>Remember that in Silverlight <em>everything</em> is asynchronous? Well, everything except <em><a href="http://msdn.microsoft.com/en-us/library/ms598690(VS.95).aspx" target="_blank">MessageBox.Show</a></em>? And ‘everything’ includes <em><a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.childwindow.show(VS.95).aspx" target="_blank">ChildWindow.Show</a></em>! Meaning my confirm method will not work this way. To overcome this I decided to pass a delegate to the dialog constructor and made sure it’s called in the OK case: </p>
<p><img src="http://ajdotnet.files.wordpress.com/2009/11/code_dialog_callback.jpg" /> </p>
<p>And to be able to pass the delegate I changed the existing AES as well (and the interface respectively):</p>
<p><img src="http://ajdotnet.files.wordpress.com/2009/11/code_messageboxservice_better.jpg" /> </p>
<blockquote><p>Of course I had to adjust the default implementation using a messagebox:</p>
<p><img src="http://ajdotnet.files.wordpress.com/2009/11/code_messageboxservice_callback.jpg" /> </p>
</blockquote>
<p>The calling code changes respectively, passing a lambda:</p>
<p><img src="http://ajdotnet.files.wordpress.com/2009/11/code_verwendung_confirm_new.jpg" /> </p>
<p>Done. Now my application looks nice, even if it has to show a message box:</p>
<p><img src="http://ajdotnet.files.wordpress.com/2009/11/app_messagebox_new.jpg" /> </p>
<p><strong><a href="http://en.wikipedia.org/wiki/ANFSCD" target="_blank">ANFSCD</a>…</strong></p>
<p>This endeavor served actually three purposes: </p>
<ul>
<li>First, I wanted/needed the feature <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  </li>
<li>Second, I wanted to see/demonstrate the service provider pattern from a user’s point of view. </li>
<li>And third – as you may have noticed from some screenshots – I used this implementation to check out VS2010 beta. </li>
</ul>
<blockquote><p>A quick verdict about VS 2010 beta (not really worth a separate post)&#8230;</p>
<p>The core system, i.e. the shell, the C# code editor, build system, etc. feels very good. No apparent bugs, quite fast, including intellisense, and close enough to VS2008 to feel familiar. Considering that big parts of this are complete rewrites, this is quite an achievement.</p>
<p>The visual designer for (Silverlight) XAML works nice for user controls. Designing grids, the property pane, and other tasks, is at first glance en par with Blend, but comes in a more familiar „Visual Studio flavor“; still it feels more rich and mature than VS2008.      <br />However, there are some notable gaps. Editing of styles and templates, animations, and visual state manager are not covered. Thus my guess is that Blend will remain a necessary complement to VS, even if one has to switch less often. BTW: Contrary to <a href="http://timheuer.com/blog/archive/2009/10/22/can-i-use-vs2010-for-silverlight-3-development.aspx" target="_blank">what Tim wrote</a>, I could work with Blend on VS2010 solutions (the project that cannot be loaded is only the web project), I just refrained from manipulating my project files with Blend.</p>
<p>Other areas I touched briefly have been less satisfying. <a href="http://msdn.microsoft.com/en-us/library/dd997841(VS.100).aspx" target="_blank">IntelliTrace</a> didn’t work, but I didn’t spend too much time on that. The architecture and modeling area for example has changed, but is by no means bug free (to the point of “not yet usable”). The profiler has evolved, but IMO still lacks what DevPartner offered nearly 10 years ago: <a href="http://www.microfocus.com/products/DevPartner/StudioProfessionalEditionCapabilities.asp#6" target="_blank">a decent call graph</a>. </p>
<p>Oh, one bright spot for any dev lead: code analysis (FxCop) rules are now <a href="http://blogs.msdn.com/fxcop/archive/2008/11/12/fun-with-code-analysis-rulesets.aspx" target="_blank">maintained in separate files</a>, projects reference these files by name.</p>
<p>Anyway, I have been using VS2010 beta since I installed it and was never compelled to switch back to VS2008. I’m going to have to reinstall my machine anytime soon, and I’m planning on going along with VS2010 beta, not installing VS2008 at all.</p>
</blockquote>
<p><font color="#008000">That’s all for now folks,      <br /><strong>AJ.NET</strong></font></p>
<p><a href="http://www.dotnetkicks.com/kick/?url=http://ajdotnet.wordpress.com/2009/11/28/silverlight-bitspieces-part-9-a-messagebox-replacement/"><img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http://ajdotnet.wordpress.com/2009/11/28/silverlight-bitspieces-part-9-a-messagebox-replacement/" border="0" alt="kick it on DotNetKicks.com" /></a></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Visual Studio 2010-VS ALM Challenge]]></title>
<link>http://cnetug.wordpress.com/2009/11/27/visual-studio-2010-vs-alm-challenge/</link>
<pubDate>Fri, 27 Nov 2009 14:13:53 +0000</pubDate>
<dc:creator>Fredrick J Sahaya</dc:creator>
<guid>http://cnetug.wordpress.com/2009/11/27/visual-studio-2010-vs-alm-challenge/</guid>
<description><![CDATA[Welcome to the VS ALM Challenge. Here is your opportunity to showcase your skills on Visual Studio 2]]></description>
<content:encoded><![CDATA[Welcome to the VS ALM Challenge. Here is your opportunity to showcase your skills on Visual Studio 2]]></content:encoded>
</item>
<item>
<title><![CDATA[C# 4.0 Series – Part 2: Dynamic]]></title>
<link>http://xavierdecoster.wordpress.com/2009/11/26/c-4-0-series-%e2%80%93-part-2-dynamic/</link>
<pubDate>Thu, 26 Nov 2009 21:23:10 +0000</pubDate>
<dc:creator>Xavier Decoster</dc:creator>
<guid>http://xavierdecoster.wordpress.com/2009/11/26/c-4-0-series-%e2%80%93-part-2-dynamic/</guid>
<description><![CDATA[As I mentioned in Part 1, the main theme of C# 4.0 is &#8220;dynamic&#8221;. Part 2 is about explain]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><strong>As I mentioned in <a href="http://xavierdecoster.wordpress.com/2009/11/22/c-4-0-series-%e2%80%93-part-1-overview/" target="_blank">Part 1</a></strong><strong>, the main theme of C# 4.0 is &#8220;dynamic&#8221;. Part 2 is about explaining you what&#8217;s it all about.<br />
</strong></p>
<h1>A static language in a dynamic world</h1>
<p>It&#8217;s an industry trend that dynamic languages seem to be gaining popularity lately, amongst which we count fellow members as IronPython, IronRuby, F# and others.</p>
<p>Many, almost religious, discussions have been flooding the internet about which programming paradigm is the best, and the conclusion is, that they both have advantages and disadvantages.</p>
<p>It&#8217;s not so much about which is the best, but more about which can or should I use when.</p>
<p>Dynamic typing mostly has a very simple and succinct syntax, and has the advantage that it doesn&#8217;t need any compilation.</p>
<p>In a dynamic language, everything gets implicitly typed, while static languages enforce you to do the opposite: without a compiler and without explicit casting, a static language would be dead code.</p>
<p>On the other hand, it&#8217;s just because of C# being statically typed that most of us love it and enjoy it&#8217;s robustness and performance. Without static typing, you wouldn&#8217;t have the intelligent tools we know today, such as an Intellisense-enabled Visual Studio for instance.</p>
<p>Microsoft very well anticipated this trend and has built a Dynamic Language Runtime (DLR) on top of or next to the well-known Common Language Runtime (CLR), enabling the interaction of dynamic languages with the .NET 4.0 Framework.</p>
<p>Now, you might wonder why you would need this beast, and the truth is that, if you don&#8217;t know, you probably don&#8217;t need it <span style="font-family:Wingdings;">J</span>.</p>
<p>Anyway, any C# developer should know about its existence to know when he could actually take advantage of it. Most of us will probable even take advantage of it without knowing by using the improved COM-interop features that come with the .NET 4.0 Framework, or by doing some reflection.</p>
<h2>Dynamically typed objects and the DLR</h2>
<p>The Dynamic Language Runtime is the CLR-equivalent for dynamic languages. That being said, it doesn&#8217;t mean that static languages don&#8217;t use it or can&#8217;t take advantage of it.</p>
<p>The CLR could handle already some dynamic operations such as reflection, but it wasn&#8217;t really meant for it, and it lacked some features.</p>
<p>For instance, the DLR takes care about expression trees (think about LINQ statements): it receives an expression tree that represents a piece of code, and it will compile it to the most efficient MSIL-code (Microsoft Intermediate Language).</p>
<p>Secondly, it handles dynamic dispatch, for instance: you can have a dynamic object you know nothing about (might be a JavaScript object, Python, or just plain old .NET), and you want to invoke a method call on it. At this time, the DLR takes over and it will generate some code for you to make this method call happen in the most efficient way possible.</p>
<p>Next to that, the DLR does something known as &#8220;call site caching&#8221;: if a method gets called multiple times, you will have to pay only once for the overhead of the method dispatch. This overhead makes sense, because you don&#8217;t know that the method exists on that specific object, so the DLR has to look it up (luckily for you, you don&#8217;t have to). After the first call, the call site (the result of the method lookup) will get cached by the DLR to be used in any subsequent calls to that method.</p>
<p>On top of that, you can use both dynamic and static languages.</p>
<p>Because we don&#8217;t care any longer about what type of object we are working with (we do, but we don&#8217;t want to handle the coding to actually do something with it any more), the DLR has to be smart enough to handle different kinds of objects.</p>
<p>That&#8217;s why it is equipped with a set of binders to enable to communicate with different types of objects: it has a POCO-binder (plain old CLR object or .NET object), a JavaScript binder, a Ruby and Python binder and a COM binder.</p>
<p>If the object that is statically declared to be dynamic is…</p>
<ul>
<li>… a .NET object: the DLR uses Reflection;</li>
<li>… a COM object: the DLR uses IDispatch;</li>
<li>… any object implementing IDynamicObject: the DLR uses the IDynamicObject implementation of that object.</li>
</ul>
<p>Simply put, it enables a unified programming experience for all these scenarios, and that&#8217;s where the new &#8216;dynamic&#8217; keyword kicks in.</p>
<p><span style="font-size:9pt;">Note: The IDynamicObject and related interfaces are food for another blog post anytime soon, but it is more a .NET 4.0 feature than a C# 4.0 language specific feature. So is the DLR actually, but it is required to know about it before explaining what the language feature is all about.<br />
</span></p>
<p><img src="http://xavierdecoster.files.wordpress.com/2009/11/112609_2122_c40series1.png" alt="" /></p>
<h2>The dynamic keyword was born</h2>
<p>Some of you might recognize these pieces of code, but why reinventing the wheel if it is a very good sample, so all credit to the guy who came up with it.</p>
<p>Suppose you have an object that represents a calculator and allows to you get the sum of two integers. If you actually have a method that returns you a statically typed Calculator instance, your code would be very similar to this:</p>
<p><img src="http://xavierdecoster.files.wordpress.com/2009/11/112609_2122_c40series2.png" alt="" /></p>
<p>Suppose you could do the same by getting the calculator through reflection. Then you&#8217;re code would suddenly grow to something huge as you can find below:</p>
<p><img src="http://xavierdecoster.files.wordpress.com/2009/11/112609_2122_c40series3.png" alt="" /></p>
<p>Or even better, if it concerns a JavaScript object, it looks like this:</p>
<p><img src="http://xavierdecoster.files.wordpress.com/2009/11/112609_2122_c40series4.png" alt="" /></p>
<p>And that, for doing the same simple operation! I know a good developer is most likely to be lazy (in the good meaning of the word here), so we really don&#8217;t want to spend our days producing these kind of things.</p>
<p>Because we really want to take care about what our code does, and less about how it does it &#8211; especially if something as the DLR can assure us it will do it in the same way as we would do it ourselves, or even better &#8211; a new keyword has come to life to instruct the DLR to take care of it.</p>
<p>The code would look like the following (and could handle all of the above cases):</p>
<p><img src="http://xavierdecoster.files.wordpress.com/2009/11/112609_2122_c40series5.png" alt="" /></p>
<p>Pretty cool and straightforward, isn&#8217;t it?</p>
<p>Now the question is, after years of predication that static typing is THE way of programming, should we all do everything dynamic from now on?</p>
<p>Well, I&#8217;d rather agree with the following quote of Bart De Smet (Microsoft Software Development Engineer, MVP C#): calling static objects from a dynamic world is easy (e.g. PowerShell), the reverse, calling dynamic objects as if they were static, is like rowing against the current.</p>
<h2>Compile-time dynamic, Run-time static</h2>
<p>Don&#8217;t forget you are doing stuff dynamically here. The dynamic keyword just told the compiler that your object has to be dynamically dispatched. You don&#8217;t have Visual Studio&#8217;s Intellisense any longer, because you simply don&#8217;t know the object. Does it even have properties, or the method you would want to invoke? At compile-time, you simply don&#8217;t know.</p>
<p><em>&#8220;It is statically typed to be dynamic.&#8221;<br />
</em></p>
<p>This means, when an operand is dynamic, some things get postponed until runtime, such as:</p>
<ul>
<li>Member selection gets deferred to run-time</li>
<li>At run-time, actual type(s) are substituted for dynamic</li>
<li>The static result type of an operation will also be dynamic</li>
</ul>
<p>Next post: C# 4.0 Series &#8211; Part 3: Optional and Named Parameters</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[LHC - Collisions]]></title>
<link>http://shapemetrics.wordpress.com/2009/11/25/lhc-collisions/</link>
<pubDate>Wed, 25 Nov 2009 18:04:58 +0000</pubDate>
<dc:creator>shapemetrics</dc:creator>
<guid>http://shapemetrics.wordpress.com/2009/11/25/lhc-collisions/</guid>
<description><![CDATA[A headline referring to the LHC particle accelerator made me laugh; the headline states: LHC has its]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>A headline referring to the LHC particle accelerator made me laugh; the headline states: LHC has its First Collisions. Think not really; didn&#8217;t it collide with a sandwich?</p>
<p><a href="http://scitech.blogs.cnn.com/2009/11/23/large-hadron-collider-has-first-collisions/">http://scitech.blogs.cnn.com/2009/11/23/large-hadron-collider-has-first-collisions/</a></p>
<p>For those not informed about the LHC it is the worlds largest particle accelerator; 17 miles in circumference; tucked away in the mountains between France and Switzerland. Twice since it schedule debut it has had issues; the first of which was a power issue (uses enough energy to power a small city) and the second of them was due to bread from a sandwich which was somehow inside of it.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[ServiceModelReg.exe]]></title>
<link>http://admod.wordpress.com/2009/11/24/servicemodelreg-exe/</link>
<pubDate>Tue, 24 Nov 2009 10:08:54 +0000</pubDate>
<dc:creator>AdmOd</dc:creator>
<guid>http://admod.wordpress.com/2009/11/24/servicemodelreg-exe/</guid>
<description><![CDATA[เกี่ยวกับ ASP.Net กันสักหน่อย สำหรับวิธีการนี้จะอ้างอิงบน Windows 7 RTM (Build #7600) เป็นหลักนะครับ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>เกี่ยวกับ <a class="zem_slink" title="ASP.NET" rel="homepage" href="http://www.asp.net">ASP.Net</a> กันสักหน่อย</p>
<blockquote><p>สำหรับวิธีการนี้จะอ้างอิงบน <a class="zem_slink" title="Windows" rel="homepage" href="http://www.microsoft.com/WINDOWS">Windows</a> 7 RTM (Build #7600) เป็นหลักนะครับ</p></blockquote>
<p>เอาล่ะ เกริ่นนำสักนิดส์</p>
<p>สำหรับผู้ใช้ ASP.Net ในการพัฒนาเว็บไซต์ หนึ่งในระบบ Manage บัญชีผู้ใช้ที่ใช้กันอย่างแพร่หลาย(?) ระบบหนึ่งก็คือ ASP.Net Membership</p>
<p>แล้วการใช้ตัว ASP.Net Membership Provider นี่ก็ต้องมีการเข้าไปแก้ไฟล์อย่าง Machine.config เพื่อนำมาใช้กับ <a class="zem_slink" title="Web.config" rel="wikipedia" href="http://en.wikipedia.org/wiki/Web.config">Web.config</a> บ้างเป็นระยะๆ</p>
<blockquote><p>อนึ่ง&#8230; Machine.config จะเก็บค่าปรับตั้งอย่างละเอียดของระบบ ซึ่งเป็นในลักษณะ Default Environmen ซึ่งถ้าผู้ใช้ต้องการปรับใช้ให้เหมาะกับตัวเองก็สามารถ &#8220;ก๊อปปี้&#8221; tag เหล่านั้นมาไว้ใน Web.config เพื่อ override ค่า Default ได้จ๊ะ..</p></blockquote>
<p>แล้วทีนี้ สมมติว่าเผลอมือบอนไปแก้มันซะผิดเพี้ยน จนไม่สามารถรันได้เลย จะทำไงดี?</p>
<p><strong>วิธีแรกแรก</strong> Re- Install ตัว .Net Framework 2.0 ลงไป</p>
<p>วิธีนี้เขาว่ากันว่าใช้งานได้ผล<br />
&#8230;แต่ใช้กับ Vista/7 ไม่ได้ เพราะมัน Built-in มา จะ Reinstall หรือ Remove ไม่ได้</p>
<p><strong>วิธีที่สอง</strong> เรียกไฟล์ .default</p>
<p>ในเมื่อ Machine.config พัง ก็เรียก Machine.config.default แทนขึ้นมา</p>
<p>วิธีนี้พอจะใช้ได้ผล ในกรณีที่กำหนดค่าผิดเพี้ยนไปก็สามารถเปิดไฟล์ Machine.config.default ขึ้นมาได้ ซึ่งไฟล์นี้ก็อยู่รวมกัน Machine.config นั้นแหละ</p>
<blockquote><p>Default Path ของไฟล์ดังกล่าวอยู่ที่<br />
&#8220;C:\Windows\<a class="zem_slink" title=".NET Framework" rel="homepage" href="http://msdn.microsoft.com/netframework/">Microsoft.NET</a>\Framework\v2.0.50727\CONFIG&#8221;</p>
<p>หรือ</p>
<p>&#8220;%windir%\Microsoft.NET\Framework\v2.0.50727\CONFIG&#8221;</p></blockquote>
<p><strong>วิธีที่สาม</strong> ในกรณีที่ &#8220;จนมุม&#8221; หลังจากพยายามแก้มาน๊าน..นาน หรือ &#8220;หาไม่เจอ&#8221; หรือ &#8220;ขี้เกียจจะแก้&#8221; เรามีอีกวิธีให้คือ &#8220;ServiceModelReg.exe&#8221;</p>
<blockquote><p>พบกับไฟล์นี้ได้ที่!<br />
&#8220;C:\Windows\Microsoft.NET\Framework\v3.0\<a class="zem_slink" title="Windows Communication Foundation" rel="wikipedia" href="http://en.wikipedia.org/wiki/Windows_Communication_Foundation">Windows Communication Foundation</a>&#8220;</p>
<p>หรือ</p>
<p>&#8220;%windir%\Microsoft.NET\Framework\v3.0\Windows Communication Foundation&#8221;</p>
<p>ได้ตามที่่ทานต้องการ!</p></blockquote>
<p>วิธีการใช้ก็แสนจะเบสิกคอลลี่มว๊ากๆ</p>
<blockquote><p>คำเตือน: ใช้ภายนอกเท่านั้น<br />
วิธีใช้</p>
<ol>
<li>จงเข้าไปที่โฟลเดอร์
<p>&#160;</p>
<p>&#8220;C:\Windows\Microsoft.NET\Framework\v3.0\&#8221; หรือ<br />
&#8220;%windir%\Microsoft.NET\Framework\v3.0\&#8221;</p>
<p>&#160;</p>
</li>
<li>จงกด Shift แล้วคลิกขวาที่โฟลเดอร์ &#8220;Windows Communication Foundation&#8221;</li>
<li>จงเลือก &#8220;Open Command Window Here&#8221;</li>
<li>จงพิมพ์ว่า &#8220;S&#8221; แล้วกด tab เรื่อยๆไปจนถึง &#8220;ServiceModelReg.exe&#8221;</li>
<li>จงวรรค 1 ครั้ง แล้วพิมพ์ว่า -r เพื่อสั่งให้ Reinstall<a href="http://admod.files.wordpress.com/2009/11/servicemodelreg.png"><img style="border-width:0;" src="http://admod.files.wordpress.com/2009/11/servicemodelreg_thumb.png?w=495&#038;h=52" border="0" alt="5 ขั้นตอนนั่นเพื่อแค่นี้แหละ" width="495" height="52" /></a></li>
</ol>
</blockquote>
<p>ที่จริงมันสามารถทำได้หลากหลายกว่านี้มาก แต่จงอ่าน Help เอง</p>
<p>เมื่อได้ดังรูปแล้ว ให้กด Enter<br />
แล้วมันจะรันบ้าบ้าอะไรไม่รู้อยู่หนึงหน้าจอ</p>
<p>กระบวนการนี้ใช้เวลาไม่ถึง 1 นาที!!<br />
(ซึ่งถ้ามัวไปงมโข่งแก้ Code อาจใช้เวลาเป็นชั่วโมง เป็นวัน เดือนเดือน เป็นปี บางคนอาจทั้งชีวิต!)</p>
<p>เอาล่ะ&#8230;เมื่อทำได้แล้ว จงระลึกว่าไว้อย่างนึงว่า<br />
&#8220;จงแก้ไฟล์ระบบอย่างมีสติ<em>(มากกว่านี้)</em>&#8220;</p>
<p>จบแล้วจ้า!</p>
<p>ปล. ถ้าบทความนี้ช่วยอะไรไม่ได้ จง <a class="zem_slink" title="Google" rel="homepage" href="http://google.com">Google</a> ต่อไป <em>สู้ๆ!!</em></p>
<div class="zemanta-pixie" style="margin-top:10px;height:15px;"><a class="zemanta-pixie-a" title="Reblog this post [with Zemanta]" href="http://reblog.zemanta.com/zemified/4571b17b-d1f7-4a4e-ae73-29ef6a9528a5/"><img class="zemanta-pixie-img" style="border:medium none;float:right;" src="http://img.zemanta.com/reblog_e.png?x-id=4571b17b-d1f7-4a4e-ae73-29ef6a9528a5" alt="Reblog this post [with Zemanta]" /></a></div>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[C# 4.0 Series – Part 1: Overview ]]></title>
<link>http://xavierdecoster.wordpress.com/2009/11/22/c-4-0-series-%e2%80%93-part-1-overview/</link>
<pubDate>Sun, 22 Nov 2009 14:43:31 +0000</pubDate>
<dc:creator>Xavier Decoster</dc:creator>
<guid>http://xavierdecoster.wordpress.com/2009/11/22/c-4-0-series-%e2%80%93-part-1-overview/</guid>
<description><![CDATA[C# 4.0 offers some exciting new features that will make life easier when working with dynamic progra]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><strong>C# 4.0 offers some exciting new features that will make life easier when working with dynamic programming scenarios or COM-interoperability.<br />
</strong></p>
<p><strong>I&#8217;ll explain these improvements, the new keyword &#8216;dynamic&#8217; and also contra-variance and co-variance in these series of blog posts and I&#8217;ll try to provide you with some use cases for them to improve your code and coding experience.<br />
</strong></p>
<h1>The Evolution of C#<br />
</h1>
<p>To help you understanding why these features are added to the language, and what the future of the language looks like, you must understand its history and its evolution. Behold my attempt in this first post of the series.
</p>
<p><img src="http://xavierdecoster.files.wordpress.com/2009/11/112209_1443_c40series1.png">
	</p>
<h2>C# 1.0 – Codename COOL<br />
</h2>
<p>On June 16<sup>th</sup> 2000, almost 10 years ago, Microsoft announced the first high-level programming language to specifically target the .NET Common Language Runtime.
</p>
<p>C# 1.0, also known under the codename <strong>COOL</strong> (C-style Object Oriented Language), was meant to provide an easy to use, object-oriented, component-based language to the .NET CLR.
</p>
<p>It&#8217;s a language that borrowed a lot from other languages amongst which we find C++, Java, Delphi and others.
</p>
<p>The community had to wait to get its hands on the RTM version until February 13<sup>th</sup> 2002, but nevertheless it was an immediate hit.
</p>
<p>There was a minor version 1.1 in April 2003, but it didn&#8217;t significantly change the theme of the 1.0 release.
</p>
<h2>C# 2.0 – Generic version of C# 1.0<br />
</h2>
<p>When C# 2.0 rolled out, we finally had the missing features that should have been in C# 1.0, such as <strong>generic types</strong>, which were the main theme of this version and are still of huge importance in .NET development today.
</p>
<p>New introductions were made with other features like anonymous methods, iterators and nullable types.
</p>
<p>The latter, nullable types, was an interesting feature that was added to pave the way for C# 3.0, for which the main focus would lay on data.
</p>
<h2>C# 3.0 – Embrace your data<br />
</h2>
<p>Most developers work with data, and this happened to be the main theme of the C# 3.0 language enhancements.
</p>
<p>The largest language addition was <strong>LINQ</strong> (Language Integrated Query), and most others were primarily added to support this feature.
</p>
<p>Nevertheless, these other features can and do have their value on their own, including:
</p>
<ul>
<li>&#8216;var&#8217; (implicitly typed local variable);
</li>
<li>Anonymous types
</li>
<li>Object and collection initializers
</li>
<li>Lambda expressions
</li>
<li>Extension methods
</li>
</ul>
<h2>C# 4.0 – Statically typed to be dynamic<br />
</h2>
<p>C# 4.0 will primarily focus on <strong>dynamic programming</strong>. Version 4.0 of the .NET Framework comes with a new version of the CLR, and what&#8217;s even more important, a <strong>DLR</strong> (Dynamic Language Runtime).
</p>
<p>Now you might wonder why we would need that, but basically, this is Microsoft&#8217;s answer to the following non-exhaustive list of scenarios:
</p>
<ul>
<li>The demand for multiple language integration, including dynamic languages, such as F#, IronRuby, IronPython,…
</li>
<li>Simpler reflection
</li>
<li>Easier COM interop
</li>
<li>HTML DOM access in Web scenarios
</li>
</ul>
<p>New features are:
</p>
<ul>
<li>New keyword: dynamic (together with IDynamicObject and other cool stuff included in the .NET 4.0 Framework)
</li>
<li>Optional and named parameters
</li>
<li>Improved COM interop (combination of the 2 features above + PIA embedding feature)
</li>
<li>Generic contravariance and covariance
</li>
</ul>
<p>More information on what&#8217;s inside, and how to gain benefit from it, will be the topic of Part 2 in this series.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[CardioPod un producto de Telehealth Solutions]]></title>
<link>http://guidozanon.wordpress.com/2009/11/21/cardiopod-un-producto-de-telehealth-solutions/</link>
<pubDate>Sat, 21 Nov 2009 19:07:18 +0000</pubDate>
<dc:creator>guidozanon</dc:creator>
<guid>http://guidozanon.wordpress.com/2009/11/21/cardiopod-un-producto-de-telehealth-solutions/</guid>
<description><![CDATA[Hace unos meses Telehealth Solutions una empresa Inglesa ubicada en Watford, lanzo CardioPod, un pro]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Hace unos meses <a href="http://www.telehealthsolutions.co.uk/" target="_blank">Telehealth Solutions</a> una empresa Inglesa ubicada en Watford, lanzo CardioPod, un producto en el que venimos trabajando hace ya unos cuantos meses. El mismo permite calcular el riesgo cardio-vascular de un paciente mediante la realización de una serie de test y cuestionarios.</p>
<p>Por ahora el producto los están usando las tres principales servicios de medicina de inglaterra, pero esperamos que en el proximo año se sumen muchas mas.</p>
<p>Les dejo algunos links con articulos sobre el producto:</p>
<p><a href="http://www.news-medical.net/news/20090624/Telehealth-Solutions-launches-CardioPod-for-NHS-Health-Check.aspx" target="_blank">http://www.news-medical.net/news/20090624/Telehealth-Solutions-launches-CardioPod-for-NHS-Health-Check.aspx</a></p>
<p><a href="http://www.european-hospital.com/en/article/6058.html" target="_blank">http://www.european-hospital.com/en/article/6058.html</a></p>
<p><a href="http://www.ehiprimarycare.com/news/4990/cardiopod_launched_at_nhs_camden" target="_blank">http://www.ehiprimarycare.com/news/4990/cardiopod_launched_at_nhs_camden</a></p>
<p><a href="http://scottishhealthcare.co.uk/78/edinburgh-pharmacist-cardiopod/" target="_blank">http://scottishhealthcare.co.uk/78/edinburgh-pharmacist-cardiopod/</a></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Web Designing &amp; Out Sourcing]]></title>
<link>http://whizpeter.wordpress.com/2009/11/18/web-designing-out-sourcing/</link>
<pubDate>Wed, 18 Nov 2009 11:38:34 +0000</pubDate>
<dc:creator>whizpeter</dc:creator>
<guid>http://whizpeter.wordpress.com/2009/11/18/web-designing-out-sourcing/</guid>
<description><![CDATA[Web Designing has become the need of the hour. To grow your business perspectives across the world, ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><a href="http://www.whizkraft.com/">Web Designing</a> has become the need of the hour. To grow your business perspectives across the  world, a company needs to have a tailored and self-explanatory website which  can magnetize prospect clients and fulfill the desires of the existing patrons.  Therefore, it becomes mandatory to design a good and magnetic website to  promote your business and give you more propositions.<br />
These  days, many particularly designed companies offer <a href="http://www.whizkraft.com/contactus.php">web  design</a> services. Though, the increasing usage  of internet has encouraged offshore website development destinations to offer  their proficiency and comprehension.<br />
<a href="http://www.whizkraft.com">Website development</a> in India has proved its grit with producing quality services at the restricted  time frame. Indian web Development Company is focused to serve the best in this  cut-throat in viable world.<br />
For  choosing the best <a href="http://www.whizkraft.com">website development</a> company, one has to go through the online assortment of the various website  development companies and appraise their work. It gives you an idea to review  the company&#8217;s capabilities and a peep in its previous work. This will further  help to realize the company&#8217;s potential to create some great works. Companies  with ample experience will provide adequate information to its clients.<br />
The  web sites are designed on <a href="http://www.whizkraft.com/services.php">PHP</a>, <a href="http://www.whizkraft.com/aboutus.php">Dot  Net</a>, <a href="http://www.whizkraft.com/">.Net Framework</a>, <a href="http://www.whizkraft.com/clients.php">VB.Net</a> and <a href="http://www.whizkraft.com/portfolio.php">Flash</a> which are more commonly used to develop a web site. It is  also important to determine the familiarity of a website development company before  hiring it to work. Check the familiarity in years and adjudicate their work  superiority to get the quality work done.<br />
Sometimes,  there are many economical options available in the market. But, before grabbing  those offers, you should conclude your business needs and consumerist  aspirations. See what you need and what is your intention. It is you who is  going to pay for it. So, make sure you get the best covenant to get profitable  results in the end.<br />
Try  to be clear what kind of <a href="http://www.whizkraft.com">Web Design</a> you wish for your business and talk to the company professional to make you the  same within your price range.<br />
You&#8217;ll need to oversee and evaluate a process that is hard to  comprehend, has somewhat intangible deliverables, and where the &#8220;timing of  results&#8221; can&#8217;t be precisely defined. Given this scenario, how can you best  work with a <a href="http://www.whizkraft.com">Search Engine Optimization</a> (SEO) to achieve the best outcome  for your website?<br />
For More  Information<br />
<a href="http://www.whizkraft.com/">Web Design</a><br />
<a href="http://www.whizkraft.com/services.php">PHP</a><br />
<a href="http://www.whizkraft.com/index.php">SEO</a><br />
<a href="http://www.whizkraft.com/contactus.php">Friends and family</a><br />
The Author  is an Executive with <a href="http://www.whizkraft.com">www.whizkraft.com</a></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Rapid Development]]></title>
<link>http://shapemetrics.wordpress.com/2009/11/17/rapid-development/</link>
<pubDate>Tue, 17 Nov 2009 20:27:28 +0000</pubDate>
<dc:creator>shapemetrics</dc:creator>
<guid>http://shapemetrics.wordpress.com/2009/11/17/rapid-development/</guid>
<description><![CDATA[I have been using CodeSmith for several years now. It is only second to Red-Gates SQL products, (SQL]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>I have been using <a href="http://www.codesmithtools.com" target="_blank">CodeSmith</a> for several years now. It is only second to <a href="http://www.red-gate.com" target="_blank">Red-Gates</a> SQL products, (SQL Prompt &#38; SQL Compare). (No I am not paid by either company to make a review; just personal experience with both products).</p>
<p>I have written my own scripts that create strongly typed business objects, collections and DAL using CodeSmith. Some are dated and I have been trying to move them to more current technology like Ajax &#38; jquery.</p>
<p>Features that I would like to see in CodeSmith</p>
<ol>
<li>Better Mapping Support for map files that are not contain in the default location (My Documents\CodeSmith\Maps).</li>
<li>MasterPage like functionality for Common content structure</li>
<li>Cache dependency support know when a file has been modified in and re-compile project accordingly</li>
</ol>
<p> SQL Prompt a better intelli-sense tool than what is provided by MS in either VS.net or SQL Business Studio Management. It can see the database structure and allow you to join tables on FK/PK fields. It shortens the development time on queries by helping developers write queries.</p>
<p>SQL Prompt features I would like to see</p>
<ol>
<li>Support for CLR types built-in or custom (HierarchyId, Geometry, Geography)</li>
<li>Support dependant on Server Version</li>
<li>Custom support for naming conventions on aliases; currently takes the first letter and each capitalized; (really looks ugly to see trdx) maybe a regular expression would help</li>
</ol>
<p>Not withstanding the above feature requests; this tools are still powerful check them out for yourselves.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Connection strings for SQL Server 2005]]></title>
<link>http://dyelvn.wordpress.com/2009/11/17/connection-strings-for-sql-server-2005/</link>
<pubDate>Tue, 17 Nov 2009 06:20:10 +0000</pubDate>
<dc:creator>keithervn</dc:creator>
<guid>http://dyelvn.wordpress.com/2009/11/17/connection-strings-for-sql-server-2005/</guid>
<description><![CDATA[.NET Framework Data Provider for SQL Server Type: .NET Framework Class Library Usage: System.Data.Sq]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><div>
<h2>.NET Framework Data Provider for SQL Server</h2>
<div>
<div><strong>Type:</strong> .NET Framework Class Library<br />
<strong>Usage:</strong> System.Data.SqlClient.SqlConnection</div>
<div><strong>Manufacturer:</strong> Microsoft</div>
<div></div>
</div>
</div>
<div><strong>Standard Security</strong></div>
<div id="p0cs0">Data Source=myServerAddress;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword;</div>
<div>
<div>Use serverName\instanceName as Data Source to connect to a specific SQL Server instance.</p>
<p>Are you using SQL Server 2005 Express? Don&#8217;t miss the server name syntax Servername\SQLEXPRESS where you substitute Servername with the name of the computer where the SQL Server 2005 Express installation resides.</p></div>
</div>
<div><a href="ccstc(document.getElementById('p0cs0'));"> </a></div>
<div><strong><br />
</strong></div>
<div><strong>Standard Security alternative syntax</strong></div>
<div>This connection string produce the same result as the previous one. The reason to include it is to point out that some connection string keywords have many equivalents.</div>
<div id="p0cs1">Server=myServerAddress;Database=myDataBase;User ID=myUsername;Password=myPassword;Trusted_Connection=False;</div>
<div></div>
<div><a href="ccstc(document.getElementById('p0cs1'));"> </a></div>
<div></div>
<div><strong>Trusted Connection</strong></div>
<div id="p0cs2">Data Source=myServerAddress;Initial Catalog=myDataBase;Integrated Security=SSPI;</div>
<div></div>
<div><a href="ccstc(document.getElementById('p0cs2'));"> </a></div>
<div></div>
<div><strong>Trusted Connection alternative syntax</strong></div>
<div>This connection string produce the same result as the previous one. The reason to include it is to point out that some connection string keywords have many equivalents.</div>
<div id="p0cs3">Server=myServerAddress;Database=myDataBase;Trusted_Connection=True;</div>
<div></div>
<div><a href="ccstc(document.getElementById('p0cs3'));"> </a></div>
<div></div>
<div><strong>Connecting to an SQL Server instance</strong></div>
<div>The syntax of specifying the server instance in the value of the server key is the same for all connection strings for SQL Server.</div>
<div id="p0cs4">Server=myServerName\theInstanceName;Database=myDataBase;Trusted_Connection=True;</div>
<div></div>
<div><a href="ccstc(document.getElementById('p0cs4'));"> </a></div>
<div></div>
<div><strong>Trusted Connection from a CE device</strong></div>
<div>Often a Windows CE device is not authenticated and logged in to a domain. To use SSPI or trusted connection / authentication from a CE device, use this connection string.</div>
<div id="p0cs5">Data Source=myServerAddress;Initial Catalog=myDataBase;Integrated Security=SSPI;User ID=myDomain\myUsername;Password=myPassword;</div>
<div>Note that this will only work on a CE device.</div>
<div></div>
<div>nguon: <a href="http://www.connectionstrings.com/sql-server-2005">http://www.connectionstrings.com/sql-server-2005</a></div>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Visual Studio and SVN]]></title>
<link>http://bryandallen.wordpress.com/2009/11/16/visual-studio-and-svn/</link>
<pubDate>Mon, 16 Nov 2009 21:39:13 +0000</pubDate>
<dc:creator>Bryan Allen</dc:creator>
<guid>http://bryandallen.wordpress.com/2009/11/16/visual-studio-and-svn/</guid>
<description><![CDATA[I recently converted over to using SVN for source control for all my projects at work.  I&#8217;ve b]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>I recently converted over to using SVN for source control for all my projects at work.  I&#8217;ve been using it at home for over a year now.  So far&#8230;..its great!  I&#8217;m primarily using Visual Studio 2008 so I needed something that would integrate cleanly, but I also wanted something that could be used by multiple platforms since I&#8217;m looking into developing for the Mac and iPhone soon.  In addition, our budget is very limited so I needed a free solution.</p>
<p>Solution:</p>
<p>VisualSVN Server:   <a title="VisualSVN Server" href="http://www.visualsvn.com/server/">http://www.visualsvn.com/server/</a></p>
<ul>
<li>Easy to install SVN Server for Windows that is free if you don&#8217;t have any advanced server needs.</li>
</ul>
<p>AnkhSVN:  <a title="AnkhSVN" href="http://ankhsvn.open.collab.net/">http://ankhsvn.open.collab.net/</a></p>
<ul>
<li>Free Subversion SourceControl Provider for Visual Studio 2008.</li>
<li>Super fast, easy to integrate with existing projects, and very clean implementation.</li>
</ul>
<p>TortoiseSVN:  <a href="http://tortoisesvn.tigris.org/">http://tortoisesvn.tigris.org/</a></p>
<ul>
<li>Integrates SVN into the shell and makes it easy to add whatever I want to source control, even if  its not in a Visual Studio project.  I used TortoiseCVS at SAS a few years ago so I figured TortoiseSVN would be of similar quality.</li>
</ul>
<p>JIRA, Fisheye, and Greenhopper Starter:  <a title="Atlassian Starter" href="http://www.atlassian.com/starter/">http://www.atlassian.com/starter/</a></p>
<ul>
<li>Issue tracking, source control management and visualization, change tracking, and agile project management.</li>
<li>The starter licenses are $10 each for these so the price is definitely right.  We do have a little bit of budget here and $30 is nothing.  We&#8217;re a very small team so the starter licenses are perfect for us.</li>
<li>I&#8217;m just now getting this all up to speed and still in the evaluation phase, but the change tracking and issue management are top notch and installation and integration with VisualSVN server were pretty painless if you know anything about Java web applications.  I just needed to throw a little more RAM at my instances of Tomcat and its all running flawlessly now.</li>
</ul>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Leere Strings in .NET prüfen]]></title>
<link>http://mstechnology.wordpress.com/2009/11/16/leere-strings-in-net-prufen/</link>
<pubDate>Mon, 16 Nov 2009 18:24:08 +0000</pubDate>
<dc:creator>A. Schiemann</dc:creator>
<guid>http://mstechnology.wordpress.com/2009/11/16/leere-strings-in-net-prufen/</guid>
<description><![CDATA[Eine sehr häufige Herausforderung beim Programmieren ist die Prüfung von Strings auf ihren Inhalt. H]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Eine sehr häufige Herausforderung beim Programmieren ist die Prüfung von Strings auf ihren Inhalt. Hier insbesondere die der leeren Strings. In diesem deutschen <a href="http://blogs.myfirstsharepoint.de/archive/2009/06/09/tour-de-performance-%E2%80%93-leere-strings-pr%C3%BCfen.aspx" target="_blank">Artikel </a>von HanseVision werden die Möglichkeiten zur Prüfung auf leere Strings dargestellt und auf die Performance-Unterschiede eingegangen. Hilfreich!</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Concatenando Strings]]></title>
<link>http://henrrypires.wordpress.com/2009/11/16/concatenando-strings/</link>
<pubDate>Mon, 16 Nov 2009 14:17:44 +0000</pubDate>
<dc:creator>Henrry Pires</dc:creator>
<guid>http://henrrypires.wordpress.com/2009/11/16/concatenando-strings/</guid>
<description><![CDATA[string1 &amp; string2 &amp; string3 &amp; &#8230; string100 = Comprar hardware mais potente. É uma p]]></description>
<content:encoded><![CDATA[string1 &amp; string2 &amp; string3 &amp; &#8230; string100 = Comprar hardware mais potente. É uma p]]></content:encoded>
</item>
<item>
<title><![CDATA[Copy DLL From GAC]]></title>
<link>http://virendradugar.wordpress.com/2009/11/16/copy-dll-from-gac/</link>
<pubDate>Mon, 16 Nov 2009 07:03:57 +0000</pubDate>
<dc:creator>Virendra Dugar</dc:creator>
<guid>http://virendradugar.wordpress.com/2009/11/16/copy-dll-from-gac/</guid>
<description><![CDATA[Introduction The idea behind writing this article is to share solution to one problem that I faced r]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><h2>Introduction</h2>
<p>The idea behind writing this article is to share solution to one problem that I faced recently for one my project. The problem was how we can copy an assembly (.DLL) file from Global Assembly Cache (GAC). Well, if it simply copy and paste then I am wasting my and your valuable time over here. There is no point have an article such as this. When you read the article heading, it looks pretty simple but it is not. Let’s first start with the basics.</p>
<h2>The Basics</h2>
<p><strong>Assembly</strong>: According to MSDN “<em>Assemblies are the building blocks of .NET Framework applications; they form the fundamental unit of deployment, version control, reuse, activation scoping, and security permissions. An assembly is a collection of types and resources that are built to work together and form a logical unit of functionality. An assembly provides the common language runtime with the information it needs to be aware of type implementations.</em>“</p>
<p>There are two types of assembly</p>
<ul>
<li>Private: The assembly which is used only by a single application is called as private assembly.It does not require strong name and versioning.</li>
<li>Shared: Assembly which can be used across multiple applications is called shared assembly.</li>
</ul>
<p>Click <a href="http://msdn.microsoft.com/en-us/library/hk5f40ct(VS.71).aspx">here</a> to find more details about assembly.</p>
<p><strong>GAC (Global assembly cache)</strong>:  GAC is a place where .NET assemblies are stored, specifically used to be shared by multiple applications on that computer.</p>
<p><a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cptools/html/cpgrfglobalassemblycacheutilitygacutilexe.asp">GACUtil </a>is a command line tool which allows you to place, to remove assembly from GAC.</p>
<p>To install an assembly called VirendraAssembly in the GAC, you can use the command.</p>
<pre class="brush: xml;">gacutil /i VirendraAssembly.dll</pre>
<p>To uninstall an assembly called VirendraAssembly in the GAC, you can use the command</p>
<pre class="brush: csharp;">gacutil /u VirendraAssebmly.dll</pre>
<p>I will not go into the details of gacutil you can find from this <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cptools/html/cpgrfglobalassemblycacheutilitygacutilexe.asp">link</a>.</p>
<p>But have you ever tried to copy DLL from GAC (Global assembly cache)? Well, first time when someone asked me, I said go to GAC (c:\Windows\Assembly) folder, Select the assembly you want to copy, then right click on it and select copy option and paste it at your desired location. Well, I tried the same way but unfortunately there is no option available to copy when you make a right click on any assembly. Only available options are uninstall and properties option.</p>
<p>See the below screen shot.</p>
<p><img class="alignnone size-full wp-image-563" style="border:1px solid black;" title="Options" src="http://virendradugar.wordpress.com/files/2009/11/options.jpg" alt="Options" width="455" height="349" /></p>
<p>One more thing that is noticeable is, go to DOS prompt and fire DIR command to see the listing of C:\Windows\Assembly folder and you will be surprised to see the listing. See below screen shot.</p>
<p><img class="alignnone size-full wp-image-569" title="Screen2" src="http://virendradugar.wordpress.com/files/2009/11/screen2.jpg" alt="Screen2" width="669" height="338" /></p>
<p>Where C:\Windows\Assembly folder looks like this.See Screenshot below:</p>
<p><img class="alignnone size-full wp-image-568" style="border:1px solid black;" title="Screen1" src="http://virendradugar.wordpress.com/files/2009/11/screen1.jpg" alt="Screen1" width="655" height="394" /></p>
<p>Surprised!! Well, what you see on the DOS Prompt is the internal structure of GAC folder then why windows is not showing such structure of the GAC. Well, this is because off SHFusion.dll (Assembly cache Viewer). On the Dos Prompt fire Dir /AH command. It shows desktop.ini. SHFusion.dll uses this desktop.ini file to show abstract view of GAC.</p>
<h2>Various Techniques to show internal structure of GAC</h2>
<p>There are 4 ways to show the same structure for GAC in windows as we will in DOS.</p>
<p><span style="color:#000080;"><strong><span style="color:#0000ff;"> Rename the Desktop.ini file</span></strong></span><strong><br />
</strong><br />
As I mentioned previously, SHFusion.dll make use of desktop.ini to determine how to display the content of the GAC folder. From DOS prompt, fire these commands to rename the desktop.ini file.</p>
<pre class="brush: csharp;">attrib desktop.ini -h -r -s
rename desktop.ini desktop.ini.bak</pre>
<p>Now, go to C:\Windows\Assembly folder to see its content. Screen will look something like below screenshot</p>
<p><img class="alignnone size-large wp-image-570" style="border:1px solid black;" title="Screen3" src="http://virendradugar.wordpress.com/files/2009/11/screen3.jpg?w=1024" alt="Screen3" width="717" height="431" /></p>
<p>You can also see the particular folder content. Select GAC and you will see something like this.</p>
<p><img class="alignnone size-large wp-image-571" style="border:1px solid black;" title="Screen4" src="http://virendradugar.wordpress.com/files/2009/11/screen4.jpg?w=1024" alt="Screen4" width="717" height="431" /></p>
<p>If you want to see both the view together run this series of commands on DOS Prompt.</p>
<p><em>Assuming you are on c:\ drive.</em></p>
<pre class="brush: csharp;">cd Windows\Assembly
attrib -r -h -s desktop.ini
mkdir OriginalView
move desktop.ini OriginalView
attrib +s OriginalView
attrib +r +h +s OriginalView/desktop.ini</pre>
<p>Now, go to assembly folder. You will internal structure of GAC and plus one more folder named OriginalView. When you go in this folder, you will 	see original view of GAC.</p>
<p><strong><span style="color:#0000ff;">By Modifying the Registry</span></strong></p>
<p>The following steps will modify the registry. If you make any incorrect entry in registry, that can cause some serious problems. Sometimes you may need to install operating system again. Use registry editor at your own risk. I prefer, before you follow these steps, take a backup of registry.</p>
<p>We need to add a key in registry that will disable the abstract view of the GAC.</p>
<p><strong><span style="font-weight:normal;">To open registry editor, Go to Run and type regedit. Locate following registry, in the registry editor.</span><br />
HKEY_Local_Machine\Software\Microsoft\Fusion\</strong></p>
<p><img class="alignnone size-large wp-image-564" style="border:1px solid black;" title="Registry1" src="http://virendradugar.wordpress.com/files/2009/11/registry1.jpg?w=1024" alt="Registry1" width="717" height="431" /></p>
<p>Right click on Fusion Folder and select New -&#62;DWord Value.</p>
<p><img style="border:1px solid black;" title="Registry1" src="http://virendradugar.wordpress.com/files/2009/11/registry2.jpg" alt="Registry 2" /></p>
<p>Add a new Dword named “DisableCacheViewer” and set its value 1.</p>
<p><img style="border:1px solid black;" title="Registry1" src="http://virendradugar.wordpress.com/files/2009/11/registry3.jpg" alt="Registry 3" /></p>
<p>Now go to C:\Windows\Assembly folder and you will see folders in GAC.</p>
<p><span style="color:#0000ff;"><strong>By Uninstalling SHFusion.dll</strong></span></p>
<p>Go to Visual Studio Command Prompt and fire this command to uninstall the SHFusion.dll</p>
<pre class="brush: csharp;">regsvr32 -u C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\shfusion.dll</pre>
<p><img style="border:1px solid black;" title="Registry1" src="http://virendradugar.wordpress.com/files/2009/11/screen5.jpg" alt="Command" /></p>
<p>Following message will appear.</p>
<p><img style="border:1px solid black;" title="Registry1" src="http://virendradugar.wordpress.com/files/2009/11/message1.jpg" alt="Message" /></p>
<p>Now go to C:\Windows\Assembly folder and you will see folders in GAC.</p>
<p>To get back to the previous state of view register the SHfusion.dll using the following command, fire this command on Visual Studio Command prompt.</p>
<pre class="brush: csharp;">regsvr32 C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\shfusion.dll</pre>
<p><img style="border:1px solid black;" title="Registry1" src="http://virendradugar.wordpress.com/files/2009/11/screen6.jpg" alt="Command" /></p>
<p>And you will see following message on the screen.</p>
<p><img style="border:1px solid black;" title="Registry1" src="http://virendradugar.wordpress.com/files/2009/11/message2.jpg" alt="Message" /></p>
<p>Now go to Assembly folder again and it will show the abstract view of GAC.</p>
<p><span style="color:#0000ff;"><strong>Using SUBST Command</strong></span></p>
<p>Go to Windows DOS Prompt and type following command and press enter.</p>
<pre class="brush: csharp;">SUBST L: “C:\Windows\Assembly”</pre>
<p><img style="border:1px solid black;" title="SUBST" src="http://virendradugar.wordpress.com/files/2009/11/subst_1.jpg" alt="SUBST" /></p>
<p>This command will create a virtual drive “L” and this drive will have the internal view of GAC, where C:\Windows\Assembly will have the abstract view of GAC. Kindly ensure that the drive name that you type in SUBST command, it must not exist in your system. Go to My Computer and you will see the Drive named “L:”.</p>
<p>Now to delete this drive, run this command on command prompt.</p>
<pre class="brush: csharp;">SUBST L: /D</pre>
<p>This will delete the L: drive.</p>
<p><strong>By all above these four techniques, you can see the internal structure of GAC. Via Internal structure you can copy the DLL and paste it at desired location.<br />
</strong><br />
Now, let’s see what every folder contains in GAC. Mainly there are 5 Folders.</p>
<ol>
<li><strong>GAC </strong>: This folder contains non-native images of DLL used in .NET Framework 1.x.</li>
<li><strong>GAC_32 </strong>: A 32-bit system will only have the GAC_32 directory.  A 64-bit system will have both the directory GAC_32 and GAC_64. These directories contain assemblies that are specific to 32-64 bit mode.</li>
<li><strong>GAC_MSIL</strong>: The GAC_MSIL cache contains assemblies that can be run in either 32-bit or 64-bit mode. They don’t have any dependency.</li>
<li><strong>NativeImage Framework Version</strong> :  Native image generated for Framework version. If you have .NET Framework 1.0 and 2.0 both, then there will be two directories.</li>
<li><strong>Temporary and Tmp</strong> : Temporary Directories.</li>
</ol>
<p>The folder GAC, GAC_32, GAC_64 and GAC_MSIL contains non-native images of the DLLs. They all contain the MSIL that will be complied into native images and placed in NativeImage_Framework Version folder.</p>
<h2>Reference</h2>
<p><a href="http://www.codeproject.com/KB/dotnet/demystifygac.aspx" target="_blank">http://www.codeproject.com/KB/dotnet/demystifygac.aspx</a><br />
<a href="http://blogs.msdn.com/junfeng/archive/2004/09/12/228635.aspx" target="_blank">http://blogs.msdn.com/junfeng/archive/2004/09/12/228635.aspx</a></p>
<h2>Conclusion</h2>
<p>During this article, I have showed you various techniques to show internal structure of GAC and one can easily copy the DLL from the GAC folder and can paste it at desired location. I hope that readers will learn something new.</p>
<p>Kindly post your comments regarding feedback for this article.</p>
<p>Thanks,<br />
Virendra Dugar</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Hosting Winforms in Firefox]]></title>
<link>http://anoriginalidea.wordpress.com/2009/11/16/hosting-winforms-in-firefox/</link>
<pubDate>Mon, 16 Nov 2009 01:42:39 +0000</pubDate>
<dc:creator>anoriginalidea</dc:creator>
<guid>http://anoriginalidea.wordpress.com/2009/11/16/hosting-winforms-in-firefox/</guid>
<description><![CDATA[&#160; I have a strange fascination with hybrids.&#160; Combining old and new technologies in bizarr]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>&#160;<a href="http://anoriginalidea.files.wordpress.com/2009/11/image.png"><img style="display:inline;border-width:0;" title="image" border="0" alt="image" src="http://anoriginalidea.files.wordpress.com/2009/11/image_thumb.png?w=239&#038;h=244" width="239" height="244" /></a> </p>
<p>I have a strange fascination with hybrids.&#160; Combining old and new technologies in bizarre and interesting ways.&#160;&#160; Why must developers make “the choice” between a web or native technology? It would be great to build applications that would increase or decrease in features depending on the platform they were run on.</p>
<p>&#160;</p>
<p><a href="http://anoriginalidea.files.wordpress.com/2009/11/clip_image002.jpg"><img style="display:inline;border-width:0;" title="clip_image002" border="0" alt="clip_image002" src="http://anoriginalidea.files.wordpress.com/2009/11/clip_image002_thumb.jpg?w=244&#038;h=163" width="244" height="163" /></a></p>
<p>Do you have a Winforms application that you’d like to host in a web browser?&#160; There’s an interesting technique you can use to do this enabled by .net Framework 3.5.</p>
<p>The .net framework provides the ability to create WPF web applications (commonly called XBAP).&#160; WPF has the ability, in turn, to host Winforms.&#160; </p>
<p><strong>Security</strong></p>
<p>It appears that in order to do this effectively, it’s necessary to deploy your XBAP application as a “Full Trust” application.</p>
<p><a href="http://anoriginalidea.files.wordpress.com/2009/11/image1.png"><img style="display:inline;border-width:0;" title="image" border="0" alt="image" src="http://anoriginalidea.files.wordpress.com/2009/11/image_thumb1.png?w=244&#038;h=118" width="244" height="118" /></a> </p>
<p><strong>The code</strong></p>
<p>To use this, create an XBAP project, then a page a “WinformHost” control on it.&#160;&#160; The XAML could look like this:</p>
<p> <code>
<p>&#60;Page x:Class=&#34;Page1&#34;      <br />&#160;&#160;&#160; xmlns=&#34;<a href="http://schemas.microsoft.com/winfx/2006/xaml/presentation&#34;">http://schemas.microsoft.com/winfx/2006/xaml/presentation&#34;</a>       <br />&#160;&#160;&#160; xmlns:x=&#34;<a href="http://schemas.microsoft.com/winfx/2006/xaml&#34;">http://schemas.microsoft.com/winfx/2006/xaml&#34;</a>       <br />&#160;&#160;&#160; Title=&#34;Page1&#34;&#62;       <br />&#160;&#160;&#160; &#60;DockPanel LastChildFill=&#34;True&#34;&#62;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#60;Button Name=&#34;Button1&#34;&#160; DockPanel.Dock=&#34;Bottom&#34;&#160; &#62;This is a WPF Button&#60;/Button&#62;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#60;WindowsFormsHost Name=&#34;WinformHost&#34;&#160;&#160; /&#62;       <br />&#160;&#160;&#160; &#60;/DockPanel&#62;       <br />&#60;/Page&#62;</p>
<p> </code>
<p>Then, create some code to instantiate your winform and show it on the Winform host:</p>
<p> <code>
<p>Class Page1 </p>
<p>&#160;&#160;&#160; Private Sub Page1_Loaded(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles Me.Loaded </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; Dim loForm As New HelloWorldWinform </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; WinformHost.Child = WinformToUserControl.GetWrapper(loForm)      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; loForm.Show() </p>
<p>&#160;&#160;&#160; End Sub      <br />End Class</p>
<p> </code>
<p>Here’s the subroutine:</p>
<p> <code>
<p>Public NotInheritable Class WinformToUserControl      </p>
<p>&#160;&#160;&#160; Public Shared Function GetWrapper(ByVal form As System.Windows.Forms.Form) As System.Windows.Forms.Control       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; Dim loPanel As New System.Windows.Forms.Panel       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; loPanel.Dock = Forms.DockStyle.Fill       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; ShowFormInControl(loPanel, form)       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; Return loPanel       <br />&#160;&#160;&#160; End Function</p>
<p>&#160;&#160;&#160; Private Shared Sub ShowFormInControl(ByVal ctl As System.Windows.Forms.Control, ByVal frm As System.Windows.Forms.Form) </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; frm.TopLevel = False      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; frm.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; frm.AutoScaleMode = Forms.AutoScaleMode.Dpi       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; ctl.Controls.Add(frm) </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; frm.Dock = Forms.DockStyle.Fill      </p>
<p>&#160;&#160;&#160; End Sub      <br />End Class</p>
</p>
<p>&#160;&#160;&#160; </code>
<p><strong>Interesting bits and pieces</strong></p>
<p>We found that in order for the items inside the control to scale properly, the AutoScaleMode property on the Winform must be set to Dpi instead of the default, which is Font.&#160; I have a feeling this is because Dpi is the mode preferred for WPF, but I am uncertain.</p>
<p>In the sample WinformToUserControl class I found it better to contain the Winform inside a panel rather than exposing the Winform directly.&#160; It seemed to make it more stable.&#160; Feel free to experiment with taking it off.</p>
<p><strong>Gotchas</strong></p>
<p>As of time of writing, Firefox on my Windows 7 64 bit machine steadfastly refuses to run xbap.&#160; It appears the “Windows Presentation Foundation” addin has not been automatically installed.&#160; I have no idea how to install it.&#160; There&#8217; appears to be no information about how to do so.&#160; So if you have it, good for you.&#160; If you don’t….try re-installing the .net framework 3.51 (which didn’t work for me…)</p>
<p>I do know there was some controversy about this addin being temporarily blacklisted by Mozilla due to security concerns last month, but that’s all over now isn’t it?&#160;&#160; </p>
<p>&#160;</p>
<h4>Download</h4>
<p>You can download a <a href="http://cid-5f1708eb705d1c65.skydrive.live.com/self.aspx/Public/HostingWinformsInFirefox.zip">sample project here</a>.</p>
<p><a href="http://anoriginalidea.files.wordpress.com/2009/11/image2.png"><img style="display:inline;border-width:0;" title="image" border="0" alt="image" src="http://anoriginalidea.files.wordpress.com/2009/11/image_thumb2.png?w=231&#038;h=162" width="231" height="162" /></a> </p>
<h4>Links</h4>
<ul>
<li>I didn’t use anything from this project, but you might find it interesting <a href="http://mdiwinman.codeplex.com">MdiWindowManager</a> </li>
<li>StackOverflow <a href="http://stackoverflow.com/questions/543087/custom-class-for-dealing-with-embedding-in-forms">post on Embedding winforms in usercontrols</a> </li>
</ul>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Enumerations to Change Control Properties]]></title>
<link>http://vb2010.wordpress.com/2009/11/15/enumerations-to-change-control-properties/</link>
<pubDate>Sun, 15 Nov 2009 08:12:44 +0000</pubDate>
<dc:creator>jwavila</dc:creator>
<guid>http://vb2010.wordpress.com/2009/11/15/enumerations-to-change-control-properties/</guid>
<description><![CDATA[Ever wanted to list the properties of controls in a ComboBox to change the appearance of your app at]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Ever wanted to list the properties of controls in a ComboBox to change the appearance of your app at run-time? Rather than typing out a long list of names to add to the ComboBox, use Enum to add the list of choices&#8230;</p>
<p><!--more-->In this example we will change 2 properties of a TabControl &#8211; the TabAlignment and BorderStyle &#8211; using a selection from a ComboBox.</p>
<p>To begin with, create an app with 2 ComboBoxes and 1 TabControl.</p>
<p>The first bit of code to write is to populate the ComboBoxes with data. We&#8217;ll begin by focusing on the ComboBox for the BorderStyle choices. One way to add the possible choices is use ComboBox.Items.AddRange method, and type them all out.  So in your Form1_Load event, type this:</p>
<p><code>ComboBox1.Items.AddRange(New String() {"None", "FixedSingle", "Fixed3D"})</code></p>
<p>Of course, before you do that you would have to look in the TabPages collection in the TabControl properties list. Then look at all of the choices for BorderStyle&#8230; For BorderStyle, there are only 3 choices, so not too big a deal. However, what if the were a dozen (or more) choices? Or, take for example, the colors available for something like BackColor? There are somewhere around 130 different KnownColors in VB.NET. That would be a lot of typing and quite a few lines of code.</p>
<p>We can shorten that considerably by using an enumeration to load the items into the ComboBox. So let&#8217;s erase the line of code above and type this instead:</p>
<p><code>ComboBox1.Items.AddRange([Enum].GetNames(GetType(BorderStyle)))</code></p>
<p>Now do the same thing for ComboBox2, except get the enumeration for TabAlignment.</p>
<p>Then to change these properties at run-time, add a couple of lines of code in the SelectedIndexChanged event for each ComboBox.<br />
<code>Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged<br />
Dim brdrStyle As BorderStyle = CType(ComboBox1.SelectedIndex, BorderStyle)<br />
For Each tp As TabPage In TabControl1.TabPages<br />
tp.BorderStyle = brdrStyle<br />
Next<br />
End Sub</code><br />
<code>Private Sub ComboBox2_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ComboBox2.SelectedIndexChanged<br />
Dim tabAlign As TabAlignment = CType(ComboBox2.SelectedIndex, TabAlignment)<br />
TabControl1.Alignment = tabAlign<br />
End Sub</code></p>
<p>Now hit F5 to run your code to see how the appearance of the TabControl changes when you change the selection in each ComboBox.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[FM Radio Player]]></title>
<link>http://dranaxum.wordpress.com/2009/11/14/fm-radio-player/</link>
<pubDate>Sat, 14 Nov 2009 21:18:43 +0000</pubDate>
<dc:creator>dranaxum</dc:creator>
<guid>http://dranaxum.wordpress.com/2009/11/14/fm-radio-player/</guid>
<description><![CDATA[I&#8217;m back with a new tool I&#8217;ve made. FM Radio Player is a small application designed to p]]></description>
<content:encoded><![CDATA[I&#8217;m back with a new tool I&#8217;ve made. FM Radio Player is a small application designed to p]]></content:encoded>
</item>
<item>
<title><![CDATA[Silverlight Bits&amp;Pieces - Part 8: Application Extensions]]></title>
<link>http://ajdotnet.wordpress.com/2009/11/14/silverlight-bitspieces-part-8-application-extensions/</link>
<pubDate>Sat, 14 Nov 2009 10:20:34 +0000</pubDate>
<dc:creator>ajdotnet</dc:creator>
<guid>http://ajdotnet.wordpress.com/2009/11/14/silverlight-bitspieces-part-8-application-extensions/</guid>
<description><![CDATA[Note: This is part of a series, you can find the related posts here… The last post used the new Appl]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><blockquote><p>Note: This is part of a series, you can find the related posts <a href="http://ajdotnet.wordpress.com/category/silverlight/" target="_blank">here</a>…</p>
</blockquote>
<p>The last post used the new <a href="http://msdn.microsoft.com/en-us/library/dd833084(VS.95).aspx" target="_blank">Application Extension Services</a> (AES for short) to include security into the application. This time I’m going to take AES one step further, laying out yet another piece of basic infrastructure.</p>
<blockquote><p>As a quick recap: An AES is a simple class, implementing a simple interface (<em><a href="http://msdn.microsoft.com/en-us/library/system.windows.iapplicationservice(VS.95).aspx" target="_blank">IApplicationService</a></em>) and optionally another one (<em><a href="http://msdn.microsoft.com/en-us/library/system.windows.iapplicationlifetimeaware(VS.95).aspx" target="_blank">IApplicationLifetimeAware</a></em>). It is then registered by the developer via the <em>app.xaml</em>. SL3 instantiates the AES at runtime and calls the respective callback methods on said interfaces, including <a href="http://msdn.microsoft.com/en-us/library/system.windows.iapplicationservice.startservice(VS.95).aspx" target="_blank"><em>StartService</em></a><em>, </em><a href="http://msdn.microsoft.com/en-us/library/system.windows.iapplicationservice.stopservice(VS.95).aspx" target="_blank"><em>StopService</em></a><em>,</em> and others. The recommended way to use these services is to maintain a static property and reference the class <a href="http://msdn.microsoft.com/en-us/library/dd833084(VS.95).aspx#accessing_extension_services_from_application_code" target="_blank">accordingly</a>.</p>
</blockquote>
<p>Basically AES solve one problem: <em>How do I extend the global application class, without actually replacing it, i.e. without providing a derived class?</em></p>
<blockquote><p>The problem here is that many libraries need some kind of global anchor and in the past, tool developers often chose to provide this by subclassing the next available central artifact (e.g. the page class or the application). And the next tool developer doing the same rendered those two libraries mutually exclusive, just by employing an adverse implementation strategy.</p>
</blockquote>
<p>However, SL3 solves only the <em>providing </em>part of the equation, the part related to the application class and the instantiation of the AES. But look <a href="http://ajdotnet.wordpress.com/2009/11/08/silverlight-bitspieces-part-7-application-permissions/" target="_blank">again</a> at the <em>consumer</em> code:</p>
<p><img src="http://ajdotnet.files.wordpress.com/2009/11/code_checksecurity.jpg" /> </p>
<p>Following the <a href="http://msdn.microsoft.com/en-us/library/dd833084(VS.95).aspx#accessing_extension_services_from_application_code" target="_blank">recommendations</a>, I get singleton access to some object. Worse, the calling code is directly and tightly coupled to the AES class. But frankly, do I need SL3 to implement a singleton? Certainly not. Then why use AES in the first place? </p>
<p>What I’d love is to have the consumer code depend on some service (read interface), not on the actual implementation. And the ability to swap those services in and out, without affecting the caller. Matter of fact, the calling code doesn’t and shouldn’t care whether I use a <em>SecurityServiceThatGetsItsInformationFromTheServer </em>or a <em>SecurityServiceThatGetsItsInformationFromWindowsAzure </em>(or google account, open id, whatever).</p>
<p>If I could get that, AES would become a very valuable feature… .&#160; </p>
<p><strong>Introducing Service Providers</strong></p>
<p>OK, what the calling code needs is some service in terms of a contract, say <em>ISecurityService</em>, that it can ask for. And the same is true for any crosscutting concern, such as error reporting, tracing, caching, you name it. And actually .NET has already addressed this need with the <a href="http://msdn.microsoft.com/en-us/library/system.iserviceprovider(VS.95).aspx" target="_blank">service provider pattern</a>. This pattern has been used for example <a href="http://msdn.microsoft.com/en-us/library/ms734738.aspx" target="_blank">in WF</a> (e.g. to introduce workflow instance persistence), and <a href="http://msdn.microsoft.com/en-us/library/ms171822.aspx" target="_blank">quite extensively</a> in the Visual Studio <a href="http://msdn.microsoft.com/de-de/magazine/cc163634(en-us).aspx" target="_blank">design time infrastructure</a>.</p>
<blockquote><p>OK, I can hear you crying out <a href="http://en.wikipedia.org/wiki/Dependency_Injection" target="_blank">DI</a>. And the chorus chanting <a href="http://msdn.microsoft.com/en-us/library/dd362339.aspx" target="_blank">Unity</a> or <a href="http://ninject.org/" target="_blank">Ninject</a> (to name just two that support SL). But think again. Would you (or rather a library developer) mandate a specific DI container without reason? And you can always wire your pet container into this pattern by providing a <em>IFactory </em>service using whatever container you like. After all, the pattern handles <em>access </em>to services, not <em>instantiation </em>of them. (Which is what AES does, but again, Microsoft chose not to provide a fully fledged DI container…)</p>
</blockquote>
<p>What do I need to make this approach tick? I need a <em>GetService </em>method that iterates all AES – they are available via <em><a href="http://msdn.microsoft.com/en-us/library/system.windows.application.applicationlifetimeobjects(VS.95).aspx" target="_blank">Application.ApplicationLifetimeObjects</a></em>. And I need something to attach this method to. Using an extension method I can actually attach it to the application class:</p>
<p><img src="http://ajdotnet.files.wordpress.com/2009/11/code_getservice.jpg" /></p>
<p>The method iterates all AES, checks whether one implements the requested (interface) type. It also checks whether any AES itself follows the pattern and implements <em>IServiceProvider, </em>and respectively forwards the request if it does. (This allows me to build up a chain of providers.)</p>
<p>That’s it. Long talk, short implementation, all set <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p><strong>Reimplementing the SecurityService</strong></p>
<p>Now I need the rework the SecurityService and the calling code to comply with the pattern. The service interface is simple enough:</p>
<p><img src="http://ajdotnet.files.wordpress.com/2009/11/code_interface.jpg" /> </p>
<p>And my revised security service looks like this:</p>
<p><img src="http://ajdotnet.files.wordpress.com/2009/11/code_service2.jpg" /> </p>
<p>The base class <em>ApplicationServiceBase </em>implements the two interfaces with respective empty virtual methods, thus I only had to overwrite <em>StartService</em>. Aside from some reformatting the most notable difference with the <a href="http://ajdotnet.wordpress.com/2009/11/08/silverlight-bitspieces-part-7-application-permissions/" target="_blank">previous implementation</a> is the absence of the static <em>Current </em>property to access the service instance at runtime. I also renamed the class to reflect what it does. Since the calling code won’t refer to that name any more, this is now feasible.</p>
<p>Accessing the service at runtime is done – drum roll please – using the service provider pattern. This (admittedly not exactly nice) code can be hidden in a simple static property, adding a little convenience. I did this with a class that provides a static property, but also allows calling an extension method on the <em>Application </em>class:</p>
<p><img src="http://ajdotnet.files.wordpress.com/2009/11/code_zugriff1.jpg" /></p>
<blockquote><p>BTW: Wouldn’t it be nice to have <a href="http://ajdotnet.wordpress.com/2008/02/10/extensively-using-extension-methods/" target="_blank">extension properties</a> that I could attach to the application class…?</p>
</blockquote>
<p>And the calling code, i.e. the access to the user object changes to:</p>
<p><img src="http://ajdotnet.files.wordpress.com/2009/11/code_verwendung1.jpg" />&#160; </p>
<p>Now the calling code is completely decoupled from the actual implementation of the security service, meaning I could replace it without affecting the calling code.</p>
<p><strong>A look ahead: Building on the pattern</strong></p>
<p>There are several use cases for this pattern that I will employ (they may or may not be addressed in later posts, but at least this list should give you some ideas):</p>
<ul>
<li>Last chance exception handling: A service will react to the <a href="http://msdn.microsoft.com/en-us/library/system.windows.application.unhandledexception(VS.95).aspx" target="_blank">unhandled exception event</a> and gather context information. It will then use another service to report the error. </li>
<li>Message boxes: I will need message boxes for errors, information, and confirmation. The system <em><a href="http://msdn.microsoft.com/en-us/library/system.windows.messagebox(VS.95).aspx" target="_blank">MessageBox</a> </em>is however somewhat dull. A service will cover that and a later implementation will replace the boring system dialogs with nice and shiny replacements. </li>
<li>Logging and tracing: At some point I will have to tackle these demands. </li>
<li>… </li>
</ul>
<p>I’m sure you can think of other examples, like navigation with parameter passing, global state, caching, …. Anyway, I think this is motivation enough to roll out some additional infrastructure. </p>
<blockquote><p>As a side note: Actually I had a completely homegrown implementation of this pattern for SL2. When SL3 came out and offered AES I quickly jumped on the bandwagon and threw away most of that code. If only Microsoft had not stopped one step short of my needs… . I’d rather have the platform support that out-of-the-box. And given the simplicity of the remaining implementation this shouldn’t have been too much of an issue.</p>
</blockquote>
<p><font color="#008000">That’s all for now folks,      <br /><strong>AJ.NET</strong></font></p>
<p><a href="http://www.dotnetkicks.com/kick/?url=http://ajdotnet.wordpress.com/2009/11/14/silverlight-bitspieces-part-8-application-extensions/"><img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http://ajdotnet.wordpress.com/2009/11/14/silverlight-bitspieces-part-8-application-extensions/" border="0" alt="kick it on DotNetKicks.com" /></a></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Silverlight Bing Map Control]]></title>
<link>http://shapemetrics.wordpress.com/2009/11/10/silverlight-bing-map-control/</link>
<pubDate>Tue, 10 Nov 2009 14:44:14 +0000</pubDate>
<dc:creator>shapemetrics</dc:creator>
<guid>http://shapemetrics.wordpress.com/2009/11/10/silverlight-bing-map-control/</guid>
<description><![CDATA[Today Microsoft released the Bing Silverlight control RTW. Speak and you shall receive; I am utterly]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Today Microsoft released the Bing Silverlight control RTW. Speak and you shall receive; I am utterly surprised by its release.</p>
<p><a href="http://msdn.microsoft.com/en-us/library/ee681900.aspx">http://msdn.microsoft.com/en-us/library/ee681900.aspx</a></p>
</div>]]></content:encoded>
</item>

</channel>
</rss>
