diff --git a/Demo/Default.cshtml b/Demo/Default.cshtml
new file mode 100644
index 0000000..9e3b3e7
--- /dev/null
+++ b/Demo/Default.cshtml
@@ -0,0 +1,18 @@
+
+
+
+
+
+ Testing out my orange bits extension
+
+
+
+
+
+ Here is a box styled using less
+ Here is a box styled using sass
+ Here is a box styled using scss
+ You can't explain this
+
+
+
diff --git a/Demo/bin/Microsoft.Web.Infrastructure.dll b/Demo/bin/Microsoft.Web.Infrastructure.dll
new file mode 100644
index 0000000..85f1138
Binary files /dev/null and b/Demo/bin/Microsoft.Web.Infrastructure.dll differ
diff --git a/Demo/bin/NuGet.Core.dll b/Demo/bin/NuGet.Core.dll
new file mode 100644
index 0000000..863858b
Binary files /dev/null and b/Demo/bin/NuGet.Core.dll differ
diff --git a/Demo/bin/System.Web.Helpers.dll b/Demo/bin/System.Web.Helpers.dll
new file mode 100644
index 0000000..bcf155e
Binary files /dev/null and b/Demo/bin/System.Web.Helpers.dll differ
diff --git a/Demo/bin/System.Web.Razor.dll b/Demo/bin/System.Web.Razor.dll
new file mode 100644
index 0000000..781c8a5
Binary files /dev/null and b/Demo/bin/System.Web.Razor.dll differ
diff --git a/Demo/bin/System.Web.WebPages.Administration.dll b/Demo/bin/System.Web.WebPages.Administration.dll
new file mode 100644
index 0000000..b3da328
Binary files /dev/null and b/Demo/bin/System.Web.WebPages.Administration.dll differ
diff --git a/Demo/bin/System.Web.WebPages.Deployment.dll b/Demo/bin/System.Web.WebPages.Deployment.dll
new file mode 100644
index 0000000..65b89d9
Binary files /dev/null and b/Demo/bin/System.Web.WebPages.Deployment.dll differ
diff --git a/Demo/bin/System.Web.WebPages.Razor.dll b/Demo/bin/System.Web.WebPages.Razor.dll
new file mode 100644
index 0000000..b9bf17d
Binary files /dev/null and b/Demo/bin/System.Web.WebPages.Razor.dll differ
diff --git a/Demo/bin/System.Web.WebPages.dll b/Demo/bin/System.Web.WebPages.dll
new file mode 100644
index 0000000..7cfd108
Binary files /dev/null and b/Demo/bin/System.Web.WebPages.dll differ
diff --git a/Demo/bin/WebMatrix.Data.dll b/Demo/bin/WebMatrix.Data.dll
new file mode 100644
index 0000000..deaa549
Binary files /dev/null and b/Demo/bin/WebMatrix.Data.dll differ
diff --git a/Demo/bin/WebMatrix.Security.dll b/Demo/bin/WebMatrix.Security.dll
new file mode 100644
index 0000000..3a1be3d
Binary files /dev/null and b/Demo/bin/WebMatrix.Security.dll differ
diff --git a/Demo/bin/WebMatrix.WebData.dll b/Demo/bin/WebMatrix.WebData.dll
new file mode 100644
index 0000000..206703e
Binary files /dev/null and b/Demo/bin/WebMatrix.WebData.dll differ
diff --git a/Demo/coffeeScriptTest.coffee b/Demo/coffeeScriptTest.coffee
new file mode 100644
index 0000000..44c4261
--- /dev/null
+++ b/Demo/coffeeScriptTest.coffee
@@ -0,0 +1,36 @@
+# Assignment:
+number = 42
+opposite = true
+
+# Conditions:
+number = -42 if opposite
+
+# Functions:
+square = (x) -> x * x
+
+# Arrays:
+list = [1, 2, 3, 4, 5]
+
+# Objects:
+math =
+ root: Math.sqrt
+ square: square
+ cube: (x) -> x * square x
+
+# Splats:
+race = (winner, runners...) ->
+ print winner, runners
+
+# Existence:
+alert "I knew it!" if elvis?
+
+# Array comprehensions:
+cubes = (math.cube num for num in list)
+
+
+# show off some coffee in the browser test
+setTimeout(() ->
+ document.getElementsByClassName('coffeeBox')[0].innerHTML = 'hello from the world of coffeeScript!!!'
+ , 1500);
+
+
\ No newline at end of file
diff --git a/Demo/lessTest.less b/Demo/lessTest.less
new file mode 100644
index 0000000..16d68fb
--- /dev/null
+++ b/Demo/lessTest.less
@@ -0,0 +1,20 @@
+@green: #00FF00;
+@margin: 16px;
+
+@purple: #7D26CD;
+
+.lessBox {
+ background-color: lighten(@green, 45%);
+ border-color: @green;
+ color: darken(@green, 9%);
+ padding: @margin / 2;
+ margin: @margin / 2;
+}
+
+.coffeeBox {
+ background-color: lighten(@purple, 35%);
+ border-color: @purple;
+ color: darken(@purple, 12%);
+ padding: @margin / 2;
+ margin: @margin / 2;
+}
\ No newline at end of file
diff --git a/Demo/orderedListThree.png b/Demo/orderedListThree.png
new file mode 100644
index 0000000..0714981
Binary files /dev/null and b/Demo/orderedListThree.png differ
diff --git a/Demo/robots.txt b/Demo/robots.txt
new file mode 100644
index 0000000..f783256
--- /dev/null
+++ b/Demo/robots.txt
@@ -0,0 +1,5 @@
+
+# This file can be used to affect how search engines and other web site crawlers see your site.
+# For more information, please see http://www.w3.org/TR/html4/appendix/notes.html#h-B.4.1.1
+# WebMatrix 2.0
+
diff --git a/Demo/sassTest.css b/Demo/sassTest.css
new file mode 100644
index 0000000..737640f
--- /dev/null
+++ b/Demo/sassTest.css
@@ -0,0 +1,6 @@
+.sassBox {
+ background-color: #caeef2;
+ border-color: #3bbfce;
+ color: #2ca2af;
+ padding: 8px;
+ margin: 8px; }
diff --git a/Demo/sassTest.sass b/Demo/sassTest.sass
new file mode 100644
index 0000000..7f4ad1e
--- /dev/null
+++ b/Demo/sassTest.sass
@@ -0,0 +1,11 @@
+$blue: #3bbfce
+$margin: 16px
+
+.sassBox
+ background-color: lighten($blue, 35%)
+ border-color: $blue
+ color: darken($blue, 9%)
+ padding: $margin / 2
+ margin: $margin / 2
+
+
\ No newline at end of file
diff --git a/Demo/scssTest.scss b/Demo/scssTest.scss
new file mode 100644
index 0000000..ca50388
--- /dev/null
+++ b/Demo/scssTest.scss
@@ -0,0 +1,10 @@
+$red: #FF0000;
+$margin: 16px;
+
+.scssBox {
+ background-color: lighten($red, 45%);
+ border-color: $red;
+ color: darken($red, 9%);
+ padding: $margin / 2;
+ margin: $margin / 2;
+}
\ No newline at end of file
diff --git a/Local.testsettings b/Local.testsettings
new file mode 100644
index 0000000..a1004dc
--- /dev/null
+++ b/Local.testsettings
@@ -0,0 +1,10 @@
+
+
+ These are default test settings for a local test run.
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OrangeBits.sln b/OrangeBits.sln
new file mode 100644
index 0000000..113978c
--- /dev/null
+++ b/OrangeBits.sln
@@ -0,0 +1,36 @@
+
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OrangeBits", "OrangeBits\OrangeBits.csproj", "{A93FE0DC-E26F-4145-B3E3-283DF9B2FE77}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnitTests", "UnitTests\UnitTests.csproj", "{4C102372-8D0A-47B4-BDB8-AC9E1EC9550A}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{119BE45C-0AB9-444C-939C-AF68E22E1895}"
+ ProjectSection(SolutionItems) = preProject
+ Local.testsettings = Local.testsettings
+ OrangeBits.vsmdi = OrangeBits.vsmdi
+ TraceAndTestImpact.testsettings = TraceAndTestImpact.testsettings
+ EndProjectSection
+EndProject
+Global
+ GlobalSection(TestCaseManagementSettings) = postSolution
+ CategoryFile = OrangeBits.vsmdi
+ EndGlobalSection
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {A93FE0DC-E26F-4145-B3E3-283DF9B2FE77}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {A93FE0DC-E26F-4145-B3E3-283DF9B2FE77}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {A93FE0DC-E26F-4145-B3E3-283DF9B2FE77}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {A93FE0DC-E26F-4145-B3E3-283DF9B2FE77}.Release|Any CPU.Build.0 = Release|Any CPU
+ {4C102372-8D0A-47B4-BDB8-AC9E1EC9550A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {4C102372-8D0A-47B4-BDB8-AC9E1EC9550A}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {4C102372-8D0A-47B4-BDB8-AC9E1EC9550A}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {4C102372-8D0A-47B4-BDB8-AC9E1EC9550A}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/OrangeBits.suo b/OrangeBits.suo
new file mode 100644
index 0000000..8826b5a
Binary files /dev/null and b/OrangeBits.suo differ
diff --git a/OrangeBits.vsmdi b/OrangeBits.vsmdi
new file mode 100644
index 0000000..69ca1fb
--- /dev/null
+++ b/OrangeBits.vsmdi
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OrangeBits/Compilers/BaseCompiler.cs b/OrangeBits/Compilers/BaseCompiler.cs
new file mode 100644
index 0000000..8f44228
--- /dev/null
+++ b/OrangeBits/Compilers/BaseCompiler.cs
@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace OrangeBits.Compilers
+{
+ public class BaseCompiler
+ {
+
+ }
+}
diff --git a/OrangeBits/Compilers/CoffeeCompiler.cs b/OrangeBits/Compilers/CoffeeCompiler.cs
new file mode 100644
index 0000000..3ca3e8a
--- /dev/null
+++ b/OrangeBits/Compilers/CoffeeCompiler.cs
@@ -0,0 +1,29 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.IO;
+using SassAndCoffee.Core;
+using SassAndCoffee.Core.CoffeeScript;
+using SassAndCoffee.Core.Pipeline;
+using SassAndCoffee.Core.Pooling;
+
+namespace OrangeBits.Compilers
+{
+ public class CoffeeCompiler : ICompiler
+ {
+ public void Compile(string inPath, string outPath)
+ {
+ SassAndCoffee.Core.CoffeeScript.CoffeeScriptCompiler compiler = new CoffeeScriptCompiler(new InstanceProvider(() => new IEJavaScriptRuntime()));
+ using (StreamReader sr = new StreamReader(inPath))
+ {
+ string content = sr.ReadToEnd();
+ string output = compiler.Compile(content);
+ using (StreamWriter sw = new StreamWriter(outPath))
+ {
+ sw.Write(output);
+ }
+ }
+ }
+ }
+}
diff --git a/OrangeBits/Compilers/CompileResults.cs b/OrangeBits/Compilers/CompileResults.cs
new file mode 100644
index 0000000..8c99659
--- /dev/null
+++ b/OrangeBits/Compilers/CompileResults.cs
@@ -0,0 +1,33 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace OrangeBits.Compilers
+{
+ ///
+ /// basic structure to store results of a compilation
+ ///
+ public class CompileResults
+ {
+ ///
+ /// notes the compilation was successful
+ ///
+ public bool Success { get; set; }
+
+ ///
+ /// notes if the new file was created for the first time
+ ///
+ public bool IsNewFile { get; set; }
+
+ ///
+ /// original source input file path
+ ///
+ public string InputPath { get; set; }
+
+ ///
+ /// new compiled output file path
+ ///
+ public string OutputPath { get; set; }
+ }
+}
diff --git a/OrangeBits/Compilers/ICompiler.cs b/OrangeBits/Compilers/ICompiler.cs
new file mode 100644
index 0000000..0705624
--- /dev/null
+++ b/OrangeBits/Compilers/ICompiler.cs
@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace OrangeBits.Compilers
+{
+ interface ICompiler
+ {
+ void Compile(string inPath, string outPath);
+ }
+}
diff --git a/OrangeBits/Compilers/LessCompiler.cs b/OrangeBits/Compilers/LessCompiler.cs
new file mode 100644
index 0000000..dd6b090
--- /dev/null
+++ b/OrangeBits/Compilers/LessCompiler.cs
@@ -0,0 +1,37 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading;
+using System.ComponentModel;
+using System.Collections.Specialized;
+using System.IO;
+
+using dotless.Core;
+
+namespace OrangeBits.Compilers
+{
+ ///
+ ///
+ ///
+ public class LessCompiler : ICompiler
+ {
+ ///
+ ///
+ ///
+ ///
+ ///
+ public void Compile(string inPath, string outPath)
+ {
+ using (StreamReader sr = new StreamReader(inPath))
+ {
+ string content = sr.ReadToEnd();
+ string output = Less.Parse(content);
+ using (StreamWriter sw = new StreamWriter(outPath))
+ {
+ sw.Write(output);
+ }
+ }
+ }
+ }
+}
diff --git a/OrangeBits/Compilers/OrangeCompiler.cs b/OrangeBits/Compilers/OrangeCompiler.cs
new file mode 100644
index 0000000..81e908d
--- /dev/null
+++ b/OrangeBits/Compilers/OrangeCompiler.cs
@@ -0,0 +1,106 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.IO;
+
+namespace OrangeBits.Compilers
+{
+ ///
+ /// Top level compiler for all of the file types we support
+ ///
+ public class OrangeCompiler
+ {
+ #region Variables
+
+ ///
+ /// list of supported file extensions
+ ///
+ public static string[] supportedExtensions = new string[] { ".less", ".sass", ".scss", ".coffee" };
+
+ #endregion
+
+ #region IsSupportedFileType
+ ///
+ /// check if a file at the given path is a supported type
+ ///
+ ///
+ ///
+ public static bool IsSupportedFileType(string path)
+ {
+ FileInfo f = new FileInfo(path);
+ return (OrangeCompiler.supportedExtensions.Contains(f.Extension.ToLower()));
+ }
+ #endregion
+
+ #region GetOutputFilePath
+ ///
+ /// for a given input file, figure out what the compiled output path would be
+ ///
+ ///
+ ///
+ public static string GetOutputFilePath(string path)
+ {
+ // ensure we got a valid path
+ if (String.IsNullOrEmpty(path))
+ throw new Exception("The path passed to Orange Compiler must be a valid LESS, CoffeeScript, or Sass file");
+
+ // get the file extension
+ FileInfo f = new FileInfo(path);
+ string outPath = path.Substring(0, path.LastIndexOf('.'));
+ string outExt = (f.Extension.ToLower() == ".coffee") ? ".js" : ".css";
+ return string.Format("{0}{1}", outPath, outExt);
+ }
+
+ #endregion
+
+ #region Compile
+ ///
+ /// based on the extension, create the required compiler and compile
+ ///
+ ///
+ public static CompileResults Compile(string path)
+ {
+ ICompiler compiler = null;
+
+ // ensure we got a valid path
+ if (String.IsNullOrEmpty(path))
+ throw new Exception("The path passed to Orange Compiler must be a valid LESS, CoffeeScript, or Sass file");
+
+ // get the file extension
+ FileInfo f = new FileInfo(path);
+ string outPath = path.Substring(0, path.LastIndexOf('.'));
+ string outExt = (f.Extension.ToLower() == ".coffee") ? ".js" : ".css";
+ switch (f.Extension.ToLower())
+ {
+ case ".less":
+ compiler = new LessCompiler();
+ break;
+ case ".sass":
+ case ".scss":
+ compiler = new SassCompiler();
+ break;
+ case ".coffee":
+ compiler = new CoffeeCompiler();
+ break;
+ default:
+ throw new NotImplementedException();
+ }
+
+ // create the compiled source
+ outPath += outExt;
+ bool exists = File.Exists(outPath);
+
+ compiler.Compile(path, outPath);
+
+ return new CompileResults()
+ {
+ Success = true,
+ InputPath = path,
+ OutputPath = outPath,
+ IsNewFile = !exists
+ };
+ }
+ #endregion
+ }
+}
diff --git a/OrangeBits/Compilers/SassCompiler.cs b/OrangeBits/Compilers/SassCompiler.cs
new file mode 100644
index 0000000..993a661
--- /dev/null
+++ b/OrangeBits/Compilers/SassCompiler.cs
@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.IO;
+using SassAndCoffee.Core.Sass;
+
+namespace OrangeBits.Compilers
+{
+ public class SassCompiler : ICompiler
+ {
+ public void Compile(string inPath, string outPath)
+ {
+ SassAndCoffee.Core.Sass.SassCompiler compiler = new SassAndCoffee.Core.Sass.SassCompiler();
+ string output = compiler.Compile(inPath);
+ using (StreamWriter sw = new StreamWriter(outPath))
+ {
+ sw.Write(output);
+ }
+ }
+ }
+}
diff --git a/OrangeBits/Compilers/StylusCompiler.cs b/OrangeBits/Compilers/StylusCompiler.cs
new file mode 100644
index 0000000..687cfce
--- /dev/null
+++ b/OrangeBits/Compilers/StylusCompiler.cs
@@ -0,0 +1,15 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace OrangeBits.Compilers
+{
+ public class StylusCompiler : ICompiler
+ {
+ public void Compile(string inPath, string outPath)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}
diff --git a/OrangeBits/DelegateCommand.cs b/OrangeBits/DelegateCommand.cs
new file mode 100644
index 0000000..5c99f43
--- /dev/null
+++ b/OrangeBits/DelegateCommand.cs
@@ -0,0 +1,80 @@
+using System;
+using System.Windows.Input;
+using System.Diagnostics;
+
+namespace OrangeBits
+{
+ ///
+ /// Simple implementation of the DelegateCommand (aka RelayCommand) pattern.
+ ///
+ internal class DelegateCommand : ICommand
+ {
+ ///
+ /// Stores a reference to the CanExecute Func.
+ ///
+ private readonly Func