<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7165320373479866177</id><updated>2024-08-29T11:05:37.257+01:00</updated><category term=".Net"/><category term="WP7"/><category term="c#"/><category term="wp7dev"/><category term=".Net 3.5"/><category term=".Net 3.5 Ajax SharePoint MOSS web.config"/><category term="ASP.Net"/><category term="Anonymous Types"/><category term="ApplicationBar"/><category term="Asychronous"/><category term="BCS"/><category term="BDC"/><category term="CAS"/><category term="Click"/><category term="Code Access Security"/><category term="Cryptography"/><category term="Custom Control"/><category term="DataContract"/><category term="DataContractSerializer"/><category term="Events"/><category term="Extension Methods"/><category term="LINQ"/><category term="Lambda"/><category term="MSDN"/><category term="MVVM Light"/><category term="Sandboxing"/><category term="Serializing"/><category term="Sharepoint 2010"/><category term="Threading"/><category term="WCF"/><category term="WHS"/><category term="WSS"/><category term="WSS 4.0"/><category term="Windows Home Server"/><category term="django"/><category term="hello"/><category term="linux"/><category term="pip"/><category term="piston"/><category term="postgres"/><category term="psycopg2"/><category term="ubuntu"/><category term="virtualenv"/><title type='text'>eazy coding</title><subtitle type='html'>find me on twitter @eazynow</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://eazycoding.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7165320373479866177/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://eazycoding.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Erol Ziya</name><uri>http://www.blogger.com/profile/02295176155120038748</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://4.bp.blogspot.com/_TYax7DK60EM/Sc1SVf8XY4I/AAAAAAAAAC8/seh4iRjCIlg/S220/TheCreator(White)+-+Copy.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>12</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7165320373479866177.post-2395772767281642308</id><published>2011-04-06T16:47:00.001+01:00</published><updated>2011-04-07T16:22:01.946+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".Net"/><category scheme="http://www.blogger.com/atom/ns#" term="c#"/><category scheme="http://www.blogger.com/atom/ns#" term="Click"/><category scheme="http://www.blogger.com/atom/ns#" term="Custom Control"/><category scheme="http://www.blogger.com/atom/ns#" term="Events"/><category scheme="http://www.blogger.com/atom/ns#" term="MVVM Light"/><category scheme="http://www.blogger.com/atom/ns#" term="WP7"/><category scheme="http://www.blogger.com/atom/ns#" term="wp7dev"/><title type='text'>Creating a clickable TextBlock (or any control) in WP7 using a Custom Control</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;I came across a need on my current windows phone 7 project to have different parts of my item in a listbox clickable with different events. Plus I’m using MVVM Light. Sounds easy, right? Well I thought so until I realised that the TextBlock control doesn’t have a click event. &lt;br /&gt;
&lt;br /&gt;
First thought was putting the TextBlock into a button as content. This works, although you get this inverted effect on clicking which really didn’t look good on the controls I had. I could change this effect using states, but the button still clicked when you happened to be dragging and the starting point was the button.&lt;br /&gt;
&lt;br /&gt;
Next I looked at the GestureService/Listener which is included in the Silverlight Toolkit. This is very useful but doesn’t allow binding to MVVM Light using eventToCommand behaviours.&lt;br /&gt;
Then I looked at a TextBlock having MouseLeftButtonDown &amp;amp; Up events which I could capture. But that still fires even if I’m just dragging the list around but happened to start on the control. &lt;br /&gt;
So I figured I could get around this by tracking the point of click. My app is using MVVM however and I didn’t want to start putting either &lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Mouse event handling code in my ViewModel&lt;/li&gt;
&lt;li&gt;Lots of events in my View&lt;/li&gt;
&lt;/ol&gt;So instead I thought I’d create a custom control that has a data bindable click event. &lt;br /&gt;
Whilst creating this reusable control I thought I’d add the ability to choose it’s click detection type. &lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Point based would look to see if your finger/mouse is in the same spot when you press down and then up (good for scrolling)&lt;/li&gt;
&lt;li&gt;Border based would look to see if you’re in the bounds of the zone (like a traditional button).&lt;/li&gt;
&lt;/ul&gt;Here’s the steps I took:&lt;br /&gt;
Create the new a Windows Phone Class Library project. This will be where the control lives.&lt;br /&gt;
&lt;a href=&quot;http://lh3.ggpht.com/_TYax7DK60EM/TZyJwoTED_I/AAAAAAAAAL0/aW1hWuOJ2Jo/s1600-h/image%5B3%5D.png&quot;&gt;&lt;img alt=&quot;image&quot; border=&quot;0&quot; height=&quot;163&quot; src=&quot;http://lh4.ggpht.com/_TYax7DK60EM/TZyJw4uIjjI/AAAAAAAAAL4/8kjYwv6f92g/image_thumb%5B1%5D.png?imgmax=800&quot; style=&quot;background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; title=&quot;image&quot; width=&quot;438&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
Rename the Class1.cs using the Solution Explorer to your new control name. In this instance I’ve called it ClickZone.&lt;br /&gt;
Just above the class declaration (or in a separate file if preferred) add a public enumeration to identify the possible click types.&lt;br /&gt;
This control will inherit from the ContentControl. This will easily allow it to contain content (other controls), and will act as a click zone for them all.&lt;br /&gt;
Add a private Point variable to track the point when the finger/mouse is pressed down. Also add a boolean flag to track when the finger/mouse is in the control.&lt;br /&gt;
Your code should look similar to this now:&lt;br /&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; System;
&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; System.Windows;
&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; System.Windows.Input;
&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; System.Windows.Controls;

&lt;span class=&quot;kwrd&quot;&gt;namespace&lt;/span&gt; CustControlTest
{
&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;enum&lt;/span&gt; ClickDetectType { PointBased, BorderBased };

&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;class&lt;/span&gt; ClickZone : ContentControl
{
&lt;span class=&quot;rem&quot;&gt;//Reference for point based click&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; Point startPoint = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; Point();

&lt;span class=&quot;rem&quot;&gt;//Flag for border based click&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;bool&lt;/span&gt; isInBorder;
}
}&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
Now to add a click Event which can be captured, and a public property for the detection type.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;event&lt;/span&gt; EventHandler Click;
&lt;span class=&quot;kwrd&quot;&gt;protected&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;virtual&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; OnClick()
{
EventHandler handler = Click;
&lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (handler != &lt;span class=&quot;kwrd&quot;&gt;null&lt;/span&gt;)
handler(&lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;, &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; EventArgs());
}

&lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; ClickDetectType _detectionType = ClickDetectType.PointBased;
&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; ClickDetectType DetectionType
{
get { &lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; _detectionType; }
set { _detectionType = &lt;span class=&quot;kwrd&quot;&gt;value&lt;/span&gt;; }
}&lt;/pre&gt;&lt;br /&gt;
&lt;style type=&quot;text/css&quot;&gt;
.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, &quot;Courier New&quot;, courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/style&gt;&lt;style type=&quot;text/css&quot;&gt;
.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, &quot;Courier New&quot;, courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/style&gt;&lt;br /&gt;
&lt;br /&gt;
Next I need to capture the key mouse/finger events and track when it’s entering or leaving the control and when pressing/releasing. It’s on the release that I need to decide whether to fire the Click event or not.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;protected&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;override&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; OnMouseLeave(MouseEventArgs e)
{
&lt;span class=&quot;rem&quot;&gt;//track border exit&lt;/span&gt;
isInBorder = &lt;span class=&quot;kwrd&quot;&gt;false&lt;/span&gt;;
&lt;span class=&quot;kwrd&quot;&gt;base&lt;/span&gt;.OnMouseLeave(e);
}

&lt;span class=&quot;kwrd&quot;&gt;protected&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;override&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; OnMouseEnter(MouseEventArgs e)
{
&lt;span class=&quot;rem&quot;&gt;//track border entry&lt;/span&gt;
isInBorder = &lt;span class=&quot;kwrd&quot;&gt;true&lt;/span&gt;;
&lt;span class=&quot;kwrd&quot;&gt;base&lt;/span&gt;.OnMouseEnter(e);
}

&lt;span class=&quot;kwrd&quot;&gt;protected&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;override&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; OnMouseLeftButtonDown(MouseButtonEventArgs e)
{
&lt;span class=&quot;rem&quot;&gt;//track point entry&lt;/span&gt;
startPoint = e.GetPosition(&lt;span class=&quot;kwrd&quot;&gt;null&lt;/span&gt;);
&lt;span class=&quot;kwrd&quot;&gt;base&lt;/span&gt;.OnMouseLeftButtonDown(e);
}

