From 7d3ae84cfa0ca7b5553130b286cde2ac65cacb55 Mon Sep 17 00:00:00 2001 From: Peter Klavins Date: Wed, 10 Oct 2012 23:25:10 +0100 Subject: [PATCH] Port to Silverlight 3 on Visual Studio 2008. --- .gitignore | 4 ++ App.xaml | 8 ++++ App.xaml.cs | 57 ++++++++++++++++++++++++ BoardDisplay.cs | 20 ++++++--- BoardDisplay.xaml | 2 +- Default.html.js | 2 +- Marker.cs | 8 ++-- MarkerConflict.xaml | 2 +- MarkerSelection.xaml | 2 +- Page.xaml | 4 +- Page.xaml.cs | 78 ++++++++++++++++++--------------- Properties/AppManifest.xml | 7 +++ README.md | 10 +++++ Silverlight.js | 17 +------ SilverlightSudokuHelper.csproj | 49 ++++++++++++++------- Tada.wma | Bin 0 -> 31984 bytes WindowsCriticalStop.wma | Bin 0 -> 18514 bytes WindowsLogonSound.wma | Bin 0 -> 23004 bytes WindowsNavigationStart.wma | Bin 0 -> 9534 bytes 19 files changed, 190 insertions(+), 80 deletions(-) create mode 100644 .gitignore create mode 100644 App.xaml create mode 100644 App.xaml.cs create mode 100644 Properties/AppManifest.xml create mode 100644 README.md create mode 100644 Tada.wma create mode 100644 WindowsCriticalStop.wma create mode 100644 WindowsLogonSound.wma create mode 100644 WindowsNavigationStart.wma diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..293a4f7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +*.user +*.suo +ClientBin/ +obj/ diff --git a/App.xaml b/App.xaml new file mode 100644 index 0000000..4b0c8a4 --- /dev/null +++ b/App.xaml @@ -0,0 +1,8 @@ + + + + + diff --git a/App.xaml.cs b/App.xaml.cs new file mode 100644 index 0000000..304af67 --- /dev/null +++ b/App.xaml.cs @@ -0,0 +1,57 @@ +using System; +using System.Windows; + +namespace SilverlightSudokuHelper +{ + 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 Page(); + } + + 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 --git a/BoardDisplay.cs b/BoardDisplay.cs index f1fb608..2de46ad 100644 --- a/BoardDisplay.cs +++ b/BoardDisplay.cs @@ -1,16 +1,17 @@ -using System; +using System; using System.Windows; using System.Windows.Controls; +using System.Windows.Markup; using System.Windows.Media; using System.Windows.Media.Animation; using System.Windows.Shapes; namespace SilverlightSudokuHelper { - internal class BoardDisplay : Control + internal class BoardDisplay : UserControl { private const int MarkerMargin = 2; - private const string FontFamily = "Arial"; + private FontFamily FontFamily = new FontFamily("Arial"); private bool _candidatesVisible = true; private Canvas _root; @@ -30,7 +31,7 @@ internal class BoardDisplay : Control public BoardDisplay() { // Initialize from XAML and get references to child elements - _root = InitializeFromXaml(Utility.GetXamlResource("SilverlightSudokuHelper.BoardDisplay.xaml")) as Canvas; + _root = XamlReader.Load(Utility.GetXamlResource("SilverlightSudokuHelper.BoardDisplay.xaml")) as Canvas; _fadeStoryboard = _root.FindName("FadeStoryboard") as Storyboard; _fadeAnimation = _root.FindName("FadeAnimation") as DoubleAnimation; @@ -92,7 +93,10 @@ public BoardDisplay() } // Handle the Loaded event to do layout - Loaded += new EventHandler(HandleLoaded); + Loaded += new RoutedEventHandler(HandleLoaded); + + // Attach the constructed object to make it visible + Content = _root; } private void HandleLoaded(object sender, EventArgs e) @@ -103,6 +107,12 @@ private void HandleLoaded(object sender, EventArgs e) public void Layout() { + // Do nothing if Width is NaN + if (Double.IsNaN(Width)) + { + return; + } + // Resize the frame and lines to fill the control _frame.Width = Width; _frame.Height = Height; diff --git a/BoardDisplay.xaml b/BoardDisplay.xaml index 15a1894..b1aad90 100644 --- a/BoardDisplay.xaml +++ b/BoardDisplay.xaml @@ -1,4 +1,4 @@ - diff --git a/Default.html.js b/Default.html.js index 0544dc4..756422e 100644 --- a/Default.html.js +++ b/Default.html.js @@ -4,7 +4,7 @@ function createSilverlight() { Silverlight.createObjectEx({ - source: "Page.xaml", + source: "ClientBin/SilverlightSudokuHelper.xap", parentElement: document.getElementById("SilverlightControlHost"), id: "SilverlightControl", properties: { diff --git a/Marker.cs b/Marker.cs index 290428e..2177d40 100644 --- a/Marker.cs +++ b/Marker.cs @@ -1,10 +1,11 @@ -using System.Windows.Controls; +using System.Windows.Controls; +using System.Windows.Markup; using System.Windows.Media.Animation; using System.Windows.Shapes; namespace SilverlightSudokuHelper { - internal class Marker : Control + internal class Marker : UserControl { private Canvas _root; private Rectangle _background; @@ -14,10 +15,11 @@ internal class Marker : Control public Marker(string resourceName) { // Initialize from XAML and get references to child elements - _root = InitializeFromXaml(Utility.GetXamlResource(resourceName)) as Canvas; + _root = XamlReader.Load(Utility.GetXamlResource(resourceName)) as Canvas; _background = _root.FindName("Background") as Rectangle; _border = _root.FindName("Border") as Rectangle; _pulse = _root.FindName("Pulse") as Storyboard; // May fail + Content = _root; } public void Layout() diff --git a/MarkerConflict.xaml b/MarkerConflict.xaml index b10a4d9..c467afb 100644 --- a/MarkerConflict.xaml +++ b/MarkerConflict.xaml @@ -1,4 +1,4 @@ - diff --git a/Page.xaml.cs b/Page.xaml.cs index a805abe..0c980f5 100644 --- a/Page.xaml.cs +++ b/Page.xaml.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Windows; using System.Windows.Browser; using System.Windows.Controls; @@ -59,12 +59,18 @@ private enum SoundEffect { New, Move, Conflict, Complete }; // _fadingBoardDisplay renders the previous board and fades away when changes are made private BoardDisplay _fadingBoardDisplay; private double _defaultVolume; + private Content BrowserHost; + + public Page() + { + InitializeComponent(); + } public void Page_Loaded(object o, EventArgs e) { // Initialize variables - InitializeComponent(); _defaultVolume = mediaElement.Volume; + BrowserHost = App.Current.Host.Content; // Initialize UI _primaryBoardDisplay = new BoardDisplay(); @@ -73,9 +79,9 @@ public void Page_Loaded(object o, EventArgs e) Children.Add(_fadingBoardDisplay); // Initialize handlers - KeyUp += new KeyboardEventHandler(HandleKeyUp); - MouseLeftButtonDown += new MouseEventHandler(HandleMouseLeftButtonDown); - BrowserHost.Resize += new EventHandler(HandleResize); + KeyUp += new KeyEventHandler(HandleKeyUp); + MouseLeftButtonDown += new MouseButtonEventHandler(HandleMouseLeftButtonDown); + BrowserHost.Resized += new EventHandler(HandleResize); // Create the starting board, play the "new" sound, and fade it in _primaryBoardDisplay.Board = Board.FromString(BoardWikipediaSample); @@ -83,30 +89,30 @@ public void Page_Loaded(object o, EventArgs e) _fadingBoardDisplay.Fade(FadeSecondsLoading); } - private void HandleKeyUp(object sender, KeyboardEventArgs e) + private void HandleKeyUp(object sender, KeyEventArgs e) { switch (e.Key) { - case 8: // Escape + case Key.Escape: // Escape _primaryBoardDisplay.Solve(); break; - case 14: // Left arrow - case 15: // Up arrow - case 16: // Right arrow - case 17: // Down arrow + case Key.Left: // Left arrow + case Key.Up: // Up arrow + case Key.Right: // Right arrow + case Key.Down: // Down arrow // Move the marker var markerPosition = _primaryBoardDisplay.MarkerPosition; switch (e.Key) { - case 14: markerPosition.X--; break; - case 15: markerPosition.Y--; break; - case 16: markerPosition.X++; break; - case 17: markerPosition.Y++; break; + case Key.Left: markerPosition.X--; break; + case Key.Up: markerPosition.Y--; break; + case Key.Right: markerPosition.X++; break; + case Key.Down: markerPosition.Y++; break; } _primaryBoardDisplay.MarkerPosition = markerPosition; _fadingBoardDisplay.MarkerPosition = markerPosition; break; - case 19: // Delete + case Key.Delete: // Delete // Clear the cell's value PrepareFade(); if (_primaryBoardDisplay.ChangeSelectedValue(Digit.Unknown, Digit.Kind.Normal)) @@ -116,18 +122,18 @@ private void HandleKeyUp(object sender, KeyboardEventArgs e) _fadingBoardDisplay.Fade(FadeSecondsNormal); } break; - case 21: // 1 - case 22: // 2 - case 23: // 3 - case 24: // 4 - case 25: // 5 - case 26: // 6 - case 27: // 7 - case 28: // 8 - case 29: // 9 + case Key.D1: // 1 + case Key.D2: // 2 + case Key.D3: // 3 + case Key.D4: // 4 + case Key.D5: // 5 + case Key.D6: // 6 + case Key.D7: // 7 + case Key.D8: // 8 + case Key.D9: // 9 // Set the cell's value PrepareFade(); - if (_primaryBoardDisplay.ChangeSelectedValue(e.Key - 20, (e.Shift ? Digit.Kind.Given : (e.Ctrl ? Digit.Kind.Guess : Digit.Kind.Normal)))) + if (_primaryBoardDisplay.ChangeSelectedValue(e.Key - Key.D0, ((Keyboard.Modifiers & ModifierKeys.Shift) == ModifierKeys.Shift ? Digit.Kind.Given : ((Keyboard.Modifiers & ModifierKeys.Control) == ModifierKeys.Control ? Digit.Kind.Guess : Digit.Kind.Normal)))) { // Normal move; play the appropriate sound and fade it PlaySoundEffect(_primaryBoardDisplay.Board.Complete ? SoundEffect.Complete : SoundEffect.Move); @@ -139,25 +145,25 @@ private void HandleKeyUp(object sender, KeyboardEventArgs e) PlaySoundEffect(SoundEffect.Conflict); } break; - case 31: // B - case 35: // F - case 48: // S - case 52: // W + case Key.B: // B + case Key.F: // F + case Key.S: // S + case Key.W: // W // Switch to the specified board PrepareFade(); var boardString = ""; switch (e.Key) { - case 31: boardString = BoardBlank; break; - case 35: boardString = BoardAlmostFinished; break; - case 48: boardString = BoardSudopediaSample; break; - case 52: boardString = BoardWikipediaSample; break; + case Key.B: boardString = BoardBlank; break; + case Key.F: boardString = BoardAlmostFinished; break; + case Key.S: boardString = BoardSudopediaSample; break; + case Key.W: boardString = BoardWikipediaSample; break; } _primaryBoardDisplay.Board = Board.FromString(boardString); PlaySoundEffect(SoundEffect.New); _fadingBoardDisplay.Fade(FadeSecondsNormal); break; - case 32: // C + case Key.C: // C // Toggle the candidate display PrepareFade(); _primaryBoardDisplay.CandidatesVisible = !_primaryBoardDisplay.CandidatesVisible; @@ -205,7 +211,7 @@ private void PlaySoundEffect(SoundEffect soundEffect) break; } // Set the source and play the sound - mediaElement.Source = new Uri(HtmlPage.DocumentUri, soundFile); + mediaElement.Source = new Uri(HtmlPage.Document.DocumentUri, soundFile); mediaElement.Play(); } diff --git a/Properties/AppManifest.xml b/Properties/AppManifest.xml new file mode 100644 index 0000000..5d14ace --- /dev/null +++ b/Properties/AppManifest.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/README.md b/README.md new file mode 100644 index 0000000..6be686d --- /dev/null +++ b/README.md @@ -0,0 +1,10 @@ +# Silverlight Sudoku with LINQ + +A port to Silverlight 3 of the original code published in 2007 by Richard +Birkby, which itself is a merge of his Sudoku solver using LINQ, based on +Peter Norvig's work, with David Anson's Silverlight Sudoku Helper program. +The respective articles can be found here: + +* Richard Birkby: [C# Nuggets : Silverlight Sudoku with LINQ](http://aspadvice.com/blogs/rbirkby/archive/2007/08/23/Silverlight-Sudoku-with-LINQ.aspx) +* David Anson: [Time for a little fun and games (Silverlight helps play Sudoku!) - Delay's Blog - Site Home - MSDN Blogs](http://blogs.msdn.com/b/delay/archive/2007/08/21/time-for-a-little-fun-and-games-silverlight-helps-play-sudoku.aspx) +* Peter Norvig: [Solving Every Sudoku Puzzle](http://www.norvig.com/sudoku.html) diff --git a/Silverlight.js b/Silverlight.js index 1a42132..80ff397 100644 --- a/Silverlight.js +++ b/Silverlight.js @@ -1,15 +1,2 @@ -/////////////////////////////////////////////////////////////////////////////// -// -// Silverlight.js (1.1 Preview) version 1.0 -// -// This file is provided by Microsoft as a helper file for websites that -// incorporate Silverlight Objects. This file is provided under the Silverlight -// SDK 1.1 license available at http://go.microsoft.com/fwlink/?linkid=94243. -// You may not use or distribute this file or the code in this file except as -// expressly permitted under that license. -// -// Copyright (c) 2007 Microsoft Corporation. All rights reserved. -// -/////////////////////////////////////////////////////////////////////////////// - -if(!window.Silverlight)window.Silverlight={};Silverlight._silverlightCount=0;Silverlight.ua=null;Silverlight.available=false;Silverlight.fwlinkRoot="http://go.microsoft.com/fwlink/?LinkID=";Silverlight.detectUserAgent=function(){var a=window.navigator.userAgent;Silverlight.ua={OS:"Unsupported",Browser:"Unsupported"};if(a.indexOf("Windows NT")>=0)Silverlight.ua.OS="Windows";else if(a.indexOf("PPC Mac OS X")>=0)Silverlight.ua.OS="MacPPC";else if(a.indexOf("Intel Mac OS X")>=0)Silverlight.ua.OS="MacIntel";if(Silverlight.ua.OS!="Unsupported")if(a.indexOf("MSIE")>=0){if(navigator.userAgent.indexOf("Win64")==-1)if(parseInt(a.split("MSIE")[1])>=6)Silverlight.ua.Browser="MSIE"}else if(a.indexOf("Firefox")>=0){var b=a.split("Firefox/")[1].split("."),c=parseInt(b[0]);if(c>=2)Silverlight.ua.Browser="Firefox";else{var d=parseInt(b[1]);if(c==1&&d>=5)Silverlight.ua.Browser="Firefox"}}else if(a.indexOf("Safari")>=0)Silverlight.ua.Browser="Safari"};Silverlight.detectUserAgent();Silverlight.isInstalled=function(d){var c=false,a=null;try{var b=null;if(Silverlight.ua.Browser=="MSIE")b=new ActiveXObject("AgControl.AgControl");else if(navigator.plugins["Silverlight Plug-In"]){a=document.createElement("div");document.body.appendChild(a);if(Silverlight.ua.Browser=="Safari")a.innerHTML='';else a.innerHTML='';b=a.childNodes[0]}if(b.IsVersionSupported(d))c=true;b=null;Silverlight.available=true}catch(e){c=false}if(a)document.body.removeChild(a);return c};Silverlight.createObject=function(l,g,m,j,k,i,h){var b={},a=j,c=k;a.source=l;b.parentElement=g;b.id=Silverlight.HtmlAttributeEncode(m);b.width=Silverlight.HtmlAttributeEncode(a.width);b.height=Silverlight.HtmlAttributeEncode(a.height);b.ignoreBrowserVer=Boolean(a.ignoreBrowserVer);b.inplaceInstallPrompt=Boolean(a.inplaceInstallPrompt);var e=a.version.split(".");b.shortVer=e[0]+"."+e[1];b.version=a.version;a.initParams=i;a.windowless=a.isWindowless;a.maxFramerate=a.framerate;for(var d in c)if(c[d]&&d!="onLoad"&&d!="onError"){a[d]=c[d];c[d]=null}delete a.width;delete a.height;delete a.id;delete a.onLoad;delete a.onError;delete a.ignoreBrowserVer;delete a.inplaceInstallPrompt;delete a.version;delete a.isWindowless;delete a.framerate;delete a.data;delete a.src;if(Silverlight.isInstalled(b.version)){if(Silverlight._silverlightCount==0)if(window.addEventListener)window.addEventListener("onunload",Silverlight.__cleanup,false);else window.attachEvent("onunload",Silverlight.__cleanup);var f=Silverlight._silverlightCount++;a.onLoad="__slLoad"+f;a.onError="__slError"+f;window[a.onLoad]=function(a){if(c.onLoad)c.onLoad(document.getElementById(b.id),h,a)};window[a.onError]=function(a,b){if(c.onError)c.onError(a,b);else Silverlight.default_error_handler(a,b)};slPluginHTML=Silverlight.buildHTML(b,a)}else slPluginHTML=Silverlight.buildPromptHTML(b);if(b.parentElement)b.parentElement.innerHTML=slPluginHTML;else return slPluginHTML};Silverlight.supportedUserAgent=function(c){var a=Silverlight.ua,b=a.OS=="Unsupported"||a.Browser=="Unsupported"||a.OS=="Windows"&&a.Browser=="Safari"||a.OS.indexOf("Mac")>=0&&a.Browser=="IE";if(c=="1.1")return !(b||a.OS=="MacPPC");else return !b};Silverlight.buildHTML=function(c,d){var a=[],e,i,g,f,h;if(Silverlight.ua.Browser=="Safari"){a.push(""}else{a.push(''+l+''+k+'';a=a.replace("{2}",h+i);a=a.replace("{3}",h+g);a=a.replace("{4}",h+j)}else{if(f.shortVer=="1.1"){b="92821";if(Silverlight.available)d="94378";else d="92810";if(c=="Windows")b="92809";else if(c=="MacIntel")b="92813"}else{if(Silverlight.available)d="94377";else d="92801";if(c=="Windows")b="92800";else if(c=="MacIntel")b="92812";else if(c=="MacPPC")b="92811"}a='
'+e+'
'}a=a.replace("{0}",b);a=a.replace("{1}",h+d+"&clcid="+m);return a};Silverlight.__cleanup=function(){for(var a=Silverlight._silverlightCount-1;a>=0;a--){window["__slLoad"+a]=null;window["__slError"+a]=null}if(window.removeEventListener)window.removeEventListener("unload",Silverlight.__cleanup,false);else window.detachEvent("onunload",Silverlight.__cleanup)};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} \ No newline at end of file +//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 --git a/SilverlightSudokuHelper.csproj b/SilverlightSudokuHelper.csproj index 53b0fcf..8724343 100644 --- a/SilverlightSudokuHelper.csproj +++ b/SilverlightSudokuHelper.csproj @@ -1,8 +1,8 @@ - + Debug AnyCPU - 9.0.20706 + 9.0.30729 2.0 {F371D205-3FCD-466F-9751-2963857CFA83} {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} @@ -11,13 +11,19 @@ SilverlightSudokuHelper SilverlightSudokuHelper v3.5 + true + true + true + SilverlightSudokuHelper.xap + Properties\AppManifest.xml + SilverlightSudokuHelper.App true full false ClientBin\ - DEBUG;TRACE + DEBUG;TRACE;SILVERLIGHT true true prompt @@ -27,21 +33,25 @@ pdbonly true ClientBin\ - TRACE + TRACE;SILVERLIGHT true true prompt 4 - + - - + + + + + App.xaml + @@ -55,9 +65,14 @@ - - MSBuild:CompileXaml - + + Designer + MSBuild:MarkupCompilePass1 + + + Designer + MSBuild:MarkupCompilePass1 + @@ -74,16 +89,20 @@ - MSBuild:Compile + MSBuild:MarkupCompilePass1 - MSBuild:Compile + MSBuild:MarkupCompilePass1 - MSBuild:Compile + MSBuild:MarkupCompilePass1 - + + + + +