<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>:: { DeVigner } :: &#187; Featured</title>
	<atom:link href="http://blog.geomentary.com/index.php/category/featured/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.geomentary.com</link>
	<description>A journey into .NET development especially in Silverlight and WPF plus interest in Multitouch technologies...</description>
	<lastBuildDate>Sat, 03 Jul 2010 00:27:36 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Silverlight MultiEnvironment Deployment &#8211; Setup &amp; Configuration Technique</title>
		<link>http://blog.geomentary.com/index.php/2010/07/silverlight-multienvironment-deployment-setup-configuration-technique/</link>
		<comments>http://blog.geomentary.com/index.php/2010/07/silverlight-multienvironment-deployment-setup-configuration-technique/#comments</comments>
		<pubDate>Sat, 03 Jul 2010 00:05:27 +0000</pubDate>
		<dc:creator>Nasir Aziz</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[WCF]]></category>

		<guid isPermaLink="false">http://blog.geomentary.com/?p=223</guid>
		<description><![CDATA[<p>PROBLEM</p>
<p>Most of us who develop in Silverlight run into atleast one issue one time or another. We start a cool new &#8230;]]></description>
			<content:encoded><![CDATA[<p><strong>PROBLEM</strong></p>
<p>Most of us who develop in Silverlight run into atleast one issue <span id="more-223"></span>one time or another. We start a cool new project, write services, test them, they run &#8211; all good! Yay! Then we deploy to production or staging environment and excitement of showing off of our new cool Silverlight application fades away pretty quickly &#8211; the dreaded &#8220;Service Not Found&#8221; error or simply no response to service calls <img src='http://blog.geomentary.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />  Hello Fiddler!? Where did my services go?</p>
<p>The fix is usually pretty easy if we paid attention to <strong>ServiceReferences.Client.Config</strong> file and &#8220;fixed&#8221; or changed the EndPoint addresses to our services , but admit it we all have some level to A.D.D (Attention Deficit Disorder) and among other things we tend to forget this crucial part or change we must do before going live. To remedy this (yep &#8211; don&#8217;t have a production deployment check list) here is a little technique that I use to solve this problem:</p>
<p><strong>SOLUTION</strong></p>
<p>I typicaly write a Static Helper class, lets say DeploymentEndpoints</p>
<pre> public static class <strong>DeploymentEndpoints</strong>
 {
        internal static string URIPath
        {
            get
            {
                return
                     HtmlPage.Document.DocumentUri.AbsoluteUri.Substring(0,
                     HtmlPage.Document.DocumentUri.AbsoluteUri.LastIndexOf("/"));
            }
        }

        public static <strong>ServiceParams</strong> Service1Info
        {
            get
            {
                return
                     new <strong>ServiceParams</strong>("CustomBinding_Service1",
                            string.Format("{0}/Services/Service1.svc", URIPath));
            }
        }

        public static <strong>ServiceParams</strong> Service2Info
        {
            get
            {
                return new <strong>ServiceParams</strong>("CustomBinding_Service2",
                                 string.Format("{0}/Services/Service2.svc", URIPath));
            }
        }
 }</pre>
<p> And a <strong>ServiceParams</strong> class as:</p>
<pre>    public class ServiceParams
    {
        private string _binding;
        private string _endPointAddress;

        public ServiceParams(string binding, string endpointAddress)
        {
            _binding = binding;
            _endPointAddress = endpointAddress;
        }
        public string EndpointAddress
        {
            get { return _endPointAddress; }
            private set { _endPointAddress = value; }
        }
        public string BindingInfo
        {
            get { return _binding; }
            private set { _binding = value; }
        }
    }</pre>
<p>The <strong>CustomBinding_Service1</strong> and <strong>CustomBinding_Service2</strong> configurations in <strong>DeploymentEnpoints</strong> class are picked from the <strong>ServiceReferences.Client.Config</strong> file. If you have any special Bindings Configurations setup there, they will apply as usual.</p>
<p>Call the service from your app like this:</p>
<pre>        private void CallService1()
        {
            ServiceReference1.Service1Client service1Client =
                 new ServiceReference1.Service1Client
                                          (DeploymentEndpoints.Service1Info.BindingInfo,
                                          DeploymentEndpoints.Service1Info.EndpointAddress);
            service1Client.WhoAmICompleted += (s, e) =&gt;
            {
                if (e.Error == null)
                {
                    textBlock1.Text = e.Result;
                    service1Client = null;
                }
            };
            service1Client.WhoAmIAsync();
        }</pre>
<p>And thats it!</p>
<p>Anytime you add a new Service, make sure you include a new Static method (like: <strong>public static ServiceParams ServiceXXXInfo&#8230;</strong>) that points to your new service in the DeploymentEndpoints class, and that you have to do only once! After that you can deploy it to any environment without worrying about changing the endpoint configs at all in <strong>ServiceReferences.Client.Config</strong> file.</p>
<p>To test it out, change the Specific Port in your Web Projects &#8220;Web&#8221; Settings section and see how it takes effect seamlessly, or better yet deploy it somewhere else with a different domain name etc.</p>
<p>And here is a simple demo project code that shows it all: <a title="WCFDeployment.Web.Zip" href="http://blog.geomentary.com/SilverlightProjects/WCFDeployment.Web.Zip">WCFDeployment.Web.zip</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.geomentary.com/index.php/2010/07/silverlight-multienvironment-deployment-setup-configuration-technique/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Silverlight Timeline Control</title>
		<link>http://blog.geomentary.com/index.php/2009/11/silverlight-timeline-control/</link>
		<comments>http://blog.geomentary.com/index.php/2009/11/silverlight-timeline-control/#comments</comments>
		<pubDate>Wed, 25 Nov 2009 11:26:52 +0000</pubDate>
		<dc:creator>Nasir Aziz</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Control]]></category>
		<category><![CDATA[Timeline]]></category>

		<guid isPermaLink="false">http://blog.geomentary.com/?p=183</guid>
		<description><![CDATA[Last week I was working on Silverlight 3 project where I needed a Timeline Control. As usual I Googled and &#8230;]]></description>
			<content:encoded><![CDATA[<div id="silverlightControlHost">Last week I was working on Silverlight 3 project where I needed a Timeline Control. As usual I Googled and saw if there was any good useable FREE code out there that someone may already have worked on. After searching for half a day and trying at least one the results were disappointing. First not even close to what I was looking for and then the one I actually found close to my requirements turned out to be buggy and not very well put together. And then there were some overpriced control libraries &#8211; Yeah, no thanks.</div>
<p><div>The decision was clear, make my own. I knew it was a tall order but I did dive into it and churned one that I can use with a goal to keep it simple and customizable for anyone to use. I am attaching a project that uses this control library that you can <a href="http://blog.geomentary.com/SilverlightProjects/TimelineControl/Timeline.zip"><strong>DOWNLOAD</strong> </a>and mess with. I will eventually release the soure code too if there is some interest out there. In the meanwhile, check it out and see what you think. Yes I can improve this a lot but this will do for now.</div>
</p>
<p>
Below is a data of US States (in yellow) Union join dates and President tenures (in green)
</p>
<ul>
<li>Mouse wheel on bottom timeline will Zoom it In or Out</li>
<li>Grab the notch on Slider to expand or reduce the magnification size</li>
<li>Go Full Screen by clicking on top right corner. Especially if you want to try out MouseWheel without messing with the browser scroll (annoying)</li>
</ul>
<p>Download the sample app to try it out. I like suggestions or comments if you can spare any <img src='http://blog.geomentary.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />
</p>
<p><div>Cheers!</div>
</p>
<p><div id="silverlightControlHost">
        <object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="660" height="400"><param name="source" value="http://blog.geomentary.com/SilverlightProjects/TimelineControl/ClientBin/TimeLineTest.xap"/><param name="onError" value="onSilverlightError" /><param name="background" value="white" /><param name="minRuntimeVersion" value="3.0.40624.0" /><param name="autoUpgrade" value="true" /><a href="http://go.microsoft.com/fwlink/?LinkID=149156&#038;v=3.0.40624.0" style="text-decoration:none"><br />
 			  <img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style:none"/><br />
		  </a><br />
	    </object><iframe id="_sl_historyFrame" style="visibility:hidden;height:0px;width:0px;border:0px"></iframe></div>
<div><strong><a href="http://blog.geomentary.com/SilverlightProjects/TimelineControl/Timeline.zip">DOWNLOAD Project</a></strong></div></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.geomentary.com/index.php/2009/11/silverlight-timeline-control/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
