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; | |
/// <summary> | |
/// A generic factory pattern. | |
/// <para>The Factory pattern is a creational pattern, | |
/// whose purpose is to define an interface for | |
/// creating an object, but let subclasses decide | |
/// which class to instantiate.</para> | |
/// </summary> | |
/// <typeparam name="T">The type created by the factory.</typeparam> |
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
if $(ConfigurationName) == Release "$(SolutionDir)packages\NuGet.CommandLine.1.5.21005.9019\tools\NuGet.exe" pack "$(ProjectPath)" -Properties Configuration=Release -Verbose |
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; | |
/// <summary> | |
/// An example Dispose pattern. | |
/// <para>The Dispose pattern is a design pattern, whose | |
/// purpose is to handle resource cleanup in runtime | |
/// environments that use automatic garbage collection.</para> | |
/// </summary> | |
public class YourClass : IDisposable | |
{ |
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; | |
/// <summary> | |
/// An example Observer pattern. | |
/// <para>The Observer pattern is a behavioral | |
/// pattern, whose purpose is to define a one-to-many | |
/// dependency between objects where a state change | |
/// in one object results with all its dependents | |
/// being notified and updated automatically.</para> |
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; | |
internal class AndSpecification<T> : ISpecification<T> | |
{ | |
private ISpecification<T> Specification1 { get; set; } | |
private ISpecification<T> Specification2 { get; set; } | |
internal AndSpecification(ISpecification<T> s1, ISpecification<T> s2) | |
{ | |
Specification1 = s1; |
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; | |
/// <summary> | |
/// An example abstract factory interface. | |
/// <para>The Abstract Factory pattern is a creational | |
/// pattern, whose purpose is to provide an interface | |
/// for creating families of related or dependent | |
/// objects, without specifying their concrete | |
/// classes.</para> | |
/// </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; | |
/// <summary> | |
/// An actual to expected adapter. | |
/// <para>The Adapter pattern is a structural pattern, | |
/// whose purpose is to convert the interface of a class | |
/// into another interface clients expect.</para> | |
/// </summary> | |
public class ActualToExpectedAdapter : IExpected | |
{ |
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; | |
/// <summary> | |
/// The object which adds responsibilities to | |
/// a base instance. | |
/// <para>The Decorator pattern is a structural pattern, whose | |
/// purpose is to attach additional responsibilities to | |
/// an object dynamically keeping the same interface. </para> | |
/// </summary> | |
public class BaseDecorator : IBase |
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; | |
/// <summary> | |
/// The actual object. | |
/// </summary> | |
public class ConcreteObject : IObject | |
{ | |
public void DoWork() | |
{ | |
} |
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; | |
/// <summary> | |
/// The object which delegates to the appropriate sub-system. | |
/// <para>The Facade pattern is a structural pattern, whose | |
/// purpose is to provide a unified interface to a set of | |
/// interfaces in a subsystem.</para> | |
/// </summary> | |
public class Facade | |
{ |
OlderNewer