<?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-6499890790280411938</id><updated>2026-09-22T05:31:02.089+02:00</updated><category term=".NET"/><category term="Active Directory"/><category term="C# .NET"/><category term="Team Foundation Server"/><category term="Development"/><category term="The Cornball"/><category term="Programming"/><category term="Windows"/><category term="LEAP"/><category term="Microsoft"/><category term="Azure"/><category term="Cloud"/><category term="Silverlight"/><category term="Visual Studio"/><category term="Exchange"/><category term="Google Apps"/><category term="MEF"/><category term="Password"/><category term="Redmond"/><category term="SQL Server"/><category term="WPF"/><category term="Windows Server"/><category term="jQuery"/><category term="ASP.NET"/><category term="Administrator"/><category term="Backbone"/><category term="Bootstrap"/><category term="Build"/><category term="Certificate"/><category term="Certification"/><category term="DNS"/><category term="Destroy"/><category term="Dropbox"/><category term="Gmail"/><category term="HTML"/><category term="Handheld"/><category term="IIS"/><category term="System.DirectoryServices.Protocols"/><category term="WCF"/><category term="AJAX"/><category term="ActiveSync"/><category term="Animation"/><category term="BPOS"/><category term="Berlin"/><category term="Binding"/><category term="Bing Maps"/><category term="Blogger"/><category term="BriForum"/><category term="Brunch"/><category term="Camera icon"/><category term="Change"/><category term="Chaplin"/><category term="Chicago"/><category term="Cisco"/><category term="Citrix"/><category term="Cloud Day"/><category term="CodePlex"/><category term="Configuration"/><category term="Connecta"/><category term="DST"/><category term="Dallas"/><category term="Data Collector Sets"/><category term="DataAnnotation"/><category term="Desktop virtualization"/><category term="Diagnostics"/><category term="Domain"/><category term="Double Click"/><category term="EDNS0"/><category term="English"/><category term="Firewall"/><category term="FormData"/><category term="Getdate"/><category term="Google Plus"/><category term="Google Search Appliance"/><category term="Identity"/><category term="Internet Explorer"/><category term="Intune"/><category term="JavaScript"/><category term="Local Security Authority"/><category term="MSBuild"/><category term="MVC"/><category term="MVVM"/><category term="NPS"/><category term="NUnit"/><category term="Nostalgia"/><category term="Outlook"/><category term="Parsley"/><category term="Policy"/><category term="Power Tools"/><category term="Preloader"/><category term="Privileges"/><category term="Quartz.NET"/><category term="RADIUS"/><category term="Remote Procedure Call"/><category term="RemoteFX"/><category term="Resource"/><category term="RichTextBox"/><category term="SNMP"/><category term="SOAP"/><category term="SWEREF 99"/><category term="SkipWorkItemCreation"/><category term="Sound Effects"/><category term="Splash Screen"/><category term="System Attendant"/><category term="System Resource Manager"/><category term="System.DirectoryServices"/><category term="System.DirectoryServices.AccountManagement"/><category term="TACACS"/><category term="TEC Europe"/><category term="Team Explorer"/><category term="Team Foundation Services"/><category term="Testrunconfig"/><category term="Tooltip"/><category term="Topology"/><category term="VDI"/><category term="VMWare"/><category term="Validation"/><category term="Visio"/><category term="WMI"/><category term="WebBrowser"/><category term="WordPress"/><category term="Work Item"/><category term="XAML"/><category term="XHR"/><category term="iPhone"/><title type='text'>Victor Stodell</title><subtitle type='html'>.NET, TFS, Azure or anything Microsoft</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://victor.stodell.se/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6499890790280411938/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://victor.stodell.se/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/6499890790280411938/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Victor</name><uri>http://www.blogger.com/profile/11525593043576250274</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>62</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6499890790280411938.post-4455363195599679338</id><published>2014-07-24T11:50:00.001+02:00</published><updated>2014-07-24T11:50:22.133+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Backbone"/><category scheme="http://www.blogger.com/atom/ns#" term="Brunch"/><category scheme="http://www.blogger.com/atom/ns#" term="Chaplin"/><category scheme="http://www.blogger.com/atom/ns#" term="jQuery"/><category scheme="http://www.blogger.com/atom/ns#" term="The Cornball"/><title type='text'>The Cornball goes to Brunch with Chaplin</title><content type='html'>Lately I&#39;ve been working pretty hard on different projects but not really stumbling upon anything blogworthy. The most recent project is quite interesting though, a single page, touch friendly, web application using the latest and greatest technologies. We&#39;ve ended up with using &lt;a href=&quot;https://github.com/paulmillr/brunch-with-chaplin&quot; target=&quot;_blank&quot;&gt;Brunch with Chaplin&lt;/a&gt;, which is a very neat way of setting up a &lt;a href=&quot;http://backbonejs.org/&quot; target=&quot;_blank&quot;&gt;Backbone&lt;/a&gt; based single page web project with &lt;a href=&quot;http://brunch.io/&quot; target=&quot;_blank&quot;&gt;Brunch&lt;/a&gt; and &lt;a href=&quot;http://chaplinjs.org/&quot; target=&quot;_blank&quot;&gt;Chaplin&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
Aside from this, I have my own little project that has lived on for almost 15 years already, &lt;a href=&quot;http://victor.stodell.se/p/projects.html&quot; target=&quot;_blank&quot;&gt;The Cornball&lt;/a&gt;. From being a plain Windows application written i C an Win32 API, it has been ported to .NET using WPF, and is currently a Silverlight application hosted on Windows Azure.&lt;br /&gt;
&lt;br /&gt;
I could not find a better time to reanimate this project and create a new web based version, touch friendly, super optimized, awesome in any way. So I did...

