-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Port to Silverlight 3 on Visual Studio 2008.
- Loading branch information
Showing
19 changed files
with
190 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
*.user | ||
*.suo | ||
ClientBin/ | ||
obj/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
x:Class="SilverlightSudokuHelper.App" | ||
> | ||
<Application.Resources> | ||
|
||
</Application.Resources> | ||
</Application> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) | ||
{ | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<Canvas xmlns="http://schemas.microsoft.com/client/2007" | ||
<Canvas xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
x:Class="SilverlightSudokuHelper.Page;assembly=ClientBin/SilverlightSudokuHelper.dll" | ||
x:Class="SilverlightSudokuHelper.Page" | ||
Loaded="Page_Loaded"> | ||
<MediaElement x:Name="mediaElement" /> | ||
</Canvas> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<Deployment xmlns="http://schemas.microsoft.com/client/2007/deployment" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
> | ||
<Deployment.Parts> | ||
</Deployment.Parts> | ||
|
||
</Deployment> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
Oops, something went wrong.