├── README.md ├── Input Documents └── Document1.xml ├── TechEd.Demo.SolidPrinciples ├── packages.config ├── App.config ├── Document.cs ├── Program.cs ├── Properties │ └── AssemblyInfo.cs └── TechEd.Demo.SolidPrinciples.csproj ├── TechEd.Demo.SolidPrinciples.Lsp.Principles ├── packages.config ├── App.config ├── Program.cs ├── Properties │ └── AssemblyInfo.cs ├── CarTests.cs ├── Entities │ └── Car.cs └── TechEd.Demo.SolidPrinciples.Lsp.Principles.csproj ├── TechEd.Demo.SolidPrinciples.Srp ├── packages.config ├── InvalidInputFormatException.cs ├── App.config ├── Document.cs ├── DocumentSerializer.cs ├── InputParser.cs ├── Program.cs ├── DocumentStorage.cs ├── FormatConverter.cs ├── Properties │ └── AssemblyInfo.cs └── TechEd.Demo.SolidPrinciples.Srp.csproj ├── .nuget ├── NuGet.Config └── NuGet.targets ├── TechEd.Demo.SolidPrinciples.Refactored ├── packages.config ├── App.config ├── Document.cs ├── Properties │ └── AssemblyInfo.cs ├── Program.cs └── TechEd.Demo.SolidPrinciples.Refactored.csproj ├── TechEd.Demo.SolidPrinciples.Isp ├── InvalidTargetException.cs ├── InvalidInputFormatException.cs ├── Document.cs ├── packages.config ├── App.config ├── IDocumentSerializer.cs ├── Program.cs ├── InputParser.cs ├── Properties │ └── AssemblyInfo.cs ├── FormatConverter.cs ├── DocumentStorage.cs └── TechEd.Demo.SolidPrinciples.Isp.csproj ├── TechEd.Demo.SolidPrinciples.Lsp ├── InvalidTargetException.cs ├── InvalidInputFormatException.cs ├── Document.cs ├── packages.config ├── App.config ├── IDocumentSerializer.cs ├── Program.cs ├── InputParser.cs ├── Properties │ └── AssemblyInfo.cs ├── FormatConverter.cs ├── DocumentStorage.cs └── TechEd.Demo.SolidPrinciples.Lsp.csproj ├── TechEd.Demo.SolidPrinciples.Ocp ├── InvalidTargetException.cs ├── InvalidInputFormatException.cs ├── Document.cs ├── packages.config ├── App.config ├── IDocumentSerializer.cs ├── Program.cs ├── InputParser.cs ├── Properties │ └── AssemblyInfo.cs ├── FormatConverter.cs ├── DocumentStorage.cs └── TechEd.Demo.SolidPrinciples.Ocp.csproj ├── TechEd.Demo.SolidPrinciples.Dip.Manual ├── InvalidTargetException.cs ├── InvalidInputFormatException.cs ├── Document.cs ├── packages.config ├── InputRetriever.cs ├── App.config ├── DocumentPersister.cs ├── IDocumentSerializer.cs ├── InputParser.cs ├── FormatConverter.cs ├── Properties │ └── AssemblyInfo.cs ├── Program.cs ├── DocumentStorage.cs └── TechEd.Demo.SolidPrinciples.Dip.Manual.csproj ├── TechEd.Demo.SolidPrinciples.Dip.IoCContainer ├── InvalidTargetException.cs ├── InvalidInputFormatException.cs ├── Document.cs ├── packages.config ├── InputRetriever.cs ├── DocumentPersister.cs ├── InputParser.cs ├── IDocumentSerializer.cs ├── FormatConverter.cs ├── Properties │ └── AssemblyInfo.cs ├── App.config ├── Program.cs ├── DocumentStorage.cs └── TechEd.Demo.SolidPrinciples.Dip.IoCContainer.csproj ├── TechEd.Demo.SolidPrinciples.Dip.ServiceLocator ├── InvalidTargetException.cs ├── InvalidInputFormatException.cs ├── Document.cs ├── InputRetriever.cs ├── DocumentPersister.cs ├── packages.config ├── IDocumentSerializer.cs ├── App.config ├── InputParser.cs ├── Properties │ └── AssemblyInfo.cs ├── FormatConverter.cs ├── Program.cs ├── DocumentStorage.cs └── TechEd.Demo.SolidPrinciples.Dip.ServiceLocator.csproj └── TechEd.Demo.SolidPrinciples.sln /README.md: -------------------------------------------------------------------------------- 1 | #TechEd.Demo.SolidPrinciples 2 | 3 | https://www.youtube.com/watch?v=gwIS9cZlrhk&t=2073s -------------------------------------------------------------------------------- /Input Documents/Document1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | My Document 4 | Hello world from filesystem! 5 | -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Lsp.Principles/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Srp/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /.nuget/NuGet.Config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Refactored/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Isp/InvalidTargetException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace TechEd.Demo.SolidPrinciples.Isp 4 | { 5 | public class InvalidTargetException : Exception 6 | { 7 | } 8 | } -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Lsp/InvalidTargetException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace TechEd.Demo.SolidPrinciples.Lsp 4 | { 5 | public class InvalidTargetException : Exception 6 | { 7 | } 8 | } -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Ocp/InvalidTargetException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace TechEd.Demo.SolidPrinciples.Ocp 4 | { 5 | public class InvalidTargetException : Exception 6 | { 7 | } 8 | } -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Dip.Manual/InvalidTargetException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace TechEd.Demo.SolidPrinciples.Dip.Manual 4 | { 5 | public class InvalidTargetException : Exception 6 | { 7 | } 8 | } -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Isp/InvalidInputFormatException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace TechEd.Demo.SolidPrinciples.Isp 4 | { 5 | public class InvalidInputFormatException : Exception 6 | { 7 | } 8 | } -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Lsp/InvalidInputFormatException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace TechEd.Demo.SolidPrinciples.Lsp 4 | { 5 | public class InvalidInputFormatException : Exception 6 | { 7 | } 8 | } -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Ocp/InvalidInputFormatException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace TechEd.Demo.SolidPrinciples.Ocp 4 | { 5 | public class InvalidInputFormatException : Exception 6 | { 7 | } 8 | } -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Srp/InvalidInputFormatException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace TechEd.Demo.SolidPrinciples.Srp 4 | { 5 | public class InvalidInputFormatException : Exception 6 | { 7 | } 8 | } -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Dip.Manual/InvalidInputFormatException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace TechEd.Demo.SolidPrinciples.Dip.Manual 4 | { 5 | public class InvalidInputFormatException : Exception 6 | { 7 | } 8 | } -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Dip.IoCContainer/InvalidTargetException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace TechEd.Demo.SolidPrinciples.Dip.IoCContainer 4 | { 5 | public class InvalidTargetException : Exception 6 | { 7 | } 8 | } -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples/Document.cs: -------------------------------------------------------------------------------- 1 | namespace TechEd.Demo.SolidPrinciples 2 | { 3 | public class Document 4 | { 5 | public string Title { get; set; } 6 | public string Text { get; set; } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Dip.ServiceLocator/InvalidTargetException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace TechEd.Demo.SolidPrinciples.Dip.ServiceLocator 4 | { 5 | public class InvalidTargetException : Exception 6 | { 7 | } 8 | } -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Isp/Document.cs: -------------------------------------------------------------------------------- 1 | namespace TechEd.Demo.SolidPrinciples.Isp 2 | { 3 | public class Document 4 | { 5 | public string Title { get; set; } 6 | public string Text { get; set; } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Lsp/Document.cs: -------------------------------------------------------------------------------- 1 | namespace TechEd.Demo.SolidPrinciples.Lsp 2 | { 3 | public class Document 4 | { 5 | public string Title { get; set; } 6 | public string Text { get; set; } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Ocp/Document.cs: -------------------------------------------------------------------------------- 1 | namespace TechEd.Demo.SolidPrinciples.Ocp 2 | { 3 | public class Document 4 | { 5 | public string Title { get; set; } 6 | public string Text { get; set; } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Srp/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Srp/Document.cs: -------------------------------------------------------------------------------- 1 | namespace TechEd.Demo.SolidPrinciples.Srp 2 | { 3 | public class Document 4 | { 5 | public string Title { get; set; } 6 | public string Text { get; set; } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Dip.IoCContainer/InvalidInputFormatException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace TechEd.Demo.SolidPrinciples.Dip.IoCContainer 4 | { 5 | public class InvalidInputFormatException : Exception 6 | { 7 | } 8 | } -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Refactored/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Dip.ServiceLocator/InvalidInputFormatException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace TechEd.Demo.SolidPrinciples.Dip.ServiceLocator 4 | { 5 | public class InvalidInputFormatException : Exception 6 | { 7 | } 8 | } -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Lsp.Principles/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Dip.Manual/Document.cs: -------------------------------------------------------------------------------- 1 | namespace TechEd.Demo.SolidPrinciples.Dip.Manual 2 | { 3 | public class Document 4 | { 5 | public string Title { get; set; } 6 | public string Text { get; set; } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Refactored/Document.cs: -------------------------------------------------------------------------------- 1 | namespace TechEd.Demo.SolidPrinciples.Refactored 2 | { 3 | public class Document 4 | { 5 | public string Title { get; set; } 6 | public string Text { get; set; } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Dip.IoCContainer/Document.cs: -------------------------------------------------------------------------------- 1 | namespace TechEd.Demo.SolidPrinciples.Dip.IoCContainer 2 | { 3 | public class Document 4 | { 5 | public string Title { get; set; } 6 | public string Text { get; set; } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Dip.ServiceLocator/Document.cs: -------------------------------------------------------------------------------- 1 | namespace TechEd.Demo.SolidPrinciples.Dip.ServiceLocator 2 | { 3 | public class Document 4 | { 5 | public string Title { get; set; } 6 | public string Text { get; set; } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Srp/DocumentSerializer.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | 3 | namespace TechEd.Demo.SolidPrinciples.Srp 4 | { 5 | public class DocumentSerializer 6 | { 7 | public string Serialize(Document document) 8 | { 9 | return JsonConvert.SerializeObject(document); 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Lsp.Principles/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace TechEd.Demo.SolidPrinciples.Lsp.Principles 8 | { 9 | class Program 10 | { 11 | static void Main(string[] args) 12 | { 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Isp/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Lsp/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Ocp/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Dip.Manual/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Srp/InputParser.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Xml.Linq; 3 | 4 | namespace TechEd.Demo.SolidPrinciples.Srp 5 | { 6 | public class InputParser 7 | { 8 | public Document ParseInput(string input) 9 | { 10 | Document doc; 11 | try 12 | { 13 | var xdoc = XDocument.Parse(input); 14 | doc = new Document(); 15 | doc.Title = xdoc.Root.Element("title").Value; 16 | doc.Text = xdoc.Root.Element("text").Value; 17 | } 18 | catch (Exception) 19 | { 20 | throw new InvalidInputFormatException(); 21 | } 22 | 23 | return doc; 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Dip.IoCContainer/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Srp/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | 4 | namespace TechEd.Demo.SolidPrinciples.Srp 5 | { 6 | class Program 7 | { 8 | static void Main(string[] args) 9 | { 10 | var sourceFileName = Path.Combine(Environment.CurrentDirectory, "..\\..\\..\\Input Documents\\Document1.xml"); 11 | var targetFileName = Path.Combine(Environment.CurrentDirectory, "..\\..\\..\\Output Documents\\Document1.json"); 12 | 13 | var formatConverter = new FormatConverter(); 14 | if (!formatConverter.ConvertFormat(sourceFileName, targetFileName)) 15 | { 16 | Console.WriteLine("Conversion failed..."); 17 | Console.ReadKey(); 18 | } 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Dip.Manual/InputRetriever.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | namespace TechEd.Demo.SolidPrinciples.Dip.Manual 6 | { 7 | public static class InputRetriever 8 | { 9 | private static readonly Dictionary, IInputRetriever> InputRetrievers = new Dictionary, IInputRetriever>(); 10 | 11 | public static void RegisterInputRetriever(Func evaluator, IInputRetriever inputRetriever) 12 | { 13 | InputRetrievers.Add(evaluator, inputRetriever); 14 | } 15 | 16 | public static IInputRetriever ForFileName(string filename) 17 | { 18 | return InputRetrievers.First(x => x.Key(filename)).Value; 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Dip.IoCContainer/InputRetriever.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | namespace TechEd.Demo.SolidPrinciples.Dip.IoCContainer 6 | { 7 | public static class InputRetriever 8 | { 9 | private static readonly Dictionary, IInputRetriever> InputRetrievers = new Dictionary, IInputRetriever>(); 10 | 11 | public static void RegisterInputRetriever(Func evaluator, IInputRetriever inputRetriever) 12 | { 13 | InputRetrievers.Add(evaluator, inputRetriever); 14 | } 15 | 16 | public static IInputRetriever ForFileName(string filename) 17 | { 18 | return InputRetrievers.First(x => x.Key(filename)).Value; 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Dip.ServiceLocator/InputRetriever.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | namespace TechEd.Demo.SolidPrinciples.Dip.ServiceLocator 6 | { 7 | public static class InputRetriever 8 | { 9 | private static readonly Dictionary, IInputRetriever> InputRetrievers = new Dictionary, IInputRetriever>(); 10 | 11 | public static void RegisterInputRetriever(Func evaluator, IInputRetriever inputRetriever) 12 | { 13 | InputRetrievers.Add(evaluator, inputRetriever); 14 | } 15 | 16 | public static IInputRetriever ForFileName(string filename) 17 | { 18 | return InputRetrievers.First(x => x.Key(filename)).Value; 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Isp/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Lsp/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Ocp/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Dip.Manual/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Dip.Manual/DocumentPersister.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | namespace TechEd.Demo.SolidPrinciples.Dip.Manual 6 | { 7 | public static class DocumentPersister 8 | { 9 | private static readonly Dictionary, IDocumentPersister> DocumentPersisters = new Dictionary, IDocumentPersister>(); 10 | 11 | public static void RegisterDocumentPersister(Func evaluator, IDocumentPersister documentPersister) 12 | { 13 | DocumentPersisters.Add(evaluator, documentPersister); 14 | } 15 | 16 | public static IDocumentPersister ForFileName(string filename) 17 | { 18 | return DocumentPersisters.First(x => x.Key(filename)).Value; 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Dip.IoCContainer/DocumentPersister.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | namespace TechEd.Demo.SolidPrinciples.Dip.IoCContainer 6 | { 7 | public static class DocumentPersister 8 | { 9 | private static readonly Dictionary, IDocumentPersister> DocumentPersisters = new Dictionary, IDocumentPersister>(); 10 | 11 | public static void RegisterDocumentPersister(Func evaluator, IDocumentPersister documentPersister) 12 | { 13 | DocumentPersisters.Add(evaluator, documentPersister); 14 | } 15 | 16 | public static IDocumentPersister ForFileName(string filename) 17 | { 18 | return DocumentPersisters.First(x => x.Key(filename)).Value; 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Dip.ServiceLocator/DocumentPersister.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | namespace TechEd.Demo.SolidPrinciples.Dip.ServiceLocator 6 | { 7 | public static class DocumentPersister 8 | { 9 | private static readonly Dictionary, IDocumentPersister> DocumentPersisters = new Dictionary, IDocumentPersister>(); 10 | 11 | public static void RegisterDocumentPersister(Func evaluator, IDocumentPersister documentPersister) 12 | { 13 | DocumentPersisters.Add(evaluator, documentPersister); 14 | } 15 | 16 | public static IDocumentPersister ForFileName(string filename) 17 | { 18 | return DocumentPersisters.First(x => x.Key(filename)).Value; 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Isp/IDocumentSerializer.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using Newtonsoft.Json.Serialization; 3 | 4 | namespace TechEd.Demo.SolidPrinciples.Isp 5 | { 6 | public interface IDocumentSerializer 7 | { 8 | string Serialize(Document document); 9 | } 10 | 11 | public class JsonDocumentSerializer : IDocumentSerializer 12 | { 13 | public string Serialize(Document document) 14 | { 15 | return JsonConvert.SerializeObject(document); 16 | } 17 | } 18 | 19 | public class CamelCaseJsonSerializer : IDocumentSerializer 20 | { 21 | public string Serialize(Document document) 22 | { 23 | var settings = new JsonSerializerSettings 24 | { 25 | ContractResolver = new CamelCasePropertyNamesContractResolver() 26 | }; 27 | return JsonConvert.SerializeObject(document, settings); 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Lsp/IDocumentSerializer.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using Newtonsoft.Json.Serialization; 3 | 4 | namespace TechEd.Demo.SolidPrinciples.Lsp 5 | { 6 | public interface IDocumentSerializer 7 | { 8 | string Serialize(Document document); 9 | } 10 | 11 | public class JsonDocumentSerializer : IDocumentSerializer 12 | { 13 | public string Serialize(Document document) 14 | { 15 | return JsonConvert.SerializeObject(document); 16 | } 17 | } 18 | 19 | public class CamelCaseJsonSerializer : IDocumentSerializer 20 | { 21 | public string Serialize(Document document) 22 | { 23 | var settings = new JsonSerializerSettings 24 | { 25 | ContractResolver = new CamelCasePropertyNamesContractResolver() 26 | }; 27 | return JsonConvert.SerializeObject(document, settings); 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Ocp/IDocumentSerializer.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using Newtonsoft.Json.Serialization; 3 | 4 | namespace TechEd.Demo.SolidPrinciples.Ocp 5 | { 6 | public interface IDocumentSerializer 7 | { 8 | string Serialize(Document document); 9 | } 10 | 11 | public class JsonDocumentSerializer : IDocumentSerializer 12 | { 13 | public string Serialize(Document document) 14 | { 15 | return JsonConvert.SerializeObject(document); 16 | } 17 | } 18 | 19 | public class CamelCaseJsonSerializer : IDocumentSerializer 20 | { 21 | public string Serialize(Document document) 22 | { 23 | var settings = new JsonSerializerSettings 24 | { 25 | ContractResolver = new CamelCasePropertyNamesContractResolver() 26 | }; 27 | return JsonConvert.SerializeObject(document, settings); 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Dip.Manual/IDocumentSerializer.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using Newtonsoft.Json.Serialization; 3 | 4 | namespace TechEd.Demo.SolidPrinciples.Dip.Manual 5 | { 6 | public interface IDocumentSerializer 7 | { 8 | string Serialize(Document document); 9 | } 10 | 11 | public class JsonDocumentSerializer : IDocumentSerializer 12 | { 13 | public string Serialize(Document document) 14 | { 15 | return JsonConvert.SerializeObject(document); 16 | } 17 | } 18 | 19 | public class CamelCaseJsonSerializer : IDocumentSerializer 20 | { 21 | public string Serialize(Document document) 22 | { 23 | var settings = new JsonSerializerSettings 24 | { 25 | ContractResolver = new CamelCasePropertyNamesContractResolver() 26 | }; 27 | return JsonConvert.SerializeObject(document, settings); 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Dip.ServiceLocator/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Dip.ServiceLocator/IDocumentSerializer.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using Newtonsoft.Json.Serialization; 3 | 4 | namespace TechEd.Demo.SolidPrinciples.Dip.ServiceLocator 5 | { 6 | public interface IDocumentSerializer 7 | { 8 | string Serialize(Document document); 9 | } 10 | 11 | public class JsonDocumentSerializer : IDocumentSerializer 12 | { 13 | public string Serialize(Document document) 14 | { 15 | return JsonConvert.SerializeObject(document); 16 | } 17 | } 18 | 19 | public class CamelCaseJsonSerializer : IDocumentSerializer 20 | { 21 | public string Serialize(Document document) 22 | { 23 | var settings = new JsonSerializerSettings 24 | { 25 | ContractResolver = new CamelCasePropertyNamesContractResolver() 26 | }; 27 | return JsonConvert.SerializeObject(document, settings); 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Isp/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | 4 | namespace TechEd.Demo.SolidPrinciples.Isp 5 | { 6 | class Program 7 | { 8 | static void Main(string[] args) 9 | { 10 | var sourceFileName = Path.Combine(Environment.CurrentDirectory, "..\\..\\..\\Input Documents\\Document1.xml"); 11 | var targetFileName = Path.Combine(Environment.CurrentDirectory, "..\\..\\..\\Output Documents\\Document1.json"); 12 | //var sourceFileName = "http://chris.59north.com/Document1.xml"; 13 | //var targetFileName = "https://teched.blob.core.windows.net/converted-documents/Document1.json"; 14 | 15 | var formatConverter = new FormatConverter(); 16 | if (!formatConverter.ConvertFormat(sourceFileName, targetFileName)) 17 | { 18 | Console.WriteLine("Conversion failed..."); 19 | Console.ReadKey(); 20 | } 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Lsp/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | 4 | namespace TechEd.Demo.SolidPrinciples.Lsp 5 | { 6 | class Program 7 | { 8 | static void Main(string[] args) 9 | { 10 | var sourceFileName = Path.Combine(Environment.CurrentDirectory, "..\\..\\..\\Input Documents\\Document1.xml"); 11 | var targetFileName = Path.Combine(Environment.CurrentDirectory, "..\\..\\..\\Output Documents\\Document1.json"); 12 | //var sourceFileName = "http://chris.59north.com/Document1.xml"; 13 | //var targetFileName = "https://teched.blob.core.windows.net/converted-documents/Document1.json"; 14 | 15 | var formatConverter = new FormatConverter(); 16 | if (!formatConverter.ConvertFormat(sourceFileName, targetFileName)) 17 | { 18 | Console.WriteLine("Conversion failed..."); 19 | Console.ReadKey(); 20 | } 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Ocp/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | 4 | namespace TechEd.Demo.SolidPrinciples.Ocp 5 | { 6 | class Program 7 | { 8 | static void Main(string[] args) 9 | { 10 | var sourceFileName = Path.Combine(Environment.CurrentDirectory, "..\\..\\..\\Input Documents\\Document1.xml"); 11 | var targetFileName = Path.Combine(Environment.CurrentDirectory, "..\\..\\..\\Output Documents\\Document1.json"); 12 | //var sourceFileName = "http://chris.59north.com/Document1.xml"; 13 | //var targetFileName = "https://teched.blob.core.windows.net/converted-documents/Document1.json"; 14 | 15 | var formatConverter = new FormatConverter(); 16 | if (!formatConverter.ConvertFormat(sourceFileName, targetFileName)) 17 | { 18 | Console.WriteLine("Conversion failed..."); 19 | Console.ReadKey(); 20 | } 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Ocp/InputParser.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Xml.Linq; 3 | using Newtonsoft.Json; 4 | 5 | namespace TechEd.Demo.SolidPrinciples.Ocp 6 | { 7 | public class InputParser 8 | { 9 | public virtual Document ParseInput(string input) 10 | { 11 | Document doc; 12 | try 13 | { 14 | var xdoc = XDocument.Parse(input); 15 | doc = new Document(); 16 | doc.Title = xdoc.Root.Element("title").Value; 17 | doc.Text = xdoc.Root.Element("text").Value; 18 | } 19 | catch (Exception) 20 | { 21 | throw new InvalidInputFormatException(); 22 | } 23 | 24 | return doc; 25 | } 26 | } 27 | 28 | public class JsonInputParser : InputParser 29 | { 30 | public override Document ParseInput(string input) 31 | { 32 | return JsonConvert.DeserializeObject(input); 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Dip.ServiceLocator/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Srp/DocumentStorage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | 4 | namespace TechEd.Demo.SolidPrinciples.Srp 5 | { 6 | public class DocumentStorage 7 | { 8 | public string GetData(string fileName) 9 | { 10 | if (!File.Exists(fileName)) 11 | throw new FileNotFoundException(); 12 | 13 | using (var stream = File.OpenRead(fileName)) 14 | using (var reader = new StreamReader(stream)) 15 | { 16 | return reader.ReadToEnd(); 17 | } 18 | } 19 | 20 | public void PersistDocument(string serializedDocument, string targetFileName) 21 | { 22 | try 23 | { 24 | using (var stream = File.Open(targetFileName, FileMode.Create, FileAccess.Write)) 25 | using (var sw = new StreamWriter(stream)) 26 | { 27 | sw.Write(serializedDocument); 28 | sw.Close(); 29 | } 30 | } 31 | catch (Exception) 32 | { 33 | throw new AccessViolationException(); 34 | } 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Isp/InputParser.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Xml.Linq; 3 | using Newtonsoft.Json; 4 | 5 | namespace TechEd.Demo.SolidPrinciples.Isp 6 | { 7 | public class InputParser 8 | { 9 | public virtual Document ParseInput(string input) 10 | { 11 | Document doc; 12 | try 13 | { 14 | var xdoc = XDocument.Parse(input); 15 | doc = new Document(); 16 | doc.Title = xdoc.Root.Element("title").Value; 17 | doc.Text = xdoc.Root.Element("text").Value; 18 | } 19 | catch (Exception) 20 | { 21 | throw new InvalidInputFormatException(); 22 | } 23 | 24 | return doc; 25 | } 26 | } 27 | 28 | public class JsonInputParser : InputParser 29 | { 30 | public override Document ParseInput(string input) 31 | { 32 | try 33 | { 34 | return JsonConvert.DeserializeObject(input); 35 | } 36 | catch (Exception) 37 | { 38 | return base.ParseInput(input); 39 | } 40 | } 41 | } 42 | } -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Lsp/InputParser.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Xml.Linq; 3 | using Newtonsoft.Json; 4 | 5 | namespace TechEd.Demo.SolidPrinciples.Lsp 6 | { 7 | public class InputParser 8 | { 9 | public virtual Document ParseInput(string input) 10 | { 11 | Document doc; 12 | try 13 | { 14 | var xdoc = XDocument.Parse(input); 15 | doc = new Document(); 16 | doc.Title = xdoc.Root.Element("title").Value; 17 | doc.Text = xdoc.Root.Element("text").Value; 18 | } 19 | catch (Exception) 20 | { 21 | throw new InvalidInputFormatException(); 22 | } 23 | 24 | return doc; 25 | } 26 | } 27 | 28 | public class JsonInputParser : InputParser 29 | { 30 | public override Document ParseInput(string input) 31 | { 32 | try 33 | { 34 | return JsonConvert.DeserializeObject(input); 35 | } 36 | catch (Exception) 37 | { 38 | return base.ParseInput(input); 39 | } 40 | } 41 | } 42 | } -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Dip.Manual/InputParser.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Xml.Linq; 3 | using Newtonsoft.Json; 4 | 5 | namespace TechEd.Demo.SolidPrinciples.Dip.Manual 6 | { 7 | public class InputParser 8 | { 9 | public virtual Document ParseInput(string input) 10 | { 11 | Document doc; 12 | try 13 | { 14 | var xdoc = XDocument.Parse(input); 15 | doc = new Document(); 16 | doc.Title = xdoc.Root.Element("title").Value; 17 | doc.Text = xdoc.Root.Element("text").Value; 18 | } 19 | catch (Exception) 20 | { 21 | throw new InvalidInputFormatException(); 22 | } 23 | 24 | return doc; 25 | } 26 | } 27 | 28 | public class JsonInputParser : InputParser 29 | { 30 | public override Document ParseInput(string input) 31 | { 32 | try 33 | { 34 | return JsonConvert.DeserializeObject(input); 35 | } 36 | catch (Exception) 37 | { 38 | return base.ParseInput(input); 39 | } 40 | } 41 | } 42 | } -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Dip.IoCContainer/InputParser.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Xml.Linq; 3 | using Newtonsoft.Json; 4 | 5 | namespace TechEd.Demo.SolidPrinciples.Dip.IoCContainer 6 | { 7 | public class InputParser 8 | { 9 | public virtual Document ParseInput(string input) 10 | { 11 | Document doc; 12 | try 13 | { 14 | var xdoc = XDocument.Parse(input); 15 | doc = new Document(); 16 | doc.Title = xdoc.Root.Element("title").Value; 17 | doc.Text = xdoc.Root.Element("text").Value; 18 | } 19 | catch (Exception) 20 | { 21 | throw new InvalidInputFormatException(); 22 | } 23 | 24 | return doc; 25 | } 26 | } 27 | 28 | public class JsonInputParser : InputParser 29 | { 30 | public override Document ParseInput(string input) 31 | { 32 | try 33 | { 34 | return JsonConvert.DeserializeObject(input); 35 | } 36 | catch (Exception) 37 | { 38 | return base.ParseInput(input); 39 | } 40 | } 41 | } 42 | } -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Dip.ServiceLocator/InputParser.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Xml.Linq; 4 | using Newtonsoft.Json; 5 | 6 | namespace TechEd.Demo.SolidPrinciples.Dip.ServiceLocator 7 | { 8 | public class InputParser 9 | { 10 | public virtual Document ParseInput(string input) 11 | { 12 | Document doc; 13 | try 14 | { 15 | var xdoc = XDocument.Parse(input); 16 | doc = new Document(); 17 | doc.Title = xdoc.Root.Element("title").Value; 18 | doc.Text = xdoc.Root.Element("text").Value; 19 | } 20 | catch (Exception) 21 | { 22 | throw new InvalidInputFormatException(); 23 | } 24 | 25 | return doc; 26 | } 27 | } 28 | 29 | public class JsonInputParser : InputParser 30 | { 31 | public override Document ParseInput(string input) 32 | { 33 | try 34 | { 35 | return JsonConvert.DeserializeObject(input); 36 | } 37 | catch (Exception) 38 | { 39 | return base.ParseInput(input); 40 | } 41 | } 42 | } 43 | } -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Xml.Linq; 4 | using Newtonsoft.Json; 5 | 6 | namespace TechEd.Demo.SolidPrinciples 7 | { 8 | class Program 9 | { 10 | static void Main(string[] args) 11 | { 12 | var sourceFileName = Path.Combine(Environment.CurrentDirectory, "..\\..\\..\\Input Documents\\Document1.xml"); 13 | var targetFileName = Path.Combine(Environment.CurrentDirectory, "..\\..\\..\\Output Documents\\Document1.json"); 14 | 15 | string input; 16 | using (var stream = File.OpenRead(sourceFileName)) 17 | using (var reader = new StreamReader(stream)) 18 | { 19 | input = reader.ReadToEnd(); 20 | } 21 | 22 | var xdoc = XDocument.Parse(input); 23 | var doc = new Document 24 | { 25 | Title = xdoc.Root.Element("title").Value, 26 | Text = xdoc.Root.Element("text").Value 27 | }; 28 | 29 | var serializedDoc = JsonConvert.SerializeObject(doc); 30 | 31 | using (var stream = File.Open(targetFileName, FileMode.Create, FileAccess.Write)) 32 | using (var sw = new StreamWriter(stream)) 33 | { 34 | sw.Write(serializedDoc); 35 | sw.Close(); 36 | } 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Dip.IoCContainer/IDocumentSerializer.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using Newtonsoft.Json.Serialization; 3 | 4 | namespace TechEd.Demo.SolidPrinciples.Dip.IoCContainer 5 | { 6 | public interface IDocumentSerializer 7 | { 8 | string Serialize(Document document); 9 | } 10 | 11 | public class JsonDocumentSerializer : IDocumentSerializer 12 | { 13 | public string Serialize(Document document) 14 | { 15 | return JsonConvert.SerializeObject(document); 16 | } 17 | } 18 | 19 | public class CamelCaseJsonSerializer : IDocumentSerializer 20 | { 21 | public string Serialize(Document document) 22 | { 23 | var settings = new JsonSerializerSettings 24 | { 25 | ContractResolver = new CamelCasePropertyNamesContractResolver() 26 | }; 27 | return JsonConvert.SerializeObject(document, settings); 28 | } 29 | } 30 | 31 | public class IndentedCamelCaseJsonSerializer : IDocumentSerializer 32 | { 33 | public string Serialize(Document document) 34 | { 35 | var settings = new JsonSerializerSettings 36 | { 37 | ContractResolver = new CamelCasePropertyNamesContractResolver(), 38 | Formatting = Formatting.Indented 39 | }; 40 | return JsonConvert.SerializeObject(document, settings); 41 | } 42 | } 43 | } -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Srp/FormatConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | 4 | namespace TechEd.Demo.SolidPrinciples.Srp 5 | { 6 | public class FormatConverter 7 | { 8 | private readonly DocumentStorage _documentStorage; 9 | private readonly InputParser _inputParser; 10 | private readonly DocumentSerializer _documentSerializer; 11 | 12 | public FormatConverter() 13 | { 14 | _documentStorage = new DocumentStorage(); 15 | _inputParser = new InputParser(); 16 | _documentSerializer = new DocumentSerializer(); 17 | } 18 | 19 | public bool ConvertFormat(string sourceFileName, string targetFileName) 20 | { 21 | string input; 22 | try 23 | { 24 | input = _documentStorage.GetData(sourceFileName); 25 | } 26 | catch (FileNotFoundException) 27 | { 28 | return false; 29 | } 30 | 31 | var doc = _inputParser.ParseInput(input); 32 | var serializedDoc = _documentSerializer.Serialize(doc); 33 | 34 | try 35 | { 36 | _documentStorage.PersistDocument(serializedDoc, targetFileName); 37 | } 38 | catch (AccessViolationException) 39 | { 40 | return false; 41 | } 42 | 43 | return true; 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Dip.Manual/FormatConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | 4 | namespace TechEd.Demo.SolidPrinciples.Dip.Manual 5 | { 6 | public class FormatConverter 7 | { 8 | private readonly IDocumentSerializer _documentSerializer; 9 | private readonly InputParser _inputParser; 10 | 11 | public FormatConverter(IDocumentSerializer documentSerializer, InputParser inputParser) 12 | { 13 | _documentSerializer = documentSerializer; 14 | _inputParser = inputParser; 15 | } 16 | 17 | public bool ConvertFormat(string sourceFileName, string targetFileName) 18 | { 19 | string input; 20 | try 21 | { 22 | var inputRetriever = InputRetriever.ForFileName(sourceFileName); 23 | input = inputRetriever.GetData(sourceFileName); 24 | } 25 | catch (FileNotFoundException) 26 | { 27 | return false; 28 | } 29 | 30 | var doc = _inputParser.ParseInput(input); 31 | var serializedDoc = _documentSerializer.Serialize(doc); 32 | 33 | try 34 | { 35 | var documentPersister = DocumentPersister.ForFileName(targetFileName); 36 | documentPersister.PersistDocument(serializedDoc, targetFileName); 37 | } 38 | catch (AccessViolationException) 39 | { 40 | return false; 41 | } 42 | 43 | return true; 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Dip.IoCContainer/FormatConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | 4 | namespace TechEd.Demo.SolidPrinciples.Dip.IoCContainer 5 | { 6 | public class FormatConverter 7 | { 8 | private readonly IDocumentSerializer _documentSerializer; 9 | private readonly InputParser _inputParser; 10 | 11 | public FormatConverter(IDocumentSerializer documentSerializer, InputParser inputParser) 12 | { 13 | _documentSerializer = documentSerializer; 14 | _inputParser = inputParser; 15 | } 16 | 17 | public bool ConvertFormat(string sourceFileName, string targetFileName) 18 | { 19 | string input; 20 | try 21 | { 22 | var inputRetriever = InputRetriever.ForFileName(sourceFileName); 23 | input = inputRetriever.GetData(sourceFileName); 24 | } 25 | catch (FileNotFoundException) 26 | { 27 | return false; 28 | } 29 | 30 | var doc = _inputParser.ParseInput(input); 31 | var serializedDoc = _documentSerializer.Serialize(doc); 32 | 33 | try 34 | { 35 | var documentPersister = DocumentPersister.ForFileName(targetFileName); 36 | documentPersister.PersistDocument(serializedDoc, targetFileName); 37 | } 38 | catch (AccessViolationException) 39 | { 40 | return false; 41 | } 42 | 43 | return true; 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("TechEd.Demo.SolidPrinciples")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("TechEd.Demo.SolidPrinciples")] 13 | [assembly: AssemblyCopyright("Copyright © 2014")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("d0b6bf92-bd82-47f9-821e-6b7eac7d191e")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Isp/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("TechEd.Demo.SolidPrinciples.Isp")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("TechEd.Demo.SolidPrinciples.Isp")] 13 | [assembly: AssemblyCopyright("Copyright © 2014")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("d45e291e-29d7-45a6-a878-95e81068b105")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Lsp/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("TechEd.Demo.SolidPrinciples.Lsp")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("TechEd.Demo.SolidPrinciples.Lsp")] 13 | [assembly: AssemblyCopyright("Copyright © 2014")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("737d3a0c-7f9b-40f0-8fa2-ca38e479b1eb")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Ocp/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("TechEd.Demo.SolidPrinciples.Ocp")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("TechEd.Demo.SolidPrinciples.Ocp")] 13 | [assembly: AssemblyCopyright("Copyright © 2014")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("09f183a7-0899-46a0-bf02-7d985222d335")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Srp/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("TechEd.Demo.SolidPrinciples.Srp")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("TechEd.Demo.SolidPrinciples.Srp")] 13 | [assembly: AssemblyCopyright("Copyright © 2014")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("b801d0fb-407a-43f3-8b64-3ee10d1314ea")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Dip.Manual/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("TechEd.Demo.SolidPrinciples.Dip.Manual")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("TechEd.Demo.SolidPrinciples.Dip.Manual")] 13 | [assembly: AssemblyCopyright("Copyright © 2014")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("31aaaccf-9f63-4bf4-8e08-6c7f182d55ae")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Refactored/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("TechEd.Demo.SolidPrinciples.Refactored")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("TechEd.Demo.SolidPrinciples.Refactored")] 13 | [assembly: AssemblyCopyright("Copyright © 2014")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("9f858089-6e47-4c55-a3a2-58704c2ffe97")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Lsp.Principles/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("TechEd.Demo.SolidPrinciples.Lsp.Principles")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("TechEd.Demo.SolidPrinciples.Lsp.Principles")] 13 | [assembly: AssemblyCopyright("Copyright © 2014")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("e7d953e0-6fa4-46cb-a5e0-23788a7e4d75")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Dip.IoCContainer/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("TechEd.Demo.SolidPrinciples.Dip.IoCContainer")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("TechEd.Demo.SolidPrinciples.Dip.IoCContainer")] 13 | [assembly: AssemblyCopyright("Copyright © 2014")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("cfcda840-6dbf-4439-b79f-19f085ca9e07")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Dip.ServiceLocator/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("TechEd.Demo.SolidPrinciples.Dip.ServiceLocator")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("TechEd.Demo.SolidPrinciples.Dip.ServiceLocator")] 13 | [assembly: AssemblyCopyright("Copyright © 2014")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("7850f777-6adf-4662-a3c9-90c59b4d9c38")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Dip.ServiceLocator/FormatConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | 4 | namespace TechEd.Demo.SolidPrinciples.Dip.ServiceLocator 5 | { 6 | public class FormatConverter 7 | { 8 | private readonly IDocumentSerializer _documentSerializer; 9 | private readonly InputParser _inputParser; 10 | 11 | public FormatConverter() 12 | { 13 | _documentSerializer = Microsoft.Practices.ServiceLocation.ServiceLocator.Current.GetInstance(); 14 | _inputParser = Microsoft.Practices.ServiceLocation.ServiceLocator.Current.GetInstance(); 15 | } 16 | 17 | public bool ConvertFormat(string sourceFileName, string targetFileName) 18 | { 19 | string input; 20 | try 21 | { 22 | var inputRetriever = InputRetriever.ForFileName(sourceFileName); 23 | input = inputRetriever.GetData(sourceFileName); 24 | } 25 | catch (FileNotFoundException) 26 | { 27 | return false; 28 | } 29 | 30 | var doc = _inputParser.ParseInput(input); 31 | var serializedDoc = _documentSerializer.Serialize(doc); 32 | 33 | try 34 | { 35 | var documentPersister = DocumentPersister.ForFileName(targetFileName); 36 | documentPersister.PersistDocument(serializedDoc, targetFileName); 37 | } 38 | catch (AccessViolationException) 39 | { 40 | return false; 41 | } 42 | 43 | return true; 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Lsp.Principles/CarTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Drawing; 3 | using NUnit.Framework; 4 | using TechEd.Demo.SolidPrinciples.Lsp.Principles.Entities; 5 | 6 | namespace TechEd.Demo.SolidPrinciples.Lsp.Principles 7 | { 8 | [TestFixture] 9 | public class CarTests 10 | { 11 | //Covariance of method arguments is not possible in C# 12 | //Contravariance of method return values is not possible in C# 13 | 14 | [Test] 15 | public void Make_sure_car_can_start() 16 | { 17 | //var car = new Car(Color.Red); 18 | //var car = new BrokenCar(Color.Red); // Postconditions weakened 19 | var car = new CrimeBossCar(Color.Black, true); // Throws new type of exceptions 20 | 21 | try 22 | { 23 | car.StartEngine(); 24 | } 25 | catch (OutOfFuelException) 26 | { 27 | Assert.Fail("Car had no gas..."); 28 | } 29 | 30 | Assert.IsTrue(car.IsEngineRunning); 31 | } 32 | 33 | [Test] 34 | public void Make_sure_engine_is_running_after_start() 35 | { 36 | //var car = new Car(Color.Red); 37 | //var car = new Prius(Color.Red); // Changing invariants 38 | var car = new StolenCar(Color.Red); // Changing preconditions 39 | 40 | car.StartEngine(); 41 | 42 | Assert.IsTrue(car.IsEngineRunning); 43 | } 44 | 45 | [Test] 46 | public void Make_sure_car_is_painted_correctly() 47 | { 48 | //var car = new Car(Color.Red); 49 | var car = new PimpedCar(Color.Red); // Violating history constraint 50 | car.SetTemperature(10); 51 | 52 | Assert.AreEqual(Color.Red, car.Color); 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Refactored/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Xml.Linq; 4 | using Newtonsoft.Json; 5 | 6 | namespace TechEd.Demo.SolidPrinciples.Refactored 7 | { 8 | class Program 9 | { 10 | static void Main(string[] args) 11 | { 12 | var sourceFileName = Path.Combine(Environment.CurrentDirectory, "..\\..\\..\\Input Documents\\Document1.xml"); 13 | var targetFileName = Path.Combine(Environment.CurrentDirectory, "..\\..\\..\\Output Documents\\Document1.json"); 14 | 15 | var input = GetInput(sourceFileName); 16 | var doc = GetDocument(input); 17 | var serializedDoc = SerializeDocument(doc); 18 | PersistDocument(serializedDoc, targetFileName); 19 | } 20 | 21 | private static string GetInput(string sourceFileName) 22 | { 23 | using (var stream = File.OpenRead(sourceFileName)) 24 | using (var reader = new StreamReader(stream)) 25 | { 26 | return reader.ReadToEnd(); 27 | } 28 | } 29 | private static Document GetDocument(string input) 30 | { 31 | var xdoc = XDocument.Parse(input); 32 | var doc = new Document(); 33 | doc.Title = xdoc.Root.Element("title").Value; 34 | doc.Text = xdoc.Root.Element("text").Value; 35 | 36 | return doc; 37 | } 38 | private static string SerializeDocument(Document doc) 39 | { 40 | return JsonConvert.SerializeObject(doc); 41 | } 42 | private static void PersistDocument(string serializedDoc, string targetFileName) 43 | { 44 | using (var stream = File.Open(targetFileName, FileMode.Create, FileAccess.Write)) 45 | using (var sw = new StreamWriter(stream)) 46 | { 47 | sw.Write(serializedDoc); 48 | sw.Close(); 49 | } 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Dip.Manual/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Configuration; 3 | using System.IO; 4 | 5 | namespace TechEd.Demo.SolidPrinciples.Dip.Manual 6 | { 7 | class Program 8 | { 9 | static void Main(string[] args) 10 | { 11 | var sourceFileName = Path.Combine(Environment.CurrentDirectory, "..\\..\\..\\Input Documents\\Document1.xml"); 12 | var targetFileName = Path.Combine(Environment.CurrentDirectory, "..\\..\\..\\Output Documents\\Document1.json"); 13 | //var sourceFileName = "http://chris.59north.com/Document1.xml"; 14 | //var targetFileName = "https://teched.blob.core.windows.net/converted-documents/Document1.json"; 15 | 16 | ConfigureStorage(); 17 | 18 | var documentSerializer = new CamelCaseJsonSerializer(); 19 | var inputParser = new JsonInputParser(); 20 | 21 | var formatConverter = new FormatConverter(documentSerializer, inputParser); 22 | if (!formatConverter.ConvertFormat(sourceFileName, targetFileName)) 23 | { 24 | Console.WriteLine("Conversion failed..."); 25 | Console.ReadKey(); 26 | } 27 | } 28 | 29 | private static void ConfigureStorage() 30 | { 31 | var blobStorage = new BlobDocumentStorage(ConfigurationManager.AppSettings["storageAccount"], ConfigurationManager.AppSettings["storageKey"]); 32 | var fileStorage = new FileDocumentStorage(); 33 | var httpInputRetriever = new HttpInputRetriever(); 34 | 35 | InputRetriever.RegisterInputRetriever(x => x.StartsWith("http"), httpInputRetriever); 36 | InputRetriever.RegisterInputRetriever(IsBlobstorageUrl, blobStorage); 37 | InputRetriever.RegisterInputRetriever(x => true, fileStorage); 38 | DocumentPersister.RegisterDocumentPersister(IsBlobstorageUrl, blobStorage); 39 | DocumentPersister.RegisterDocumentPersister(x => true, fileStorage); 40 | } 41 | private static bool IsBlobstorageUrl(string str) 42 | { 43 | var storageAccount = ConfigurationManager.AppSettings["storageAccount"]; 44 | return str.StartsWith(string.Format("https://{0}.blob.core.windows.net/", storageAccount)); 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Lsp/FormatConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Configuration; 3 | using System.IO; 4 | 5 | namespace TechEd.Demo.SolidPrinciples.Lsp 6 | { 7 | public class FormatConverter 8 | { 9 | private readonly IDocumentSerializer _documentSerializer; 10 | private readonly InputParser _inputParser; 11 | 12 | public FormatConverter() 13 | { 14 | //_documentSerializer = new JsonDocumentSerializer(); 15 | _documentSerializer = new CamelCaseJsonSerializer(); 16 | _inputParser = new JsonInputParser(); 17 | } 18 | 19 | public bool ConvertFormat(string sourceFileName, string targetFileName) 20 | { 21 | string input; 22 | try 23 | { 24 | var documentStorage = GetDocumentStorageForFileName(sourceFileName); 25 | input = documentStorage.GetData(sourceFileName); 26 | } 27 | catch (FileNotFoundException) 28 | { 29 | return false; 30 | } 31 | 32 | var doc = _inputParser.ParseInput(input); 33 | var serializedDoc = _documentSerializer.Serialize(doc); 34 | 35 | try 36 | { 37 | var documentStorage = GetDocumentStorageForFileName(targetFileName); 38 | documentStorage.PersistDocument(serializedDoc, targetFileName); 39 | } 40 | catch (AccessViolationException) 41 | { 42 | return false; 43 | } 44 | 45 | return true; 46 | } 47 | 48 | private DocumentStorage GetDocumentStorageForFileName(string fileName) 49 | { 50 | 51 | if (IsBlobstorageUrl(fileName)) 52 | return new BlobDocumentStorage(ConfigurationManager.AppSettings["storageAccount"], ConfigurationManager.AppSettings["storageKey"]); 53 | 54 | if (fileName.StartsWith("http")) 55 | return new HttpInputRetriever(); 56 | 57 | return new FileDocumentStorage(); 58 | } 59 | 60 | private bool IsBlobstorageUrl(string str) 61 | { 62 | var storageAccount = ConfigurationManager.AppSettings["storageAccount"]; 63 | return str.StartsWith(string.Format("https://{0}.blob.core.windows.net/", storageAccount)); 64 | } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Ocp/FormatConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Configuration; 3 | using System.IO; 4 | 5 | namespace TechEd.Demo.SolidPrinciples.Ocp 6 | { 7 | public class FormatConverter 8 | { 9 | private readonly IDocumentSerializer _documentSerializer; 10 | private readonly InputParser _inputParser; 11 | 12 | public FormatConverter() 13 | { 14 | //_documentSerializer = new JsonDocumentSerializer(); 15 | _documentSerializer = new CamelCaseJsonSerializer(); 16 | _inputParser = new JsonInputParser(); 17 | } 18 | 19 | public bool ConvertFormat(string sourceFileName, string targetFileName) 20 | { 21 | string input; 22 | try 23 | { 24 | var documentStorage = GetDocumentStorageForFileName(sourceFileName); 25 | input = documentStorage.GetData(sourceFileName); 26 | } 27 | catch (FileNotFoundException) 28 | { 29 | return false; 30 | } 31 | 32 | var doc = _inputParser.ParseInput(input); 33 | var serializedDoc = _documentSerializer.Serialize(doc); 34 | 35 | try 36 | { 37 | var documentStorage = GetDocumentStorageForFileName(targetFileName); 38 | documentStorage.PersistDocument(serializedDoc, targetFileName); 39 | } 40 | catch (AccessViolationException) 41 | { 42 | return false; 43 | } 44 | 45 | return true; 46 | } 47 | 48 | private DocumentStorage GetDocumentStorageForFileName(string fileName) 49 | { 50 | 51 | if (IsBlobstorageUrl(fileName)) 52 | return new BlobDocumentStorage(ConfigurationManager.AppSettings["storageAccount"], ConfigurationManager.AppSettings["storageKey"]); 53 | 54 | if (fileName.StartsWith("http")) 55 | return new HttpInputRetriever(); 56 | 57 | return new FileDocumentStorage(); 58 | } 59 | 60 | private bool IsBlobstorageUrl(string str) 61 | { 62 | var storageAccount = ConfigurationManager.AppSettings["storageAccount"]; 63 | return str.StartsWith(string.Format("https://{0}.blob.core.windows.net/", storageAccount)); 64 | } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Dip.IoCContainer/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Dip.ServiceLocator/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Configuration; 3 | using System.IO; 4 | using Microsoft.Practices.Unity; 5 | 6 | namespace TechEd.Demo.SolidPrinciples.Dip.ServiceLocator 7 | { 8 | class Program 9 | { 10 | static void Main(string[] args) 11 | { 12 | var sourceFileName = Path.Combine(Environment.CurrentDirectory, "..\\..\\..\\Input Documents\\Document1.xml"); 13 | var targetFileName = Path.Combine(Environment.CurrentDirectory, "..\\..\\..\\Output Documents\\Document1.json"); 14 | //var sourceFileName = "http://chris.59north.com/Document1.xml"; 15 | //var targetFileName = "https://teched.blob.core.windows.net/converted-documents/Document1.json"; 16 | 17 | ConfigureServiceLocator(); 18 | ConfigureStorage(); 19 | 20 | var formatConverter = new FormatConverter(); 21 | if (!formatConverter.ConvertFormat(sourceFileName, targetFileName)) 22 | { 23 | Console.WriteLine("Conversion failed..."); 24 | Console.ReadKey(); 25 | } 26 | } 27 | 28 | private static void ConfigureServiceLocator() 29 | { 30 | IUnityContainer container = new UnityContainer(); 31 | 32 | container.RegisterType(); 33 | container.RegisterType(); 34 | 35 | var locator = new UnityServiceLocator(container); 36 | Microsoft.Practices.ServiceLocation.ServiceLocator.SetLocatorProvider(() => locator); 37 | } 38 | private static void ConfigureStorage() 39 | { 40 | var blobStorage = new BlobDocumentStorage(ConfigurationManager.AppSettings["storageAccount"], ConfigurationManager.AppSettings["storageKey"]); 41 | var fileStorage = new FileDocumentStorage(); 42 | var httpInputRetriever = new HttpInputRetriever(); 43 | 44 | InputRetriever.RegisterInputRetriever(x => x.StartsWith("http"), httpInputRetriever); 45 | InputRetriever.RegisterInputRetriever(IsBlobstorageUrl, blobStorage); 46 | InputRetriever.RegisterInputRetriever(x => true, fileStorage); 47 | DocumentPersister.RegisterDocumentPersister(IsBlobstorageUrl, blobStorage); 48 | DocumentPersister.RegisterDocumentPersister(x => true, fileStorage); 49 | } 50 | private static bool IsBlobstorageUrl(string str) 51 | { 52 | var storageAccount = ConfigurationManager.AppSettings["storageAccount"]; 53 | return str.StartsWith(string.Format("https://{0}.blob.core.windows.net/", storageAccount)); 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Isp/FormatConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Configuration; 3 | using System.IO; 4 | 5 | namespace TechEd.Demo.SolidPrinciples.Isp 6 | { 7 | public class FormatConverter 8 | { 9 | private readonly IDocumentSerializer _documentSerializer; 10 | private readonly InputParser _inputParser; 11 | 12 | public FormatConverter() 13 | { 14 | //_documentSerializer = new JsonDocumentSerializer(); 15 | _documentSerializer = new CamelCaseJsonSerializer(); 16 | _inputParser = new JsonInputParser(); 17 | } 18 | 19 | public bool ConvertFormat(string sourceFileName, string targetFileName) 20 | { 21 | string input; 22 | try 23 | { 24 | var inputRetriever = GetInputRetrieverForFileName(sourceFileName); 25 | input = inputRetriever.GetData(sourceFileName); 26 | } 27 | catch (FileNotFoundException) 28 | { 29 | return false; 30 | } 31 | 32 | var doc = _inputParser.ParseInput(input); 33 | var serializedDoc = _documentSerializer.Serialize(doc); 34 | 35 | try 36 | { 37 | var documentPerister = GetDocumentPersisterForFileName(targetFileName); 38 | documentPerister.PersistDocument(serializedDoc, targetFileName); 39 | } 40 | catch (AccessViolationException) 41 | { 42 | return false; 43 | } 44 | 45 | return true; 46 | } 47 | 48 | private IInputRetriever GetInputRetrieverForFileName(string fileName) 49 | { 50 | if (IsBlobstorageUrl(fileName)) 51 | return new BlobDocumentStorage(ConfigurationManager.AppSettings["storageAccount"], ConfigurationManager.AppSettings["storageKey"]); 52 | 53 | if (fileName.StartsWith("http")) 54 | return new HttpInputRetriever(); 55 | 56 | return new FileDocumentStorage(); 57 | } 58 | private IDocumentPersister GetDocumentPersisterForFileName(string fileName) 59 | { 60 | if (IsBlobstorageUrl(fileName)) 61 | return new BlobDocumentStorage(ConfigurationManager.AppSettings["storageAccount"], ConfigurationManager.AppSettings["storageKey"]); 62 | 63 | return new FileDocumentStorage(); 64 | } 65 | 66 | private bool IsBlobstorageUrl(string str) 67 | { 68 | var storageAccount = ConfigurationManager.AppSettings["storageAccount"]; 69 | return str.StartsWith(string.Format("https://{0}.blob.core.windows.net/", storageAccount)); 70 | } 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Dip.IoCContainer/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Configuration; 3 | using System.IO; 4 | using Microsoft.Practices.Unity; 5 | using Microsoft.Practices.Unity.Configuration; 6 | 7 | namespace TechEd.Demo.SolidPrinciples.Dip.IoCContainer 8 | { 9 | class Program 10 | { 11 | static void Main(string[] args) 12 | { 13 | var sourceFileName = Path.Combine(Environment.CurrentDirectory, "..\\..\\..\\Input Documents\\Document1.xml"); 14 | var targetFileName = Path.Combine(Environment.CurrentDirectory, "..\\..\\..\\Output Documents\\Document1.json"); 15 | //var sourceFileName = "http://chris.59north.com/Document1.xml"; 16 | //var targetFileName = "https://teched.blob.core.windows.net/converted-documents/Document1.json"; 17 | 18 | //var container = GetContainer(); 19 | var container = ConfigureDeclarativelyContainer(); 20 | ConfigureStorage(); 21 | 22 | var formatConverter = container.Resolve(); 23 | if (!formatConverter.ConvertFormat(sourceFileName, targetFileName)) 24 | { 25 | Console.WriteLine("Conversion failed..."); 26 | Console.ReadKey(); 27 | } 28 | } 29 | 30 | private static IUnityContainer GetContainer() 31 | { 32 | IUnityContainer container = new UnityContainer(); 33 | 34 | container.RegisterType(); 35 | container.RegisterType(); 36 | 37 | return container; 38 | } 39 | private static IUnityContainer ConfigureDeclarativelyContainer() 40 | { 41 | IUnityContainer container = new UnityContainer(); 42 | var section = (UnityConfigurationSection)ConfigurationManager.GetSection("unity"); 43 | section.Configure(container); 44 | return container; 45 | } 46 | private static void ConfigureStorage() 47 | { 48 | var blobStorage = new BlobDocumentStorage(ConfigurationManager.AppSettings["storageAccount"], ConfigurationManager.AppSettings["storageKey"]); 49 | var fileStorage = new FileDocumentStorage(); 50 | var httpInputRetriever = new HttpInputRetriever(); 51 | 52 | InputRetriever.RegisterInputRetriever(x => x.StartsWith("http"), httpInputRetriever); 53 | InputRetriever.RegisterInputRetriever(IsBlobstorageUrl, blobStorage); 54 | InputRetriever.RegisterInputRetriever(x => true, fileStorage); 55 | DocumentPersister.RegisterDocumentPersister(IsBlobstorageUrl, blobStorage); 56 | DocumentPersister.RegisterDocumentPersister(x => true, fileStorage); 57 | } 58 | private static bool IsBlobstorageUrl(string str) 59 | { 60 | var storageAccount = ConfigurationManager.AppSettings["storageAccount"]; 61 | return str.StartsWith(string.Format("https://{0}.blob.core.windows.net/", storageAccount)); 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Lsp.Principles/Entities/Car.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Drawing; 3 | 4 | namespace TechEd.Demo.SolidPrinciples.Lsp.Principles.Entities 5 | { 6 | public class Car 7 | { 8 | private bool _hasFuel = true; 9 | 10 | public Car(Color color) 11 | { 12 | Color = color; 13 | } 14 | 15 | public virtual void StartEngine() 16 | { 17 | if (!_hasFuel) 18 | throw new OutOfFuelException("Can't start a car without gas in tank..."); 19 | 20 | IsEngineRunning = true; 21 | } 22 | public virtual void StopEngine() 23 | { 24 | IsEngineRunning = false; 25 | } 26 | 27 | public bool IsEngineRunning { get; private set; } 28 | public Color Color { get; protected set; } 29 | } 30 | 31 | public class BrokenCar : Car 32 | { 33 | public BrokenCar(Color color) : base(color) 34 | { 35 | } 36 | 37 | public override void StartEngine() 38 | { 39 | throw new NotImplementedException(); 40 | } 41 | } 42 | 43 | public class CrimeBossCar : Car 44 | { 45 | private readonly bool _boobyTrapped; 46 | 47 | public CrimeBossCar(Color color, bool boobyTrap) 48 | : base(color) 49 | { 50 | _boobyTrapped = boobyTrap; 51 | } 52 | 53 | public override void StartEngine() 54 | { 55 | if (_boobyTrapped) 56 | throw new MetYourMakerException("Boom! You are dead!"); 57 | 58 | base.StartEngine(); 59 | } 60 | } 61 | 62 | public class Prius : Car 63 | { 64 | public Prius(Color color) : base(color) 65 | { 66 | } 67 | 68 | public override void StartEngine() 69 | { 70 | } 71 | public override void StopEngine() 72 | { 73 | } 74 | } 75 | 76 | public class StolenCar : Car 77 | { 78 | private bool _ignitionWiresStripped; 79 | 80 | public StolenCar(Color color) : base(color) 81 | { 82 | } 83 | 84 | public void StripIgnitionWires() 85 | { 86 | _ignitionWiresStripped = true; 87 | } 88 | public override void StartEngine() 89 | { 90 | if (!_ignitionWiresStripped) return; 91 | 92 | base.StartEngine(); 93 | } 94 | } 95 | 96 | // http://www.dailymail.co.uk/sciencetech/article-2451931/Car-colour-heat-sensitive-paint-changes-depending-weather.html 97 | public class PimpedCar : Car 98 | { 99 | private readonly Color _color; 100 | 101 | public PimpedCar(Color color) : base(color) 102 | { 103 | _color = color; 104 | } 105 | 106 | public void SetTemperature(int temp) 107 | { 108 | if (temp > 20) 109 | Color = _color; 110 | else 111 | Color = Color.Black; 112 | } 113 | } 114 | 115 | 116 | public class OutOfFuelException : Exception 117 | { 118 | public OutOfFuelException(string message) : base(message) 119 | { 120 | 121 | } 122 | } 123 | public class MetYourMakerException : Exception 124 | { 125 | public MetYourMakerException(string message) : base(message) 126 | { 127 | 128 | } 129 | } 130 | } 131 | -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Lsp.Principles/TechEd.Demo.SolidPrinciples.Lsp.Principles.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {750C6448-F2D2-4E09-9FD3-F7A75D3AC5E8} 8 | Exe 9 | Properties 10 | TechEd.Demo.SolidPrinciples.Lsp.Principles 11 | TechEd.Demo.SolidPrinciples.Lsp.Principles 12 | v4.5 13 | 512 14 | ..\ 15 | true 16 | 17 | 18 | AnyCPU 19 | true 20 | full 21 | false 22 | bin\Debug\ 23 | DEBUG;TRACE 24 | prompt 25 | 4 26 | 27 | 28 | AnyCPU 29 | pdbonly 30 | true 31 | bin\Release\ 32 | TRACE 33 | prompt 34 | 4 35 | 36 | 37 | 38 | ..\packages\NUnit.2.6.3\lib\nunit.framework.dll 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. 64 | 65 | 66 | 67 | 74 | -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples/TechEd.Demo.SolidPrinciples.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {8D3723A7-3DF8-4DEE-8120-4C4DBF084B84} 8 | Exe 9 | Properties 10 | TechEd.Demo.SolidPrinciples 11 | TechEd.Demo.SolidPrinciples 12 | v4.5 13 | 512 14 | ..\ 15 | true 16 | 17 | 18 | AnyCPU 19 | true 20 | full 21 | false 22 | bin\Debug\ 23 | DEBUG;TRACE 24 | prompt 25 | 4 26 | 27 | 28 | AnyCPU 29 | pdbonly 30 | true 31 | bin\Release\ 32 | TRACE 33 | prompt 34 | 4 35 | 36 | 37 | 38 | False 39 | ..\packages\Newtonsoft.Json.6.0.1\lib\net45\Newtonsoft.Json.dll 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. 63 | 64 | 65 | 66 | 73 | -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Ocp/DocumentStorage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Net; 4 | using Microsoft.WindowsAzure.Storage; 5 | using Microsoft.WindowsAzure.Storage.Auth; 6 | using Microsoft.WindowsAzure.Storage.Blob; 7 | 8 | namespace TechEd.Demo.SolidPrinciples.Ocp 9 | { 10 | public abstract class DocumentStorage 11 | { 12 | public abstract string GetData(string fileName); 13 | public abstract void PersistDocument(string serializedDocument, string targetFileName); 14 | } 15 | 16 | public class FileDocumentStorage : DocumentStorage 17 | { 18 | public override string GetData(string fileName) 19 | { 20 | if (!File.Exists(fileName)) 21 | throw new FileNotFoundException("Could not find a file with that name..."); 22 | 23 | using (var stream = File.OpenRead(fileName)) 24 | using (var reader = new StreamReader(stream)) 25 | { 26 | return reader.ReadToEnd(); 27 | } 28 | } 29 | public override void PersistDocument(string serializedDocument, string targetFileName) 30 | { 31 | try 32 | { 33 | using (var stream = File.Open(targetFileName, FileMode.Create, FileAccess.Write)) 34 | using (var sw = new StreamWriter(stream)) 35 | { 36 | sw.Write(serializedDocument); 37 | sw.Close(); 38 | } 39 | } 40 | catch (Exception) 41 | { 42 | throw new AccessViolationException(); 43 | } 44 | } 45 | } 46 | 47 | public class BlobDocumentStorage : DocumentStorage 48 | { 49 | private readonly CloudBlobClient _blobClient; 50 | 51 | public BlobDocumentStorage(string storageAccount, string storageKey) 52 | { 53 | var account = new CloudStorageAccount(new StorageCredentials(storageAccount, storageKey), true); 54 | _blobClient = account.CreateCloudBlobClient(); 55 | } 56 | 57 | public override string GetData(string fileName) 58 | { 59 | if (!fileName.StartsWith(_blobClient.BaseUri.ToString())) 60 | { 61 | throw new InvalidTargetException(); 62 | } 63 | 64 | var client = new WebClient(); 65 | var input = client.DownloadString(fileName); 66 | 67 | return input; 68 | } 69 | public override void PersistDocument(string serializedDocument, string targetFileName) 70 | { 71 | if (!targetFileName.StartsWith(_blobClient.BaseUri.ToString())) 72 | { 73 | throw new InvalidTargetException(); 74 | } 75 | 76 | var uri = new Uri(targetFileName); 77 | var containerName = uri.AbsolutePath.Substring(1, uri.AbsolutePath.IndexOf('/', 1) - 1); 78 | var container = _blobClient.GetContainerReference(containerName); 79 | container.CreateIfNotExists(BlobContainerPublicAccessType.Container); 80 | var blob = container.GetBlockBlobReference(targetFileName.Replace(_blobClient.BaseUri + containerName + "/", "")); 81 | blob.UploadText(serializedDocument); 82 | } 83 | } 84 | 85 | public class HttpInputRetriever : DocumentStorage 86 | { 87 | public override void PersistDocument(string serializedDocument, string targetFileName) 88 | { 89 | throw new NotImplementedException(); 90 | } 91 | 92 | public override string GetData(string fileName) 93 | { 94 | if (!fileName.StartsWith("http")) 95 | { 96 | throw new InvalidTargetException(); 97 | } 98 | 99 | var client = new WebClient(); 100 | var input = client.DownloadString(fileName); 101 | 102 | return input; 103 | } 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Refactored/TechEd.Demo.SolidPrinciples.Refactored.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {50016C85-035C-4628-A506-40155666FD5E} 8 | Exe 9 | Properties 10 | TechEd.Demo.SolidPrinciples.Refactored 11 | TechEd.Demo.SolidPrinciples.Refactored 12 | v4.5 13 | 512 14 | ..\ 15 | true 16 | 17 | 18 | AnyCPU 19 | true 20 | full 21 | false 22 | bin\Debug\ 23 | DEBUG;TRACE 24 | prompt 25 | 4 26 | 27 | 28 | AnyCPU 29 | pdbonly 30 | true 31 | bin\Release\ 32 | TRACE 33 | prompt 34 | 4 35 | 36 | 37 | 38 | False 39 | ..\Format Converter\packages\Newtonsoft.Json.6.0.1\lib\net45\Newtonsoft.Json.dll 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. 63 | 64 | 65 | 66 | 73 | -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Lsp/DocumentStorage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Net; 4 | using Microsoft.WindowsAzure.Storage; 5 | using Microsoft.WindowsAzure.Storage.Auth; 6 | using Microsoft.WindowsAzure.Storage.Blob; 7 | 8 | namespace TechEd.Demo.SolidPrinciples.Lsp 9 | { 10 | public abstract class DocumentStorage 11 | { 12 | public abstract string GetData(string fileName); 13 | public abstract void PersistDocument(string serializedDocument, string targetFileName); 14 | } 15 | 16 | public class FileDocumentStorage : DocumentStorage 17 | { 18 | public override string GetData(string fileName) 19 | { 20 | if (!File.Exists(fileName)) 21 | throw new FileNotFoundException("Could not find a file with that name..."); 22 | 23 | using (var stream = File.OpenRead(fileName)) 24 | using (var reader = new StreamReader(stream)) 25 | { 26 | return reader.ReadToEnd(); 27 | } 28 | } 29 | public override void PersistDocument(string serializedDocument, string targetFileName) 30 | { 31 | try 32 | { 33 | using (var stream = File.Open(targetFileName, FileMode.Create, FileAccess.Write)) 34 | using (var sw = new StreamWriter(stream)) 35 | { 36 | sw.Write(serializedDocument); 37 | sw.Close(); 38 | } 39 | } 40 | catch (Exception) 41 | { 42 | throw new AccessViolationException(); 43 | } 44 | } 45 | } 46 | 47 | public class BlobDocumentStorage : DocumentStorage 48 | { 49 | private readonly CloudBlobClient _blobClient; 50 | 51 | public BlobDocumentStorage(string storageAccount, string storageKey) 52 | { 53 | var account = new CloudStorageAccount(new StorageCredentials(storageAccount, storageKey), true); 54 | _blobClient = account.CreateCloudBlobClient(); 55 | } 56 | 57 | public override string GetData(string fileName) 58 | { 59 | if (!fileName.StartsWith(_blobClient.BaseUri.ToString())) 60 | { 61 | throw new InvalidTargetException(); 62 | } 63 | 64 | var client = new WebClient(); 65 | var input = client.DownloadString(fileName); 66 | 67 | return input; 68 | } 69 | public override void PersistDocument(string serializedDocument, string targetFileName) 70 | { 71 | if (!targetFileName.StartsWith(_blobClient.BaseUri.ToString())) 72 | { 73 | throw new InvalidTargetException(); 74 | } 75 | 76 | var uri = new Uri(targetFileName); 77 | var containerName = uri.AbsolutePath.Substring(1, uri.AbsolutePath.IndexOf('/', 1) - 1); 78 | var container = _blobClient.GetContainerReference(containerName); 79 | container.CreateIfNotExists(BlobContainerPublicAccessType.Container); 80 | var blob = container.GetBlockBlobReference(targetFileName.Replace(_blobClient.BaseUri + containerName + "/", "")); 81 | blob.UploadText(serializedDocument); 82 | } 83 | } 84 | 85 | public class HttpInputRetriever : DocumentStorage 86 | { 87 | public override void PersistDocument(string serializedDocument, string targetFileName) 88 | { 89 | // Impossible to solve... 90 | // Fixed in the ISP phase... 91 | throw new NotImplementedException(); 92 | } 93 | 94 | public override string GetData(string fileName) 95 | { 96 | if (!fileName.StartsWith("http")) 97 | { 98 | throw new InvalidTargetException(); 99 | } 100 | 101 | var client = new WebClient(); 102 | var input = client.DownloadString(fileName); 103 | 104 | return input; 105 | } 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Isp/DocumentStorage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Net; 4 | using Microsoft.WindowsAzure.Storage; 5 | using Microsoft.WindowsAzure.Storage.Auth; 6 | using Microsoft.WindowsAzure.Storage.Blob; 7 | 8 | namespace TechEd.Demo.SolidPrinciples.Isp 9 | { 10 | public interface IInputRetriever 11 | { 12 | string GetData(string fileName); 13 | } 14 | public interface IDocumentPersister 15 | { 16 | void PersistDocument(string serializedDocument, string targetFileName); 17 | } 18 | public abstract class DocumentStorage : IInputRetriever, IDocumentPersister 19 | { 20 | public abstract string GetData(string fileName); 21 | public abstract void PersistDocument(string serializedDocument, string targetFileName); 22 | } 23 | 24 | public class FileDocumentStorage : DocumentStorage 25 | { 26 | public override string GetData(string fileName) 27 | { 28 | if (!File.Exists(fileName)) 29 | throw new FileNotFoundException("Could not find a file with that name..."); 30 | 31 | using (var stream = File.OpenRead(fileName)) 32 | using (var reader = new StreamReader(stream)) 33 | { 34 | return reader.ReadToEnd(); 35 | } 36 | } 37 | public override void PersistDocument(string serializedDocument, string targetFileName) 38 | { 39 | try 40 | { 41 | using (var stream = File.Open(targetFileName, FileMode.Create, FileAccess.Write)) 42 | using (var sw = new StreamWriter(stream)) 43 | { 44 | sw.Write(serializedDocument); 45 | sw.Close(); 46 | } 47 | } 48 | catch (Exception) 49 | { 50 | throw new AccessViolationException(); 51 | } 52 | } 53 | } 54 | 55 | public class BlobDocumentStorage : DocumentStorage 56 | { 57 | private readonly CloudBlobClient _blobClient; 58 | 59 | public BlobDocumentStorage(string storageAccount, string storageKey) 60 | { 61 | var account = new CloudStorageAccount(new StorageCredentials(storageAccount, storageKey), true); 62 | _blobClient = account.CreateCloudBlobClient(); 63 | } 64 | 65 | public override string GetData(string fileName) 66 | { 67 | if (!fileName.StartsWith(_blobClient.BaseUri.ToString())) 68 | { 69 | throw new InvalidTargetException(); 70 | } 71 | 72 | var client = new WebClient(); 73 | var input = client.DownloadString(fileName); 74 | 75 | return input; 76 | } 77 | public override void PersistDocument(string serializedDocument, string targetFileName) 78 | { 79 | if (!targetFileName.StartsWith(_blobClient.BaseUri.ToString())) 80 | { 81 | throw new InvalidTargetException(); 82 | } 83 | 84 | var uri = new Uri(targetFileName); 85 | var containerName = uri.AbsolutePath.Substring(1, uri.AbsolutePath.IndexOf('/', 1) - 1); 86 | var container = _blobClient.GetContainerReference(containerName); 87 | container.CreateIfNotExists(BlobContainerPublicAccessType.Container); 88 | var blob = container.GetBlockBlobReference(targetFileName.Replace(_blobClient.BaseUri + containerName + "/", "")); 89 | blob.UploadText(serializedDocument); 90 | } 91 | } 92 | 93 | public class HttpInputRetriever : IInputRetriever 94 | { 95 | public string GetData(string fileName) 96 | { 97 | if (!fileName.StartsWith("http")) 98 | { 99 | throw new InvalidTargetException(); 100 | } 101 | 102 | var client = new WebClient(); 103 | var input = client.DownloadString(fileName); 104 | 105 | return input; 106 | } 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Dip.Manual/DocumentStorage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Net; 4 | using Microsoft.WindowsAzure.Storage; 5 | using Microsoft.WindowsAzure.Storage.Auth; 6 | using Microsoft.WindowsAzure.Storage.Blob; 7 | 8 | namespace TechEd.Demo.SolidPrinciples.Dip.Manual 9 | { 10 | public interface IInputRetriever 11 | { 12 | string GetData(string fileName); 13 | } 14 | public interface IDocumentPersister 15 | { 16 | void PersistDocument(string serializedDocument, string targetFileName); 17 | } 18 | public abstract class DocumentStorage : IInputRetriever, IDocumentPersister 19 | { 20 | public abstract string GetData(string fileName); 21 | public abstract void PersistDocument(string serializedDocument, string targetFileName); 22 | } 23 | 24 | public class FileDocumentStorage : DocumentStorage 25 | { 26 | public override string GetData(string fileName) 27 | { 28 | if (!File.Exists(fileName)) 29 | throw new FileNotFoundException("Could not find a file with that name..."); 30 | 31 | using (var stream = File.OpenRead(fileName)) 32 | using (var reader = new StreamReader(stream)) 33 | { 34 | return reader.ReadToEnd(); 35 | } 36 | } 37 | public override void PersistDocument(string serializedDocument, string targetFileName) 38 | { 39 | try 40 | { 41 | using (var stream = File.Open(targetFileName, FileMode.Create, FileAccess.Write)) 42 | using (var sw = new StreamWriter(stream)) 43 | { 44 | sw.Write(serializedDocument); 45 | sw.Close(); 46 | } 47 | } 48 | catch (Exception) 49 | { 50 | throw new AccessViolationException(); 51 | } 52 | } 53 | } 54 | 55 | public class BlobDocumentStorage : DocumentStorage 56 | { 57 | private readonly CloudBlobClient _blobClient; 58 | 59 | public BlobDocumentStorage(string storageAccount, string storageKey) 60 | { 61 | var account = new CloudStorageAccount(new StorageCredentials(storageAccount, storageKey), true); 62 | _blobClient = account.CreateCloudBlobClient(); 63 | } 64 | 65 | public override string GetData(string fileName) 66 | { 67 | if (!fileName.StartsWith(_blobClient.BaseUri.ToString())) 68 | { 69 | throw new InvalidTargetException(); 70 | } 71 | 72 | var client = new WebClient(); 73 | var input = client.DownloadString(fileName); 74 | 75 | return input; 76 | } 77 | public override void PersistDocument(string serializedDocument, string targetFileName) 78 | { 79 | if (!targetFileName.StartsWith(_blobClient.BaseUri.ToString())) 80 | { 81 | throw new InvalidTargetException(); 82 | } 83 | 84 | var uri = new Uri(targetFileName); 85 | var containerName = uri.AbsolutePath.Substring(1, uri.AbsolutePath.IndexOf('/', 1) - 1); 86 | var container = _blobClient.GetContainerReference(containerName); 87 | container.CreateIfNotExists(BlobContainerPublicAccessType.Container); 88 | var blob = container.GetBlockBlobReference(targetFileName.Replace(_blobClient.BaseUri + containerName + "/", "")); 89 | blob.UploadText(serializedDocument); 90 | } 91 | } 92 | 93 | public class HttpInputRetriever : IInputRetriever 94 | { 95 | public string GetData(string fileName) 96 | { 97 | if (!fileName.StartsWith("http")) 98 | { 99 | throw new InvalidTargetException(); 100 | } 101 | 102 | var client = new WebClient(); 103 | var input = client.DownloadString(fileName); 104 | 105 | return input; 106 | } 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Dip.IoCContainer/DocumentStorage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Net; 4 | using Microsoft.WindowsAzure.Storage; 5 | using Microsoft.WindowsAzure.Storage.Auth; 6 | using Microsoft.WindowsAzure.Storage.Blob; 7 | 8 | namespace TechEd.Demo.SolidPrinciples.Dip.IoCContainer 9 | { 10 | public interface IInputRetriever 11 | { 12 | string GetData(string fileName); 13 | } 14 | public interface IDocumentPersister 15 | { 16 | void PersistDocument(string serializedDocument, string targetFileName); 17 | } 18 | public abstract class DocumentStorage : IInputRetriever, IDocumentPersister 19 | { 20 | public abstract string GetData(string fileName); 21 | public abstract void PersistDocument(string serializedDocument, string targetFileName); 22 | } 23 | 24 | public class FileDocumentStorage : DocumentStorage 25 | { 26 | public override string GetData(string fileName) 27 | { 28 | if (!File.Exists(fileName)) 29 | throw new FileNotFoundException("Could not find a file with that name..."); 30 | 31 | using (var stream = File.OpenRead(fileName)) 32 | using (var reader = new StreamReader(stream)) 33 | { 34 | return reader.ReadToEnd(); 35 | } 36 | } 37 | public override void PersistDocument(string serializedDocument, string targetFileName) 38 | { 39 | try 40 | { 41 | using (var stream = File.Open(targetFileName, FileMode.Create, FileAccess.Write)) 42 | using (var sw = new StreamWriter(stream)) 43 | { 44 | sw.Write(serializedDocument); 45 | sw.Close(); 46 | } 47 | } 48 | catch (Exception) 49 | { 50 | throw new AccessViolationException(); 51 | } 52 | } 53 | } 54 | 55 | public class BlobDocumentStorage : DocumentStorage 56 | { 57 | private readonly CloudBlobClient _blobClient; 58 | 59 | public BlobDocumentStorage(string storageAccount, string storageKey) 60 | { 61 | var account = new CloudStorageAccount(new StorageCredentials(storageAccount, storageKey), true); 62 | _blobClient = account.CreateCloudBlobClient(); 63 | } 64 | 65 | public override string GetData(string fileName) 66 | { 67 | if (!fileName.StartsWith(_blobClient.BaseUri.ToString())) 68 | { 69 | throw new InvalidTargetException(); 70 | } 71 | 72 | var client = new WebClient(); 73 | var input = client.DownloadString(fileName); 74 | 75 | return input; 76 | } 77 | public override void PersistDocument(string serializedDocument, string targetFileName) 78 | { 79 | if (!targetFileName.StartsWith(_blobClient.BaseUri.ToString())) 80 | { 81 | throw new InvalidTargetException(); 82 | } 83 | 84 | var uri = new Uri(targetFileName); 85 | var containerName = uri.AbsolutePath.Substring(1, uri.AbsolutePath.IndexOf('/', 1) - 1); 86 | var container = _blobClient.GetContainerReference(containerName); 87 | container.CreateIfNotExists(BlobContainerPublicAccessType.Container); 88 | var blob = container.GetBlockBlobReference(targetFileName.Replace(_blobClient.BaseUri + containerName + "/", "")); 89 | blob.UploadText(serializedDocument); 90 | } 91 | } 92 | 93 | public class HttpInputRetriever : IInputRetriever 94 | { 95 | public string GetData(string fileName) 96 | { 97 | if (!fileName.StartsWith("http")) 98 | { 99 | throw new InvalidTargetException(); 100 | } 101 | 102 | var client = new WebClient(); 103 | var input = client.DownloadString(fileName); 104 | 105 | return input; 106 | } 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Dip.ServiceLocator/DocumentStorage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Net; 4 | using Microsoft.WindowsAzure.Storage; 5 | using Microsoft.WindowsAzure.Storage.Auth; 6 | using Microsoft.WindowsAzure.Storage.Blob; 7 | 8 | namespace TechEd.Demo.SolidPrinciples.Dip.ServiceLocator 9 | { 10 | public interface IInputRetriever 11 | { 12 | string GetData(string fileName); 13 | } 14 | public interface IDocumentPersister 15 | { 16 | void PersistDocument(string serializedDocument, string targetFileName); 17 | } 18 | public abstract class DocumentStorage : IInputRetriever, IDocumentPersister 19 | { 20 | public abstract string GetData(string fileName); 21 | public abstract void PersistDocument(string serializedDocument, string targetFileName); 22 | } 23 | 24 | public class FileDocumentStorage : DocumentStorage 25 | { 26 | public override string GetData(string fileName) 27 | { 28 | if (!File.Exists(fileName)) 29 | throw new FileNotFoundException("Could not find a file with that name..."); 30 | 31 | using (var stream = File.OpenRead(fileName)) 32 | using (var reader = new StreamReader(stream)) 33 | { 34 | return reader.ReadToEnd(); 35 | } 36 | } 37 | public override void PersistDocument(string serializedDocument, string targetFileName) 38 | { 39 | try 40 | { 41 | using (var stream = File.Open(targetFileName, FileMode.Create, FileAccess.Write)) 42 | using (var sw = new StreamWriter(stream)) 43 | { 44 | sw.Write(serializedDocument); 45 | sw.Close(); 46 | } 47 | } 48 | catch (Exception) 49 | { 50 | throw new AccessViolationException(); 51 | } 52 | } 53 | } 54 | 55 | public class BlobDocumentStorage : DocumentStorage 56 | { 57 | private readonly CloudBlobClient _blobClient; 58 | 59 | public BlobDocumentStorage(string storageAccount, string storageKey) 60 | { 61 | var account = new CloudStorageAccount(new StorageCredentials(storageAccount, storageKey), true); 62 | _blobClient = account.CreateCloudBlobClient(); 63 | } 64 | 65 | public override string GetData(string fileName) 66 | { 67 | if (!fileName.StartsWith(_blobClient.BaseUri.ToString())) 68 | { 69 | throw new InvalidTargetException(); 70 | } 71 | 72 | var client = new WebClient(); 73 | var input = client.DownloadString(fileName); 74 | 75 | return input; 76 | } 77 | public override void PersistDocument(string serializedDocument, string targetFileName) 78 | { 79 | if (!targetFileName.StartsWith(_blobClient.BaseUri.ToString())) 80 | { 81 | throw new InvalidTargetException(); 82 | } 83 | 84 | var uri = new Uri(targetFileName); 85 | var containerName = uri.AbsolutePath.Substring(1, uri.AbsolutePath.IndexOf('/', 1) - 1); 86 | var container = _blobClient.GetContainerReference(containerName); 87 | container.CreateIfNotExists(BlobContainerPublicAccessType.Container); 88 | var blob = container.GetBlockBlobReference(targetFileName.Replace(_blobClient.BaseUri + containerName + "/", "")); 89 | blob.UploadText(serializedDocument); 90 | } 91 | } 92 | 93 | public class HttpInputRetriever : IInputRetriever 94 | { 95 | public string GetData(string fileName) 96 | { 97 | if (!fileName.StartsWith("http")) 98 | { 99 | throw new InvalidTargetException(); 100 | } 101 | 102 | var client = new WebClient(); 103 | var input = client.DownloadString(fileName); 104 | 105 | return input; 106 | } 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Srp/TechEd.Demo.SolidPrinciples.Srp.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {BD6E941A-ABA5-499A-BC16-DDF6FE25B0B9} 8 | Exe 9 | Properties 10 | TechEd.Demo.SolidPrinciples.Srp 11 | TechEd.Demo.SolidPrinciples.Srp 12 | v4.5 13 | 512 14 | ..\ 15 | true 16 | 17 | 18 | AnyCPU 19 | true 20 | full 21 | false 22 | bin\Debug\ 23 | DEBUG;TRACE 24 | prompt 25 | 4 26 | 27 | 28 | AnyCPU 29 | pdbonly 30 | true 31 | bin\Release\ 32 | TRACE 33 | prompt 34 | 4 35 | 36 | 37 | 38 | False 39 | ..\packages\Newtonsoft.Json.6.0.1\lib\net45\Newtonsoft.Json.dll 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. 68 | 69 | 70 | 71 | 78 | -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Isp/TechEd.Demo.SolidPrinciples.Isp.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {C08140CF-685F-4E37-B425-273D70E81BC4} 8 | Exe 9 | Properties 10 | TechEd.Demo.SolidPrinciples.Isp 11 | TechEd.Demo.SolidPrinciples.Isp 12 | v4.5 13 | 512 14 | ..\ 15 | true 16 | 17 | 18 | AnyCPU 19 | true 20 | full 21 | false 22 | bin\Debug\ 23 | DEBUG;TRACE 24 | prompt 25 | 4 26 | 27 | 28 | AnyCPU 29 | pdbonly 30 | true 31 | bin\Release\ 32 | TRACE 33 | prompt 34 | 4 35 | 36 | 37 | 38 | True 39 | ..\packages\Microsoft.Data.Edm.5.6.0\lib\net40\Microsoft.Data.Edm.dll 40 | 41 | 42 | True 43 | ..\packages\Microsoft.Data.OData.5.6.0\lib\net40\Microsoft.Data.OData.dll 44 | 45 | 46 | True 47 | ..\packages\Microsoft.Data.Services.Client.5.6.0\lib\net40\Microsoft.Data.Services.Client.dll 48 | 49 | 50 | False 51 | ..\packages\Microsoft.WindowsAzure.ConfigurationManager.1.8.0.0\lib\net35-full\Microsoft.WindowsAzure.Configuration.dll 52 | 53 | 54 | False 55 | ..\packages\WindowsAzure.Storage.3.1.0.0\lib\net40\Microsoft.WindowsAzure.Storage.dll 56 | 57 | 58 | False 59 | ..\packages\Newtonsoft.Json.6.0.1\lib\net45\Newtonsoft.Json.dll 60 | 61 | 62 | 63 | 64 | 65 | 66 | True 67 | ..\packages\System.Spatial.5.6.0\lib\net40\System.Spatial.dll 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. 95 | 96 | 97 | 98 | 105 | -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Lsp/TechEd.Demo.SolidPrinciples.Lsp.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {CA111CED-B035-43BB-B9ED-6FB078FB4F8B} 8 | Exe 9 | Properties 10 | TechEd.Demo.SolidPrinciples.Lsp 11 | TechEd.Demo.SolidPrinciples.Lsp 12 | v4.5 13 | 512 14 | ..\ 15 | true 16 | 17 | 18 | AnyCPU 19 | true 20 | full 21 | false 22 | bin\Debug\ 23 | DEBUG;TRACE 24 | prompt 25 | 4 26 | 27 | 28 | AnyCPU 29 | pdbonly 30 | true 31 | bin\Release\ 32 | TRACE 33 | prompt 34 | 4 35 | 36 | 37 | 38 | True 39 | ..\packages\Microsoft.Data.Edm.5.6.0\lib\net40\Microsoft.Data.Edm.dll 40 | 41 | 42 | True 43 | ..\packages\Microsoft.Data.OData.5.6.0\lib\net40\Microsoft.Data.OData.dll 44 | 45 | 46 | True 47 | ..\packages\Microsoft.Data.Services.Client.5.6.0\lib\net40\Microsoft.Data.Services.Client.dll 48 | 49 | 50 | False 51 | ..\packages\Microsoft.WindowsAzure.ConfigurationManager.1.8.0.0\lib\net35-full\Microsoft.WindowsAzure.Configuration.dll 52 | 53 | 54 | False 55 | ..\packages\WindowsAzure.Storage.3.1.0.0\lib\net40\Microsoft.WindowsAzure.Storage.dll 56 | 57 | 58 | False 59 | ..\packages\Newtonsoft.Json.6.0.1\lib\net45\Newtonsoft.Json.dll 60 | 61 | 62 | 63 | 64 | 65 | 66 | True 67 | ..\packages\System.Spatial.5.6.0\lib\net40\System.Spatial.dll 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. 95 | 96 | 97 | 98 | 105 | -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Ocp/TechEd.Demo.SolidPrinciples.Ocp.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {2AE9CB40-1E14-4E06-A24D-34BCF2A1B3AF} 8 | Exe 9 | Properties 10 | TechEd.Demo.SolidPrinciples.Ocp 11 | TechEd.Demo.SolidPrinciples.Ocp 12 | v4.5 13 | 512 14 | ..\ 15 | true 16 | 17 | 18 | AnyCPU 19 | true 20 | full 21 | false 22 | bin\Debug\ 23 | DEBUG;TRACE 24 | prompt 25 | 4 26 | 27 | 28 | AnyCPU 29 | pdbonly 30 | true 31 | bin\Release\ 32 | TRACE 33 | prompt 34 | 4 35 | 36 | 37 | 38 | True 39 | ..\packages\Microsoft.Data.Edm.5.6.0\lib\net40\Microsoft.Data.Edm.dll 40 | 41 | 42 | True 43 | ..\packages\Microsoft.Data.OData.5.6.0\lib\net40\Microsoft.Data.OData.dll 44 | 45 | 46 | True 47 | ..\packages\Microsoft.Data.Services.Client.5.6.0\lib\net40\Microsoft.Data.Services.Client.dll 48 | 49 | 50 | False 51 | ..\packages\Microsoft.WindowsAzure.ConfigurationManager.1.8.0.0\lib\net35-full\Microsoft.WindowsAzure.Configuration.dll 52 | 53 | 54 | False 55 | ..\packages\WindowsAzure.Storage.3.1.0.0\lib\net40\Microsoft.WindowsAzure.Storage.dll 56 | 57 | 58 | False 59 | ..\packages\Newtonsoft.Json.6.0.1\lib\net45\Newtonsoft.Json.dll 60 | 61 | 62 | 63 | 64 | 65 | 66 | True 67 | ..\packages\System.Spatial.5.6.0\lib\net40\System.Spatial.dll 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. 95 | 96 | 97 | 98 | 105 | -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Dip.Manual/TechEd.Demo.SolidPrinciples.Dip.Manual.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {E73B4743-9F2C-437A-90A5-1F986A5BD2C8} 8 | Exe 9 | Properties 10 | TechEd.Demo.SolidPrinciples.Dip.Manual 11 | TechEd.Demo.SolidPrinciples.Dip.Manual 12 | v4.5 13 | 512 14 | ..\ 15 | true 16 | 17 | 18 | AnyCPU 19 | true 20 | full 21 | false 22 | bin\Debug\ 23 | DEBUG;TRACE 24 | prompt 25 | 4 26 | 27 | 28 | AnyCPU 29 | pdbonly 30 | true 31 | bin\Release\ 32 | TRACE 33 | prompt 34 | 4 35 | 36 | 37 | 38 | True 39 | ..\packages\Microsoft.Data.Edm.5.6.0\lib\net40\Microsoft.Data.Edm.dll 40 | 41 | 42 | True 43 | ..\packages\Microsoft.Data.OData.5.6.0\lib\net40\Microsoft.Data.OData.dll 44 | 45 | 46 | True 47 | ..\packages\Microsoft.Data.Services.Client.5.6.0\lib\net40\Microsoft.Data.Services.Client.dll 48 | 49 | 50 | False 51 | ..\packages\Microsoft.WindowsAzure.ConfigurationManager.1.8.0.0\lib\net35-full\Microsoft.WindowsAzure.Configuration.dll 52 | 53 | 54 | False 55 | ..\packages\WindowsAzure.Storage.3.1.0.0\lib\net40\Microsoft.WindowsAzure.Storage.dll 56 | 57 | 58 | False 59 | ..\packages\Newtonsoft.Json.6.0.1\lib\net45\Newtonsoft.Json.dll 60 | 61 | 62 | 63 | 64 | 65 | 66 | True 67 | ..\packages\System.Spatial.5.6.0\lib\net40\System.Spatial.dll 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. 97 | 98 | 99 | 100 | 107 | -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Dip.IoCContainer/TechEd.Demo.SolidPrinciples.Dip.IoCContainer.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {73360AAC-7EDF-45EF-A2F6-88ABFABB9EF0} 8 | Exe 9 | Properties 10 | TechEd.Demo.SolidPrinciples.Dip.IoCContainer 11 | TechEd.Demo.SolidPrinciples.Dip.IoCContainer 12 | v4.5 13 | 512 14 | ..\ 15 | true 16 | 17 | 18 | AnyCPU 19 | true 20 | full 21 | false 22 | bin\Debug\ 23 | DEBUG;TRACE 24 | prompt 25 | 4 26 | 27 | 28 | AnyCPU 29 | pdbonly 30 | true 31 | bin\Release\ 32 | TRACE 33 | prompt 34 | 4 35 | 36 | 37 | 38 | True 39 | ..\packages\Microsoft.Data.Edm.5.6.0\lib\net40\Microsoft.Data.Edm.dll 40 | 41 | 42 | True 43 | ..\packages\Microsoft.Data.OData.5.6.0\lib\net40\Microsoft.Data.OData.dll 44 | 45 | 46 | True 47 | ..\packages\Microsoft.Data.Services.Client.5.6.0\lib\net40\Microsoft.Data.Services.Client.dll 48 | 49 | 50 | ..\packages\Unity.3.0.1304.1\lib\Net45\Microsoft.Practices.Unity.dll 51 | 52 | 53 | ..\packages\Unity.3.0.1304.1\lib\Net45\Microsoft.Practices.Unity.Configuration.dll 54 | 55 | 56 | False 57 | ..\packages\Microsoft.WindowsAzure.ConfigurationManager.1.8.0.0\lib\net35-full\Microsoft.WindowsAzure.Configuration.dll 58 | 59 | 60 | False 61 | ..\packages\WindowsAzure.Storage.3.1.0.0\lib\net40\Microsoft.WindowsAzure.Storage.dll 62 | 63 | 64 | False 65 | ..\packages\Newtonsoft.Json.6.0.1\lib\net45\Newtonsoft.Json.dll 66 | 67 | 68 | 69 | 70 | 71 | 72 | True 73 | ..\packages\System.Spatial.5.6.0\lib\net40\System.Spatial.dll 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. 103 | 104 | 105 | 106 | 113 | -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.Dip.ServiceLocator/TechEd.Demo.SolidPrinciples.Dip.ServiceLocator.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {C37FC562-CE8A-4F09-82C0-CC6FD53E8A93} 8 | Exe 9 | Properties 10 | TechEd.Demo.SolidPrinciples.Dip.ServiceLocator 11 | TechEd.Demo.SolidPrinciples.Dip.ServiceLocator 12 | v4.5 13 | 512 14 | ..\ 15 | true 16 | 17 | 18 | AnyCPU 19 | true 20 | full 21 | false 22 | bin\Debug\ 23 | DEBUG;TRACE 24 | prompt 25 | 4 26 | 27 | 28 | AnyCPU 29 | pdbonly 30 | true 31 | bin\Release\ 32 | TRACE 33 | prompt 34 | 4 35 | 36 | 37 | 38 | True 39 | ..\packages\Microsoft.Data.Edm.5.6.0\lib\net40\Microsoft.Data.Edm.dll 40 | 41 | 42 | True 43 | ..\packages\Microsoft.Data.OData.5.6.0\lib\net40\Microsoft.Data.OData.dll 44 | 45 | 46 | True 47 | ..\packages\Microsoft.Data.Services.Client.5.6.0\lib\net40\Microsoft.Data.Services.Client.dll 48 | 49 | 50 | ..\packages\CommonServiceLocator.1.0\lib\NET35\Microsoft.Practices.ServiceLocation.dll 51 | 52 | 53 | ..\packages\Unity.2.0\lib\20\Microsoft.Practices.Unity.dll 54 | 55 | 56 | ..\packages\Unity.2.0\lib\20\Microsoft.Practices.Unity.Configuration.dll 57 | 58 | 59 | ..\packages\Unity.2.0\lib\20\Microsoft.Practices.Unity.Interception.dll 60 | 61 | 62 | ..\packages\Unity.2.0\lib\20\Microsoft.Practices.Unity.Interception.Configuration.dll 63 | 64 | 65 | ..\packages\CommonServiceLocator.UnityAdapter.1.0.0.41670\lib\net35\Microsoft.Practices.Unity.ServiceLocatorAdapter.dll 66 | 67 | 68 | False 69 | ..\packages\Microsoft.WindowsAzure.ConfigurationManager.1.8.0.0\lib\net35-full\Microsoft.WindowsAzure.Configuration.dll 70 | 71 | 72 | False 73 | ..\packages\WindowsAzure.Storage.3.1.0.0\lib\net40\Microsoft.WindowsAzure.Storage.dll 74 | 75 | 76 | False 77 | ..\packages\Newtonsoft.Json.6.0.1\lib\net45\Newtonsoft.Json.dll 78 | 79 | 80 | 81 | 82 | 83 | 84 | True 85 | ..\packages\System.Spatial.5.6.0\lib\net40\System.Spatial.dll 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. 115 | 116 | 117 | 118 | 125 | -------------------------------------------------------------------------------- /.nuget/NuGet.targets: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $(MSBuildProjectDirectory)\..\ 5 | 6 | 7 | false 8 | 9 | 10 | false 11 | 12 | 13 | true 14 | 15 | 16 | false 17 | 18 | 19 | 20 | 21 | 22 | 26 | 27 | 28 | 29 | 30 | $([System.IO.Path]::Combine($(SolutionDir), ".nuget")) 31 | 32 | 33 | 34 | 35 | $(SolutionDir).nuget 36 | 37 | 38 | 39 | packages.$(MSBuildProjectName.Replace(' ', '_')).config 40 | 41 | 42 | 43 | 44 | 45 | $(PackagesProjectConfig) 46 | 47 | 48 | 49 | 50 | packages.config 51 | 52 | 53 | 54 | 55 | 56 | 57 | $(NuGetToolsPath)\NuGet.exe 58 | @(PackageSource) 59 | 60 | "$(NuGetExePath)" 61 | mono --runtime=v4.0.30319 $(NuGetExePath) 62 | 63 | $(TargetDir.Trim('\\')) 64 | 65 | -RequireConsent 66 | -NonInteractive 67 | 68 | "$(SolutionDir) " 69 | "$(SolutionDir)" 70 | 71 | 72 | $(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(NonInteractiveSwitch) $(RequireConsentSwitch) -solutionDir $(PaddedSolutionDir) 73 | $(NuGetCommand) pack "$(ProjectPath)" -Properties "Configuration=$(Configuration);Platform=$(Platform)" $(NonInteractiveSwitch) -OutputDirectory "$(PackageOutputDir)" -symbols 74 | 75 | 76 | 77 | RestorePackages; 78 | $(BuildDependsOn); 79 | 80 | 81 | 82 | 83 | $(BuildDependsOn); 84 | BuildPackage; 85 | 86 | 87 | 88 | 89 | 90 | 91 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 106 | 107 | 110 | 111 | 112 | 113 | 115 | 116 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 148 | 149 | 150 | 151 | 152 | -------------------------------------------------------------------------------- /TechEd.Demo.SolidPrinciples.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.30110.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TechEd.Demo.SolidPrinciples", "TechEd.Demo.SolidPrinciples\TechEd.Demo.SolidPrinciples.csproj", "{8D3723A7-3DF8-4DEE-8120-4C4DBF084B84}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TechEd.Demo.SolidPrinciples.Refactored", "TechEd.Demo.SolidPrinciples.Refactored\TechEd.Demo.SolidPrinciples.Refactored.csproj", "{50016C85-035C-4628-A506-40155666FD5E}" 9 | EndProject 10 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "0. RAG", "0. RAG", "{4DB01FA5-F48B-4A25-ACB2-D735106B09D0}" 11 | EndProject 12 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "1. SRP", "1. SRP", "{6CD529CC-3A1B-427C-84EF-060598EC41AD}" 13 | EndProject 14 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TechEd.Demo.SolidPrinciples.Srp", "TechEd.Demo.SolidPrinciples.Srp\TechEd.Demo.SolidPrinciples.Srp.csproj", "{BD6E941A-ABA5-499A-BC16-DDF6FE25B0B9}" 15 | EndProject 16 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "2. OCP", "2. OCP", "{89E126E6-A7E5-4B5B-8768-64A792C88D47}" 17 | EndProject 18 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TechEd.Demo.SolidPrinciples.Ocp", "TechEd.Demo.SolidPrinciples.Ocp\TechEd.Demo.SolidPrinciples.Ocp.csproj", "{2AE9CB40-1E14-4E06-A24D-34BCF2A1B3AF}" 19 | EndProject 20 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "3. LSP", "3. LSP", "{7F6DC777-8BA9-4D72-96A4-A93C16F8209E}" 21 | EndProject 22 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TechEd.Demo.SolidPrinciples.Lsp", "TechEd.Demo.SolidPrinciples.Lsp\TechEd.Demo.SolidPrinciples.Lsp.csproj", "{CA111CED-B035-43BB-B9ED-6FB078FB4F8B}" 23 | EndProject 24 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "4. ISP", "4. ISP", "{A5F97B90-FF67-4514-BD4D-0B8746CABCA7}" 25 | EndProject 26 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TechEd.Demo.SolidPrinciples.Isp", "TechEd.Demo.SolidPrinciples.Isp\TechEd.Demo.SolidPrinciples.Isp.csproj", "{C08140CF-685F-4E37-B425-273D70E81BC4}" 27 | EndProject 28 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "5. DIP", "5. DIP", "{266C951E-892F-42BC-9F08-1A52A53A7801}" 29 | EndProject 30 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TechEd.Demo.SolidPrinciples.Dip.Manual", "TechEd.Demo.SolidPrinciples.Dip.Manual\TechEd.Demo.SolidPrinciples.Dip.Manual.csproj", "{E73B4743-9F2C-437A-90A5-1F986A5BD2C8}" 31 | EndProject 32 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TechEd.Demo.SolidPrinciples.Dip.ServiceLocator", "TechEd.Demo.SolidPrinciples.Dip.ServiceLocator\TechEd.Demo.SolidPrinciples.Dip.ServiceLocator.csproj", "{C37FC562-CE8A-4F09-82C0-CC6FD53E8A93}" 33 | EndProject 34 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TechEd.Demo.SolidPrinciples.Dip.IoCContainer", "TechEd.Demo.SolidPrinciples.Dip.IoCContainer\TechEd.Demo.SolidPrinciples.Dip.IoCContainer.csproj", "{73360AAC-7EDF-45EF-A2F6-88ABFABB9EF0}" 35 | EndProject 36 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{6E98A5C7-B68B-4674-ACAE-247D4A9074A2}" 37 | ProjectSection(SolutionItems) = preProject 38 | .nuget\NuGet.Config = .nuget\NuGet.Config 39 | .nuget\NuGet.exe = .nuget\NuGet.exe 40 | .nuget\NuGet.targets = .nuget\NuGet.targets 41 | EndProjectSection 42 | EndProject 43 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TechEd.Demo.SolidPrinciples.Lsp.Principles", "TechEd.Demo.SolidPrinciples.Lsp.Principles\TechEd.Demo.SolidPrinciples.Lsp.Principles.csproj", "{750C6448-F2D2-4E09-9FD3-F7A75D3AC5E8}" 44 | EndProject 45 | Global 46 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 47 | Debug|Any CPU = Debug|Any CPU 48 | Release|Any CPU = Release|Any CPU 49 | EndGlobalSection 50 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 51 | {8D3723A7-3DF8-4DEE-8120-4C4DBF084B84}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 52 | {8D3723A7-3DF8-4DEE-8120-4C4DBF084B84}.Debug|Any CPU.Build.0 = Debug|Any CPU 53 | {8D3723A7-3DF8-4DEE-8120-4C4DBF084B84}.Release|Any CPU.ActiveCfg = Release|Any CPU 54 | {8D3723A7-3DF8-4DEE-8120-4C4DBF084B84}.Release|Any CPU.Build.0 = Release|Any CPU 55 | {50016C85-035C-4628-A506-40155666FD5E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 56 | {50016C85-035C-4628-A506-40155666FD5E}.Debug|Any CPU.Build.0 = Debug|Any CPU 57 | {50016C85-035C-4628-A506-40155666FD5E}.Release|Any CPU.ActiveCfg = Release|Any CPU 58 | {50016C85-035C-4628-A506-40155666FD5E}.Release|Any CPU.Build.0 = Release|Any CPU 59 | {BD6E941A-ABA5-499A-BC16-DDF6FE25B0B9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 60 | {BD6E941A-ABA5-499A-BC16-DDF6FE25B0B9}.Debug|Any CPU.Build.0 = Debug|Any CPU 61 | {BD6E941A-ABA5-499A-BC16-DDF6FE25B0B9}.Release|Any CPU.ActiveCfg = Release|Any CPU 62 | {BD6E941A-ABA5-499A-BC16-DDF6FE25B0B9}.Release|Any CPU.Build.0 = Release|Any CPU 63 | {2AE9CB40-1E14-4E06-A24D-34BCF2A1B3AF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 64 | {2AE9CB40-1E14-4E06-A24D-34BCF2A1B3AF}.Debug|Any CPU.Build.0 = Debug|Any CPU 65 | {2AE9CB40-1E14-4E06-A24D-34BCF2A1B3AF}.Release|Any CPU.ActiveCfg = Release|Any CPU 66 | {2AE9CB40-1E14-4E06-A24D-34BCF2A1B3AF}.Release|Any CPU.Build.0 = Release|Any CPU 67 | {CA111CED-B035-43BB-B9ED-6FB078FB4F8B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 68 | {CA111CED-B035-43BB-B9ED-6FB078FB4F8B}.Debug|Any CPU.Build.0 = Debug|Any CPU 69 | {CA111CED-B035-43BB-B9ED-6FB078FB4F8B}.Release|Any CPU.ActiveCfg = Release|Any CPU 70 | {CA111CED-B035-43BB-B9ED-6FB078FB4F8B}.Release|Any CPU.Build.0 = Release|Any CPU 71 | {C08140CF-685F-4E37-B425-273D70E81BC4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 72 | {C08140CF-685F-4E37-B425-273D70E81BC4}.Debug|Any CPU.Build.0 = Debug|Any CPU 73 | {C08140CF-685F-4E37-B425-273D70E81BC4}.Release|Any CPU.ActiveCfg = Release|Any CPU 74 | {C08140CF-685F-4E37-B425-273D70E81BC4}.Release|Any CPU.Build.0 = Release|Any CPU 75 | {E73B4743-9F2C-437A-90A5-1F986A5BD2C8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 76 | {E73B4743-9F2C-437A-90A5-1F986A5BD2C8}.Debug|Any CPU.Build.0 = Debug|Any CPU 77 | {E73B4743-9F2C-437A-90A5-1F986A5BD2C8}.Release|Any CPU.ActiveCfg = Release|Any CPU 78 | {E73B4743-9F2C-437A-90A5-1F986A5BD2C8}.Release|Any CPU.Build.0 = Release|Any CPU 79 | {C37FC562-CE8A-4F09-82C0-CC6FD53E8A93}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 80 | {C37FC562-CE8A-4F09-82C0-CC6FD53E8A93}.Debug|Any CPU.Build.0 = Debug|Any CPU 81 | {C37FC562-CE8A-4F09-82C0-CC6FD53E8A93}.Release|Any CPU.ActiveCfg = Release|Any CPU 82 | {C37FC562-CE8A-4F09-82C0-CC6FD53E8A93}.Release|Any CPU.Build.0 = Release|Any CPU 83 | {73360AAC-7EDF-45EF-A2F6-88ABFABB9EF0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 84 | {73360AAC-7EDF-45EF-A2F6-88ABFABB9EF0}.Debug|Any CPU.Build.0 = Debug|Any CPU 85 | {73360AAC-7EDF-45EF-A2F6-88ABFABB9EF0}.Release|Any CPU.ActiveCfg = Release|Any CPU 86 | {73360AAC-7EDF-45EF-A2F6-88ABFABB9EF0}.Release|Any CPU.Build.0 = Release|Any CPU 87 | {750C6448-F2D2-4E09-9FD3-F7A75D3AC5E8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 88 | {750C6448-F2D2-4E09-9FD3-F7A75D3AC5E8}.Debug|Any CPU.Build.0 = Debug|Any CPU 89 | {750C6448-F2D2-4E09-9FD3-F7A75D3AC5E8}.Release|Any CPU.ActiveCfg = Release|Any CPU 90 | {750C6448-F2D2-4E09-9FD3-F7A75D3AC5E8}.Release|Any CPU.Build.0 = Release|Any CPU 91 | EndGlobalSection 92 | GlobalSection(SolutionProperties) = preSolution 93 | HideSolutionNode = FALSE 94 | EndGlobalSection 95 | GlobalSection(NestedProjects) = preSolution 96 | {50016C85-035C-4628-A506-40155666FD5E} = {4DB01FA5-F48B-4A25-ACB2-D735106B09D0} 97 | {8D3723A7-3DF8-4DEE-8120-4C4DBF084B84} = {4DB01FA5-F48B-4A25-ACB2-D735106B09D0} 98 | {BD6E941A-ABA5-499A-BC16-DDF6FE25B0B9} = {6CD529CC-3A1B-427C-84EF-060598EC41AD} 99 | {2AE9CB40-1E14-4E06-A24D-34BCF2A1B3AF} = {89E126E6-A7E5-4B5B-8768-64A792C88D47} 100 | {CA111CED-B035-43BB-B9ED-6FB078FB4F8B} = {7F6DC777-8BA9-4D72-96A4-A93C16F8209E} 101 | {750C6448-F2D2-4E09-9FD3-F7A75D3AC5E8} = {7F6DC777-8BA9-4D72-96A4-A93C16F8209E} 102 | {C08140CF-685F-4E37-B425-273D70E81BC4} = {A5F97B90-FF67-4514-BD4D-0B8746CABCA7} 103 | {E73B4743-9F2C-437A-90A5-1F986A5BD2C8} = {266C951E-892F-42BC-9F08-1A52A53A7801} 104 | {C37FC562-CE8A-4F09-82C0-CC6FD53E8A93} = {266C951E-892F-42BC-9F08-1A52A53A7801} 105 | {73360AAC-7EDF-45EF-A2F6-88ABFABB9EF0} = {266C951E-892F-42BC-9F08-1A52A53A7801} 106 | EndGlobalSection 107 | EndGlobal 108 | --------------------------------------------------------------------------------