So please follow my journey at &lt;a href=&quot;https://github.com/lovlka/cornball-js&quot; target=&quot;_blank&quot;&gt;Github&lt;/a&gt;. It&#39;s going to take a while, I assure you, but I already have some ground work done.&lt;br /&gt;
&lt;br /&gt;
Meanwhile, check out the current Silverlight version at &lt;a href=&quot;http://lantisen.stodell.se/&quot;&gt;http://lantisen.stodell.se/&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://victor.stodell.se/feeds/4455363195599679338/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://victor.stodell.se/2014/07/the-cornball-goes-to-brunch-with-chaplin.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6499890790280411938/posts/default/4455363195599679338'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6499890790280411938/posts/default/4455363195599679338'/><link rel='alternate' type='text/html' href='http://victor.stodell.se/2014/07/the-cornball-goes-to-brunch-with-chaplin.html' title='The Cornball goes to Brunch with Chaplin'/><author><name>Victor</name><uri>http://www.blogger.com/profile/11525593043576250274</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6499890790280411938.post-6875088784837358945</id><published>2014-02-18T15:29:00.001+01:00</published><updated>2014-02-18T15:32:09.621+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="AJAX"/><category scheme="http://www.blogger.com/atom/ns#" term="Bootstrap"/><category scheme="http://www.blogger.com/atom/ns#" term="FormData"/><category scheme="http://www.blogger.com/atom/ns#" term="jQuery"/><category scheme="http://www.blogger.com/atom/ns#" term="XHR"/><title type='text'>jQuery file upload with Bootstrap progress bar</title><content type='html'>Performing an asynchronous file upload from the browser is a common problem with almost as many solutions as there are developers. The following solution is the best fit for my needs, and also works well with most popular browsers. Backwards compatibility is not an issue in this case which is great, because I can use the new technologies as they are supposed to be used.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;i&gt;Everything is put together in &lt;a href=&quot;http://jsfiddle.net/&quot; target=&quot;_blank&quot;&gt;JSFiddle&lt;/a&gt; for a &lt;a href=&quot;http://jsfiddle.net/lovlka/N4Jxk/&quot; target=&quot;_blank&quot;&gt;working example&lt;/a&gt;. I will continue to explain the parts below...&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
First, the input field needs to be styled as a button. The form tag is only present for us to be able to reset the file input field later on.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: html&quot;&gt;&amp;lt;form&amp;gt;
&amp;nbsp; &amp;nbsp; &amp;lt;span class=&quot;fileUpload btn btn-default&quot;&amp;gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;span class=&quot;glyphicon glyphicon-upload&quot;&amp;gt;&amp;lt;/span&amp;gt; Upload file
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;input type=&quot;file&quot; id=&quot;uploadFile&quot; /&amp;gt;
&amp;nbsp; &amp;nbsp; &amp;lt;/span&amp;gt;
&amp;lt;/form&amp;gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: css&quot;&gt;.fileUpload {
    position: relative;
    overflow: hidden;
}
.fileUpload input {
    position: absolute;
    top: 0;
    right: 0;
    margin: 0;
    padding: 0;
    cursor: pointer;
    opacity: 0;
}&lt;/pre&gt;
&lt;br /&gt;
The Javascript is contained within one method which is executed when the file input is changed.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: javascript&quot;&gt;$(&quot;#uploadFile&quot;).change(function() {
&amp;nbsp; &amp;nbsp; var formData = new FormData();
&amp;nbsp; &amp;nbsp; formData.append(&#39;file&#39;, this.files[0]);
&amp;nbsp; &amp;nbsp;
&amp;nbsp; &amp;nbsp; $(&quot;#files&quot;).append($(&quot;#fileUploadProgressTemplate&quot;).tmpl());
&amp;nbsp; &amp;nbsp; $(&quot;#fileUploadError&quot;).addClass(&quot;hide&quot;);
&amp;nbsp; &amp;nbsp;
&amp;nbsp; &amp;nbsp; $.ajax({
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; url: &#39;/url/json/&#39;,
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; type: &#39;POST&#39;,
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xhr: function() {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var xhr = $.ajaxSettings.xhr();
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (xhr.upload) {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xhr.upload.addEventListener(&#39;progress&#39;, function(evt) {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var percent = (evt.loaded / evt.total) * 100;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $(&quot;#files&quot;).find(&quot;.progress-bar&quot;).width(percent + &quot;%&quot;);
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }, false);
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return xhr;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; },
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; success: function(data) {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $(&quot;#files&quot;).children().last().remove();
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $(&quot;#files&quot;).append($(&quot;#fileUploadItemTemplate&quot;).tmpl(data));
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $(&quot;#uploadFile&quot;).closest(&quot;form&quot;).trigger(&quot;reset&quot;);
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; },
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; error: function() {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $(&quot;#fileUploadError&quot;).removeClass(&quot;hide&quot;).text(&quot;An error occured!&quot;);
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $(&quot;#files&quot;).children().last().remove();
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $(&quot;#uploadFile&quot;).closest(&quot;form&quot;).trigger(&quot;reset&quot;);
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; },
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; data: formData,
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cache: false,
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; contentType: false,
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; processData: false
&amp;nbsp; &amp;nbsp; }, &#39;json&#39;);
});&lt;/pre&gt;
&lt;br /&gt;
When selecting a file for upload, a new AJAX request is performed. I use the FormData object to pass on the file to the backend as&amp;nbsp;multipart/form-data. By attaching an event handler to the progress event I can set the width of the progress bar to the calculated percentage.&lt;br /&gt;
&lt;br /&gt;
The error and success methods are simple handlers that hide the progress bar and either adds the file to the list on success or displays an error message on error.&lt;br /&gt;
&lt;br /&gt;
In this particular case I am using jQuery templating, but since that project is abandoned I would recommend chosing another template engine...</content><link rel='replies' type='application/atom+xml' href='http://victor.stodell.se/feeds/6875088784837358945/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://victor.stodell.se/2014/02/jquery-file-upload-with-bootstrap.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6499890790280411938/posts/default/6875088784837358945'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6499890790280411938/posts/default/6875088784837358945'/><link rel='alternate' type='text/html' href='http://victor.stodell.se/2014/02/jquery-file-upload-with-bootstrap.html' title='jQuery file upload with Bootstrap progress bar'/><author><name>Victor</name><uri>http://www.blogger.com/profile/11525593043576250274</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6499890790280411938.post-5252691266311294428</id><published>2014-02-17T13:37:00.000+01:00</published><updated>2014-02-17T13:43:28.134+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET"/><category scheme="http://www.blogger.com/atom/ns#" term="MEF"/><category scheme="http://www.blogger.com/atom/ns#" term="MVC"/><title type='text'>Using ASP.NET MVC with MEF</title><content type='html'>&lt;i&gt;I wrote this post almost a year ago, but never published it for some reason. Anyway, here is a little MVC/MEF magic.&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
By default a controller in &lt;a href=&quot;http://www.asp.net/mvc&quot; target=&quot;_blank&quot;&gt;MVC&lt;/a&gt; must have a parameterless constructor. When using &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/dd460648(v=vs.110).aspx&quot; target=&quot;_blank&quot;&gt;MEF&lt;/a&gt; a good practice is to inject the services via constructor parameters. These two in combination obviously creates an issue where the following scenario will not work out of the box, since there is no parameterless constructor for&amp;nbsp;&lt;a href=&quot;http://www.asp.net/mvc&quot; target=&quot;_blank&quot;&gt;MVC&lt;/a&gt;&amp;nbsp;to use.&lt;br /&gt;
&lt;br /&gt;
Note that the &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.componentmodel.composition.creationpolicy(v=vs.110).aspx&quot; target=&quot;_blank&quot;&gt;PartCreationPolicy&lt;/a&gt; is set to NonShared since a new controller have to be initialized for each request.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: csharp&quot;&gt;[Export]
[PartCreationPolicy(CreationPolicy.NonShared)]
public class HomeController : Controller
{
&amp;nbsp; &amp;nbsp; private readonly IServiceClient _service;

&amp;nbsp; &amp;nbsp; [ImportingConstructor]
&amp;nbsp; &amp;nbsp; public HomeController(IServiceClient service)
&amp;nbsp; &amp;nbsp; {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; _service = service;
&amp;nbsp; &amp;nbsp; }

&amp;nbsp; &amp;nbsp; public ActionResult Index()
&amp;nbsp; &amp;nbsp; {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return View();
&amp;nbsp; &amp;nbsp; }
}&lt;/pre&gt;
&lt;br /&gt;
For this scenario to work we need to override the default controller factory with a custom implementation. This class basically just gets initialized with our&amp;nbsp;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/dd460648(v=vs.110).aspx&quot; target=&quot;_blank&quot;&gt;MEF&lt;/a&gt;&amp;nbsp;container and the overridden GetControllerInstance uses this&amp;nbsp;container to get an appropriate controller for the current request.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: csharp&quot;&gt;public class MefControllerFactory : DefaultControllerFactory
{
&amp;nbsp; &amp;nbsp; private readonly CompositionContainer _compositionContainer;

&amp;nbsp; &amp;nbsp; public MefControllerFactory(CompositionContainer compositionContainer)
&amp;nbsp; &amp;nbsp; {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; _compositionContainer = compositionContainer;
&amp;nbsp; &amp;nbsp; }

&amp;nbsp; &amp;nbsp; protected override IController GetControllerInstance(RequestContext requestContext, Type controllerType)
&amp;nbsp; &amp;nbsp; {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var export = _compositionContainer.GetExports(controllerType, null, null).SingleOrDefault();

&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; IController result;

&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (export != null)
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; result = export.Value as IController;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; result = base.GetControllerInstance(requestContext, controllerType);
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; _compositionContainer.ComposeParts(result);
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }

&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return result;
&amp;nbsp; &amp;nbsp; }
}&lt;/pre&gt;
&lt;br /&gt;
The only thing left to do now is to tell&amp;nbsp;&lt;a href=&quot;http://www.asp.net/mvc&quot; target=&quot;_blank&quot;&gt;MVC&lt;/a&gt;&amp;nbsp;to use our custom controller factory with the &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.web.mvc.controllerbuilder.setcontrollerfactory(v=vs.118).aspx&quot; target=&quot;_blank&quot;&gt;SetControllerFactory&lt;/a&gt;&amp;nbsp;method in Global.asax with our container as an argument to the MefControllerFactory.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: csharp&quot;&gt;protected void Application_Start()
{
&amp;nbsp; &amp;nbsp; ControllerBuilder.Current.SetControllerFactory(new MefControllerFactory(_container));
}&lt;/pre&gt;
&lt;br /&gt;
When this is set up an empty constructor is no longer necessary in our controllers since&amp;nbsp;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/dd460648(v=vs.110).aspx&quot; target=&quot;_blank&quot;&gt;MEF&lt;/a&gt;&amp;nbsp;will be responsible&amp;nbsp;for instantiation of the controllers.</content><link rel='replies' type='application/atom+xml' href='http://victor.stodell.se/feeds/5252691266311294428/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://victor.stodell.se/2014/02/using-aspnet-mvc-with-mef.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6499890790280411938/posts/default/5252691266311294428'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6499890790280411938/posts/default/5252691266311294428'/><link rel='alternate' type='text/html' href='http://victor.stodell.se/2014/02/using-aspnet-mvc-with-mef.html' title='Using ASP.NET MVC with MEF'/><author><name>Victor</name><uri>http://www.blogger.com/profile/11525593043576250274</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6499890790280411938.post-5939432438216115475</id><published>2014-01-16T14:51:00.000+01:00</published><updated>2014-02-17T15:44:27.835+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="HTML"/><category scheme="http://www.blogger.com/atom/ns#" term="RichTextBox"/><category scheme="http://www.blogger.com/atom/ns#" term="WPF"/><category scheme="http://www.blogger.com/atom/ns#" term="XAML"/><title type='text'>Bindable RichTextBox with HTML conversion in WPF</title><content type='html'>In &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms754130(v=vs.110).aspx&quot; target=&quot;_blank&quot;&gt;WPF&lt;/a&gt;, the &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.windows.controls.richtextbox(v=vs.110).aspx&quot; target=&quot;_blank&quot;&gt;RichTextBox&lt;/a&gt;&amp;nbsp;control is not really like other controls. Due to its flexible nature, there is no built in way of binding a property to the content. In this case, I wanted a simple&amp;nbsp;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.windows.controls.richtextbox(v=vs.110).aspx&quot; target=&quot;_blank&quot;&gt;RichTextBox&lt;/a&gt;&amp;nbsp;control with a binding to an&amp;nbsp;HTML formatted string to be able to use the built-in formatting features of the&amp;nbsp;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.windows.controls.richtextbox(v=vs.110).aspx&quot; target=&quot;_blank&quot;&gt;RichTextBox&lt;/a&gt;&amp;nbsp;and allow users&amp;nbsp;to create simple HTML formatted content.&lt;br /&gt;
&lt;br /&gt;
First, doing the conversion on-the-fly proved to have major performance issues, so I ended up binding the content to a XAML string. The XAML to HTML conversion can be performed at any time.&lt;br /&gt;
&lt;br /&gt;
I created a UserControl with a bindable Text-property. The view contains a&amp;nbsp;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.windows.controls.richtextbox(v=vs.110).aspx&quot; target=&quot;_blank&quot;&gt;RichTextBox&lt;/a&gt;&amp;nbsp;control.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: xml&quot;&gt;&amp;lt;RichTextBox x:Name=&quot;richTextBox&quot; TextChanged=&quot;OnRichTextBoxChanged&quot;&amp;gt;&lt;/pre&gt;
&lt;br /&gt;
The source code for the user control contains the Text property and the methods to handle the binding.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: csharp&quot;&gt;public static readonly DependencyProperty TextProperty = DependencyProperty.Register(
    &quot;Text&quot;, typeof(string), typeof(TextEditor),
&amp;nbsp; &amp;nbsp; new FrameworkPropertyMetadata(string.Empty, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnTextPropertyChanged));

private static void OnTextPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
&amp;nbsp; &amp;nbsp; textEditor.richTextBox.Document = GetDocumentFromXaml((string) e.NewValue);
}

private void OnRichTextBoxChanged(object sender, TextChangedEventArgs e)
{
&amp;nbsp; &amp;nbsp; Text = GetXamlFromDocument(richTextBox.Document);
}

private static string GetXamlFromDocument(FlowDocument document)
{
&amp;nbsp; &amp;nbsp; return XamlWriter.Save(document);
}

private static FlowDocument GetDocumentFromXaml(string xaml)
{
&amp;nbsp; &amp;nbsp; if (string.IsNullOrEmpty(xaml))
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return new FlowDocument();

&amp;nbsp; &amp;nbsp; return (FlowDocument)XamlReader.Parse(xaml);
}&lt;/pre&gt;
&lt;br /&gt;
Putting this together as a custom control either derived from RichTextBox or just as a simple UserControl as above both works fine. I choose this method since I have exended the control to be more than just a bindable RichTextBox, so this made more sense.



When it comes to comverting the XAML to HTML, Microsoft have put together a &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/vstudio/aa972129(v=vs.90).aspx&quot; target=&quot;_blank&quot;&gt;sample library&lt;/a&gt; which does a great job. I haven&#39;t had to do any changes to their original code for my scenarios to work, but there might be scenarios where modification is necessary.
</content><link rel='replies' type='application/atom+xml' href='http://victor.stodell.se/feeds/5939432438216115475/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://victor.stodell.se/2014/01/bindable-richtextbox-with-html.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6499890790280411938/posts/default/5939432438216115475'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6499890790280411938/posts/default/5939432438216115475'/><link rel='alternate' type='text/html' href='http://victor.stodell.se/2014/01/bindable-richtextbox-with-html.html' title='Bindable RichTextBox with HTML conversion in WPF'/><author><name>Victor</name><uri>http://www.blogger.com/profile/11525593043576250274</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6499890790280411938.post-963376174282387480</id><published>2013-12-18T15:12:00.002+01:00</published><updated>2013-12-18T15:25:08.787+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Backbone"/><category scheme="http://www.blogger.com/atom/ns#" term="Bootstrap"/><category scheme="http://www.blogger.com/atom/ns#" term="JavaScript"/><category scheme="http://www.blogger.com/atom/ns#" term="jQuery"/><category scheme="http://www.blogger.com/atom/ns#" term="Parsley"/><category scheme="http://www.blogger.com/atom/ns#" term="Tooltip"/><title type='text'>Using Bootstrap Tooltip to show Parsley validation errors</title><content type='html'>I&#39;m currently working on a web application using a variety of different frameworks, such as &lt;a href=&quot;http://backbonejs.org/&quot; target=&quot;_blank&quot;&gt;Backbone&lt;/a&gt; for the back-end, &lt;a href=&quot;http://getbootstrap.com/&quot; target=&quot;_blank&quot;&gt;Bootstrap&lt;/a&gt; for the front-end and &lt;a href=&quot;http://parsleyjs.org/&quot; target=&quot;_blank&quot;&gt;Parsley&lt;/a&gt; for client side form validation.&amp;nbsp;&lt;a href=&quot;http://parsleyjs.org/&quot; target=&quot;_blank&quot;&gt;Parsley&lt;/a&gt; is a really powerful validation toolkit, but it takes some tweaking to make it blend with the &lt;a href=&quot;http://getbootstrap.com/&quot; target=&quot;_blank&quot;&gt;Bootstrap&lt;/a&gt; front-end. Fortunately this is a one time fix, which can be re-used all over our project.&lt;br /&gt;
&lt;br /&gt;
Since there will be some custom options in our&amp;nbsp;&lt;a href=&quot;http://parsleyjs.org/&quot; target=&quot;_blank&quot;&gt;Parsley&lt;/a&gt;&amp;nbsp;object, we can&#39;t use the default &lt;i&gt;parsley-validate&lt;/i&gt; attribute on the form. Instead we have to initialize the validation with the jQuery syntax:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: js&quot;&gt;$(&#39;#my-form&#39;).parsley(parsleyOptions);&lt;/pre&gt;
&lt;br /&gt;
The options are were the magic happens, and in our case we have a global options object that our forms use to get the same experience all over the application. Here&#39;s what it looks like:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: js&quot;&gt;var parsleyOptions = {
 &amp;nbsp;// Sets success and error class to Bootstrap class names
 &amp;nbsp;successClass: &#39;has-success&#39;,
 &amp;nbsp;errorClass: &#39;has-error&#39;,

 &amp;nbsp;// Bootsrap needs success/error class to be set on parent element
 &amp;nbsp;errors: {
  &amp;nbsp; classHandler: function(el) {
 &amp;nbsp; &amp;nbsp; &amp;nbsp;return el.parent();
&amp;nbsp; &amp;nbsp; },
&amp;nbsp; &amp;nbsp; // Set these to empty to make sure the default Parsley elements are not rendered
&amp;nbsp; &amp;nbsp; errorsWrapper: &#39;&#39;,
&amp;nbsp; &amp;nbsp; errorElem: &#39;&#39;
 &amp;nbsp;},
 &amp;nbsp;listeners: {
&amp;nbsp; &amp;nbsp; // Show a tooltip when a validation error occurs
&amp;nbsp; &amp;nbsp; onFieldError: function (elem, constraints, parsleyField) {
 &amp;nbsp; &amp;nbsp; &amp;nbsp;elem.tooltip({
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;animation: false,
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;container: &#39;body&#39;,
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;placement: &#39;top&#39;,
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;title: elem.data(&#39;error-message&#39;)
 &amp;nbsp; &amp;nbsp; &amp;nbsp;});
 &amp;nbsp; &amp;nbsp;},
 &amp;nbsp; &amp;nbsp;// Hide validation tooltip if field is validated
 &amp;nbsp; &amp;nbsp;onFieldSuccess: function(elem, constraints, parsleyField) {
 &amp;nbsp; &amp;nbsp; &amp;nbsp;elem.tooltip(&#39;destroy&#39;);
 &amp;nbsp; &amp;nbsp;}
&amp;nbsp; }
};
&lt;/pre&gt;
&lt;br /&gt;
There are, of course, some caveats with this approach. By default,&amp;nbsp;&lt;a href=&quot;http://parsleyjs.org/&quot; target=&quot;_blank&quot;&gt;Parsley&lt;/a&gt;&amp;nbsp;has a fallback to some default error&amp;nbsp;messages and multiple validation errors is normally shown if there are multiple errors. The approach above reguires the &lt;i&gt;data-error-message&lt;/i&gt; attribute on all validated fields and only one message for each field will be displayed.&lt;script type=&quot;text/javascript&quot;&gt;
  SyntaxHighlighter.highlight();
&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://victor.stodell.se/feeds/963376174282387480/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://victor.stodell.se/2013/12/using-bootstrap-tooltip-to-show-parsley.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6499890790280411938/posts/default/963376174282387480'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6499890790280411938/posts/default/963376174282387480'/><link rel='alternate' type='text/html' href='http://victor.stodell.se/2013/12/using-bootstrap-tooltip-to-show-parsley.html' title='Using Bootstrap Tooltip to show Parsley validation errors'/><author><name>Victor</name><uri>http://www.blogger.com/profile/11525593043576250274</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6499890790280411938.post-8467544426324140839</id><published>2013-08-26T14:42:00.001+02:00</published><updated>2013-12-18T11:54:37.132+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="IIS"/><category scheme="http://www.blogger.com/atom/ns#" term="MEF"/><category scheme="http://www.blogger.com/atom/ns#" term="WCF"/><title type='text'>Proper initialize/dispose with WCF and MEF</title><content type='html'>Initialization and disposing of services in a WCF application is a bit of a hassle to control when running on an IIS instance, since the application starts and stops every now and then based on server requests. It doesnt make it easier when using an IOC, as in our case MEF.&lt;br /&gt;
&lt;br /&gt;
To have total control of the startup and shutdown events we began with adding a service factory to all our WCF services.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: xml&quot;&gt;
&amp;lt;%@ ServiceHost Language=&quot;C#&quot; Debug=&quot;true&quot; Service=&quot;WcfService&quot; Factory=&quot;CustomServiceHostFactory&quot; %&amp;gt;
&lt;/pre&gt;
&lt;br /&gt;
When ever the application gets woke up by a request to any of the services, the service factory will be used to instantiate the service. This means we can add any logic to these methods to have full control of the WCF application initialization. Here is what a service factory class could look like. (Composition is a static class containing a reference to the MEF container)&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: csharp&quot;&gt;
public class CustomServiceHostFactory : ServiceHostFactory
{
    private static readonly object SynchronizationContext = new object();

    public CustomServiceHostFactory ()
    {
        ApplicationInitialize();
    }

    protected override ServiceHost CreateServiceHost(Type serviceType, Uri[] baseAddresses)
    {
        var serviceHost = base.CreateServiceHost(serviceType, baseAddresses);
        serviceHost.Opened += (s, a) =&amp;gt; ApplicationStarted();
        serviceHost.Closed += (s, a) =&amp;gt; ApplicationDispose();
        return serviceHost;
    }

    private void ApplicationInitialize()
    {
        if (Composition.Container != null) return;

        lock (SynchronizationContext)
        {
            if (Composition.Container == null)
            {
                // Initialize container
                Composition.Initialize();
            }
        }
    }

    private void ApplicationStarted()
    {
        // Do anything after application has been started
    }

    private void ApplicationDispose()
    {
        lock (SynchronizationContext)
        {
            if (Composition.Container != null)
                Composition.Dispose();
        }
    }
}
&lt;/pre&gt;
&lt;br /&gt;
Since there are more than one service running we have to make sure the factory is thread safe and only does the initialization and disposing once. You should also note the order in which the methods are executed. The initialization are done in the constructor, but if you want something done when initialization is completed you should use the ServiceHost.Opened event, which is accessible by overriding the CreateServiceHost method.
&lt;script type=&quot;text/javascript&quot;&gt;
 SyntaxHighlighter.highlight();
&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://victor.stodell.se/feeds/8467544426324140839/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://victor.stodell.se/2013/08/proper-initializedispose-with-wcf-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6499890790280411938/posts/default/8467544426324140839'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6499890790280411938/posts/default/8467544426324140839'/><link rel='alternate' type='text/html' href='http://victor.stodell.se/2013/08/proper-initializedispose-with-wcf-and.html' title='Proper initialize/dispose with WCF and MEF'/><author><name>Victor</name><uri>http://www.blogger.com/profile/11525593043576250274</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6499890790280411938.post-7860008027827826680</id><published>2013-08-08T12:45:00.000+02:00</published><updated>2013-12-18T12:04:30.330+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C# .NET"/><category scheme="http://www.blogger.com/atom/ns#" term="DataAnnotation"/><category scheme="http://www.blogger.com/atom/ns#" term="Validation"/><title type='text'>Custom DataAnnotation validation on multiple properties</title><content type='html'>There are a few cases where you want to be able to validate a property value based on the value of another property. As always there are a bunch of different solutions to this problem, but the cleanest way of doing so is to create a custom DataAnnotaion validation attribute.&lt;br /&gt;
&lt;br /&gt;
It is as easy as creating a class derived from ValidationAttribute and overriding the IsValid-method, but instead of the usual IsValid(object value) we will be overriding the IsValid(object value, ValidationContext validationContext) method.&lt;br /&gt;
&lt;br /&gt;
The ValidationContext contains information about the current object beeing validated and makes it possible to get the values of related properties. By including the related properties and values in our validation class constructor. All in all, it could look like this, even though the validation logic does not really make sense in a real world context it explains the idea pretty good.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: csharp&quot;&gt;
[AttributeUsage(AttributeTargets.Property)]
public class CustomValidationAttribute : ValidationAttribute
{
    public string PropertyName { get; private set; }

    public CustomValidationAttribute(string propertyName)
    {
        PropertyName = propertyName;
    }

    protected override ValidationResult IsValid(object value, ValidationContext validationContext)
    {
        if(validationContext == null)
            return null;

        var property = validationContext.ObjectType.GetProperty(PropertyName);
        if (property == null)
            return new ValidationResult(string.Format(CultureInfo.CurrentCulture, &quot;Unknown property &quot; + PropertyName));
            
        var propertyValue = property.GetValue(validationContext.ObjectInstance, null);
        if(string.IsNullOrWhiteSpace((string)propertyValue))
            return new ValidationResult(string.Format(CultureInfo.CurrentCulture, PropertyName + &quot; value is null&quot;));

        if (string.IsNullOrWhiteSpace((string)value))
            return new ValidationResult(ErrorMessage);

        return null;
    }
}
&lt;/pre&gt;
&lt;br /&gt;
When using the attribute we will simply atach it to the property with the related property name as an argument.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: csharp&quot;&gt;
[CustomValidation(&quot;FirstName&quot;, ErrorMessage = &quot;FirstName must not be null or empty&quot;)]
public string LastName { get; set; }
&lt;/pre&gt;
&lt;br /&gt;
Using this technique it is easy to create extremely flexible and advanced validation based on several property values on any object.
&lt;script type=&quot;text/javascript&quot;&gt;
 SyntaxHighlighter.highlight();
&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://victor.stodell.se/feeds/7860008027827826680/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://victor.stodell.se/2013/08/custom-dataannotation-validation-on.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6499890790280411938/posts/default/7860008027827826680'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6499890790280411938/posts/default/7860008027827826680'/><link rel='alternate' type='text/html' href='http://victor.stodell.se/2013/08/custom-dataannotation-validation-on.html' title='Custom DataAnnotation validation on multiple properties'/><author><name>Victor</name><uri>http://www.blogger.com/profile/11525593043576250274</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6499890790280411938.post-7872455675282696830</id><published>2012-07-03T21:21:00.001+02:00</published><updated>2013-12-18T12:40:53.579+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C# .NET"/><category scheme="http://www.blogger.com/atom/ns#" term="Development"/><category scheme="http://www.blogger.com/atom/ns#" term="MVVM"/><category scheme="http://www.blogger.com/atom/ns#" term="WPF"/><title type='text'>Binding Enum with DescriptionAttribute in WPF</title><content type='html'>Binding an enumeration to a ComboBox can be done in several ways. In most cases you don&#39;t want to display the value itself, but a more user friendly description. One common approach is to use the &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.componentmodel.descriptionattribute.aspx&quot;&gt;DescriptionAttribute&lt;/a&gt; on the Enum values to supply a description for each value.&amp;nbsp;&lt;span style=&quot;background-color: white;&quot;&gt;This is all possible in a very MVVM friendly way.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
First step is to add the&amp;nbsp;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.componentmodel.descriptionattribute.aspx&quot;&gt;DescriptionAttribute&lt;/a&gt;&amp;nbsp;to the values of the enumeration.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: csharp&quot;&gt;
public enum MyValues
{
    [Description(&quot;First value&quot;)]
    First,

    [Description(&quot;Second value&quot;)]
    Second
}
&lt;/pre&gt;
&lt;br /&gt;
To retrieve the description from the enum we use a simple extension method. This method returns the value of the DescriptionAttribute if it exists, otherwise the string representation of the enum value is returned.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: csharp&quot;&gt;
public static string GetDescription(this Enum value)
{
    var fieldInfo = value.GetType().GetField(value.ToString());
    var attribute = fieldInfo.GetCustomAttributes(typeof(DescriptionAttribute), false).FirstOrDefault() as DescriptionAttribute;

    return attribute != null ? attribute.Description : value.ToString();
}
&lt;/pre&gt;
&lt;br /&gt;
With this extension method it is really easy to write a generic enum description converter to use where ever an enum value is presented to the user. But the more interesting case is where we want to present the enumeration in a ComboBox or a similar control. To accomplish this you can use a &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.windows.markup.markupextension.aspx&quot;&gt;MarkupExtension&lt;/a&gt;. (Please note that this code is stripped from all type validation and such to be easier to read.)&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: csharp&quot;&gt;
public class EnumExtension : MarkupExtension
{
    private readonly Type _enumType;

    public EnumExtension(Type enumType)
    {
        _enumType = enumType;
    }

    public override object ProvideValue(IServiceProvider serviceProvider)
    {
        return (from object enumValue in Enum.GetValues(_enumType)
                select new EnumMember {Value = enumValue, Description = ((Enum)enumValue).GetDescription()}).ToArray();
    }

    public class EnumMember
    {
        public string Description { get; set; }
        public object Value { get; set; }
    }
}
&lt;/pre&gt;
&lt;br /&gt;
The&amp;nbsp;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.componentmodel.descriptionattribute.aspx&quot;&gt;DescriptionAttribute&lt;/a&gt;&amp;nbsp;together with these extensions gives us a really neat way of populating the values of an enum into a ComboBox.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: xml&quot;&gt;&amp;lt;ComboBox SelectedValue=&quot;{Binding MyValue}&quot;
          ItemsSource=&quot;{Binding Source={my:EnumExtension {x:Type MyValues}}}&quot;
          DisplayMemberPath=&quot;Description&quot; SelectedValuePath=&quot;Value&quot; /&amp;gt;
&lt;/pre&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
 SyntaxHighlighter.highlight();
&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://victor.stodell.se/feeds/7872455675282696830/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://victor.stodell.se/2012/07/binding-enum-with-descriptionattribute.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6499890790280411938/posts/default/7872455675282696830'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6499890790280411938/posts/default/7872455675282696830'/><link rel='alternate' type='text/html' href='http://victor.stodell.se/2012/07/binding-enum-with-descriptionattribute.html' title='Binding Enum with DescriptionAttribute in WPF'/><author><name>Victor</name><uri>http://www.blogger.com/profile/11525593043576250274</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6499890790280411938.post-1747824319592644396</id><published>2012-06-03T00:00:00.000+02:00</published><updated>2012-06-07T22:14:30.657+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="LEAP"/><category scheme="http://www.blogger.com/atom/ns#" term="Microsoft"/><category scheme="http://www.blogger.com/atom/ns#" term="Redmond"/><title type='text'>LEAP Sweden in Redmond</title><content type='html'>Well, there is not very much to say about the trip to Redmond, except that it was awesome! It has been a week filled with seminars and social activities in Microsoft Conference Center and closeby venues. We even paid a visit to The Flight Museum outside Seattle and actually got a private tour from Clemens Vasters, who knew surprisingly much about airplanes.&lt;br /&gt;
&lt;br /&gt;
Not only have I been able to meet other extremely talented developers and architects who participated in the LEAP program, I&#39;ve also had the chance to meet some of the most involved people at Microsoft and got to hear about the latest and hottest topics in IT today.&lt;br /&gt;
&lt;br /&gt;
The speakers included &lt;a href=&quot;http://research.microsoft.com/en-us/people/jhalleux/&quot;&gt;Jonathan de Halleux&lt;/a&gt;, Stuart Kwan, &lt;a href=&quot;http://weblogs.asp.net/scottgu/&quot;&gt;Scott Guthrie&lt;/a&gt;, &lt;a href=&quot;http://channel9.msdn.com/Events/Speakers/Miha-Kralj&quot;&gt;Miha Kralj&lt;/a&gt;, &lt;a href=&quot;http://vasters.com/clemensv/&quot;&gt;Clemens Vasters&lt;/a&gt;,&amp;nbsp;&lt;a href=&quot;http://twitter.com/#!/cihangirb&quot;&gt;Cihan Biyikoglu&lt;/a&gt;,&amp;nbsp;&lt;a href=&quot;http://channel9.msdn.com/Events/Speakers/Bryan-Agnetta&quot;&gt;Bryan Agnetta&lt;/a&gt; and more.&amp;nbsp;The topics were everything from theoretical architectural lectures to deep product previews and technical discussions. Overall it was a great schedule packed with so much information I almost don&#39;t know what to do with all of it.&lt;br /&gt;
&lt;br /&gt;
There will be announcements in the near future for some of the previews we got to see. For instance the new Azure improvements will be announced June 7th and as you might know we got the Release Preview of Windows 8 just a couple of days ago. There sure are a lot going on right now and I know I&#39;m going to stay alert to keep up!&lt;br /&gt;
&lt;br /&gt;
Here are some other interesting stuff that was mentioned during the seminars:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Myers-Briggs_Type_Indicator&quot;&gt;Meyers Briggs Type Indicator&lt;/a&gt;: &quot;A good architect should be at least N and T&quot; - Miha Kralj&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://research.microsoft.com/en-us/projects/pex/&quot;&gt;Pex&lt;/a&gt; is a Microsoft Research project which aims to automatically generate test suites with high code coverage tests.&amp;nbsp;&lt;a href=&quot;http://pex4fun.com/&quot;&gt;Pex4Fun&lt;/a&gt;&amp;nbsp;takes the Pex engine and makes it into a fun programming game.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://research.microsoft.com/en-us/projects/moles/&quot;&gt;Moles&lt;/a&gt; is a cool isolation framework which makes it possible to replace system methods with your own delegates, for instance replace DateTime.Now with a custom date. This framework will be included in .NET 4.5, named &lt;a href=&quot;http://research.microsoft.com/en-us/projects/moles/&quot;&gt;Fakes&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
I really hope that there will be a continuation of LEAP next year and I would recommend (almost) anyone to attend. I would also like to give a big handout to &lt;a href=&quot;http://bjorneriksen.blogspot.se/&quot;&gt;Björn Eriksen&lt;/a&gt; who made this arrangement possible, and did it really well!&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9wUAkyo8yEXMZd6pWYdgXJb6C4AJ9v-uWJhcgINVBXkjdDeFP3EX01HRbMEZpToQIlBmRTZ1O-g-6n86qDi6fX5l1Z4lDZSy-BZeHZ0X0FUV3bQUVN_TUMr7c_92cOd_9gqFPuOaR5eOd/s1600/415186_365107836871543_1511427741_o.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;424&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9wUAkyo8yEXMZd6pWYdgXJb6C4AJ9v-uWJhcgINVBXkjdDeFP3EX01HRbMEZpToQIlBmRTZ1O-g-6n86qDi6fX5l1Z4lDZSy-BZeHZ0X0FUV3bQUVN_TUMr7c_92cOd_9gqFPuOaR5eOd/s640/415186_365107836871543_1511427741_o.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://victor.stodell.se/feeds/1747824319592644396/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://victor.stodell.se/2012/06/leap-sweden-in-redmond.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6499890790280411938/posts/default/1747824319592644396'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6499890790280411938/posts/default/1747824319592644396'/><link rel='alternate' type='text/html' href='http://victor.stodell.se/2012/06/leap-sweden-in-redmond.html' title='LEAP Sweden in Redmond'/><author><name>Victor</name><uri>http://www.blogger.com/profile/11525593043576250274</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9wUAkyo8yEXMZd6pWYdgXJb6C4AJ9v-uWJhcgINVBXkjdDeFP3EX01HRbMEZpToQIlBmRTZ1O-g-6n86qDi6fX5l1Z4lDZSy-BZeHZ0X0FUV3bQUVN_TUMr7c_92cOd_9gqFPuOaR5eOd/s72-c/415186_365107836871543_1511427741_o.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6499890790280411938.post-434784577153532359</id><published>2012-05-03T18:30:00.000+02:00</published><updated>2012-05-03T22:25:25.246+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Citrix"/><category scheme="http://www.blogger.com/atom/ns#" term="LEAP"/><category scheme="http://www.blogger.com/atom/ns#" term="Microsoft"/><category scheme="http://www.blogger.com/atom/ns#" term="Programming"/><category scheme="http://www.blogger.com/atom/ns#" term="Redmond"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL Server"/><category scheme="http://www.blogger.com/atom/ns#" term="VMWare"/><category scheme="http://www.blogger.com/atom/ns#" term="Windows"/><category scheme="http://www.blogger.com/atom/ns#" term="Windows Server"/><title type='text'>LEAP Sweden - Windows 8 and Windows Server 2012</title><content type='html'>I am back home in the couch filled with enthusiasm from the last gathering of LEAP Sweden before the trip to Redmond in the end of May. Todays topic was the new versions of Windows (server and client) as well as the Business Intelligence product suite from Microsoft.&lt;br /&gt;
&lt;br /&gt;
The Business Intelligence suite basically is a really nice integration between products that already exist. With &lt;a href=&quot;http://www.microsoft.com/sqlserver/en/us/default.aspx&quot;&gt;SQL Server 2012&lt;/a&gt;, &lt;a href=&quot;http://sharepoint.microsoft.com/en-us/Pages/default.aspx&quot;&gt;SharePoint 2010&lt;/a&gt; and &lt;a href=&quot;http://office.microsoft.com/en-us/excel/&quot;&gt;Excel 2010&lt;/a&gt; tightly integrated Microsoft offers a really attractive package.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://itbloggen.se/cs/blogs/micke/&quot;&gt;Mikael Nyström&lt;/a&gt; showed off some of the new features in &lt;a href=&quot;http://www.microsoft.com/en-us/server-cloud/windows-server/v8-default.aspx&quot;&gt;Windows Server 2012&lt;/a&gt;. To say the least this is an impressive release. There is a heavy focus on virtualization, storage and terminal services which makes &lt;a href=&quot;http://www.microsoft.com/&quot;&gt;Microsoft&lt;/a&gt; a strong competitor against both &lt;a href=&quot;http://www.vmware.com/&quot;&gt;VMWare&lt;/a&gt; and &lt;a href=&quot;http://www.citrix.com/&quot;&gt;Citrix&lt;/a&gt; in the small to medium sized business segment. One of the coolest features has to be&amp;nbsp;conditional permissions.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.coderox.se/&quot;&gt;Johan Lindfors&lt;/a&gt; gave a demo on &lt;a href=&quot;http://msdn.microsoft.com/en-us/windows/apps&quot;&gt;Windows 8 development&lt;/a&gt;. He showed some samples of how easy it is to develop Metro style applications on the &lt;a href=&quot;http://en.wikipedia.org/wiki/Windows_Runtime&quot;&gt;WinRT&lt;/a&gt;. We have already seen some new cool features in &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/bb386063(v=vs.110).aspx&quot;&gt;Visual Studio 11&lt;/a&gt; and &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms171868(v=vs.110).aspx&quot;&gt;.NET 4.5&lt;/a&gt;, but the &lt;a href=&quot;http://msdn.microsoft.com/en-gb/vstudio/async.aspx&quot;&gt;new async features&lt;/a&gt;&amp;nbsp;coming sometime in the future (CTP currently available) is absolutely awesome! Especially the &lt;a href=&quot;http://blogs.msdn.com/b/pfxteam/archive/2012/04/12/10293335.aspx&quot;&gt;async/await keywords&lt;/a&gt;, which simply is an extremely clean way of dealing with asynchronous calls.&lt;br /&gt;
&lt;br /&gt;
At last we got a presentation from &lt;a href=&quot;http://chris.59north.com/&quot;&gt;Chris Klug&lt;/a&gt; who had prepared a neat cross framework demo built with the &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/gg597391.aspx&quot;&gt;Portable Class Libraries&lt;/a&gt;. This makes it quite simple to create a shared code base for Windows Phone 7, Windows 8, Silverlight and WPF.&lt;br /&gt;
&lt;br /&gt;
In about a month we will be heading to Redmond for the last three days of the Lead Enterprise Architect Program, which I am sure will be awesome!</content><link rel='replies' type='application/atom+xml' href='http://victor.stodell.se/feeds/434784577153532359/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://victor.stodell.se/2012/05/leap-sweden-windows-8-and-windows.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6499890790280411938/posts/default/434784577153532359'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6499890790280411938/posts/default/434784577153532359'/><link rel='alternate' type='text/html' href='http://victor.stodell.se/2012/05/leap-sweden-windows-8-and-windows.html' title='LEAP Sweden - Windows 8 and Windows Server 2012'/><author><name>Victor</name><uri>http://www.blogger.com/profile/11525593043576250274</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6499890790280411938.post-5840733825170218918</id><published>2012-04-19T21:34:00.001+02:00</published><updated>2013-12-18T14:23:04.398+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Certificate"/><category scheme="http://www.blogger.com/atom/ns#" term="SOAP"/><category scheme="http://www.blogger.com/atom/ns#" term="WCF"/><title type='text'>Connecting to SOAP service with certificate authentication</title><content type='html'>I have rarely worked with certificate based authentication, so when I got this neat little&amp;nbsp;SOAP service with certificate authentication in my hands I gladly accepted the challenge. All I got was the URL to the service with a certificate and the password. I also got an example written in PHP:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: php&quot;&gt;$client = new SoapClient(&quot;https://url.to.service/&quot;, array(
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &#39;local_cert&#39; =&amp;gt; &#39;client_certificate.pem&#39;, &#39;passphrase&#39; =&amp;gt; &#39;PASSPHRASE&#39;,
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &#39;cache_wsdl&#39; =&amp;gt; WSDL_CACHE_NONE
));&lt;/pre&gt;
&lt;br /&gt;
This of course looks very easy, but we all know that it&#39;s not really that easy if I want to use .NET and WCF. First of all the PEM-certificate cannot natively be used in .NET. Second of all I don&#39;t have the WSDL for the service. Here are the steps I had to go through to be able to successfully connect to the SOAP service.&lt;br /&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;Convert the certificate&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
The certificate I received was a PEM certificate which included both the private and public key. .NET does not natively support the PEM format, so I had to convert the certificate to a type that is usable in my application. For this purpose&amp;nbsp;I used &lt;a href=&quot;http://slproweb.com/products/Win32OpenSSL.html&quot;&gt;Win32OpenSSL&lt;/a&gt;&amp;nbsp;and the command is really straight forward:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: csharp&quot;&gt;openssl pkcs12 -export -in client_certificate.pem -out client_certificate.pfx&lt;/pre&gt;
&lt;br /&gt;
I was prompted for the current password and then prompted to enter a password for the new certificate. This results in a PFX certificate ready to use in .NET and that is compatible with the SOAP service.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;Connecting to the service&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
By installing the PFX-certificate in the certificate store on my computer I am able to connect to the service URL. This also means that I can use&amp;nbsp;the Add service reference Wizard in Visual Studio to generate the service client classes. However, I don&#39;t want to make the users install the certificate on their computers, but instead include the certificate in the application that will consume the service.&lt;br /&gt;
&lt;br /&gt;
Another issue is that the SSL-certificate is not issued by a trusted source. This means that a secure connection cannot be established. An ugly but surely effective hack is to override the ServerCertificateValidationCallback and simply returning true for all certificates on validation. &lt;i&gt;Note that this override is effective for the entire application!&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: csharp&quot;&gt;ServicePointManager.ServerCertificateValidationCallback = (sender, certificate, chain, errors) =&amp;gt; true;&lt;/pre&gt;
&lt;br /&gt;
When that little obstacle is overcome, it is actually a very straight path to connect to the service. First we will have to add the certificate to the solution and set it as Embedded Resource. The next step is to read the resource and add the certificate to the service binding.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: csharp&quot;&gt;var resource = typeof(MyService).Assembly.GetManifestResourceStream(&quot;client_certificate.pfx&quot;);
using(var stream = new MemoryStream())
{
&amp;nbsp; &amp;nbsp; resource.CopyTo(stream);
&amp;nbsp; &amp;nbsp; _certificate = new X509Certificate2(stream.ToArray(), &quot;PASSWORD&quot;);
}&lt;/pre&gt;
&lt;br /&gt;
When connecting all we need to do is create a BasicHttpBinding and setting the ClientCredentialType to Certificate. We also have to add the certificate to the ClientCertificate property on the service.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: csharp&quot;&gt;public void Connect()
{
&amp;nbsp; &amp;nbsp; var binding = new BasicHttpBinding(BasicHttpSecurityMode.Transport);
&amp;nbsp; &amp;nbsp; binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Certificate;

&amp;nbsp; &amp;nbsp; var endpointAddress = new EndpointAddress(&quot;https://url.to.service/&quot;);

&amp;nbsp; &amp;nbsp; _service = new ServiceClient(binding, endpointAddress);
&amp;nbsp; &amp;nbsp; _service.ClientCredentials.ClientCertificate.Certificate = _certificate;
&amp;nbsp; &amp;nbsp; _service.Open();
}&lt;/pre&gt;
&lt;br /&gt;
That is about everything that needs to be done. With the certificate added to the project and to the binding the authentication is handled with the certificate and the supplied password. The service works great on any computer without having to install the certificate or entering any credentials. Of course this is not the most secure solution out there, but it sure gets the job done!
&lt;script type=&quot;text/javascript&quot;&gt;
 SyntaxHighlighter.highlight();
&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://victor.stodell.se/feeds/5840733825170218918/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://victor.stodell.se/2012/04/connecting-to-soap-service-with.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6499890790280411938/posts/default/5840733825170218918'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6499890790280411938/posts/default/5840733825170218918'/><link rel='alternate' type='text/html' href='http://victor.stodell.se/2012/04/connecting-to-soap-service-with.html' title='Connecting to SOAP service with certificate authentication'/><author><name>Victor</name><uri>http://www.blogger.com/profile/11525593043576250274</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6499890790280411938.post-2702977760375935961</id><published>2012-03-23T10:34:00.001+01:00</published><updated>2013-12-18T14:18:15.021+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Development"/><category scheme="http://www.blogger.com/atom/ns#" term="MEF"/><category scheme="http://www.blogger.com/atom/ns#" term="Quartz.NET"/><title type='text'>Quartz.NET and MEF</title><content type='html'>I have been implementing a scheduler service for several different jobs on several difference schedules, which led me into using &lt;a href=&quot;http://quartznet.sourceforge.net/&quot;&gt;Quartz.NET&lt;/a&gt;. This is a really nice framework, but since we&#39;re using &lt;a href=&quot;http://mef.codeplex.com/&quot;&gt;MEF&lt;/a&gt; I ran into some issues.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://quartznet.sourceforge.net/&quot;&gt;Quartz.NET&lt;/a&gt;&amp;nbsp;basically consists of the scheduler engine which runs jobs implementing the IJob interface. The interface simply consists of an Execute method. I&amp;nbsp;export each job with the IJob interface using&amp;nbsp;&lt;a href=&quot;http://mef.codeplex.com/&quot;&gt;MEF&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: csharp&quot;&gt;
[Export(typeof(IJob))]
public class MyJob : IJob
{
    public void Execute(JobExecutionContext context)
    {
        ...
    }
}
&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
In my scheduler implementation the jobs are imported into an IEnumerable&amp;lt;IJob&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: csharp&quot;&gt;
[ImportMany(typeof(IJob))]
public IEnumerable&amp;lt;IJob&amp;gt; Jobs { get; set; }
&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
The initialization of the scheduled tasks is pretty straight forward. A standard scheduler factory is initialized which in turn gives us a scheduler instance. Each job that was imported by&amp;nbsp;&lt;a href=&quot;http://mef.codeplex.com/&quot;&gt;MEF&lt;/a&gt;&amp;nbsp;is then added to the scheduler, here with a simple 10 minute trigger just to make things easier.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: csharp&quot;&gt;
var factory = new StdSchedulerFactory();
var scheduler = factory.GetScheduler();
foreach (var job in Jobs)
{
&amp;nbsp; &amp;nbsp; var jobDetail = new JobDetail(&quot;Job name&quot;, job.GetType());
&amp;nbsp; &amp;nbsp; var trigger = TriggerUtils.MakeMinutelyTrigger(&quot;Trigger name&quot;, 10, SimpleTrigger.RepeatIndefinitely);
&amp;nbsp; &amp;nbsp; scheduler.ScheduleJob(jobDetail, trigger);
}
&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
That is about everything we need to get the jobs going.&amp;nbsp;The issue with&amp;nbsp;&lt;a href=&quot;http://mef.codeplex.com/&quot;&gt;MEF&lt;/a&gt;&amp;nbsp;however is that each time a job is triggered to run the scheduler creates a new instance of the job.&amp;nbsp;To prevent this behaviour we must create a custom implementation of the scheduler. The IJobFactory interface contains a NewJob method that is run each time a job is about to be run. We would like to return the same instance every time.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: csharp&quot;&gt;
public class MefJobFactory : IJobFactory
{
&amp;nbsp; &amp;nbsp; public IJob NewJob(TriggerFiredBundle bundle)
&amp;nbsp; &amp;nbsp; {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; try
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var jobs = Bootstrapper.Instance.Container.GetExports&amp;lt;IJob&amp;gt;();
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return jobs.First(job =&amp;gt; job.GetType() == bundle.JobDetail.JobType).Value;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; catch (Exception exception)
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; throw new SchedulerException(&quot;Problem instantiating class &quot; + bundle.JobDetail.JobType, exception);
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&amp;nbsp; &amp;nbsp; }
}
&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
There is one last thing to do to actually implement this custom job factory. Nothing in the code above needs to be changed. All we have to do is to add a few lines to the app.config to instruct&amp;nbsp;&lt;a href=&quot;http://quartznet.sourceforge.net/&quot;&gt;Quartz.NET&lt;/a&gt;&amp;nbsp;to use our custom implementation instead of the default.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: xml&quot;&gt;
&amp;lt;configuration&amp;gt;
&amp;nbsp; &amp;nbsp; &amp;lt;configSections&amp;gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;section name=&quot;quartz&quot; type=&quot;System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0,Culture=neutral, PublicKeyToken=b77a5c561934e089&quot; /&amp;gt;
&amp;nbsp; &amp;nbsp; &amp;lt;/configSections&amp;gt;
&amp;nbsp; &amp;nbsp; ...
&amp;nbsp; &amp;nbsp; &amp;lt;quartz&amp;gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;add key=&quot;quartz.scheduler.jobFactory.type&quot; value=&quot;MyScheduler.MefJobFactory,&amp;nbsp;MyScheduler&quot; /&amp;gt;
&amp;nbsp; &amp;nbsp; &amp;lt;/quartz&amp;gt;
&amp;lt;/configuration&amp;gt;
&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
And thats it! Instead of creating a new instance of the job on each run, my custom implementation is used to get the&amp;nbsp;&lt;a href=&quot;http://mef.codeplex.com/&quot;&gt;MEF&lt;/a&gt;&amp;nbsp;exported job.
&lt;script type=&quot;text/javascript&quot;&gt;
 SyntaxHighlighter.highlight();
&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://victor.stodell.se/feeds/2702977760375935961/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://victor.stodell.se/2012/03/quartznet-and-mef.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6499890790280411938/posts/default/2702977760375935961'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6499890790280411938/posts/default/2702977760375935961'/><link rel='alternate' type='text/html' href='http://victor.stodell.se/2012/03/quartznet-and-mef.html' title='Quartz.NET and MEF'/><author><name>Victor</name><uri>http://www.blogger.com/profile/11525593043576250274</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6499890790280411938.post-9100486444340287176</id><published>2012-03-08T19:30:00.000+01:00</published><updated>2012-03-10T14:15:27.207+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Identity"/><category scheme="http://www.blogger.com/atom/ns#" term="LEAP"/><category scheme="http://www.blogger.com/atom/ns#" term="Microsoft"/><title type='text'>LEAP Sweden - Identity &amp; Access Management</title><content type='html'>Today was the third day of the Swedish Lead Enterprise Architect Program at Microsoft in Kista. It has been a day filled with sessions on security and identity with a kind of unavoidable focus on federated identities in the cloud.&lt;br /&gt;
&lt;br /&gt;
Overall it has been an awesome day with seminars from &lt;a href=&quot;http://www.idmcrisis.com/&quot; target=&quot;_blank&quot;&gt;Henrik Nilsson&lt;/a&gt;, &lt;a href=&quot;http://geekswithblogs.net/barryoreilly/Default.aspx&quot; target=&quot;_blank&quot;&gt;Barry O&#39;Reilly&lt;/a&gt; and &lt;a href=&quot;http://molero.se/&quot; target=&quot;_blank&quot;&gt;Sergio Molero&lt;/a&gt; among others. A lot of Microsoft technologies was mentioned, &lt;a href=&quot;http://www.microsoft.com/en-us/server-cloud/forefront/identity-manager.aspx&quot; target=&quot;_blank&quot;&gt;Forefront Identity Manager&lt;/a&gt;, &lt;a href=&quot;http://technet.microsoft.com/en-us/library/adfs2(v=ws.10).aspx&quot; target=&quot;_blank&quot;&gt;Active Directory Federation Services 2.0&lt;/a&gt;, &lt;a href=&quot;http://www.microsoft.com/en-us/server-cloud/forefront/unified-access-gateway.aspx&quot; target=&quot;_blank&quot;&gt;Forefront Unified Access Gateway&lt;/a&gt;, &lt;a href=&quot;http://www.microsoft.com/en-us/server-cloud/windows-server/directaccess.aspx&quot; target=&quot;_blank&quot;&gt;Direct Access&lt;/a&gt;,&amp;nbsp;&lt;a href=&quot;http://msdn.microsoft.com/en-us/security/aa570351&quot; target=&quot;_blank&quot;&gt;Windows Identity Framework&lt;/a&gt; and of course&amp;nbsp;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/windowsazure/ee732536.aspx&quot; target=&quot;_blank&quot;&gt;Azure Access Control Service&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
Microsoft really has a great suite of applications regarding Identity &amp;amp; Access Management.&amp;nbsp;I just wish there was a project or two where I could utilize all of these amazing technologies. I have had a plan to add a login feature to the &lt;a href=&quot;http://cornball.cloudapp.net/&quot; target=&quot;_blank&quot;&gt;Cornball&lt;/a&gt; using federated identities, so that might happen in the near future.&lt;br /&gt;
&lt;br /&gt;
Besides, &lt;a href=&quot;http://bjorneriksen.blogspot.com/&quot; target=&quot;_blank&quot;&gt;Björn Eriksen&lt;/a&gt; provided a tip for all of us thursty for education. Microsoft have collected a wide range of white papers, videos and links into what they call&amp;nbsp;&lt;a href=&quot;http://www.microsoftvirtualacademy.com/&quot; target=&quot;_blank&quot;&gt;Microsoft Virtual Academy&lt;/a&gt;. Learn, explore and collect education points as you do it!&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiundI_T3Po-oxXfHhCzNxDNzu4ffIJaZvQx28NWDPgnOTJPmzKacMx5Vmc2gNkNR7jpze9S_UwpA2ygRyto8YRRmxjPt9F2qsWyU1GOvcCPBrkmebBL3p_Q1-AqrGkCanSyMIKcRTb3Dkm/s1600/LEAP2012.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;86&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiundI_T3Po-oxXfHhCzNxDNzu4ffIJaZvQx28NWDPgnOTJPmzKacMx5Vmc2gNkNR7jpze9S_UwpA2ygRyto8YRRmxjPt9F2qsWyU1GOvcCPBrkmebBL3p_Q1-AqrGkCanSyMIKcRTb3Dkm/s640/LEAP2012.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://victor.stodell.se/feeds/9100486444340287176/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://victor.stodell.se/2012/03/leap-sweden-identity-access-management.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6499890790280411938/posts/default/9100486444340287176'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6499890790280411938/posts/default/9100486444340287176'/><link rel='alternate' type='text/html' href='http://victor.stodell.se/2012/03/leap-sweden-identity-access-management.html' title='LEAP Sweden - Identity &amp; Access Management'/><author><name>Victor</name><uri>http://www.blogger.com/profile/11525593043576250274</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiundI_T3Po-oxXfHhCzNxDNzu4ffIJaZvQx28NWDPgnOTJPmzKacMx5Vmc2gNkNR7jpze9S_UwpA2ygRyto8YRRmxjPt9F2qsWyU1GOvcCPBrkmebBL3p_Q1-AqrGkCanSyMIKcRTb3Dkm/s72-c/LEAP2012.jpg" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6499890790280411938.post-1951942085738136569</id><published>2012-02-16T19:00:00.000+01:00</published><updated>2012-02-17T13:02:19.728+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Azure"/><category scheme="http://www.blogger.com/atom/ns#" term="LEAP"/><title type='text'>First gathering of LEAP Sweden 2012</title><content type='html'>I am back home in the couch after the second day on the first gathering of &lt;a href=&quot;http://victor.stodell.se/2012/01/microsoft-leap-sweden-2012.html&quot; target=&quot;_blank&quot;&gt;Microsoft LEAP Sweden 2012&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
It has been two days packed with lectures on architecture and cloud computing. Without giving away too much, here are some short notes from this first gathering:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;In software arcitecture, knowing your patterns and practices is always a good thing. The same goes for best practices. &lt;a href=&quot;http://en.wikipedia.org/wiki/SOLID_(object-oriented_design)&quot; target=&quot;_blank&quot;&gt;SOLID&lt;/a&gt; is not a new concept, but it bears repeating!&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li&gt;The future is all about &lt;a href=&quot;http://en.wikipedia.org/wiki/Bring_your_own_device&quot; target=&quot;_blank&quot;&gt;bring-you-own-device&lt;/a&gt;, the cloud in general and&amp;nbsp;&lt;a href=&quot;https://www.windowsazure.com/en-us/&quot; target=&quot;_blank&quot;&gt;Azure&lt;/a&gt;&amp;nbsp;in particular.&amp;nbsp;Also, the future is now!&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li&gt;The &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/windowsazure/hh545593.aspx&quot; target=&quot;_blank&quot;&gt;Windows Azure HPC Scheduler&lt;/a&gt; is awesome for high performance computing scenarios where an extra boost is needed. You gotta love the elastic cloud!&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li&gt;I will start working on a &lt;a href=&quot;http://www.rockpaperazure.com/&quot; target=&quot;_blank&quot;&gt;Rock Paper Azure&lt;/a&gt; bot this weekend and try to conquer the world.&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;br /&gt;
The speakers that shared this information with us were among others &lt;a href=&quot;http://blog.lowendahl.net/&quot; target=&quot;_blank&quot;&gt;Patrik Löwendahl&lt;/a&gt;,&amp;nbsp;&lt;a href=&quot;http://brianhprince.com/&quot; target=&quot;_blank&quot;&gt;Brian Prince&lt;/a&gt;&amp;nbsp;and of course&amp;nbsp;&lt;a href=&quot;http://bjorneriksen.blogspot.com/&quot; target=&quot;_blank&quot;&gt;Björn Eriksen&lt;/a&gt;&amp;nbsp;that is organizing all of this.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
I am already looking forward to the next gathering in march when the topic will be Identity &amp;amp; Access Management.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiundI_T3Po-oxXfHhCzNxDNzu4ffIJaZvQx28NWDPgnOTJPmzKacMx5Vmc2gNkNR7jpze9S_UwpA2ygRyto8YRRmxjPt9F2qsWyU1GOvcCPBrkmebBL3p_Q1-AqrGkCanSyMIKcRTb3Dkm/s1600/LEAP2012.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;84&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiundI_T3Po-oxXfHhCzNxDNzu4ffIJaZvQx28NWDPgnOTJPmzKacMx5Vmc2gNkNR7jpze9S_UwpA2ygRyto8YRRmxjPt9F2qsWyU1GOvcCPBrkmebBL3p_Q1-AqrGkCanSyMIKcRTb3Dkm/s640/LEAP2012.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://victor.stodell.se/feeds/1951942085738136569/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://victor.stodell.se/2012/02/first-gathering-of-leap-sweden-2012.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6499890790280411938/posts/default/1951942085738136569'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6499890790280411938/posts/default/1951942085738136569'/><link rel='alternate' type='text/html' href='http://victor.stodell.se/2012/02/first-gathering-of-leap-sweden-2012.html' title='First gathering of LEAP Sweden 2012'/><author><name>Victor</name><uri>http://www.blogger.com/profile/11525593043576250274</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiundI_T3Po-oxXfHhCzNxDNzu4ffIJaZvQx28NWDPgnOTJPmzKacMx5Vmc2gNkNR7jpze9S_UwpA2ygRyto8YRRmxjPt9F2qsWyU1GOvcCPBrkmebBL3p_Q1-AqrGkCanSyMIKcRTb3Dkm/s72-c/LEAP2012.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6499890790280411938.post-1769049272084946402</id><published>2012-02-07T10:19:00.000+01:00</published><updated>2013-12-18T14:23:53.583+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Binding"/><category scheme="http://www.blogger.com/atom/ns#" term="C# .NET"/><category scheme="http://www.blogger.com/atom/ns#" term="Development"/><category scheme="http://www.blogger.com/atom/ns#" term="HTML"/><category scheme="http://www.blogger.com/atom/ns#" term="WebBrowser"/><category scheme="http://www.blogger.com/atom/ns#" term="WPF"/><title type='text'>Binding a HTML-formatted string to a WPF WebBrowser control</title><content type='html'>Sometimes there is a need to display a HTML formatted string in a WPF application. There are a couple of ways to do this, but the most stright forward is to use a &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.windows.controls.webbrowser.aspx&quot; target=&quot;_blank&quot;&gt;WebBrowser&lt;/a&gt; control and the &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.windows.controls.webbrowser.navigatetostring.aspx&quot; target=&quot;_blank&quot;&gt;NavigateToString&lt;/a&gt; method.&lt;br /&gt;
&lt;br /&gt;
This approach has one big flaw, you cannot use binding to a string out of the box, but I found a great solution through &lt;a href=&quot;http://stackoverflow.com/questions/2585782/displaying-html-from-string-in-wpf-webbrowser-control&quot; target=&quot;_blank&quot;&gt;Stack Overflow&lt;/a&gt; which adds a bindable property to the&amp;nbsp;
&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.windows.controls.webbrowser.aspx&quot; target=&quot;_blank&quot;&gt;WebBrowser&lt;/a&gt;&amp;nbsp;control using&amp;nbsp;
&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.windows.controls.webbrowser.navigatetostring.aspx&quot; target=&quot;_blank&quot;&gt;NavigateToString&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
The following class is all that is needed to add that behavior. A new depencency property named Html is introduced to the&amp;nbsp;
&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.windows.controls.webbrowser.aspx&quot; target=&quot;_blank&quot;&gt;WebBrowser&lt;/a&gt;&amp;nbsp;and the proper change action is performed in the OnHtmlChanged method.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: csharp&quot;&gt;public class BrowserBehavior
{
    public static readonly DependencyProperty HtmlProperty = DependencyProperty.RegisterAttached(
        &quot;Html&quot;, typeof(string), typeof(BrowserBehavior), new FrameworkPropertyMetadata(OnHtmlChanged));

    [AttachedPropertyBrowsableForType(typeof(WebBrowser))]
    public static string GetHtml(WebBrowser browser)
    {
        return (string)browser.GetValue(HtmlProperty);
    }

    public static void SetHtml(WebBrowser browser, string value)
    {
        browser.SetValue(HtmlProperty, value);
    }

    static void OnHtmlChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e)
    {
        var browser = dependencyObject as WebBrowser;
        if (browser != null)
        {
            browser.NavigateToString(e.NewValue);
        }
    }
}&lt;/pre&gt;
&lt;br /&gt;
To bind this property the XAML looks like this:&lt;br /&gt;
&lt;pre class=&quot;brush: xml&quot;&gt;&amp;lt;WebBrowser local:BrowserBehavior.Html=&quot;{Binding Path=HtmlText}&quot;&amp;gt;&amp;lt;/WebBrowser&amp;gt;&lt;/pre&gt;
&lt;br /&gt;
Since we are printing some swedish characters the encoding got a little bit funky. This is nothing that the&amp;nbsp;
&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.windows.controls.webbrowser.aspx&quot; target=&quot;_blank&quot;&gt;WebBrowser&lt;/a&gt;&amp;nbsp;control itself affects, but it has to be set with an encoding meta tag in the HTML. So simply add the following meta tag to the head section of the HTML to be shown in the browser control:&lt;br /&gt;
&lt;pre class=&quot;brush: xml&quot;&gt;&amp;lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html;charset=UTF-8&quot; /&amp;gt;&lt;/pre&gt;
&lt;br /&gt;
Another thing that does not seem to be able to affect on the&amp;nbsp;
&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.windows.controls.webbrowser.aspx&quot; target=&quot;_blank&quot;&gt;WebBrowser&lt;/a&gt;&amp;nbsp;control is the context menu. The default context menu is the same as you would get in an Internet Explorer window. When using the&amp;nbsp;
&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.windows.controls.webbrowser.navigatetostring.aspx&quot; target=&quot;_blank&quot;&gt;NavigateToString&lt;/a&gt;&amp;nbsp;method to add the content the navigation in the browser control will not work. Hence we would like to hide the context menu. The easiest way to do so is with a litte javascript in the rendered HTML:&lt;br /&gt;
&lt;pre class=&quot;brush: xml&quot;&gt;&amp;lt;body oncontextmenu=&quot;return false;&quot;&amp;gt;&lt;/pre&gt;
&lt;br /&gt;
By adding these little hacks we have an easy way to show HTML content in a bindable fashion. Sure there are still some caveats to this solution, for instance an F5 keystroke will refresh the browser window. But we cannot use &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.windows.forms.webbrowser.webbrowsershortcutsenabled.aspx&quot; target=&quot;_blank&quot;&gt;WebBrowserShortcutsEnabled&lt;/a&gt; since we want the users to be able to copy text from the browser using the Ctrl-C shortcut.
&lt;script type=&quot;text/javascript&quot;&gt;
 SyntaxHighlighter.highlight();
&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://victor.stodell.se/feeds/1769049272084946402/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://victor.stodell.se/2012/02/binding-html-formatted-string-to-wpf.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6499890790280411938/posts/default/1769049272084946402'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6499890790280411938/posts/default/1769049272084946402'/><link rel='alternate' type='text/html' href='http://victor.stodell.se/2012/02/binding-html-formatted-string-to-wpf.html' title='Binding a HTML-formatted string to a WPF WebBrowser control'/><author><name>Victor</name><uri>http://www.blogger.com/profile/11525593043576250274</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6499890790280411938.post-6349250276400460639</id><published>2012-01-21T20:10:00.000+01:00</published><updated>2012-01-21T20:10:36.022+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Double Click"/><category scheme="http://www.blogger.com/atom/ns#" term="Silverlight"/><category scheme="http://www.blogger.com/atom/ns#" term="Sound Effects"/><category scheme="http://www.blogger.com/atom/ns#" term="The Cornball"/><title type='text'>New Silverlight 5 features in The Cornball</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJkmDrSW3bnD3gixzhF53qM0l-JMry3oz5G5xi8quP_xaKFXqvthX5K9WA1NPwLm1ukKQpsx7PiAuxpNxUBrP6P1266fSYpj8TcfS9YfMcNVPXd2QCFyaOz3GRmS_Od9eba_S40SIg9vwx/s1600/Microsoft_Silverlight_logo.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;200&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJkmDrSW3bnD3gixzhF53qM0l-JMry3oz5G5xi8quP_xaKFXqvthX5K9WA1NPwLm1ukKQpsx7PiAuxpNxUBrP6P1266fSYpj8TcfS9YfMcNVPXd2QCFyaOz3GRmS_Od9eba_S40SIg9vwx/s200/Microsoft_Silverlight_logo.png&quot; width=&quot;180&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
The release of &lt;a href=&quot;http://www.silverlight.net/learn/overview/what&#39;s-new-in-silverlight-5&quot; target=&quot;_blank&quot;&gt;Silverlight 5&lt;/a&gt; is allegedly the last major release of &lt;a href=&quot;http://www.silverlight.net/&quot; target=&quot;_blank&quot;&gt;Silverlight&lt;/a&gt;, but it brought some great stuff that I have now incorporated in the latest release of &lt;a href=&quot;http://cornball.cloudapp.net/&quot; target=&quot;_blank&quot;&gt;The Cornball&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
There are a lot of good descriptions and even video samples of the new features in&amp;nbsp;&lt;a href=&quot;http://www.silverlight.net/learn/overview/what&#39;s-new-in-silverlight-5&quot; target=&quot;_blank&quot;&gt;What&#39;s new in Silverlight 5&lt;/a&gt;. These are the two new features that I am using in &lt;a href=&quot;http://cornball.cloudapp.net/&quot; target=&quot;_blank&quot;&gt;The Cornball&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;Mouse Button Double Click&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
Previously I have used a custom implementation with a timer to capture double clicks on the cards. But since this feature finally is included in the framework I decided to use that instead. The &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.windows.input.mousebuttoneventargs(v=vs.95).aspx&quot; target=&quot;_blank&quot;&gt;MouseButtonEventArgs&lt;/a&gt; now has a &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.windows.input.mousebuttoneventargs.clickcount(v=vs.95).aspx&quot; target=&quot;_blank&quot;&gt;ClickCount&lt;/a&gt; property which simply indicates the number of times the mouse button was clicked. That leaves us with a much cleaner implementation of the single and double click scenario.&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;private void CardMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
    switch (e.ClickCount)
    {
    case 1:
        // Handle single click
        break;
    case 2:
        // Handle double click
        break;
    }
}&lt;/pre&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;Low-Latency Sound Effects&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
I have had plans to include sound effects before, but there haven&#39;t really been a good enough solution to do so. The MediaElement tag made it possible to play video and audio, but was never really meant to play sound effects in this matter. In Silverlight 5 a couple of classes from the XNA framework are included, SoundEffect and SoundEffectInstance.&lt;br /&gt;
&lt;br /&gt;
Instead of showing any of my code I would like to recommend the &lt;a href=&quot;http://www.silverlight.net/learn/overview/what&#39;s-new-in-silverlight-5/silverlight-5-low-latency-sound-effects&quot; target=&quot;_blank&quot;&gt;video sample&lt;/a&gt; by Pete Brown that displays these new features in a very good way.&lt;br /&gt;
&lt;br /&gt;
To see the results of what I accomplished, please visit &lt;a href=&quot;http://cornball.cloudapp.net/&quot; target=&quot;_blank&quot;&gt;The Cornball&lt;/a&gt; and try to beat the high score!</content><link rel='replies' type='application/atom+xml' href='http://victor.stodell.se/feeds/6349250276400460639/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://victor.stodell.se/2012/01/new-silverlight-5-features-in-cornball_21.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6499890790280411938/posts/default/6349250276400460639'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6499890790280411938/posts/default/6349250276400460639'/><link rel='alternate' type='text/html' href='http://victor.stodell.se/2012/01/new-silverlight-5-features-in-cornball_21.html' title='New Silverlight 5 features in The Cornball'/><author><name>Victor</name><uri>http://www.blogger.com/profile/11525593043576250274</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJkmDrSW3bnD3gixzhF53qM0l-JMry3oz5G5xi8quP_xaKFXqvthX5K9WA1NPwLm1ukKQpsx7PiAuxpNxUBrP6P1266fSYpj8TcfS9YfMcNVPXd2QCFyaOz3GRmS_Od9eba_S40SIg9vwx/s72-c/Microsoft_Silverlight_logo.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6499890790280411938.post-2607129077856205580</id><published>2012-01-18T09:30:00.002+01:00</published><updated>2012-01-25T16:32:02.951+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="LEAP"/><category scheme="http://www.blogger.com/atom/ns#" term="Microsoft"/><category scheme="http://www.blogger.com/atom/ns#" term="Redmond"/><title type='text'>Microsoft LEAP Sweden 2012</title><content type='html'>I have been privileged to participate in the&amp;nbsp;&lt;a href=&quot;http://bjorneriksen.blogspot.com/2011/12/leaplead-enterprise-architect-program.html&quot; target=&quot;_blank&quot;&gt;Lead Enterprise Architect Program&lt;/a&gt;&amp;nbsp;at Microsoft this spring.&lt;br /&gt;
&lt;blockquote&gt;
The Lead Enterprise Architect Program (LEAP) is a program that aims to give understanding of the strategic core components of the Microsoft platform.&lt;br /&gt;
&lt;br /&gt;
LEAP consists of five master class training sessions as well as three days of sessions at Microsoft headquarters in Redmond, Seattle.&lt;/blockquote&gt;
The direction of the classes are extremely appealing and I really hope that they will live up to my expectations:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Application architecture on the Microsoft Platform&lt;/li&gt;
&lt;li&gt;Cloud computing for Architects&lt;/li&gt;
&lt;li&gt;Identity &amp;amp; Access Management&lt;/li&gt;
&lt;li&gt;Integration on premises and in the cloud&lt;/li&gt;
&lt;li&gt;Business Intelligence and Enterprise Search&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;br /&gt;
The program starts in February and ends with the trip to Redmond in the end of May. During this time I will try to write as much as possible about this whole experience, which I hope will be amazing!&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiundI_T3Po-oxXfHhCzNxDNzu4ffIJaZvQx28NWDPgnOTJPmzKacMx5Vmc2gNkNR7jpze9S_UwpA2ygRyto8YRRmxjPt9F2qsWyU1GOvcCPBrkmebBL3p_Q1-AqrGkCanSyMIKcRTb3Dkm/s1600/LEAP2012.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;86&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiundI_T3Po-oxXfHhCzNxDNzu4ffIJaZvQx28NWDPgnOTJPmzKacMx5Vmc2gNkNR7jpze9S_UwpA2ygRyto8YRRmxjPt9F2qsWyU1GOvcCPBrkmebBL3p_Q1-AqrGkCanSyMIKcRTb3Dkm/s640/LEAP2012.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://victor.stodell.se/feeds/2607129077856205580/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://victor.stodell.se/2012/01/microsoft-leap-sweden-2012.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6499890790280411938/posts/default/2607129077856205580'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6499890790280411938/posts/default/2607129077856205580'/><link rel='alternate' type='text/html' href='http://victor.stodell.se/2012/01/microsoft-leap-sweden-2012.html' title='Microsoft LEAP Sweden 2012'/><author><name>Victor</name><uri>http://www.blogger.com/profile/11525593043576250274</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiundI_T3Po-oxXfHhCzNxDNzu4ffIJaZvQx28NWDPgnOTJPmzKacMx5Vmc2gNkNR7jpze9S_UwpA2ygRyto8YRRmxjPt9F2qsWyU1GOvcCPBrkmebBL3p_Q1-AqrGkCanSyMIKcRTb3Dkm/s72-c/LEAP2012.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6499890790280411938.post-6923369710718600676</id><published>2012-01-11T10:58:00.000+01:00</published><updated>2012-01-11T15:56:25.142+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Team Foundation Server"/><category scheme="http://www.blogger.com/atom/ns#" term="Team Foundation Services"/><category scheme="http://www.blogger.com/atom/ns#" term="The Cornball"/><category scheme="http://www.blogger.com/atom/ns#" term="Visual Studio"/><title type='text'>My experience with TFS Preview</title><content type='html'>I have been using the &lt;a href=&quot;http://www.tfspreview.com/&quot; target=&quot;_blank&quot;&gt;Team Foundation Services preview&lt;/a&gt; for a while now, and the least I can say is that I am impressed! The web interface has a nice &lt;a href=&quot;http://en.wikipedia.org/wiki/Metro_(design_language)&quot; target=&quot;_blank&quot;&gt;Metro style design&lt;/a&gt; and gives a high quality experience overall.&lt;br /&gt;
&lt;br /&gt;
By installing the &lt;a href=&quot;http://go.microsoft.com/fwlink/?LinkID=212065&quot;&gt;KB2581206&lt;/a&gt;&amp;nbsp;hotfix I can also access my TFS account from Visual Studio, which is absolutely fantastic. I might even sound a bit fanatic by saying that it is like a dream come true... The server appears as a traditional Team Foundation Server in Visual Studio apart from the logon process (a Windows Live popup window). &lt;a href=&quot;http://blogs.msdn.com/b/visualstudioalm/archive/2011/09/14/learning-about-team-foundation-service-preview.aspx&quot; target=&quot;_blank&quot;&gt;Read more&lt;/a&gt; and try it out yourself!&lt;br /&gt;
&lt;br /&gt;
Besides playing around with the user interface I have actually tried to work a little seriously with the service as well. Partly by uploading my project the Cornball and developing against the TFS in Visual Studio. So far this experience is very positive and I have not found any issues or oddities at all, except that the environment is kind of slow. This whole thing also takes me one step further out in the world of clouds. Particularly the Cornball, since hardly anything of that is left on my computer.&lt;br /&gt;
&lt;br /&gt;
Here is a snapshot of the start page in my Cornball project, which is very empty at the time...&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;img border=&quot;0&quot; height=&quot;392&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEioyp4ONfJY4d1P2RXp7RukXJ7XJBXlhishUqx52Kp7IxxNkHuVAFt8WyE9HYD7VcAvNrizSvKxPizaCr84TFUmClWQi0HB3cg4qqCrdq31dJJUTU-7ZkE_-zj0h9R2W5Yxo6WTkpPhZiFt/s640/tfscornball.PNG&quot; width=&quot;640&quot; /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://victor.stodell.se/feeds/6923369710718600676/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://victor.stodell.se/2012/01/my-experience-with-tfs-preview.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6499890790280411938/posts/default/6923369710718600676'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6499890790280411938/posts/default/6923369710718600676'/><link rel='alternate' type='text/html' href='http://victor.stodell.se/2012/01/my-experience-with-tfs-preview.html' title='My experience with TFS Preview'/><author><name>Victor</name><uri>http://www.blogger.com/profile/11525593043576250274</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEioyp4ONfJY4d1P2RXp7RukXJ7XJBXlhishUqx52Kp7IxxNkHuVAFt8WyE9HYD7VcAvNrizSvKxPizaCr84TFUmClWQi0HB3cg4qqCrdq31dJJUTU-7ZkE_-zj0h9R2W5Yxo6WTkpPhZiFt/s72-c/tfscornball.PNG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6499890790280411938.post-8381278639949580906</id><published>2012-01-03T18:02:00.000+01:00</published><updated>2012-01-18T10:21:18.369+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".NET"/><category scheme="http://www.blogger.com/atom/ns#" term="Google Search Appliance"/><category scheme="http://www.blogger.com/atom/ns#" term="Programming"/><title type='text'>Google Search Appliance .NET solution</title><content type='html'>I recently worked on a project to integrate the search results from a &lt;a href=&quot;http://www.google.se/enterprise/search/gsa.html&quot; target=&quot;_blank&quot;&gt;Google Search Appliance&lt;/a&gt; into a .NET application. Although it seems like a pretty straight forward task, there were some small issues that I thought I might share.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;Background&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
The communication with the Google Search Appliance is made simply with a HTTP GET request, which returns an XML formatted response. As for the Suggest service, the request looks about the same but the result returned is JSON encoded. For more information, please see the &lt;a href=&quot;http://code.google.com/apis/searchappliance/documentation/&quot; target=&quot;_blank&quot;&gt;Google Search Appliance documentation&lt;/a&gt;,&amp;nbsp;which is very extensive.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;Internationalization&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
Since this solution was to incorporate several languages, the .NET application had to support and differentiate the languages. The GSA has very good built-in language support but there were at least one thing that was not completely obvious.&lt;br /&gt;
&lt;br /&gt;
The GSA uses either HTTP headers or query string parameters to determine in which language the request is made. If neither of these are supplied the GSA may not return a correct response. This was the issue in our case, where we got unpredictable results in the spelling suggestions.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Summary: &lt;/b&gt;Always send an appropriate &lt;a href=&quot;http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.2&quot; target=&quot;_blank&quot;&gt;Accept-Charset&lt;/a&gt; and &lt;a href=&quot;http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.4&quot; target=&quot;_blank&quot;&gt;Accept-Language&lt;/a&gt; HTTP header.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;XPath or LINQ to Xml?&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
There is already a publicly available .NET library (&lt;a href=&quot;http://gsalib.codeplex.com/&quot; target=&quot;_blank&quot;&gt;GSALib&lt;/a&gt;) to communicate with the Google Search Appliance, but for several reasons I chose not to use that library and build our own customized library. Since all responses from the GSA is XML formatted a key element in the communication is the XML parsing.&lt;br /&gt;
&lt;br /&gt;
In .NET today there are basically two different choices, &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.xml.xpath.aspx&quot; target=&quot;_blank&quot;&gt;XPath&lt;/a&gt; or &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.xml.linq.aspx&quot; target=&quot;_blank&quot;&gt;LINQ to XML&lt;/a&gt;. In the decision making process there were two key features to consider, ease of use and performance. MSDN published an article on this subject,&amp;nbsp;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/bb675156.aspx&quot; target=&quot;_blank&quot;&gt;Comparison of XPath and LINQ to XML&lt;/a&gt;. The following blog even took their time to make a little performance test, &lt;a href=&quot;http://codehelp.smartdev.eu/2009/04/15/xpath-vs-linq-to-xml/&quot; target=&quot;_blank&quot;&gt;XPath vs LINQ to XML&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Summary&lt;/b&gt;: I chose LINQ to XML mostly because of its composition, which produces code that is easier to read and modify since we practically always read all elements in the XML file.</content><link rel='replies' type='application/atom+xml' href='http://victor.stodell.se/feeds/8381278639949580906/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://victor.stodell.se/2012/01/google-search-appliance-net-solution.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6499890790280411938/posts/default/8381278639949580906'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6499890790280411938/posts/default/8381278639949580906'/><link rel='alternate' type='text/html' href='http://victor.stodell.se/2012/01/google-search-appliance-net-solution.html' title='Google Search Appliance .NET solution'/><author><name>Victor</name><uri>http://www.blogger.com/profile/11525593043576250274</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6499890790280411938.post-8069355887970242856</id><published>2011-12-01T20:20:00.000+01:00</published><updated>2012-01-10T21:03:22.748+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Change"/><category scheme="http://www.blogger.com/atom/ns#" term="Connecta"/><category scheme="http://www.blogger.com/atom/ns#" term="Development"/><category scheme="http://www.blogger.com/atom/ns#" term="English"/><title type='text'>Changes in my life, and on my blog</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiU0JfwZSQxpNuMhpDAF8wHACduKyAk0h_RGXMd8cYpeE1Fpw723JbNUJGtEXfV_QAgWckINV6LSujEpDZ0Y8iWuGUH0kuo5hJQrBQdGolOudPgH08HKpGju4XNq5LGC3IDFEt0KLUrmEGB/s1600/changes.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;240&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiU0JfwZSQxpNuMhpDAF8wHACduKyAk0h_RGXMd8cYpeE1Fpw723JbNUJGtEXfV_QAgWckINV6LSujEpDZ0Y8iWuGUH0kuo5hJQrBQdGolOudPgH08HKpGju4XNq5LGC3IDFEt0KLUrmEGB/s320/changes.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
Yesterday I did my last working day at my previous employer and the next week I will begin my employment as a Microsoft consultant at&amp;nbsp;&lt;a href=&quot;http://www.connecta.se/&quot; target=&quot;_blank&quot;&gt;Connecta&lt;/a&gt;&amp;nbsp;in Stockholm. Of course this means that things will change, but only for the better I hope. Leaving a position that you like on a workplace that you like is a tough decision. But in my case there are some amazing possibilities and challenges that I just cannot turn down.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
The type of work I will be doing differs a bit from my previous position. I will be more focused on development, which also means that I will try to change the direction of this blog to be more development oriented. At the same time, I have come to realize that by blogging in Swedish I do not really contribute to the community as much as I could. Therefore I have chosen to translate my previous posts to English and continue to blog in English from now on.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Furthermore I have decided to focus more on my blog. I have some interesting projects ahead, both personal and professional, which mean that could I easily increase my blogging frequency. Because the more challenges I run into, the more I will have to write about. Hopefully this will all turn out well and if so, it will be a great 2012!&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://victor.stodell.se/feeds/8069355887970242856/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://victor.stodell.se/2011/12/changes-in-my-life-and-on-my-blog.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6499890790280411938/posts/default/8069355887970242856'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6499890790280411938/posts/default/8069355887970242856'/><link rel='alternate' type='text/html' href='http://victor.stodell.se/2011/12/changes-in-my-life-and-on-my-blog.html' title='Changes in my life, and on my blog'/><author><name>Victor</name><uri>http://www.blogger.com/profile/11525593043576250274</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiU0JfwZSQxpNuMhpDAF8wHACduKyAk0h_RGXMd8cYpeE1Fpw723JbNUJGtEXfV_QAgWckINV6LSujEpDZ0Y8iWuGUH0kuo5hJQrBQdGolOudPgH08HKpGju4XNq5LGC3IDFEt0KLUrmEGB/s72-c/changes.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6499890790280411938.post-7565906240433103231</id><published>2011-11-03T17:50:00.003+01:00</published><updated>2012-01-08T16:59:44.998+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Gmail"/><category scheme="http://www.blogger.com/atom/ns#" term="Google Apps"/><category scheme="http://www.blogger.com/atom/ns#" term="Google Plus"/><title type='text'>Google+ finally for everyone!</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;200&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj09HDlBelPamdYWNL3QUTn5ypchwzUl6EsCVaIUarcCHcPeDonXB5PpGpUmBJKEmS26o6btE0sq1Bg2pXalm7PEl9lX_3ve1Ktt1NROyUbFgWa4bOfgquFX-dKiAWoWlYcWH8FCotoKB7W/s200/google-plus.jpg&quot; width=&quot;200&quot; /&gt;&lt;/div&gt;There have been a lot of whining on Google from their Apps-users since the launch of&amp;nbsp;&lt;a href=&quot;http://plus.google.com/&quot; target=&quot;_blank&quot;&gt;Google+&lt;/a&gt;&amp;nbsp;for everyone with a regular Google-account. The Apps-users have not been able to use&amp;nbsp;&lt;a href=&quot;http://plus.google.com/&quot; target=&quot;_blank&quot;&gt;Google+&lt;/a&gt;, until now! (actually&amp;nbsp;&lt;a href=&quot;http://googleenterprise.blogspot.com/2011/10/google-is-now-available-with-google.html&quot; target=&quot;_blank&quot;&gt;october 27&lt;/a&gt;)&lt;br /&gt;
&lt;br /&gt;
As usual I am impressed with most of the things Google accomplishes, but now when all of their services have gotten a visual and functional touchup I am getting really impressed.&lt;br /&gt;
&lt;br /&gt;
As someone at an early stage pointed out it is really sweet of Google to play naive and let me fill in my profile information when I create my profile (as if Google did not already know), but after a few clicks I am on the go.&amp;nbsp;My albums from Picasa is automatically integrated and even the pictures I have uploaded to this blog is shown in&amp;nbsp;&lt;a href=&quot;http://plus.google.com/&quot; target=&quot;_blank&quot;&gt;Google+&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
But what happens next? Practically no one of my friends are on&amp;nbsp;&lt;a href=&quot;http://plus.google.com/&quot; target=&quot;_blank&quot;&gt;Google+&lt;/a&gt;&amp;nbsp;so what do I use it for? I guess we will see. Hopefully there will be even more integration between the social networks in the future. I am anyhow very satified with the fact that you now can find me on&amp;nbsp;&lt;a href=&quot;http://facebook.com/&quot; target=&quot;_blank&quot;&gt;Facebook&lt;/a&gt;, &lt;a href=&quot;http://linkedin.com/&quot; target=&quot;_blank&quot;&gt;LinkedIn&lt;/a&gt;, &lt;a href=&quot;http://twitter.com/&quot; target=&quot;_blank&quot;&gt;Twitter&lt;/a&gt;, &lt;a href=&quot;http://victor.stodell.se/&quot; target=&quot;_blank&quot;&gt;this blog&lt;/a&gt;&amp;nbsp;and now also&amp;nbsp;&lt;a href=&quot;http://plus.google.com/&quot; target=&quot;_blank&quot;&gt;Google+&lt;/a&gt;!</content><link rel='replies' type='application/atom+xml' href='http://victor.stodell.se/feeds/7565906240433103231/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://victor.stodell.se/2011/11/google-plus-antligen-for-alla.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6499890790280411938/posts/default/7565906240433103231'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6499890790280411938/posts/default/7565906240433103231'/><link rel='alternate' type='text/html' href='http://victor.stodell.se/2011/11/google-plus-antligen-for-alla.html' title='Google+ finally for everyone!'/><author><name>Victor</name><uri>http://www.blogger.com/profile/11525593043576250274</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj09HDlBelPamdYWNL3QUTn5ypchwzUl6EsCVaIUarcCHcPeDonXB5PpGpUmBJKEmS26o6btE0sq1Bg2pXalm7PEl9lX_3ve1Ktt1NROyUbFgWa4bOfgquFX-dKiAWoWlYcWH8FCotoKB7W/s72-c/google-plus.jpg" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6499890790280411938.post-2296842473157008886</id><published>2011-08-19T11:23:00.002+02:00</published><updated>2012-01-07T20:14:11.499+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Active Directory"/><category scheme="http://www.blogger.com/atom/ns#" term="Local Security Authority"/><category scheme="http://www.blogger.com/atom/ns#" term="Windows"/><title type='text'>User.Identity returns old login name after name change</title><content type='html'>When a person gets married or makes a name change for some other reason this usually means that the login name for the Active Directory-account changes as well. This is rarely a problem, but it turned out to cause some issues on our web server, where the&amp;nbsp;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.web.httpcontext.user.aspx&quot;&gt;User.Identity&lt;/a&gt;&amp;nbsp;property&amp;nbsp;was still returning the old login name.&lt;br /&gt;
&lt;br /&gt;
The user logged on with the new login name, but was identified by the web application as the old login name. The reason this occurs is because the&amp;nbsp;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.web.httpcontext.user.aspx&quot;&gt;User.Identity&lt;/a&gt;&amp;nbsp;property relies on the&amp;nbsp;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms721799(v=vs.85).aspx&quot;&gt;LsaLookupSids&lt;/a&gt;&amp;nbsp;method to convert the user SID to a login name. The method first calls the local&amp;nbsp;&lt;a href=&quot;http://technet.microsoft.com/en-us/library/cc961958.aspx&quot;&gt;LSA-cache&lt;/a&gt;, which is not synchronized with the Active Directory.&lt;br /&gt;
&lt;br /&gt;
For this purpose a simple reboot of the web server to clear the&amp;nbsp;&lt;a href=&quot;http://technet.microsoft.com/en-us/library/cc961958.aspx&quot;&gt;LSA-cache&lt;/a&gt;&amp;nbsp;propably would have sufficed. But since we didn&#39;t want to take the application offline rebooting was not an option. Instead, it is possible to set the registry value&amp;nbsp;&lt;a href=&quot;http://support.microsoft.com/kb/946358&quot;&gt;LsaLookupCacheMaxSize&lt;/a&gt; in HKLM\SYSTEM\CurrentControlSet\Control\Lsa. If this value is set to 0 the &lt;a href=&quot;http://technet.microsoft.com/en-us/library/cc961958.aspx&quot;&gt;LSA-cache&lt;/a&gt;&amp;nbsp;is cleared. It is recommended that the setting is reset after the cache is cleared, since the main purpose of the&amp;nbsp;&lt;a href=&quot;http://technet.microsoft.com/en-us/library/cc961958.aspx&quot;&gt;LSA-cache&lt;/a&gt;&amp;nbsp;is to enhance performance.&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
Read more about this issue and the solution here:&amp;nbsp;&lt;a href=&quot;http://support.microsoft.com/kb/946358&quot;&gt;http://support.microsoft.com/kb/946358&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://victor.stodell.se/feeds/2296842473157008886/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://victor.stodell.se/2011/08/systemsecurityprincipal-returnerar.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6499890790280411938/posts/default/2296842473157008886'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6499890790280411938/posts/default/2296842473157008886'/><link rel='alternate' type='text/html' href='http://victor.stodell.se/2011/08/systemsecurityprincipal-returnerar.html' title='User.Identity returns old login name after name change'/><author><name>Victor</name><uri>http://www.blogger.com/profile/11525593043576250274</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6499890790280411938.post-7966506394118322589</id><published>2011-08-11T14:28:00.003+02:00</published><updated>2012-01-08T16:13:33.797+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="DNS"/><category scheme="http://www.blogger.com/atom/ns#" term="EDNS0"/><category scheme="http://www.blogger.com/atom/ns#" term="Windows Server"/><title type='text'>Windows Server 2008 R2 DNS issues</title><content type='html'>This week we stumbled upon some weirdness in our new 2008 R2 DNS servers. A couple of URLs, for example www.smhi.se and www.stockholm.se could not be resolved from a 2008 R2 server. The existing 2003 servers with the same configuration worked perfectly.&lt;br /&gt;
&lt;br /&gt;
After thorough troubleshooting we found out that there is a new default setting in Windows Server 2008 R2 regarding the&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/EDNS0&quot;&gt;EDNS-protocol&lt;/a&gt;&amp;nbsp;that caused the issues. Not all of the DNS servers around the internet are able to handle&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/EDNS0&quot;&gt;EDNS&lt;/a&gt;, but in 2008 R2 this protocol is enabled by default. Normally you would think there is a fallback mechanism to standard DNS protocol if an EDNS request fails, but Windows Server does not have that.&lt;br /&gt;
&lt;br /&gt;
The solution was simply to disable EDNS by using the command: &lt;i&gt;dnscmd /config /EnableEDNSProbes 0&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
Scott Forsyth has written more about this issue and how he found the solution:&lt;br /&gt;
&lt;a href=&quot;http://weblogs.asp.net/owscott/archive/2009/09/15/windows-server-2008-r2-dns-issues.aspx&quot;&gt;http://weblogs.asp.net/owscott/archive/2009/09/15/windows-server-2008-r2-dns-issues.aspx&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://victor.stodell.se/feeds/7966506394118322589/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://victor.stodell.se/2011/08/dns-problem-i-windows-server-2008-r2.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6499890790280411938/posts/default/7966506394118322589'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6499890790280411938/posts/default/7966506394118322589'/><link rel='alternate' type='text/html' href='http://victor.stodell.se/2011/08/dns-problem-i-windows-server-2008-r2.html' title='Windows Server 2008 R2 DNS issues'/><author><name>Victor</name><uri>http://www.blogger.com/profile/11525593043576250274</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6499890790280411938.post-3170503845254293999</id><published>2011-08-03T11:28:00.000+02:00</published><updated>2012-01-10T22:08:56.220+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Exchange"/><category scheme="http://www.blogger.com/atom/ns#" term="Firewall"/><category scheme="http://www.blogger.com/atom/ns#" term="Remote Procedure Call"/><title type='text'>Configure static ports for Exchange</title><content type='html'>In a firewalled Exchange environment it is always easier if Exchange communicates on static ports. Normally RPC on port 135 is used to initialize the communication. Any further communication is made through a port dynamically selected by each service on the Exchange-server.&lt;br /&gt;
&lt;br /&gt;
I will not go deeper into how this is made, because it has been described very well in this blog:&lt;br /&gt;
&lt;a href=&quot;http://www.proexchange.be/blogs/exchange2007/archive/2009/05/18/configuring-static-ports-for-exchange-2007.aspx&quot;&gt;http://www.proexchange.be/blogs/exchange2007/archive/2009/05/18/configuring-static-ports-for-exchange-2007.aspx&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Except from the traditional bribes to the network guys, there were just a couple of registry settings on the Exchange-server and some of the clients to make everything work as a charm, even through the firewalls.</content><link rel='replies' type='application/atom+xml' href='http://victor.stodell.se/feeds/3170503845254293999/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://victor.stodell.se/2011/08/konfigurera-statiska-portar-for.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6499890790280411938/posts/default/3170503845254293999'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6499890790280411938/posts/default/3170503845254293999'/><link rel='alternate' type='text/html' href='http://victor.stodell.se/2011/08/konfigurera-statiska-portar-for.html' title='Configure static ports for Exchange'/><author><name>Victor</name><uri>http://www.blogger.com/profile/11525593043576250274</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6499890790280411938.post-4637681473179724732</id><published>2011-06-21T08:25:00.004+02:00</published><updated>2012-01-08T14:38:12.146+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Azure"/><category scheme="http://www.blogger.com/atom/ns#" term="Cloud"/><category scheme="http://www.blogger.com/atom/ns#" term="The Cornball"/><title type='text'>Moving to the cloud - part 4</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em; text-align: center;&quot;&gt;
&lt;a href=&quot;http://lantisen.stodell.se/&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;135&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgd4wslUOyABkZZAv28BiJFDX9dW8lA2Y2lVBOPN7DD6sULYcpLbPyxDwcrsyB0VZ9wZbQRCg81j9DE4zc-b2xpjGpRmxY4m24dse4gQIyfOwBskwRW4Cj7m2PZv4-2mwI6Ou2rGINx73l7/s320/lantisen.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
When e-mail, files and blog are already in the cloud the Cornball is the only application left on my hosting provider. It is now getting really exciting because there is no doubt that the Corball should move to the&amp;nbsp;Microsoft cloud, &lt;a href=&quot;http://www.microsoft.com/windowsazure/&quot;&gt;Windows Azure&lt;/a&gt;.&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
The Cornball&amp;nbsp;is a &lt;a href=&quot;http://www.silverlight.net/&quot;&gt;Silverlight&lt;/a&gt;&amp;nbsp;application which communicates through a&amp;nbsp;&lt;a href=&quot;http://msdn.microsoft.com/en-us/netframework/aa663324&quot;&gt;WCF&lt;/a&gt;&amp;nbsp;service with a&amp;nbsp;&lt;a href=&quot;http://www.mysql.com/&quot;&gt;MySQL&lt;/a&gt;&amp;nbsp;database, all on the same hosting provider. This is about to be converted into a&amp;nbsp;&lt;a href=&quot;http://www.silverlight.net/&quot;&gt;Silverlight&lt;/a&gt;&amp;nbsp;application which communicates through a&amp;nbsp;&lt;a href=&quot;http://msdn.microsoft.com/en-us/netframework/aa663324&quot;&gt;WCF&lt;/a&gt;&amp;nbsp;service on&amp;nbsp;&lt;a href=&quot;http://www.microsoft.com/windowsazure/&quot;&gt;Windows Azure&lt;/a&gt;&amp;nbsp;that in turn communicates with an &lt;a href=&quot;http://www.microsoft.com/windowsazure/sqlazure/&quot;&gt;SQL Azure&lt;/a&gt;&amp;nbsp;database.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;a href=&quot;http://www.microsoft.com/&quot;&gt;Microsoft&lt;/a&gt; have published a lot of information to&amp;nbsp;&lt;a href=&quot;http://www.microsoft.com/windowsazure/getstarted/&quot;&gt;get started with Windows Azure&lt;/a&gt;, but basically it is quite simple. After downloading the tools and SDK it is just to get on with the development. Through my MSDN subscription I have got some free Azure capacity so just by logging on to the &lt;a href=&quot;https://windows.azure.com/default.aspx&quot;&gt;Windows Azure portal&lt;/a&gt;&amp;nbsp;I am ready to configure my cloud.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrkcRNRAH-7EIMTdc74WOEV81IgBxB2eK4jAdzBakJY7NlApf6qoLnv30a7wYc3QKaD8FKdI7LdhUlF-V1Hvp5CTUDM1JFOMkc3tde77IxbGzst7uCFGtsWnqoi_VZ_mQFdI6fuOM15D-z/s1600/azure.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;305&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrkcRNRAH-7EIMTdc74WOEV81IgBxB2eK4jAdzBakJY7NlApf6qoLnv30a7wYc3QKaD8FKdI7LdhUlF-V1Hvp5CTUDM1JFOMkc3tde77IxbGzst7uCFGtsWnqoi_VZ_mQFdI6fuOM15D-z/s400/azure.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
The Windows Azure Management Portal is a Silverlight based user interface which is very easy to use an intuitive. There is a wide variety of settings and possibilities, but the things I needed for my application was to create a Data Store, a database and also a Hosted Service. Once these components were created I could easily set up a connection in Visual Studion which enabled me to Deploy my application directly to the cloud.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEji6EOciSH_4Bh_VfnoFnd2lQFFroY3vT3jO-UNW9DYqyoiANiClCtwByy_7ZLcNsszJg449xSkI1oE7eXt97C4R-dtd0HzdlB-RYhqHvcuvuS9LYH-xCBQwizR54LuyyYlky9lBNNiKHsS/s1600/sqlazure.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;291&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEji6EOciSH_4Bh_VfnoFnd2lQFFroY3vT3jO-UNW9DYqyoiANiClCtwByy_7ZLcNsszJg449xSkI1oE7eXt97C4R-dtd0HzdlB-RYhqHvcuvuS9LYH-xCBQwizR54LuyyYlky9lBNNiKHsS/s400/sqlazure.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;
SQL Azure has a Silverlight based user interface as well, and it works perfectly for my simple needs. I have only got two tables and a couple of stored procedures. There are some limitations in SQL Azure compared to SQL Server but since I was moving from a MySQL server that was nothing I really thought about.&lt;br /&gt;
&lt;br /&gt;
So, now I have moved e-mail, files, web sites and databases to the cloud and I could not be more happy! Everything has been running as clockwork and I have saved some money each year as well. I have also gained a lot of experience and set myself free from some worries.&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://victor.stodell.se/feeds/4637681473179724732/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://victor.stodell.se/2011/06/flytta-till-molnet-del-4.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6499890790280411938/posts/default/4637681473179724732'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6499890790280411938/posts/default/4637681473179724732'/><link rel='alternate' type='text/html' href='http://victor.stodell.se/2011/06/flytta-till-molnet-del-4.html' title='Moving to the cloud - part 4'/><author><name>Victor</name><uri>http://www.blogger.com/profile/11525593043576250274</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgd4wslUOyABkZZAv28BiJFDX9dW8lA2Y2lVBOPN7DD6sULYcpLbPyxDwcrsyB0VZ9wZbQRCg81j9DE4zc-b2xpjGpRmxY4m24dse4gQIyfOwBskwRW4Cj7m2PZv4-2mwI6Ou2rGINx73l7/s72-c/lantisen.png" height="72" width="72"/><thr:total>0</thr:total></entry></feed>