&lt;span class=&quot;kwrd&quot;&gt;protected&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;override&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; OnMouseLeftButtonUp(MouseButtonEventArgs e)
{
&lt;span class=&quot;kwrd&quot;&gt;switch&lt;/span&gt; (_detectionType)
{
&lt;span class=&quot;kwrd&quot;&gt;case&lt;/span&gt; ClickDetectType.BorderBased:
&lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (isInBorder)
OnClick();
&lt;span class=&quot;kwrd&quot;&gt;break&lt;/span&gt;;
&lt;span class=&quot;kwrd&quot;&gt;case&lt;/span&gt; ClickDetectType.PointBased:
&lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (startPoint.X == e.GetPosition(&lt;span class=&quot;kwrd&quot;&gt;null&lt;/span&gt;).X &amp;amp;&amp;amp; startPoint.Y == e.GetPosition(&lt;span class=&quot;kwrd&quot;&gt;null&lt;/span&gt;).Y)
OnClick();
&lt;span class=&quot;kwrd&quot;&gt;break&lt;/span&gt;;
}

isInBorder = &lt;span class=&quot;kwrd&quot;&gt;false&lt;/span&gt;;
startPoint = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; Point();

&lt;span class=&quot;kwrd&quot;&gt;base&lt;/span&gt;.OnMouseLeftButtonUp(e);
}&lt;/pre&gt;&lt;br /&gt;
&lt;style type=&quot;text/css&quot;&gt;
.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, &quot;Courier New&quot;, courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/style&gt;&lt;br /&gt;
&lt;br /&gt;
Now that’s the class done, but it still needs a template. This is where you need a ResourceDictionary xaml file. Create a folder called Themes, and in it add a new xaml file called generic.xaml. Make sure you switch the Build Action to Resource, as it needs to be compiled into the DLL.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://lh6.ggpht.com/_TYax7DK60EM/TZyJxsrDc5I/AAAAAAAAAL8/nnK4aC-E3_I/s1600-h/image%5B7%5D.png&quot;&gt;&lt;img alt=&quot;image&quot; border=&quot;0&quot; height=&quot;249&quot; src=&quot;http://lh6.ggpht.com/_TYax7DK60EM/TZyJyKkdt7I/AAAAAAAAAMA/tBdcAW9mqn8/image_thumb%5B3%5D.png?imgmax=800&quot; style=&quot;background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; title=&quot;image&quot; width=&quot;415&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For my control layout I went for a simple structure of a Border control, with the content inside inside it. For more details on creating a ResourceDictionary, see the links at the bottom.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;?&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;xml&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;version&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;1.0&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;encoding&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;utf-8&quot;&lt;/span&gt; ?&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;ResourceDictionary&lt;/span&gt;
&lt;span class=&quot;attr&quot;&gt;xmlns&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot;&lt;/span&gt;
&lt;span class=&quot;attr&quot;&gt;xmlns:x&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot;&lt;/span&gt;
&lt;span class=&quot;attr&quot;&gt;xmlns:vsm&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;clr-namespace:System.Windows;assembly=System.Windows&quot;&lt;/span&gt;
&lt;span class=&quot;attr&quot;&gt;xmlns:controls&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;clr-namespace:CustControlTest&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;Style&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;TargetType&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;controls:ClickZone&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;Setter&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Property&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;Background&quot;&lt;/span&gt; 
&lt;span class=&quot;attr&quot;&gt;Value&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;Transparent&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;Setter&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Property&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;BorderBrush&quot;&lt;/span&gt; 
&lt;span class=&quot;attr&quot;&gt;Value&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;{StaticResource PhoneTextBoxBrush}&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;Setter&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Property&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;BorderThickness&quot;&lt;/span&gt; 
&lt;span class=&quot;attr&quot;&gt;Value&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;{StaticResource PhoneBorderThickness}&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;Setter&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Property&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;Template&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;Setter.Value&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;ControlTemplate&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;TargetType&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;controls:ClickZone&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;Grid&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;Border&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Background&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;{TemplateBinding Background}&quot;&lt;/span&gt;
&lt;span class=&quot;attr&quot;&gt;BorderBrush&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;{TemplateBinding BorderBrush}&quot;&lt;/span&gt;
&lt;span class=&quot;attr&quot;&gt;BorderThickness&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;{TemplateBinding BorderThickness}&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;ContentPresenter&lt;/span&gt;
&lt;span class=&quot;attr&quot;&gt;x:Name&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;ContentContainer&quot;&lt;/span&gt;
&lt;span class=&quot;attr&quot;&gt;Content&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;{TemplateBinding Content}&quot;&lt;/span&gt;
&lt;span class=&quot;attr&quot;&gt;ContentTemplate&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;{TemplateBinding ContentTemplate}&quot;&lt;/span&gt;
&lt;span class=&quot;attr&quot;&gt;Margin&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;{TemplateBinding Padding}&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;Border&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;Grid&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;ControlTemplate&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;Setter.Value&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;Setter&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;Style&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;ResourceDictionary&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;style type=&quot;text/css&quot;&gt;
.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, &quot;Courier New&quot;, courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/style&gt;&lt;br /&gt;
&lt;br /&gt;
Using the TemplateBindings meant that the properties can be changed when reusing the control later. &lt;br /&gt;
&lt;br /&gt;
&lt;style type=&quot;text/css&quot;&gt;
.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, &quot;Courier New&quot;, courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/style&gt;&lt;style type=&quot;text/css&quot;&gt;
.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, &quot;Courier New&quot;, courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/style&gt;&lt;style type=&quot;text/css&quot;&gt;
.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, &quot;Courier New&quot;, courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/style&gt;&lt;br /&gt;
&lt;br /&gt;
Hopefully that should all compile fine now. So to test, create a new Project and reference this project. I’m going to use an MVVM Light one to show binding. You should now see the ClickZone control in the Toolbox&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://lh4.ggpht.com/_TYax7DK60EM/TZyJyvlFhHI/AAAAAAAAAME/XiJNh1KaMyk/s1600-h/image%5B15%5D.png&quot;&gt;&lt;img alt=&quot;image&quot; border=&quot;0&quot; height=&quot;94&quot; src=&quot;http://lh6.ggpht.com/_TYax7DK60EM/TZyJy8k-WyI/AAAAAAAAAMI/4bSqpN98T7g/image_thumb%5B7%5D.png?imgmax=800&quot; style=&quot;background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; title=&quot;image&quot; width=&quot;447&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can now drop this control on your page, and put content inside it. For this I’ll use Blend to show Blendability.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://lh6.ggpht.com/_TYax7DK60EM/TZyJzdi4JwI/AAAAAAAAAMM/njkdfMOT8hA/s1600-h/image%5B19%5D.png&quot;&gt;&lt;img alt=&quot;image&quot; border=&quot;0&quot; height=&quot;237&quot; src=&quot;http://lh6.ggpht.com/_TYax7DK60EM/TZyJzyZquPI/AAAAAAAAAMQ/SXgl0Kd77-g/image_thumb%5B9%5D.png?imgmax=800&quot; style=&quot;background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; title=&quot;image&quot; width=&quot;421&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As you can see, I am able to add an EventToCommand behaviour to the ClickZone.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can see on the Properties of the EventToCommand that I can now bind to the Click event.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://lh5.ggpht.com/_TYax7DK60EM/TZyJ0VofkZI/AAAAAAAAAMU/VO5EIqkTjUU/s1600-h/image%5B23%5D.png&quot;&gt;&lt;img alt=&quot;image&quot; border=&quot;0&quot; height=&quot;263&quot; src=&quot;http://lh4.ggpht.com/_TYax7DK60EM/TZyJ0j3t2JI/AAAAAAAAAMY/xrdlgxpdEsg/image_thumb%5B11%5D.png?imgmax=800&quot; style=&quot;background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; title=&quot;image&quot; width=&quot;197&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finally adding a command to the ViewModel which updates a property I can see the result!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://lh5.ggpht.com/_TYax7DK60EM/TZyJ1i9K3nI/AAAAAAAAAMc/Bk616TfDoIM/s1600-h/image%5B27%5D.png&quot;&gt;&lt;img alt=&quot;image&quot; border=&quot;0&quot; height=&quot;295&quot; src=&quot;http://lh3.ggpht.com/_TYax7DK60EM/TZyJ16Xj_pI/AAAAAAAAAMg/rk5jGicCjTk/image_thumb%5B13%5D.png?imgmax=800&quot; style=&quot;background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; title=&quot;image&quot; width=&quot;154&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Links I found useful:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.windowsphonegeek.com/articles/Creating-a-WP7-Custom-Control-in-7-Steps&quot;&gt;&lt;span style=&quot;color: #0066cc;&quot;&gt;http://www.windowsphonegeek.com/articles/Creating-a-WP7-Custom-Control-in-7-Steps&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.windowsphonegeek.com/articles/WP7-WatermarkedTextBox-custom-control&quot;&gt;&lt;span style=&quot;color: #0066cc;&quot;&gt;http://www.windowsphonegeek.com/articles/WP7-WatermarkedTextBox-custom-control&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.windows.dependencyproperty%28v=vs.95%29.aspx&quot;&gt;&lt;span style=&quot;color: #0066cc;&quot;&gt;http://msdn.microsoft.com/en-us/library/system.windows.dependencyproperty%28v=vs.95%29.aspx&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I have included all the code and sample MVVM Light application in the following file:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&amp;nbsp;&lt;a href=&quot;http://bit.ly/ClickZone&quot;&gt;http://bit.ly/ClickZone&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eazycoding.blogspot.com/feeds/2395772767281642308/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eazycoding.blogspot.com/2011/04/creating-clickable-textblock-or-any.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7165320373479866177/posts/default/2395772767281642308'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7165320373479866177/posts/default/2395772767281642308'/><link rel='alternate' type='text/html' href='http://eazycoding.blogspot.com/2011/04/creating-clickable-textblock-or-any.html' title='Creating a clickable TextBlock (or any control) in WP7 using a Custom Control'/><author><name>Erol Ziya</name><uri>http://www.blogger.com/profile/02295176155120038748</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://4.bp.blogspot.com/_TYax7DK60EM/Sc1SVf8XY4I/AAAAAAAAAC8/seh4iRjCIlg/S220/TheCreator(White)+-+Copy.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh4.ggpht.com/_TYax7DK60EM/TZyJw4uIjjI/AAAAAAAAAL4/8kjYwv6f92g/s72-c/image_thumb%5B1%5D.png?imgmax=800" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7165320373479866177.post-4686362138641155015</id><published>2011-03-31T11:39:00.000+01:00</published><updated>2011-03-31T11:39:38.177+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ApplicationBar"/><category scheme="http://www.blogger.com/atom/ns#" term="c#"/><category scheme="http://www.blogger.com/atom/ns#" term="WP7"/><category scheme="http://www.blogger.com/atom/ns#" term="wp7dev"/><title type='text'>Changing ApplicationBar items at runtime on Windows Phone 7</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;I&#39;m currently developing a Windows Phone 7 application for work (that adds c#.net to the list of languages I&#39;ve worked on since joining 6 months ago, the others being python and java - gotta love the labs environment!)&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Something small which vexed me briefly was trying to change icons and menu bar items at runtime.&amp;nbsp;If you&#39;ve tried to reference them by name in code then you&#39;ll have most likely been presented with a null reference error.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;The trick is to reference them by index number (zero based), for example:&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;var iconbutt = (IApplicationBarIconButton)ApplicationBar.Buttons[0];&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;var menuitem = (IApplicationBarMenuItem)ApplicationBar.MenuItems[0];&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;You can then modify them as required.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;The reason that you have to do this is because the ApplicationBar and it&#39;s child items stem from Microsoft.Phone.Shell namespace rather than System.Windows.Controls. This also explains why you can&#39;t simply data bind, although there are workarounds for that.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eazycoding.blogspot.com/feeds/4686362138641155015/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eazycoding.blogspot.com/2011/03/changing-applicationbar-items-at.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7165320373479866177/posts/default/4686362138641155015'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7165320373479866177/posts/default/4686362138641155015'/><link rel='alternate' type='text/html' href='http://eazycoding.blogspot.com/2011/03/changing-applicationbar-items-at.html' title='Changing ApplicationBar items at runtime on Windows Phone 7'/><author><name>Erol Ziya</name><uri>http://www.blogger.com/profile/02295176155120038748</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://4.bp.blogspot.com/_TYax7DK60EM/Sc1SVf8XY4I/AAAAAAAAAC8/seh4iRjCIlg/S220/TheCreator(White)+-+Copy.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7165320373479866177.post-4660906536117842139</id><published>2011-02-23T08:59:00.011+00:00</published><updated>2011-02-23T09:20:29.918+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="django"/><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><category scheme="http://www.blogger.com/atom/ns#" term="pip"/><category scheme="http://www.blogger.com/atom/ns#" term="piston"/><category scheme="http://www.blogger.com/atom/ns#" term="postgres"/><category scheme="http://www.blogger.com/atom/ns#" term="psycopg2"/><category scheme="http://www.blogger.com/atom/ns#" term="ubuntu"/><category scheme="http://www.blogger.com/atom/ns#" term="virtualenv"/><title type='text'>Installing Django in VirtualEnv (Ubuntu - also with postgres &amp; piston)</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; &gt;Due to work, I&#39;ve recently switched from working with MS products and C# development to working in ubuntu developing python.&lt;/span&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; &gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; &gt;One of the first bits of advice I was given was to use &lt;a href=&quot;http://pypi.python.org/pypi/virtualenv&quot;&gt;virtualenv&lt;/a&gt;  which allows you to isolate python environments, rather than just using the machines environment (and cluttering it/get clashes of versions etc)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; &gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; &gt;The project I&#39;m working on uses Django with a Postgres database, so here are the steps I needed to get it working. I&#39;m using the default version of python however you can install different ones.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 12px; line-height: 15px; &quot;&gt;&lt;blockquote style=&quot;font-family: -webkit-monospace; &quot;&gt;&lt;pre style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; white-space: pre; font-size: 1.2em; font-family: monospace; line-height: 1.3; background-color: rgb(255, 255, 255); display: block; font-style: normal; &quot;&gt;&lt;span&gt;#install virtualenv&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; white-space: pre; font-size: 1.2em; font-family: monospace; line-height: 1.3; background-color: rgb(255, 255, 255); display: block; font-style: normal; &quot;&gt;&lt;span&gt;sudo apt-get install python-virtualenv&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; white-space: pre; font-size: 1.2em; font-family: monospace; line-height: 1.3; background-color: rgb(255, 255, 255); display: block; &quot;&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/pre&gt;&lt;pre style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; white-space: pre; font-size: 1.2em; font-family: monospace; line-height: 1.3; background-color: rgb(255, 255, 255); display: block; &quot;&gt;#install headers needed for psycopg2&lt;/pre&gt;&lt;pre style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; white-space: pre; font-size: 1.2em; font-family: monospace; line-height: 1.3; background-color: rgb(255, 255, 255); display: block; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 12px; line-height: 15px; white-space: normal; &quot;&gt;&lt;pre style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; white-space: pre; font-size: 1.2em; font-family: monospace; line-height: 1.3; background-color: rgb(255, 255, 255); display: block; &quot;&gt;#You can skip the next line if you&#39;re not using postgres as the database&lt;/pre&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; white-space: pre; font-size: 1.2em; font-family: monospace; line-height: 1.3; background-color: rgb(255, 255, 255); display: block; &quot;&gt;sudo apt-get install libpq-dev python-dev&lt;/pre&gt;&lt;pre style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; white-space: pre; font-size: 1.2em; font-family: monospace; line-height: 1.3; background-color: rgb(255, 255, 255); display: block; &quot;&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; white-space: pre; font-size: 1.2em; font-family: monospace; line-height: 1.3; background-color: rgb(255, 255, 255); display: block; &quot;&gt;#create a folder for the virtual environment&lt;/pre&gt;&lt;pre style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; white-space: pre; font-size: 1.2em; font-family: monospace; line-height: 1.3; background-color: rgb(255, 255, 255); display: block; &quot;&gt;mkdir mypyenv&lt;/pre&gt;&lt;pre style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; white-space: pre; font-size: 1.2em; font-family: monospace; line-height: 1.3; background-color: rgb(255, 255, 255); display: block; &quot;&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; white-space: pre; font-size: 1.2em; font-family: monospace; line-height: 1.3; background-color: rgb(255, 255, 255); display: block; &quot;&gt;#create the virtual environment&lt;/pre&gt;&lt;pre style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; white-space: pre; font-size: 1.2em; font-family: monospace; line-height: 1.3; background-color: rgb(255, 255, 255); display: block; &quot;&gt;#no-site-packages ensures the environment doesn&#39;t also include packages installed at machine level&lt;/pre&gt;&lt;pre style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; white-space: pre; font-size: 1.2em; font-family: monospace; line-height: 1.3; background-color: rgb(255, 255, 255); display: block; &quot;&gt;virtualenv --no-site-packages --distribute mypyenv&lt;/pre&gt;&lt;pre style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; white-space: pre; font-size: 1.2em; font-family: monospace; line-height: 1.3; background-color: rgb(255, 255, 255); display: block; &quot;&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; white-space: pre; font-size: 1.2em; font-family: monospace; line-height: 1.3; background-color: rgb(255, 255, 255); display: block; &quot;&gt;#switch to environment (environment name will be in brackets on terminal)&lt;/pre&gt;&lt;pre style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; white-space: pre; font-size: 1.2em; font-family: monospace; line-height: 1.3; background-color: rgb(255, 255, 255); display: block; &quot;&gt;source mypyenv/bin/activate&lt;/pre&gt;&lt;pre style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; white-space: pre; font-size: 1.2em; font-family: monospace; line-height: 1.3; background-color: rgb(255, 255, 255); display: block; &quot;&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; white-space: pre; font-size: 1.2em; font-family: monospace; line-height: 1.3; background-color: rgb(255, 255, 255); display: block; &quot;&gt;#install django&lt;/pre&gt;&lt;pre style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; white-space: pre; font-size: 1.2em; font-family: monospace; line-height: 1.3; background-color: rgb(255, 255, 255); display: block; &quot;&gt;pip install -E mypyenv Django&lt;/pre&gt;&lt;pre style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; white-space: pre; font-size: 1.2em; font-family: monospace; line-height: 1.3; background-color: rgb(255, 255, 255); display: block; &quot;&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; white-space: pre; font-size: 1.2em; font-family: monospace; line-height: 1.3; background-color: rgb(255, 255, 255); display: block; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 12px; line-height: 15px; white-space: normal; &quot;&gt;&lt;pre style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; white-space: pre; font-size: 1.2em; font-family: monospace; line-height: 1.3; background-color: rgb(255, 255, 255); display: block; &quot;&gt;#I&#39;m using piston also for my api - skip if you don&#39;t want it&lt;/pre&gt;&lt;pre style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; white-space: pre; font-size: 1.2em; font-family: monospace; line-height: 1.3; background-color: rgb(255, 255, 255); display: block; &quot;&gt;pip install -E mypyenv django-piston&lt;/pre&gt;&lt;pre style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; white-space: pre; font-size: 1.2em; font-family: monospace; line-height: 1.3; background-color: rgb(255, 255, 255); display: block; &quot;&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; white-space: pre; font-size: 1.2em; font-family: monospace; line-height: 1.3; background-color: rgb(255, 255, 255); display: block; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 12px; line-height: 15px; white-space: normal; &quot;&gt;&lt;pre style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; white-space: pre; font-size: 1.2em; font-family: monospace; line-height: 1.3; background-color: rgb(255, 255, 255); display: block; &quot;&gt;#install django&lt;/pre&gt;&lt;pre style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; white-space: pre; font-size: 1.2em; font-family: monospace; line-height: 1.3; background-color: rgb(255, 255, 255); display: block; &quot;&gt;pip install -E mypyenv psycopg2&lt;/pre&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;pre style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; white-space: pre; font-size: 1.2em; line-height: 1.3; background-color: rgb(255, 255, 255); display: block; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 12px; line-height: 15px; white-space: normal; &quot;&gt;&lt;pre style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; white-space: pre; font-size: 1.2em; font-family: monospace; line-height: 1.3; background-color: rgb(255, 255, 255); display: block; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 12px; line-height: 15px; white-space: normal; &quot;&gt;&lt;pre style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; white-space: pre; font-size: 1.2em; font-family: monospace; line-height: 1.3; background-color: rgb(255, 255, 255); display: block; &quot;&gt;&lt;/pre&gt;&lt;pre style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; white-space: pre; font-size: 1.2em; font-family: monospace; line-height: 1.3; background-color: rgb(255, 255, 255); display: block; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: arial; font-size: 16px; line-height: normal; white-space: normal; &quot;&gt;That should now be installed. Now just switch to your project folder and you should be able to work with it. If this is your first project then I&#39;d highly recommend the &lt;a href=&quot;http://docs.djangoproject.com/en/dev/intro/tutorial01/&quot;&gt;official tutorial&lt;/a&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/span&gt;&lt;/pre&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 16px; line-height: normal; &quot;&gt;&lt;div style=&quot;font-family: Georgia, serif; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; &gt;Once you&#39;re finished using virtual environment&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; &gt;, use the &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: monospace; font-size: 14px; line-height: 18px; white-space: pre; &quot;&gt;deactivate&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: arial; &quot;&gt; command to come out of it.&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eazycoding.blogspot.com/feeds/4660906536117842139/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eazycoding.blogspot.com/2011/02/installing-django-virtualenv-ubuntu.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7165320373479866177/posts/default/4660906536117842139'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7165320373479866177/posts/default/4660906536117842139'/><link rel='alternate' type='text/html' href='http://eazycoding.blogspot.com/2011/02/installing-django-virtualenv-ubuntu.html' title='Installing Django in VirtualEnv (Ubuntu - also with postgres &amp; piston)'/><author><name>Erol Ziya</name><uri>http://www.blogger.com/profile/02295176155120038748</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://4.bp.blogspot.com/_TYax7DK60EM/Sc1SVf8XY4I/AAAAAAAAAC8/seh4iRjCIlg/S220/TheCreator(White)+-+Copy.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7165320373479866177.post-8003641257066046726</id><published>2010-03-08T11:54:00.003+00:00</published><updated>2010-03-08T11:57:48.236+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".Net 3.5 Ajax SharePoint MOSS web.config"/><title type='text'>Enabling .Net 3.5 features in SharePoint 2007</title><content type='html'>&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Below are the changes needed to the web.config of a sharepoint site in order to enable .net 3.5 features (ajax etc)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;In the Web.Config of the Site (inetpub\wwwroot\wss\virtualdirectories\&lt;i&gt;nnnnn&lt;/i&gt;\)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;b&gt;Add to configSections&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;    &amp;lt;sectionGroup name=&amp;quot;system.web.extensions&amp;quot; type=&amp;quot;System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&amp;quot;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;      &amp;lt;sectionGroup name=&amp;quot;scripting&amp;quot; type=&amp;quot;System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&amp;quot;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;        &amp;lt;section name=&amp;quot;scriptResourceHandler&amp;quot; type=&amp;quot;System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&amp;quot; requirePermission=&amp;quot;false&amp;quot; allowDefinition=&amp;quot;MachineToApplication&amp;quot; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;        &amp;lt;sectionGroup name=&amp;quot;webServices&amp;quot; type=&amp;quot;System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&amp;quot;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;          &amp;lt;section name=&amp;quot;jsonSerialization&amp;quot; type=&amp;quot;System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&amp;quot; requirePermission=&amp;quot;false&amp;quot; allowDefinition=&amp;quot;Everywhere&amp;quot; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;          &amp;lt;section name=&amp;quot;profileService&amp;quot; type=&amp;quot;System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&amp;quot; requirePermission=&amp;quot;false&amp;quot; allowDefinition=&amp;quot;MachineToApplication&amp;quot; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;          &amp;lt;section name=&amp;quot;authenticationService&amp;quot; type=&amp;quot;System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&amp;quot; requirePermission=&amp;quot;false&amp;quot; allowDefinition=&amp;quot;MachineToApplication&amp;quot; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;          &amp;lt;section name=&amp;quot;roleService&amp;quot; type=&amp;quot;System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&amp;quot; requirePermission=&amp;quot;false&amp;quot; allowDefinition=&amp;quot;MachineToApplication&amp;quot; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;        &amp;lt;/sectionGroup&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;      &amp;lt;/sectionGroup&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;    &amp;lt;/sectionGroup&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;b&gt;Add the following to the &amp;lt;SharePoint&amp;gt;&amp;lt;SafeControls&amp;gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;lt;SafeControl Assembly=&amp;quot;System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35&amp;quot; Namespace=&amp;quot;System.Web.UI&amp;quot; TypeName=&amp;quot;*&amp;quot; Safe=&amp;quot;True&amp;quot; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;b&gt;Add to &amp;lt;system.web&amp;gt;&amp;lt;httpHandlers&amp;gt; &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;      &amp;lt;add verb=&amp;quot;*&amp;quot; path=&amp;quot;*.asmx&amp;quot; validate=&amp;quot;false&amp;quot; type=&amp;quot;System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&amp;quot; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;      &amp;lt;add verb=&amp;quot;*&amp;quot; path=&amp;quot;*_AppService.axd&amp;quot; validate=&amp;quot;false&amp;quot; type=&amp;quot;System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&amp;quot; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;      &amp;lt;add verb=&amp;quot;GET,HEAD&amp;quot; path=&amp;quot;ScriptResource.axd&amp;quot; type=&amp;quot;System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&amp;quot; validate=&amp;quot;false&amp;quot; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;b&gt;Add to &amp;lt;system.web&amp;gt;&amp;lt;httpModules&amp;gt; &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;lt;add name=&amp;quot;ScriptModule&amp;quot; type=&amp;quot;System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&amp;quot; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;b&gt;Add to &amp;lt;system.web&amp;gt;&amp;lt;compilation&amp;gt;&amp;lt;assemblies&amp;gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;        &amp;lt;add assembly=&amp;quot;System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089&amp;quot; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;        &amp;lt;add assembly=&amp;quot;System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&amp;quot; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;        &amp;lt;add assembly=&amp;quot;System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089&amp;quot; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;        &amp;lt;add assembly=&amp;quot;System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089&amp;quot; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;b&gt;Add to &amp;lt;system.web&amp;gt;&amp;lt;pages&amp;gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;      &amp;lt;controls&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;        &amp;lt;add tagPrefix=&amp;quot;asp&amp;quot; namespace=&amp;quot;System.Web.UI&amp;quot; assembly=&amp;quot;System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&amp;quot; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;        &amp;lt;add tagPrefix=&amp;quot;asp&amp;quot; namespace=&amp;quot;System.Web.UI.WebControls&amp;quot; assembly=&amp;quot;System.Web.Extensions, Version=3.5.0.0, Culture=neutral,PublicKeyToken=31BF3856AD364E35&amp;quot; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;      &amp;lt;/controls&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;b&gt;Add to &amp;lt;runtime&amp;gt;&amp;lt;assemblyBinding&amp;gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;      &amp;lt;dependentAssembly&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;        &amp;lt;assemblyIdentity name=&amp;quot;System.Web.Extensions&amp;quot; publicKeyToken=&amp;quot;31bf3856ad364e35&amp;quot; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;        &amp;lt;bindingRedirect oldVersion=&amp;quot;1.0.0.0-1.1.0.0&amp;quot; newVersion=&amp;quot;3.5.0.0&amp;quot; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;      &amp;lt;/dependentAssembly&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;      &amp;lt;dependentAssembly&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;        &amp;lt;assemblyIdentity name=&amp;quot;System.Web.Extensions.Design&amp;quot; publicKeyToken=&amp;quot;31bf3856ad364e35&amp;quot; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;        &amp;lt;bindingRedirect oldVersion=&amp;quot;1.0.0.0-1.1.0.0&amp;quot; newVersion=&amp;quot;3.5.0.0&amp;quot; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;      &amp;lt;/dependentAssembly&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;b&gt;At the bottom, just above &amp;lt;/configuration&amp;gt; add&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt; &amp;lt;system.web.extensions&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;    &amp;lt;scripting&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;      &amp;lt;webServices&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;      &amp;lt;/webServices&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;    &amp;lt;/scripting&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;  &amp;lt;/system.web.extensions&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;  &amp;lt;system.webServer&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;    &amp;lt;validation validateIntegratedModeConfiguration=&amp;quot;false&amp;quot; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;    &amp;lt;modules&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;      &amp;lt;remove name=&amp;quot;ScriptModule&amp;quot; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;      &amp;lt;add name=&amp;quot;ScriptModule&amp;quot; preCondition=&amp;quot;managedHandler&amp;quot; type=&amp;quot;System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&amp;quot; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;    &amp;lt;/modules&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;    &amp;lt;handlers&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;      &amp;lt;remove name=&amp;quot;WebServiceHandlerFactory-Integrated&amp;quot; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;      &amp;lt;remove name=&amp;quot;ScriptHandlerFactory&amp;quot; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;      &amp;lt;remove name=&amp;quot;ScriptHandlerFactoryAppServices&amp;quot; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;      &amp;lt;remove name=&amp;quot;ScriptResource&amp;quot; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;      &amp;lt;add name=&amp;quot;ScriptHandlerFactory&amp;quot; verb=&amp;quot;*&amp;quot; path=&amp;quot;*.asmx&amp;quot; preCondition=&amp;quot;integratedMode&amp;quot; type=&amp;quot;System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&amp;quot; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;      &amp;lt;add name=&amp;quot;ScriptHandlerFactoryAppServices&amp;quot; verb=&amp;quot;*&amp;quot; path=&amp;quot;*_AppService.axd&amp;quot; preCondition=&amp;quot;integratedMode&amp;quot; type=&amp;quot;System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&amp;quot; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;      &amp;lt;add name=&amp;quot;ScriptResource&amp;quot; preCondition=&amp;quot;integratedMode&amp;quot; verb=&amp;quot;GET,HEAD&amp;quot; path=&amp;quot;ScriptResource.axd&amp;quot; type=&amp;quot;System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&amp;quot; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;    &amp;lt;/handlers&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;  &amp;lt;/system.webServer&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eazycoding.blogspot.com/feeds/8003641257066046726/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eazycoding.blogspot.com/2010/03/enabling-net-35-features-in-sharepoint_08.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7165320373479866177/posts/default/8003641257066046726'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7165320373479866177/posts/default/8003641257066046726'/><link rel='alternate' type='text/html' href='http://eazycoding.blogspot.com/2010/03/enabling-net-35-features-in-sharepoint_08.html' title='Enabling .Net 3.5 features in SharePoint 2007'/><author><name>Erol Ziya</name><uri>http://www.blogger.com/profile/02295176155120038748</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://4.bp.blogspot.com/_TYax7DK60EM/Sc1SVf8XY4I/AAAAAAAAAC8/seh4iRjCIlg/S220/TheCreator(White)+-+Copy.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7165320373479866177.post-1738519974080092180</id><published>2009-09-08T10:07:00.004+01:00</published><updated>2009-09-08T10:20:59.577+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="BCS"/><category scheme="http://www.blogger.com/atom/ns#" term="BDC"/><category scheme="http://www.blogger.com/atom/ns#" term="Sharepoint 2010"/><category scheme="http://www.blogger.com/atom/ns#" term="WSS"/><category scheme="http://www.blogger.com/atom/ns#" term="WSS 4.0"/><title type='text'>BDC Becomes BCS</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:verdana;&quot;&gt;It looks like the new version of Sharepoint 2010 will rebadge the Business Data Catalog (BDC) as Business Connectivity Services (BCS).&lt;/span&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:verdana;&quot;&gt;This will be providing read/write access to external data from not only Line Of Business (LOB) systems but also web services, databases or other data in sharepoint.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:verdana;&quot;&gt;The BCS tools to do this will be in the Sharepoint Designer 2010 and VS2010 - lets hope it&#39;s easier than &#39;07 where you ended up crafting lovely metadata xml files by hand or buying 3rd party tools.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:verdana;&quot;&gt;For a look at the BCS and other new features of Sharepoint 2010, check out the sneak peaks...&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:verdana;&quot;&gt;&lt;a href=&quot;http://sharepoint.microsoft.com/2010/Sneak_Peek/Pages/Developer-Video.aspx&quot;&gt;http://sharepoint.microsoft.com/2010/Sneak_Peek/Pages/Developer-Video.aspx&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eazycoding.blogspot.com/feeds/1738519974080092180/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eazycoding.blogspot.com/2009/09/bdc-becomes-bcs.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7165320373479866177/posts/default/1738519974080092180'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7165320373479866177/posts/default/1738519974080092180'/><link rel='alternate' type='text/html' href='http://eazycoding.blogspot.com/2009/09/bdc-becomes-bcs.html' title='BDC Becomes BCS'/><author><name>Erol Ziya</name><uri>http://www.blogger.com/profile/02295176155120038748</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://4.bp.blogspot.com/_TYax7DK60EM/Sc1SVf8XY4I/AAAAAAAAAC8/seh4iRjCIlg/S220/TheCreator(White)+-+Copy.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7165320373479866177.post-3240326563428394967</id><published>2009-03-28T17:54:00.004+00:00</published><updated>2009-03-28T18:09:02.391+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.Net"/><category scheme="http://www.blogger.com/atom/ns#" term="Asychronous"/><category scheme="http://www.blogger.com/atom/ns#" term="Threading"/><title type='text'>Asynchronous ASP.Net</title><content type='html'>&lt;span style=&quot;font-family:verdana;&quot;&gt;This entry is actually the one of a write up of my notes from previous &lt;/span&gt;&lt;a style=&quot;COLOR: rgb(124,140,197)&quot; href=&quot;http://www.devweek.com/&quot; target=&quot;_blank&quot;&gt;&lt;span style=&quot;font-family:verdana;&quot;&gt;DevWeeks&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;font-family:verdana;&quot;&gt;. Although from 2007, this is still relevant today...&lt;br /&gt;These notes follow on from a Jeff Prosise talk on this subject at DevWeek 2007.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-family:verdana;&quot;&gt;&lt;strong&gt;&lt;u&gt;Asynchronous ASP.NET Programming – Jeff Prosise&lt;br /&gt;&lt;/u&gt;&lt;/strong&gt;Most sites that access external data (databases, web services etc) are written are done so in a synchronous way, and when the number of users increases the site can suddenly slow right down to a crawl, or even fail totally.&lt;br /&gt;&lt;br /&gt;When ASP.NET receives a request for a page, it grabs a thread from a thread pool and assigns that request to the thread. A normal, or synchronous, page holds onto the thread for the duration of the request, preventing the thread from being used to process other requests.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;If a synchronous request becomes I/O bound - for example, if it calls out to a Web service or queries a database and waits for the call to come back - then the thread assigned to the request is stuck doing nothing until the call returns. That impedes scalability because the thread pool has a finite number of threads available.&lt;br /&gt;&lt;br /&gt;If all request-processing threads are blocked waiting for I/O operations to complete, additional requests get queued up waiting for threads to be free. At best, throughput decreases because requests wait longer to be processed.&lt;br /&gt;&lt;br /&gt;At worst, the queue fills up and ASP.NET fails subsequent requests with 503 &quot;Server Unavailable&quot; errors.&lt;br /&gt;&lt;br /&gt;ASP.NET 2.0 however supports asynchronous pages.&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;table width=&quot;100%&quot;&gt;&lt;tr&gt;&lt;td&gt;&lt;a href=&quot;http://i.msdn.microsoft.com/cc163725.fig02(en-us).gif&quot;&gt;&lt;span style=&quot;font-family:verdana;font-size:85%;&quot;&gt;&lt;img style=&quot;MARGIN: 0px 10px 10px 0px; WIDTH: 354px; FLOAT: left; HEIGHT: 365px; CURSOR: hand&quot; border=&quot;0&quot; alt=&quot;&quot; src=&quot;http://i.msdn.microsoft.com/cc163725.fig02(en-us).gif&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;span style=&quot;font-family:verdana;font-size:85%;&quot;&gt;&lt;br /&gt;When the request arrives, it&#39;s assigned a thread by ASP.NET. The request begins processing on that thread, but when the time comes to hit the external data, the request launches an asynchronous request and returns the thread to the thread pool. When the query completes, the asynchronous request calls back to ASP.NET, and ASP.NET grabs another thread from the thread pool and resumes processing the request.&lt;br /&gt;While the query is outstanding, zero thread pool threads are consumed, leaving all of the threads free to service incoming requests. A request that&#39;s processed asynchronously doesn&#39;t execute any faster. But other requests execute faster because they don&#39;t have to wait for threads to become free. Requests incur less delay in entering the pipeline, and overall throughout goes up.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:verdana;font-size:85%;&quot;&gt;&lt;strong&gt;Asynchronous HTML Handler Pages&lt;br /&gt;&lt;/strong&gt;The second asynchronous programming model featured in ASP.NET is the asynchronous HTTP handler. An HTTP handler is an object that serves as an endpoint for requests. Requests for ASPX files, for example, are processed by an HTTP handler for ASPX files. Likewise, requests for ASMX files are handled by an HTTP handler that knows how to deal with ASMX services.&lt;br /&gt;&lt;br /&gt;You can extend ASP.NET to support additional file types by writing custom HTTP handlers. But even more interesting is the fact that you can deploy custom HTTP handlers in ASHX files and use them as targets of HTTP requests. This is the proper way to build Web endpoints that generate images on the fly or retrieve images from databases. You simply include an &amp;lt;img&amp;gt; tag (or Image control) in the page and point it to an ASHX that creates or fetches the image. Targeting an ASHX file with requests is more efficient than targeting an ASPX file because an ASHX file incurs much less overhead at processing time.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:verdana;font-size:85%;&quot;&gt;&lt;br /&gt;By definition, HTTP handlers implement the IHttpHandler interface. Handlers that implement that interface do their processing synchronously&lt;br /&gt;HTTP handlers don&#39;t have to be synchronous. By implementing the IHttpAsyncHandler interface, which itself derives from IHttpHandler, an HTTP handler can be asynchronous. When used correctly, an asynchronous handler utilizes ASP.NET threads more efficiently. This is done in the same manner as an asynchronous page. In fact, asynchronous pages leverage the asynchronous handler support that predated asynchronous pages in ASP.NET.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:verdana;font-size:85%;&quot;&gt;&lt;br /&gt;See &lt;a href=&quot;http://msdn.microsoft.com/en-gb/magazine/cc163725.aspx&quot;&gt;http://msdn.microsoft.com/en-gb/magazine/cc163725.aspx&lt;/a&gt; and &lt;/span&gt;&lt;a href=&quot;http://msdn.microsoft.com/msdnmag/issues/07/03/WickedCode/default.aspx&quot;&gt;&lt;span style=&quot;font-family:verdana;font-size:85%;&quot;&gt;http://msdn.microsoft.com/msdnmag/issues/07/03/WickedCode/default.aspx&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;font-family:verdana;font-size:85%;&quot;&gt; for more information.&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://eazycoding.blogspot.com/feeds/3240326563428394967/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eazycoding.blogspot.com/2009/03/asynchronous-aspnet.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7165320373479866177/posts/default/3240326563428394967'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7165320373479866177/posts/default/3240326563428394967'/><link rel='alternate' type='text/html' href='http://eazycoding.blogspot.com/2009/03/asynchronous-aspnet.html' title='Asynchronous ASP.Net'/><author><name>Erol Ziya</name><uri>http://www.blogger.com/profile/02295176155120038748</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://4.bp.blogspot.com/_TYax7DK60EM/Sc1SVf8XY4I/AAAAAAAAAC8/seh4iRjCIlg/S220/TheCreator(White)+-+Copy.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7165320373479866177.post-1885942811107305374</id><published>2009-03-27T22:27:00.003+00:00</published><updated>2009-03-28T15:13:05.946+00:00</updated><title type='text'>New Profile Pic</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:verdana;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:medium;&quot;&gt;Quick post to say thanks to my friend and colleague Rob Baines, who is not only a talented architect, but also a great cartoonist, and did the &quot;creator&quot; avatar I&#39;m using here.&lt;br /&gt;&lt;br /&gt;Check out &lt;/span&gt;&lt;/span&gt;&lt;a href=&quot;http://www.thebaines.co.uk/about/about.htm&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:verdana;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:medium;&quot;&gt;his site&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:verdana;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:medium;&quot;&gt; for more details.&lt;/span&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://eazycoding.blogspot.com/feeds/1885942811107305374/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eazycoding.blogspot.com/2009/03/new-profile-pic.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7165320373479866177/posts/default/1885942811107305374'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7165320373479866177/posts/default/1885942811107305374'/><link rel='alternate' type='text/html' href='http://eazycoding.blogspot.com/2009/03/new-profile-pic.html' title='New Profile Pic'/><author><name>Erol Ziya</name><uri>http://www.blogger.com/profile/02295176155120038748</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://4.bp.blogspot.com/_TYax7DK60EM/Sc1SVf8XY4I/AAAAAAAAAC8/seh4iRjCIlg/S220/TheCreator(White)+-+Copy.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7165320373479866177.post-7997170450688639396</id><published>2009-03-27T21:56:00.005+00:00</published><updated>2009-03-27T22:03:29.548+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".Net"/><category scheme="http://www.blogger.com/atom/ns#" term="Anonymous Types"/><category scheme="http://www.blogger.com/atom/ns#" term="Extension Methods"/><category scheme="http://www.blogger.com/atom/ns#" term="Lambda"/><category scheme="http://www.blogger.com/atom/ns#" term="LINQ"/><title type='text'>LINQ in .Net</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot;   style=&quot;border-collapse: collapse; color: rgb(51, 51, 51);   line-height: 19px; font-family:Verdana;font-size:13px;&quot;&gt;&lt;span style=&quot; ;font-family:verdana;&quot;&gt;&lt;span style=&quot; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;This entry is actually the one of a write up of my notes from previous &lt;/span&gt;&lt;a href=&quot;http://www.devweek.com/&quot; target=&quot;_blank&quot; style=&quot;color: rgb(124, 140, 197); &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;DevWeeks&lt;/span&gt;&lt;/a&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;. Although from 2008, this is still relevant today...&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot; ;font-family:verdana;&quot;&gt;&lt;span style=&quot; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot; ;font-family:verdana;&quot;&gt;&lt;span style=&quot; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;These notes follow on from &lt;/span&gt;&lt;a href=&quot;http://www.pluralsight.com/community/blogs/tewald&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;Tim Ewald&lt;/span&gt;&lt;/a&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; talk on this subject at DevWeek 2008.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:16px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;border-collapse: separate; color: rgb(0, 0, 0);  line-height: normal; font-family:Calibri;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: bold;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;text-decoration: underline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Introduction to LINQ&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot;   style=&quot;border-collapse: separate; color: rgb(0, 0, 0);   line-height: normal;font-family:Calibri;font-size:24px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;   style=&quot;  ;font-family:&#39;Times New Roman&#39;;font-size:16px;&quot;&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;LINQ stands for Language INtergrated Query, and extends the .Net framework to provide query, set and transform operations. It allows the working with of collections of objects in a SQL like fashion.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Lambda Expressions&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Is the next step past anonymous methods (which were introduced in .Net 2.0). They are symbolised by the =&gt; operator and can have a simple test, or an entire procedure following them. They can be useful when working with any collection that is enumerable. Below is an example:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Person[] people = GetPeople();&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;IEnumerable&lt;/span&gt;&lt;person&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt; result = people.Where(&lt;/span&gt;&lt;/person&gt;&lt;span style=&quot;background-image: initial; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: rgb(255, 255, 0); background-position: initial initial; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;p =&gt; p.LastName == lastname&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Extension Methods&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;These allow you to extend any existing type without breaking any implementors. Extending is just like writing a new method, however for the parameters you specify &quot;&lt;/span&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;this &lt;/span&gt;&lt;type&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;varname&gt;&lt;/varname&gt;&lt;/span&gt;&lt;/type&gt;&lt;/i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&quot;. The keyword &quot;this&quot; identifies it as an extension method, followed by the data type (could be an interface as well as a object) followed by a variable name to use in the method. The methods must be static.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;C# 3.0 uses this technique to extend IEnumerable with the Enumerable class. This adds many functions including Sum, Avg, Min, First, Union, Where, OrderBy&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;public static StringExtension&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;public static string addHi(&lt;/span&gt;&lt;span style=&quot;background-image: initial; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: rgb(255, 255, 0); background-position: initial initial; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;this string&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt; str)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;return str + &quot;Hi&quot;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;String name = &quot;test&quot;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;name = name&lt;/span&gt;&lt;span style=&quot;background-image: initial; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: rgb(255, 255, 0); background-position: initial initial; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;.addHi()&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;^&lt;/span&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Would return testHi&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Projections&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;This is used in IEnumerable collections to simplify the creation of a list of one type of object from the enumeration of a list of another type of object. It&#39;s used in the Where() and Select() extension methods of IEnumerable.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Anonymous Types&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;These are structural unnamed types, that infer their type from the first assignment to them. They differ from VB6/VBA &lt;/span&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;object &lt;/span&gt;&lt;/i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;type though as they enforce type safety from the first assignment onwards. It uses the var keyword before the name of the variable.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Type Inference&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Type inference is a way to refer to an anonymous type. The type is inferred and not dynamic (hence type safety is enforced, as stated above)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;They can only be used at a local scope.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span style=&quot;background-image: initial; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: rgb(255, 255, 0); background-position: initial initial; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;var i = 5&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;i = &quot;Hello&quot;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;^&lt;/span&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;this would produce an error as i is inferred as an int&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Object Initialisers&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Object Initialisers allow the property/field values of a new object to be set on instantiation. It&#39;s primarily used in the .Select() method of Ienumerable, via a lambda expression. An example is below:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Person[] people = GetPeople();&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;IEnumerable&lt;/span&gt;&lt;personsimple&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt; result = people.Where(p =&gt; p.LastName == lastname)&lt;/span&gt;&lt;/personsimple&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;.Select(p =&gt; new&lt;/span&gt;&lt;span style=&quot;background-image: initial; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: rgb(255, 255, 0); background-position: initial initial; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt; PersonSimple{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;span style=&quot;background-image: initial; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: rgb(255, 255, 0); background-position: initial initial; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Name=p.name,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;span style=&quot;background-image: initial; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: rgb(255, 255, 0); background-position: initial initial; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;LName = p.LastName});&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;LINQ Simplified Syntax&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;To simplify the use of the above features, new syntax is also supported which is more SQL like. Below is an example of the above code rewritten in this syntax&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Person[] people GetPeople();&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Var result = from p in people&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;where p.LastName == lastname&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Select new {p.Name,LName = p.LastName}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;LINQ Providers&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;The following providers are available:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;LINQ to Objects&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;See examples above&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;LINQ to XML&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Provides an enumerable tree model to walk through XML&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;LINQ to SQL&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Maps Database schemas to classes&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Supports queries, updates and stored procedures&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Supports delegated execution (passing an ad hoc procedure to SQL to be run)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Should be used with caution - you most likely end up pulling masses of data to the server&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;   style=&quot;  font-weight: bold;font-family:Calibri;font-size:13px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://eazycoding.blogspot.com/feeds/7997170450688639396/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eazycoding.blogspot.com/2009/03/linq-in-net.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7165320373479866177/posts/default/7997170450688639396'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7165320373479866177/posts/default/7997170450688639396'/><link rel='alternate' type='text/html' href='http://eazycoding.blogspot.com/2009/03/linq-in-net.html' title='LINQ in .Net'/><author><name>Erol Ziya</name><uri>http://www.blogger.com/profile/02295176155120038748</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://4.bp.blogspot.com/_TYax7DK60EM/Sc1SVf8XY4I/AAAAAAAAAC8/seh4iRjCIlg/S220/TheCreator(White)+-+Copy.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7165320373479866177.post-517866337314809066</id><published>2009-03-27T21:18:00.000+00:00</published><updated>2009-03-27T21:23:44.256+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".Net"/><category scheme="http://www.blogger.com/atom/ns#" term="DataContract"/><category scheme="http://www.blogger.com/atom/ns#" term="DataContractSerializer"/><category scheme="http://www.blogger.com/atom/ns#" term="Serializing"/><category scheme="http://www.blogger.com/atom/ns#" term="WCF"/><title type='text'>Behind the Scenes of WCF</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(51, 51, 51); font-family: Verdana; font-size: 13px; line-height: 19px; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: verdana; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 16px; &quot;&gt;This entry is actually the one of a write up of my notes from previous &lt;a href=&quot;http://www.devweek.com/&quot; style=&quot;color: rgb(102, 153, 204); &quot;&gt;DevWeeks&lt;/a&gt;. Although from 2008, this is still relevant today...&lt;/span&gt;&lt;/span&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: verdana; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 16px; &quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: verdana; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 16px; &quot;&gt;These notes follow on from &lt;a href=&quot;www.pluralsight.com/aaron&quot;&gt;Aaron Skonnard&lt;/a&gt; talk on this subject at DevWeek 2008.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 16px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: bold;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;text-decoration: underline;&quot;&gt;Message Oriented WCF&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 16px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(0, 0, 0); font-family: &#39;Times New Roman&#39;; line-height: normal; &quot;&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Calibri; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;WCF provides a message-oriented programming model, with flexibility in its use.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;WCF Messages&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;All WCF messages are modelled with System.ServiceModel.Channels.Message.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;They can be encoded as XML, JSON, binary etc. They can also optionally be mapped to/from .Net objects (see serializing, below).&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;The MessageVersion class allows the specifying of the versions of SOAP and WS-Addressing that you wish to use (if any).&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;As the message class has been designed to support streaming, the body of a message can only be processed once for a particular instance. You can copy the body if you need to process the message more than once. The message has a state property which will be either Created, Read, Written, Copied or Closed.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;The message has a Headers property which can hold values about the message. It is typically the job of intermediaries to process the message headers. Intermediaries often need to store the results of their processing somewhere for future use in the processing pipeline, which is why a message also have a message properties collection. The properties are usually only used during local processing, and don&#39;t usually affect what happens to the message on the wire, but they are able to.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Message bodies can be read from by calling either GetBody&lt;t&gt; or GetReadyAtBodyContents. The body can be written to by calling WriteMessage or WriteBody, passing in either an XmlDictionaryWriter or XmlWriter object.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Action values of the OperationContract can be used to map messages to methods, and these can be either universal one-way or two-way operations. Operations can either be &quot;*&quot; or named specifically.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Data and Message Contracts&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;The data contract defines the format of the message body that will be passed in the message. It is done by annotating classes with the [DataContract] and [DataMember] attributes. An example is shown below:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;[DataContract]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;public class Person&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;public string PersonID; //&lt;/span&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;This property will not be in the message&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;[DataMember]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;public string Name;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;[DataMember]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;public int Age;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;...&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;A data contract will break if any of the following changes are made:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;ul style=&quot;margin-top: 0px; margin-bottom: 0px; &quot;&gt;&lt;li style=&quot;margin-top: 0px; margin-bottom: 0px; &quot;&gt;&lt;p class=&quot;western&quot; style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Changing the type Name or Namespace&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 0px; margin-bottom: 0px; &quot;&gt;&lt;p class=&quot;western&quot; style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Changing the Order of data members&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 0px; margin-bottom: 0px; &quot;&gt;&lt;p class=&quot;western&quot; style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Changing the Name of a data member&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 0px; margin-bottom: 0px; &quot;&gt;&lt;p class=&quot;western&quot; style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Changing the type of a data member&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 0px; margin-bottom: 0px; &quot;&gt;&lt;p class=&quot;western&quot; style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Changing IsRequired property from false to true&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Message contracts map data contracts to SOAP envelopes. They allow full control to model SOAP messages and headers, by annotating the class with [MessageContract], [MessageBodyMember] and [MessageHeader] attributes on members.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Serializing&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Messages can be serialised into .Net objects using one of the supported serializers. This allows objects to be sent easily using WCF. Messages can be &quot;typed&quot; to .Net types by annotating the types with special mapping attributes. At runtime a serializer maps the .Net objects into messages.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;The XmlSerializer is the original serializer from .Net 1.0, and is still fully supported, and offers backwards compatibility to web (ASMX) services and other Non-WCF services.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;The DataContractSerializer is a new serialiser in .Net 3.0 that supports most .Net types including:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;ul style=&quot;margin-top: 0px; margin-bottom: 0px; &quot;&gt;&lt;li style=&quot;margin-top: 0px; margin-bottom: 0px; &quot;&gt;&lt;p class=&quot;western&quot; style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;CLR built in types,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 0px; margin-bottom: 0px; &quot;&gt;&lt;p class=&quot;western&quot; style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Byte Array, DateTime, TimeSpan, GUID, XmlQualifiedName, XmlElement, XmlNode arrays&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 0px; margin-bottom: 0px; &quot;&gt;&lt;p class=&quot;western&quot; style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Enums&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 0px; margin-bottom: 0px; &quot;&gt;&lt;p class=&quot;western&quot; style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Types marked with the DataContract or CollectionDataContract attribute&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 0px; margin-bottom: 0px; &quot;&gt;&lt;p class=&quot;western&quot; style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Types that implment IXmlSerializable&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 0px; margin-bottom: 0px; &quot;&gt;&lt;p class=&quot;western&quot; style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Arrays/Collection classes including List&lt;t&gt;, Dictionary&lt;k,v&gt; and HastTable&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 0px; margin-bottom: 0px; &quot;&gt;&lt;p class=&quot;western&quot; style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Types marked with Serializable attribute or implement Iserializable&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;u&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Note that the DCS only supports a subset of XSD&lt;/span&gt;&lt;/u&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;In .Net 3.5 the DataContractJSONSerializer was added, that perfoms the same as the DCS but with serializing to JSON instead of XML.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 13px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Message-oriented Design Techniques&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Pure XML messaging approaches are gaining more traction these days. This is very like REST.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Schema-first design is common in integration scenarios, specially where collaboration and parallel development is required. Data/message contracts can be generated from schemas using SvcUtil.exe. XmlSerializer (and xsd.exe) is the recommended approach here.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Code-first design is more common when collaboration isn&#39;t needed, where the developer writes data contracts and lets WCF generate the schemas. DataContractSerializer (and SvcUtil.exe) is the recommended approach here.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://eazycoding.blogspot.com/feeds/517866337314809066/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eazycoding.blogspot.com/2009/03/behind-scenes-of-wcf.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7165320373479866177/posts/default/517866337314809066'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7165320373479866177/posts/default/517866337314809066'/><link rel='alternate' type='text/html' href='http://eazycoding.blogspot.com/2009/03/behind-scenes-of-wcf.html' title='Behind the Scenes of WCF'/><author><name>Erol Ziya</name><uri>http://www.blogger.com/profile/02295176155120038748</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://4.bp.blogspot.com/_TYax7DK60EM/Sc1SVf8XY4I/AAAAAAAAAC8/seh4iRjCIlg/S220/TheCreator(White)+-+Copy.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7165320373479866177.post-2806397466589633988</id><published>2009-03-27T20:44:00.001+00:00</published><updated>2009-03-27T21:02:49.363+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".Net 3.5"/><category scheme="http://www.blogger.com/atom/ns#" term="CAS"/><category scheme="http://www.blogger.com/atom/ns#" term="Code Access Security"/><category scheme="http://www.blogger.com/atom/ns#" term="Cryptography"/><category scheme="http://www.blogger.com/atom/ns#" term="Sandboxing"/><title type='text'>Code Access Security (CAS) in .Net 3.5 (+ Other Security Bits)</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:verdana;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:medium;&quot;&gt;This entry is actually the first in a write up of my notes from previous &lt;a href=&quot;http://www.devweek.com&quot;&gt;DevWeeks&lt;/a&gt;. Although from 2008, this is still relevant today...&lt;/span&gt;&lt;/span&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:verdana;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:verdana;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:medium;&quot;&gt;These notes follow on from &lt;a href=&quot;http://www.leastprivilege.com&quot;&gt;Dominick Baiers&lt;/a&gt; talk on this subject at DevWeek 2008.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:verdana;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span&gt;&lt;span&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:verdana;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Code Access Security &amp;amp; Sandboxing&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:verdana;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Most of the important base features were added in 2.0, including a simple sandboxing API, security transparency and manifest based activation. These have been used in several current and future technologies such as ClickOnce, XBAP, and SilverLight.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:verdana;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:verdana;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Sandboxing is all about loading code dynamically yet restricting what it can and cannot do. This is supported using the AppDomain class with restricted permissions. The permissions that the code in the sandbox would use were defined by the permission set in Code Access Security (CAS).&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:verdana;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: collapse; &quot;&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span&gt;&lt;span&gt;&lt;u&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:verdana;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Code Access Security Overview&lt;/span&gt;&lt;/span&gt;&lt;/u&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:verdana;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;CAS defines permissions and permission sets that represent the right to access various system resources. The permissions are grouped into security policies by associating them with groups of code. It allows code to request the permissions it requires in order to run, as well as the permissions that would be useful to have, and specifies which permissions the code must never have. The restrictions are enforced at run time.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:verdana;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;When a method that is called demands a permission, CAS traverses the stack of assemblies up, checking if the method is allowed. The diagram below illustrates this:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot; ;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:verdana;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhaO3YNOi4qy65Vn2-DpcuePlkRci5zwv6_jDbJ8sWTKtbVeeJKpnuXgtt8lRvZIGYvP-CUTmrD-50yxzMmw5rZVfbDIqzcBNIHnQlqpSb4_nAG8MXmi_ZFO6EVgbO5iaz3-8tluWQGSwU/s400/CAS.png&quot; name=&quot;CAS&quot; align=&quot;BOTTOM&quot; width=&quot;475&quot; height=&quot;215&quot; border=&quot;0&quot; /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:verdana;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:verdana;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;Times New Roman&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: separate; &quot;&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:verdana;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Setting up permissions and policies however in CAS was very cumbersome and not very readable without in depth knowledge of CAS, and even then a challenge.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:verdana;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:verdana;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;The CAS model has now been simplified for sandboxing, so that the &lt;/span&gt;&lt;/span&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:verdana;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;PolicyLevel &lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:verdana;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;attribute is no longer required, and that the AppDomain is independent from the security policy (which is a very painful document to work with). Instead, loaded assemblies either get permissions specified in &lt;/span&gt;&lt;/span&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:verdana;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;grantSet&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:verdana;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt; or full trust if part of &lt;/span&gt;&lt;/span&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:verdana;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;fullTrustAssemblies&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:verdana;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt; list.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:verdana;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span&gt;&lt;span&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:verdana;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Windows Security Integration&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:verdana;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Much of the work to provide Windows security integration was done in 2.0 with SIDs, ACLs and tokens.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:verdana;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:verdana;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Role based security has been integrated since 1.0 using IIdentity and IPrincipal along with Thread.CurrentPrincipal and PrincipalPermission. 3.0 introduced authorisation systems based on claims (Claim type, Resource, Right) which are grouped into claim sets. A claim set has an issuer and the issuer itself is a claim set.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:verdana;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:verdana;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;A new &quot;convenience&quot; library has been added for common tasks called System.DirectoryServices.AccountManagement. This allows amongst other things:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:verdana;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;ul style=&quot;margin-top: 0px; margin-bottom: 0px; &quot;&gt;&lt;ul style=&quot;margin-top: 0px; margin-bottom: 0px; &quot;&gt;&lt;li style=&quot;margin-top: 0px; margin-bottom: 0px; &quot;&gt;&lt;p class=&quot;western&quot; style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:verdana;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Adding/modifying/deleting user/group/machine accounts&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 0px; margin-bottom: 0px; &quot;&gt;&lt;p class=&quot;western&quot; style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:verdana;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Password validation&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;margin-top: 0px; margin-bottom: 0px; &quot;&gt;&lt;p class=&quot;western&quot; style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:verdana;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&quot;is user x in group y&quot; scenarios&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:verdana;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:verdana;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;It supports local, domain and ADAM user stores.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:verdana;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span&gt;&lt;span&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:verdana;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Cryptography&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:verdana;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;The symmetric cryptography and hashing algorithms have been updated in 3.5.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:verdana;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:verdana;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Also, support has been added for Crypto Next Generation (CNG) API, which is the next generation of crypto standards which are compliant with the NSA &quot;Crypto Suite B&quot; set, and elliptic curve based algorithms.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:verdana;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span&gt;&lt;span&gt;&lt;u&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:verdana;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Note, the new API is only supported by Vista and Windows Server 2008 however&lt;/span&gt;&lt;/span&gt;&lt;/u&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:verdana;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span&gt;&lt;span&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:verdana;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Network Protocols&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:verdana;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;The most important additions here were made in 2.0, which are SslStream and NegotiateStream, which allow the layering of SSL and SPNEGO over arbitrary network streams. This gets used by higher level frameworks live WCF.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:verdana;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:verdana;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Two new secure protocols were also added in 3.5 which were Named Pipes (anonymous and named) and Peer technologies including peer to peer (P2P), peer name resolution protocol (PNRP) and people near me (PNM)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:verdana;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span&gt;&lt;span&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:verdana;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Management&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:verdana;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;New support is added for Event Tracing for Windows (ETW) and Windows Eventing 6.0 with new classes including EventSchemaTraceListener, System.Diagnostics.Eventing and System.Diagnostics.Eventing.Reader.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:verdana;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:verdana;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Windows Management Instrumentation (WMI) support has also been rewritten under System.Management and System.Management.Instrumentation.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:Calibri;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eazycoding.blogspot.com/feeds/2806397466589633988/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eazycoding.blogspot.com/2009/03/code-access-security-cas-in-net-35.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7165320373479866177/posts/default/2806397466589633988'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7165320373479866177/posts/default/2806397466589633988'/><link rel='alternate' type='text/html' href='http://eazycoding.blogspot.com/2009/03/code-access-security-cas-in-net-35.html' title='Code Access Security (CAS) in .Net 3.5 (+ Other Security Bits)'/><author><name>Erol Ziya</name><uri>http://www.blogger.com/profile/02295176155120038748</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://4.bp.blogspot.com/_TYax7DK60EM/Sc1SVf8XY4I/AAAAAAAAAC8/seh4iRjCIlg/S220/TheCreator(White)+-+Copy.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhaO3YNOi4qy65Vn2-DpcuePlkRci5zwv6_jDbJ8sWTKtbVeeJKpnuXgtt8lRvZIGYvP-CUTmrD-50yxzMmw5rZVfbDIqzcBNIHnQlqpSb4_nAG8MXmi_ZFO6EVgbO5iaz3-8tluWQGSwU/s72-c/CAS.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7165320373479866177.post-3745425369604415520</id><published>2009-03-27T09:56:00.000+00:00</published><updated>2009-03-27T19:39:03.124+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="MSDN"/><category scheme="http://www.blogger.com/atom/ns#" term="WHS"/><category scheme="http://www.blogger.com/atom/ns#" term="Windows Home Server"/><title type='text'>Windows Home Server now on MSDN</title><content type='html'>Well, after all the refusals to do it, it seems that Microsoft have finally made Windows Home Server available for MSDN subscribers!&lt;br /&gt;&lt;br /&gt;See &lt;a href=&quot;http://blogs.technet.com/homeserver/archive/2009/03/23/windows-home-server-now-available-on-msdn.aspx&quot;&gt;this link&lt;/a&gt; for more details...</content><link rel='replies' type='application/atom+xml' href='http://eazycoding.blogspot.com/feeds/3745425369604415520/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eazycoding.blogspot.com/2009/03/windows-home-server-now-on-msdn.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7165320373479866177/posts/default/3745425369604415520'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7165320373479866177/posts/default/3745425369604415520'/><link rel='alternate' type='text/html' href='http://eazycoding.blogspot.com/2009/03/windows-home-server-now-on-msdn.html' title='Windows Home Server now on MSDN'/><author><name>Erol Ziya</name><uri>http://www.blogger.com/profile/02295176155120038748</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://4.bp.blogspot.com/_TYax7DK60EM/Sc1SVf8XY4I/AAAAAAAAAC8/seh4iRjCIlg/S220/TheCreator(White)+-+Copy.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7165320373479866177.post-4457316563613751961</id><published>2009-03-25T17:19:00.000+00:00</published><updated>2009-03-25T17:38:06.681+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="hello"/><title type='text'>It has begun...</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;Well I finally thought I&#39;d start a blog to save all my thoughts and discoveries whilst I code away at and outside of work!&lt;/span&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;My plan is to blog about anything to do with coding, development, architecture and all those wonderfull geek like things. &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;Anyway, a little about my experience in case people are interested. I am currently employed as technical/solutions architect with a large property services company. I&#39;ve been here over 10.5yrs. For more details on that, you  can check out my &lt;/span&gt;&lt;a href=&quot;http://www.linkedin.com/in/erolziya&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;linkedin profile&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;I&#39;ve been a true style geek since the age of 8 when I wrote my first logo program at school, then got an Amstrad CPC6128 (go 128kb of ram!) and was writing games on that as I wasn&#39;t impressed with the ones I could buy.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;I&#39;ve worked with .Net since it&#39;s initial release, and have followed it through to the current upcoming 2010 version. Also I&#39;ve worked a lot with Oracle databases and writing/tuning apps for it. But I&#39;m not adverse to dabbling with Java or any other language that intrigues me (currently having a play with Ruby &amp;amp; Python).&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Technologies &amp;amp; trends I am specifically enjoying playing with at present are Message Broker, WCF, Security (geneva etc) and REST. Oh and I&#39;m sure some cloud-play will come about too. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;I love the challenge of problem solving applications, be that with performance, or those hard to trace bugs, plus designing/architecting new solutions. I like to think I&#39;ve got a good grounding in the work I do, but I always try to remember what a great man (an ex boss in fact) once told me - and that is that &quot;you don&#39;t know what you don&#39;t know!&quot; so every day working on code is potentially a lesson - don&#39;t get compacent!&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eazycoding.blogspot.com/feeds/4457316563613751961/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eazycoding.blogspot.com/2009/03/it-has-begun.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7165320373479866177/posts/default/4457316563613751961'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7165320373479866177/posts/default/4457316563613751961'/><link rel='alternate' type='text/html' href='http://eazycoding.blogspot.com/2009/03/it-has-begun.html' title='It has begun...'/><author><name>Erol Ziya</name><uri>http://www.blogger.com/profile/02295176155120038748</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://4.bp.blogspot.com/_TYax7DK60EM/Sc1SVf8XY4I/AAAAAAAAAC8/seh4iRjCIlg/S220/TheCreator(White)+-+Copy.jpg'/></author><thr:total>0</thr:total></entry></feed>