This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
namespace DoFactory.GangOfFour.Strategy.RealWorld | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace DoFactory.GangOfFour.Proxy.RealWorld | |
{ | |
/// <summary> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace CompositePattern | |
{ | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
//Client | |
class Program | |
{ | |
static void Main(string[] args) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace DoFactory.GangOfFour.Abstract.Structural | |
{ | |
/// <summary> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace DoFactory.GangOfFour.Facade.RealWorld | |
{ | |
/// <summary> | |
/// MainApp startup class for Real-World | |
/// Facade Design Pattern. | |
/// </summary> | |
class MainApp | |
{ | |
/// <summary> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public sealed class APILookup | |
{ | |
private static readonly APILookup _instance = new APILookup(); | |
private Dictionary<string, int> _lookup; | |
private APILookup() | |
{ | |
try | |
{ | |
_lookup = Utility.GetLookup(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
namespace DoFactory.GangOfFour.Singleton.NETOptimized | |
{ | |
class MainApp | |
{ | |
static void Main() | |
{ | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Sample singleton object. | |
/// </summary> | |
public sealed class SiteStructure | |
{ | |
/// <summary> | |
/// This is an expensive resource. | |
/// We need to only store it in one place. | |
/// </summary> | |
object[] _data = new object[10]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | |
using System; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
using System.Threading; | |
using Microsoft.CodeAnalysis.CSharp.Symbols; | |
using Microsoft.CodeAnalysis.Text; | |
using Roslyn.Utilities; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Net.Sockets; | |
namespace ConsoleApplication1 | |
{ | |
class Program | |
{ |