# HG changeset patch # User stevenh7776 # Date 1338127595 -3600 # Node ID 9eadccc3b46c5adbc8dbcd6e2ce1c1fc99aec6a9 # Parent d3380f4995759ee0200188b6575fb9f70e256d52 REST working, next step unit tests diff -r d3380f499575 -r 9eadccc3b46c SilverlightAsyncRestWcf/SilverlightAsyncRestWcf.Common/Car.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SilverlightAsyncRestWcf/SilverlightAsyncRestWcf.Common/Car.cs Sun May 27 15:06:35 2012 +0100 @@ -0,0 +1,10 @@ +namespace SilverlightAsyncRestWcf.Common +{ + public class Car + { + public int Id { get; set; } + public string Make { get; set; } + public string Model { get; set; } + public int Year { get; set; } + } +} diff -r d3380f499575 -r 9eadccc3b46c SilverlightAsyncRestWcf/SilverlightAsyncRestWcf.Common/Properties/AssemblyInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SilverlightAsyncRestWcf/SilverlightAsyncRestWcf.Common/Properties/AssemblyInfo.cs Sun May 27 15:06:35 2012 +0100 @@ -0,0 +1,30 @@ +using System.Resources; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("SilverlightAsyncRestWcf.Common")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("SilverlightAsyncRestWcf.Common")] +[assembly: AssemblyCopyright("Copyright © 2012")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] +[assembly: NeutralResourcesLanguage("en")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff -r d3380f499575 -r 9eadccc3b46c SilverlightAsyncRestWcf/SilverlightAsyncRestWcf.Common/SilverlightAsyncRestWcf.Common.csproj --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SilverlightAsyncRestWcf/SilverlightAsyncRestWcf.Common/SilverlightAsyncRestWcf.Common.csproj Sun May 27 15:06:35 2012 +0100 @@ -0,0 +1,50 @@ + + + + + 10.0 + Debug + AnyCPU + {072EF229-0478-4FB2-A4D8-AEB50AC6D6CD} + Library + Properties + SilverlightAsyncRestWcf.Common + SilverlightAsyncRestWcf.Common + v4.0 + Profile3 + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + \ No newline at end of file diff -r d3380f499575 -r 9eadccc3b46c SilverlightAsyncRestWcf/SilverlightAsyncRestWcf.Services/CarService.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SilverlightAsyncRestWcf/SilverlightAsyncRestWcf.Services/CarService.cs Sun May 27 15:06:35 2012 +0100 @@ -0,0 +1,56 @@ +using System; +using System.Diagnostics.Contracts; +using System.IO; +using System.Runtime.Serialization.Json; +using System.ServiceModel.Activation; +using System.ServiceModel.Web; +using SilverlightAsyncRestWcf.Common; + +namespace SilverlightAsyncRestWcf.Services +{ + [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)] + public class CarService : IService + { + private readonly IRepository _repo; + private readonly DataContractJsonSerializer _serializer; + + public CarService() + { + _repo = new FakeCarRepository(); + _serializer = new DataContractJsonSerializer(typeof(Car)); + } + + public CarService(IRepository repo) + { + _repo = repo; + } + + [WebGet(UriTemplate = "Car/{id}")] + public string Get(string id) + { + Contract.Requires((bool)(id != null), "id != null"); + return _repo.GetById(id).ToJSON(); + } + + [WebInvoke(UriTemplate = "Car", Method = "POST")] + public void Insert(Car car) + { + Contract.Requires((bool)(car != null), "car != null"); + _repo.Insert(car); + } + + [WebInvoke(UriTemplate = "Car/{id}", Method = "PUT")] + public void Update(string id, Car car) + { + Contract.Requires((bool)(car != null), "car != null"); + _repo.Update(car); + } + + [WebInvoke(UriTemplate = "Car({id})", Method = "DELETE")] + public void Delete(string id) + { + Contract.Requires((bool)(id != null), "id != null"); + _repo.Delete(id); + } + } +} diff -r d3380f499575 -r 9eadccc3b46c SilverlightAsyncRestWcf/SilverlightAsyncRestWcf.Services/FakeCarRepository.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SilverlightAsyncRestWcf/SilverlightAsyncRestWcf.Services/FakeCarRepository.cs Sun May 27 15:06:35 2012 +0100 @@ -0,0 +1,60 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using SilverlightAsyncRestWcf.Common; + +namespace SilverlightAsyncRestWcf.Services +{ + public class FakeCarRepository : IRepository + { + private readonly IList _data; + + public FakeCarRepository() + { + _data = new List + { + new Car() {Id = 1, Make = "Rolls Royce", Model = "Bentley", Year = 1996}, + new Car() {Id = 2, Make = "Ford", Model = "Fiesta", Year = 1996}, + new Car() {Id = 3, Make = "Mercedes", Model = "C Class", Year = 1996}, + new Car() {Id = 4, Make = "BMW", Model = "7 Series", Year = 1996}, + new Car() {Id = 5, Make = "Jaguar", Model = "XKS", Year = 1996}, + new Car() {Id = 6, Make = "Audi", Model = "R8", Year = 1996} + }; + } + + public Car GetById(string id) + { + int number; + return Int32.TryParse(id, out number) + ? _data.SingleOrDefault(c => c.Id == number) + : null; + } + + public IQueryable GetAll() + { + return _data.AsQueryable(); + } + + public void Insert(Car entity) + { + _data.Add(entity); + } + + public void Update(Car entity) + { + var lookup = GetById(entity.Id.ToString()); + if (lookup == null) throw new Exception("Car not found"); + + lookup.Make = entity.Make; + lookup.Model = entity.Model; + lookup.Year = entity.Year; + } + + public void Delete(string id) + { + var lookup = GetById(id); + if (lookup == null) throw new Exception("Car not found"); + _data.Remove(lookup); + } + } +} diff -r d3380f499575 -r 9eadccc3b46c SilverlightAsyncRestWcf/SilverlightAsyncRestWcf.Services/IRepository.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SilverlightAsyncRestWcf/SilverlightAsyncRestWcf.Services/IRepository.cs Sun May 27 15:06:35 2012 +0100 @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using SilverlightAsyncRestWcf.Common; + +namespace SilverlightAsyncRestWcf.Services +{ + public interface IRepository where T : class + { + T GetById(string id); + IQueryable GetAll(); + void Insert(T entity); + void Update(T entity); + void Delete(string id); + } + + public interface IRepository + { + object GetById(string id); + IQueryable GetAll(); + void Insert(object entity); + void Update(object entity); + void Delete(string id); + } +} diff -r d3380f499575 -r 9eadccc3b46c SilverlightAsyncRestWcf/SilverlightAsyncRestWcf.Services/IService.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SilverlightAsyncRestWcf/SilverlightAsyncRestWcf.Services/IService.cs Sun May 27 15:06:35 2012 +0100 @@ -0,0 +1,20 @@ +using System.ServiceModel; + +namespace SilverlightAsyncRestWcf.Services +{ + [ServiceContract] + interface IService + { + [OperationContract] + string Get(string id); + + [OperationContract] + void Insert(T entity); + + [OperationContract] + void Update(string id, T entity); + + [OperationContract] + void Delete(string id); + } +} diff -r d3380f499575 -r 9eadccc3b46c SilverlightAsyncRestWcf/SilverlightAsyncRestWcf.Services/JSONHelper.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SilverlightAsyncRestWcf/SilverlightAsyncRestWcf.Services/JSONHelper.cs Sun May 27 15:06:35 2012 +0100 @@ -0,0 +1,16 @@ +using System.Web.Script.Serialization; + +namespace SilverlightAsyncRestWcf.Services +{ + public static class JSONHelper + { + public static string ToJSON(this object obj) + { + // DataContractJsonSerializer can be used for tighter WCF integration + // ServiceStack and JSON.NET can be use to provide faster libraries + + var serializer = new JavaScriptSerializer(); + return serializer.Serialize(obj); + } + } +} diff -r d3380f499575 -r 9eadccc3b46c SilverlightAsyncRestWcf/SilverlightAsyncRestWcf.Services/Properties/AssemblyInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SilverlightAsyncRestWcf/SilverlightAsyncRestWcf.Services/Properties/AssemblyInfo.cs Sun May 27 15:06:35 2012 +0100 @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("SilverlightAsyncRestWcf.Services")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("SilverlightAsyncRestWcf.Services")] +[assembly: AssemblyCopyright("Copyright © 2012")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("359328d7-9545-46f5-9e62-d9b39a5db7c3")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff -r d3380f499575 -r 9eadccc3b46c SilverlightAsyncRestWcf/SilverlightAsyncRestWcf.Services/SilverlightAsyncRestWcf.Services.csproj --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SilverlightAsyncRestWcf/SilverlightAsyncRestWcf.Services/SilverlightAsyncRestWcf.Services.csproj Sun May 27 15:06:35 2012 +0100 @@ -0,0 +1,63 @@ + + + + Debug + AnyCPU + 8.0.30703 + 2.0 + {51FDF081-016A-4C35-BE5A-3224E9485749} + Library + Properties + SilverlightAsyncRestWcf.Services + SilverlightAsyncRestWcf.Services + v4.0 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + {072EF229-0478-4FB2-A4D8-AEB50AC6D6CD} + SilverlightAsyncRestWcf.Common + + + + + \ No newline at end of file diff -r d3380f499575 -r 9eadccc3b46c SilverlightAsyncRestWcf/SilverlightAsyncRestWcf.Web/Global.asax --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SilverlightAsyncRestWcf/SilverlightAsyncRestWcf.Web/Global.asax Sun May 27 15:06:35 2012 +0100 @@ -0,0 +1,1 @@ +<%@ Application Codebehind="Global.asax.cs" Inherits="SilverlightAsyncRestWcf.Web.Global" Language="C#" %> diff -r d3380f499575 -r 9eadccc3b46c SilverlightAsyncRestWcf/SilverlightAsyncRestWcf.Web/Global.asax.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SilverlightAsyncRestWcf/SilverlightAsyncRestWcf.Web/Global.asax.cs Sun May 27 15:06:35 2012 +0100 @@ -0,0 +1,16 @@ +using System; +using System.ServiceModel.Activation; +using System.Web; +using System.Web.Routing; +using SilverlightAsyncRestWcf.Services; + +namespace SilverlightAsyncRestWcf.Web +{ + public class Global : HttpApplication + { + protected void Application_Start(object sender, EventArgs e) + { + RouteTable.Routes.Add(new ServiceRoute("", new WebServiceHostFactory(), typeof(CarService))); + } + } +} \ No newline at end of file diff -r d3380f499575 -r 9eadccc3b46c SilverlightAsyncRestWcf/SilverlightAsyncRestWcf.Web/Properties/AssemblyInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SilverlightAsyncRestWcf/SilverlightAsyncRestWcf.Web/Properties/AssemblyInfo.cs Sun May 27 15:06:35 2012 +0100 @@ -0,0 +1,35 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("SilverlightAsyncRestWcf.Web")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("SilverlightAsyncRestWcf.Web")] +[assembly: AssemblyCopyright("Copyright © 2012")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("52832dd2-00ee-41a0-9a47-e89c71b5612f")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff -r d3380f499575 -r 9eadccc3b46c SilverlightAsyncRestWcf/SilverlightAsyncRestWcf.Web/Silverlight.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SilverlightAsyncRestWcf/SilverlightAsyncRestWcf.Web/Silverlight.js Sun May 27 15:06:35 2012 +0100 @@ -0,0 +1,2 @@ +//v2.0.30511.0 +if(!window.Silverlight)window.Silverlight={};Silverlight._silverlightCount=0;Silverlight.__onSilverlightInstalledCalled=false;Silverlight.fwlinkRoot="http://go2.microsoft.com/fwlink/?LinkID=";Silverlight.__installationEventFired=false;Silverlight.onGetSilverlight=null;Silverlight.onSilverlightInstalled=function(){window.location.reload(false)};Silverlight.isInstalled=function(b){if(b==undefined)b=null;var a=false,m=null;try{var i=null,j=false;if(window.ActiveXObject)try{i=new ActiveXObject("AgControl.AgControl");if(b===null)a=true;else if(i.IsVersionSupported(b))a=true;i=null}catch(l){j=true}else j=true;if(j){var k=navigator.plugins["Silverlight Plug-In"];if(k)if(b===null)a=true;else{var h=k.description;if(h==="1.0.30226.2")h="2.0.30226.2";var c=h.split(".");while(c.length>3)c.pop();while(c.length<4)c.push(0);var e=b.split(".");while(e.length>4)e.pop();var d,g,f=0;do{d=parseInt(e[f]);g=parseInt(c[f]);f++}while(f");delete a.id;delete a.width;delete a.height;for(var c in a)if(a[c])b.push('');b.push("");return b.join("")};Silverlight.createObjectEx=function(b){var a=b,c=Silverlight.createObject(a.source,a.parentElement,a.id,a.properties,a.events,a.initParams,a.context);if(a.parentElement==null)return c};Silverlight.buildPromptHTML=function(b){var a="",d=Silverlight.fwlinkRoot,c=b.version;if(b.alt)a=b.alt;else{if(!c)c="";a="Get Microsoft Silverlight";a=a.replace("{1}",c);a=a.replace("{2}",d+"108181")}return a};Silverlight.getSilverlight=function(e){if(Silverlight.onGetSilverlight)Silverlight.onGetSilverlight();var b="",a=String(e).split(".");if(a.length>1){var c=parseInt(a[0]);if(isNaN(c)||c<2)b="1.0";else b=a[0]+"."+a[1]}var d="";if(b.match(/^\d+\056\d+$/))d="&v="+b;Silverlight.followFWLink("149156"+d)};Silverlight.followFWLink=function(a){top.location=Silverlight.fwlinkRoot+String(a)};Silverlight.HtmlAttributeEncode=function(c){var a,b="";if(c==null)return null;for(var d=0;d96&&a<123||a>64&&a<91||a>43&&a<58&&a!=47||a==95)b=b+String.fromCharCode(a);else b=b+"&#"+a+";"}return b};Silverlight.default_error_handler=function(e,b){var d,c=b.ErrorType;d=b.ErrorCode;var a="\nSilverlight error message \n";a+="ErrorCode: "+d+"\n";a+="ErrorType: "+c+" \n";a+="Message: "+b.ErrorMessage+" \n";if(c=="ParserError"){a+="XamlFile: "+b.xamlFile+" \n";a+="Line: "+b.lineNumber+" \n";a+="Position: "+b.charPosition+" \n"}else if(c=="RuntimeError"){if(b.lineNumber!=0){a+="Line: "+b.lineNumber+" \n";a+="Position: "+b.charPosition+" \n"}a+="MethodName: "+b.methodName+" \n"}alert(a)};Silverlight.__cleanup=function(){for(var a=Silverlight._silverlightCount-1;a>=0;a--)window["__slEvent"+a]=null;Silverlight._silverlightCount=0;if(window.removeEventListener)window.removeEventListener("unload",Silverlight.__cleanup,false);else window.detachEvent("onunload",Silverlight.__cleanup)};Silverlight.__getHandlerName=function(b){var a="";if(typeof b=="string")a=b;else if(typeof b=="function"){if(Silverlight._silverlightCount==0)if(window.addEventListener)window.addEventListener("onunload",Silverlight.__cleanup,false);else window.attachEvent("onunload",Silverlight.__cleanup);var c=Silverlight._silverlightCount++;a="__slEvent"+c;window[a]=b}else a=null;return a};Silverlight.onRequiredVersionAvailable=function(){};Silverlight.onRestartRequired=function(){};Silverlight.onUpgradeRequired=function(){};Silverlight.onInstallRequired=function(){};Silverlight.IsVersionAvailableOnError=function(d,a){var b=false;try{if(a.ErrorCode==8001&&!Silverlight.__installationEventFired){Silverlight.onUpgradeRequired();Silverlight.__installationEventFired=true}else if(a.ErrorCode==8002&&!Silverlight.__installationEventFired){Silverlight.onRestartRequired();Silverlight.__installationEventFired=true}else if(a.ErrorCode==5014||a.ErrorCode==2106){if(Silverlight.__verifySilverlight2UpgradeSuccess(a.getHost()))b=true}else b=true}catch(c){}return b};Silverlight.IsVersionAvailableOnLoad=function(b){var a=false;try{if(Silverlight.__verifySilverlight2UpgradeSuccess(b.getHost()))a=true}catch(c){}return a};Silverlight.__verifySilverlight2UpgradeSuccess=function(d){var c=false,b="2.0.31005",a=null;try{if(d.IsVersionSupported(b+".99")){a=Silverlight.onRequiredVersionAvailable;c=true}else if(d.IsVersionSupported(b+".0"))a=Silverlight.onRestartRequired;else a=Silverlight.onUpgradeRequired;if(a&&!Silverlight.__installationEventFired){a();Silverlight.__installationEventFired=true}}catch(e){}return c} \ No newline at end of file diff -r d3380f499575 -r 9eadccc3b46c SilverlightAsyncRestWcf/SilverlightAsyncRestWcf.Web/SilverlightAsyncRestWcf.Web.csproj --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SilverlightAsyncRestWcf/SilverlightAsyncRestWcf.Web/SilverlightAsyncRestWcf.Web.csproj Sun May 27 15:06:35 2012 +0100 @@ -0,0 +1,111 @@ + + + + Debug + AnyCPU + + + 2.0 + {17E7255B-8A74-48BC-BC7E-DE137250A312} + {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} + Library + Properties + SilverlightAsyncRestWcf.Web + SilverlightAsyncRestWcf.Web + v4.0 + false + {1884E77A-06B8-4932-93A7-E49F8AE316FD}|..\SilverlightAsyncRestWcf\SilverlightAsyncRestWcf.csproj|ClientBin|False + + + true + full + false + bin\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Web.config + + + Web.config + + + + + Global.asax + + + + + + + {51FDF081-016A-4C35-BE5A-3224E9485749} + SilverlightAsyncRestWcf.Services + + + + + + + + + False + True + 5349 + / + + + False + False + + + False + + + + + + \ No newline at end of file diff -r d3380f499575 -r 9eadccc3b46c SilverlightAsyncRestWcf/SilverlightAsyncRestWcf.Web/Web.config --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SilverlightAsyncRestWcf/SilverlightAsyncRestWcf.Web/Web.config Sun May 27 15:06:35 2012 +0100 @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff -r d3380f499575 -r 9eadccc3b46c SilverlightAsyncRestWcf/SilverlightAsyncRestWcf.Web/index.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SilverlightAsyncRestWcf/SilverlightAsyncRestWcf.Web/index.html Sun May 27 15:06:35 2012 +0100 @@ -0,0 +1,73 @@ + + + + + SilverlightAsyncRestWcf + + + + + +
+
+ + + + + + + + Get Microsoft Silverlight + +
+
+ + diff -r d3380f499575 -r 9eadccc3b46c SilverlightAsyncRestWcf/SilverlightAsyncRestWcf.sln --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SilverlightAsyncRestWcf/SilverlightAsyncRestWcf.sln Sun May 27 15:06:35 2012 +0100 @@ -0,0 +1,38 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SilverlightAsyncRestWcf", "SilverlightAsyncRestWcf\SilverlightAsyncRestWcf.csproj", "{1884E77A-06B8-4932-93A7-E49F8AE316FD}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SilverlightAsyncRestWcf.Web", "SilverlightAsyncRestWcf.Web\SilverlightAsyncRestWcf.Web.csproj", "{17E7255B-8A74-48BC-BC7E-DE137250A312}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SilverlightAsyncRestWcf.Services", "SilverlightAsyncRestWcf.Services\SilverlightAsyncRestWcf.Services.csproj", "{51FDF081-016A-4C35-BE5A-3224E9485749}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SilverlightAsyncRestWcf.Common", "SilverlightAsyncRestWcf.Common\SilverlightAsyncRestWcf.Common.csproj", "{072EF229-0478-4FB2-A4D8-AEB50AC6D6CD}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {1884E77A-06B8-4932-93A7-E49F8AE316FD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1884E77A-06B8-4932-93A7-E49F8AE316FD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1884E77A-06B8-4932-93A7-E49F8AE316FD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1884E77A-06B8-4932-93A7-E49F8AE316FD}.Release|Any CPU.Build.0 = Release|Any CPU + {17E7255B-8A74-48BC-BC7E-DE137250A312}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {17E7255B-8A74-48BC-BC7E-DE137250A312}.Debug|Any CPU.Build.0 = Debug|Any CPU + {17E7255B-8A74-48BC-BC7E-DE137250A312}.Release|Any CPU.ActiveCfg = Release|Any CPU + {17E7255B-8A74-48BC-BC7E-DE137250A312}.Release|Any CPU.Build.0 = Release|Any CPU + {51FDF081-016A-4C35-BE5A-3224E9485749}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {51FDF081-016A-4C35-BE5A-3224E9485749}.Debug|Any CPU.Build.0 = Debug|Any CPU + {51FDF081-016A-4C35-BE5A-3224E9485749}.Release|Any CPU.ActiveCfg = Release|Any CPU + {51FDF081-016A-4C35-BE5A-3224E9485749}.Release|Any CPU.Build.0 = Release|Any CPU + {072EF229-0478-4FB2-A4D8-AEB50AC6D6CD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {072EF229-0478-4FB2-A4D8-AEB50AC6D6CD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {072EF229-0478-4FB2-A4D8-AEB50AC6D6CD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {072EF229-0478-4FB2-A4D8-AEB50AC6D6CD}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff -r d3380f499575 -r 9eadccc3b46c SilverlightAsyncRestWcf/SilverlightAsyncRestWcf.suo Binary file SilverlightAsyncRestWcf/SilverlightAsyncRestWcf.suo has changed diff -r d3380f499575 -r 9eadccc3b46c SilverlightAsyncRestWcf/SilverlightAsyncRestWcf/App.xaml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SilverlightAsyncRestWcf/SilverlightAsyncRestWcf/App.xaml Sun May 27 15:06:35 2012 +0100 @@ -0,0 +1,8 @@ + + + + + diff -r d3380f499575 -r 9eadccc3b46c SilverlightAsyncRestWcf/SilverlightAsyncRestWcf/App.xaml.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SilverlightAsyncRestWcf/SilverlightAsyncRestWcf/App.xaml.cs Sun May 27 15:06:35 2012 +0100 @@ -0,0 +1,68 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Animation; +using System.Windows.Shapes; + +namespace SilverlightAsyncRestWcf +{ + public partial class App : Application + { + + public App() + { + this.Startup += this.Application_Startup; + this.Exit += this.Application_Exit; + this.UnhandledException += this.Application_UnhandledException; + + InitializeComponent(); + } + + private void Application_Startup(object sender, StartupEventArgs e) + { + this.RootVisual = new MainPage(); + } + + private void Application_Exit(object sender, EventArgs e) + { + + } + + private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e) + { + // If the app is running outside of the debugger then report the exception using + // the browser's exception mechanism. On IE this will display it a yellow alert + // icon in the status bar and Firefox will display a script error. + if (!System.Diagnostics.Debugger.IsAttached) + { + + // NOTE: This will allow the application to continue running after an exception has been thrown + // but not handled. + // For production applications this error handling should be replaced with something that will + // report the error to the website and stop the application. + e.Handled = true; + Deployment.Current.Dispatcher.BeginInvoke(delegate { ReportErrorToDOM(e); }); + } + } + + private void ReportErrorToDOM(ApplicationUnhandledExceptionEventArgs e) + { + try + { + string errorMsg = e.ExceptionObject.Message + e.ExceptionObject.StackTrace; + errorMsg = errorMsg.Replace('"', '\'').Replace("\r\n", @"\n"); + + System.Windows.Browser.HtmlPage.Window.Eval("throw new Error(\"Unhandled Error in Silverlight Application " + errorMsg + "\");"); + } + catch (Exception) + { + } + } + } +} diff -r d3380f499575 -r 9eadccc3b46c SilverlightAsyncRestWcf/SilverlightAsyncRestWcf/MainPage.xaml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SilverlightAsyncRestWcf/SilverlightAsyncRestWcf/MainPage.xaml Sun May 27 15:06:35 2012 +0100 @@ -0,0 +1,12 @@ + + + + + + diff -r d3380f499575 -r 9eadccc3b46c SilverlightAsyncRestWcf/SilverlightAsyncRestWcf/MainPage.xaml.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SilverlightAsyncRestWcf/SilverlightAsyncRestWcf/MainPage.xaml.cs Sun May 27 15:06:35 2012 +0100 @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Animation; +using System.Windows.Shapes; + +namespace SilverlightAsyncRestWcf +{ + public partial class MainPage : UserControl + { + public MainPage() + { + InitializeComponent(); + } + } +} diff -r d3380f499575 -r 9eadccc3b46c SilverlightAsyncRestWcf/SilverlightAsyncRestWcf/Properties/AppManifest.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SilverlightAsyncRestWcf/SilverlightAsyncRestWcf/Properties/AppManifest.xml Sun May 27 15:06:35 2012 +0100 @@ -0,0 +1,6 @@ + + + + diff -r d3380f499575 -r 9eadccc3b46c SilverlightAsyncRestWcf/SilverlightAsyncRestWcf/Properties/AssemblyInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SilverlightAsyncRestWcf/SilverlightAsyncRestWcf/Properties/AssemblyInfo.cs Sun May 27 15:06:35 2012 +0100 @@ -0,0 +1,35 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("SilverlightAsyncRestWcf")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("SilverlightAsyncRestWcf")] +[assembly: AssemblyCopyright("Copyright © 2012")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("61868a30-bba4-4c55-af6a-e8233ebf7122")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff -r d3380f499575 -r 9eadccc3b46c SilverlightAsyncRestWcf/SilverlightAsyncRestWcf/SilverlightAsyncRestWcf.csproj --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SilverlightAsyncRestWcf/SilverlightAsyncRestWcf/SilverlightAsyncRestWcf.csproj Sun May 27 15:06:35 2012 +0100 @@ -0,0 +1,114 @@ + + + + Debug + AnyCPU + 8.0.50727 + 2.0 + {1884E77A-06B8-4932-93A7-E49F8AE316FD} + {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} + Library + Properties + SilverlightAsyncRestWcf + SilverlightAsyncRestWcf + Silverlight + v4.0 + $(TargetFrameworkVersion) + true + + + true + true + SilverlightAsyncRestWcf.xap + Properties\AppManifest.xml + SilverlightAsyncRestWcf.App + SilverlightAsyncRestWcfTestPage.html + true + true + false + Properties\OutOfBrowserSettings.xml + false + true + + + + + + v3.5 + + + true + full + false + Bin\Debug + DEBUG;TRACE;SILVERLIGHT + true + true + prompt + 4 + + + pdbonly + true + Bin\Release + TRACE;SILVERLIGHT + true + true + prompt + 4 + + + + + + + + + + + + + App.xaml + + + MainPage.xaml + + + + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + + + + + + {072EF229-0478-4FB2-A4D8-AEB50AC6D6CD} + SilverlightAsyncRestWcf.Common + + + + + + + + + + + + \ No newline at end of file