├── DesignPattern.Facade ├── bin │ └── Debug │ │ ├── Facade │ │ ├── src.txt │ │ └── des.txt │ │ ├── DesignPattern.Facade.exe.config │ │ ├── Manulife.ChengDu.DesignPattern.Facade.exe.config │ │ ├── Manulife.ChengDu.DesignPattern.Facade.vshost.exe.config │ │ └── Manulife.ChengDu.DesignPattern.Facade.vshost.exe.manifest ├── obj │ └── Debug │ │ ├── TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs │ │ ├── TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs │ │ ├── TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs │ │ └── DesignPattern.Facade.csproj.FileListAbsolute.txt ├── Facade │ ├── AbstractEncryptFacade.cs │ ├── EncryptFacade.cs │ └── NewEncryptFacade.cs ├── App.config ├── Subsystem │ ├── FileWriter.cs │ ├── CipherMachine.cs │ └── FileReader.cs ├── AppConfigHelper.cs └── Properties │ └── AssemblyInfo.cs ├── DesignPattern.Bridge ├── obj │ └── Debug │ │ ├── TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs │ │ ├── TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs │ │ ├── TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs │ │ └── DesignPattern.Bridge.csproj.FileListAbsolute.txt ├── App.config ├── bin │ └── Debug │ │ ├── DesignPattern.Bridge.exe.config │ │ ├── Manulife.ChengDu.DesignPattern.Bridge.exe.config │ │ ├── Manulife.ChengDu.DesignPattern.Bridge.vshost.exe.config │ │ └── Manulife.ChengDu.DesignPattern.Bridge.vshost.exe.manifest ├── ImageImplementor.cs ├── Image.cs ├── Program.cs ├── WindowsImplementor.cs └── Properties │ └── AssemblyInfo.cs ├── DesignPattern.Proxy ├── obj │ └── Debug │ │ ├── TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs │ │ ├── TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs │ │ ├── TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs │ │ └── DesignPattern.Proxy.csproj.FileListAbsolute.txt ├── Subject │ └── ISearcher.cs ├── App.config ├── bin │ └── Debug │ │ ├── DesignPattern.Proxy.exe.config │ │ ├── Manulife.ChengDu.DesignPattern.Proxy.exe.config │ │ ├── Manulife.ChengDu.DesignPattern.Proxy.vshost.exe.config │ │ └── Manulife.ChengDu.DesignPattern.Proxy.vshost.exe.manifest ├── RealSubject │ ├── Logger.cs │ ├── RealSearcher.cs │ └── AccessValidator.cs ├── Program.cs ├── AppConfigHelper.cs └── Properties │ └── AssemblyInfo.cs ├── DesignPatterm.Decorator ├── obj │ └── Debug │ │ ├── TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs │ │ ├── TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs │ │ ├── TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs │ │ └── DesignPatterm.Decorator.csproj.FileListAbsolute.txt ├── App.config ├── bin │ └── Debug │ │ ├── DesignPatterm.Decorator.exe.config │ │ ├── Manulife.ChengDu.DesignPatterm.Decorator.exe.config │ │ ├── Manulife.ChengDu.DesignPatterm.Decorator.vshost.exe.config │ │ └── Manulife.ChengDu.DesignPatterm.Decorator.vshost.exe.manifest ├── Component.cs ├── ComponentDecorator.cs ├── Program.cs ├── Window.cs └── Properties │ └── AssemblyInfo.cs ├── DesignPattern.Adapter ├── obj │ └── Debug │ │ ├── TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs │ │ ├── TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs │ │ ├── TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs │ │ └── DesignPattern.Adapter.csproj.FileListAbsolute.txt ├── App.config ├── Target │ └── IScoreOperation.cs ├── bin │ └── Debug │ │ ├── DesignPattern.Adapter.exe.config │ │ ├── Manulife.ChengDu.DesignPattern.Adapter.exe.config │ │ ├── Manulife.ChengDu.DesignPattern.Adapter.vshost.exe.config │ │ └── Manulife.ChengDu.DesignPattern.Adapter.vshost.exe.manifest ├── Adapter │ └── OperationAdapter.cs ├── Adaptee │ └── BinarySearchHelper.cs ├── AppConfigHelper.cs └── Properties │ └── AssemblyInfo.cs ├── DesignPattern.Builder ├── obj │ └── Debug │ │ ├── TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs │ │ ├── TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs │ │ ├── TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs │ │ └── DesignPattern.Builder.csproj.FileListAbsolute.txt ├── App.config ├── bin │ └── Debug │ │ ├── DesignPattern.Builder.exe.config │ │ ├── Manulife.ChengDu.DesignPattern.Builder.exe.config │ │ ├── Manulife.ChengDu.DesignPattern.Builder.vshost.exe.config │ │ └── Manulife.ChengDu.DesignPattern.Builder.vshost.exe.manifest ├── PattenSample │ ├── Product.cs │ ├── Builder.cs │ └── Director.cs ├── GameRoleDemo │ ├── Actor.cs │ ├── ActorController.cs │ ├── ActorBuilder.cs │ ├── AngelBuilder.cs │ ├── HeroBuilder.cs │ └── DevilBuilder.cs ├── Program.cs ├── AppConfigHelper.cs └── Properties │ └── AssemblyInfo.cs ├── DesignPattern.Command ├── obj │ └── Debug │ │ ├── TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs │ │ ├── TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs │ │ ├── TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs │ │ └── DesignPattern.Command.csproj.FileListAbsolute.txt ├── Command │ ├── Command.cs │ ├── HelpCommand.cs │ └── MinimizeCommand.cs ├── Receiver │ ├── HelpHandler.cs │ └── WindowHandler.cs ├── App.config ├── bin │ └── Debug │ │ ├── DesignPattern.Command.exe.config │ │ ├── Manulife.ChengDu.DesignPattern.Command.exe.config │ │ ├── Manulife.ChengDu.DesignPattern.Command.vshost.exe.config │ │ └── Manulife.ChengDu.DesignPattern.Command.vshost.exe.manifest ├── Invoker │ └── FunctionButton.cs └── Properties │ └── AssemblyInfo.cs ├── DesignPattern.Composite ├── obj │ └── Debug │ │ ├── TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs │ │ ├── TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs │ │ ├── TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs │ │ └── DesignPattern.Composite.csproj.FileListAbsolute.txt ├── App.config ├── bin │ └── Debug │ │ ├── DesignPattern.Composite.exe.config │ │ ├── Manulife.ChengDu.DesignPattern.Composite.exe.config │ │ ├── Manulife.ChengDu.DesignPattern.Composite.vshost.exe.config │ │ └── Manulife.ChengDu.DesignPattern.Composite.vshost.exe.manifest ├── RefactoredVersion │ └── AbstractFile.cs ├── InitializeVersion │ └── ImageFile.cs └── Properties │ └── AssemblyInfo.cs ├── DesignPattern.Flyweight ├── obj │ └── Debug │ │ ├── TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs │ │ ├── TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs │ │ ├── TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs │ │ └── DesignPattern.Flyweight.csproj.FileListAbsolute.txt ├── App.config ├── bin │ └── Debug │ │ ├── DesignPattern.Flyweight.exe.config │ │ ├── Manulife.ChengDu.DesignPattern.Flyweight.exe.config │ │ ├── Manulife.ChengDu.DesignPattern.Flyweight.vshost.exe.config │ │ └── Manulife.ChengDu.DesignPattern.Flyweight.vshost.exe.manifest ├── Flyweight │ ├── IgoChessman.cs │ ├── BlackIgoChessman.cs │ └── Coordinates.cs ├── FlyweightFactory │ └── IgoChessmanFactory.cs └── Properties │ └── AssemblyInfo.cs ├── DesignPattern.Interpreter ├── obj │ └── Debug │ │ ├── TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs │ │ ├── TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs │ │ ├── TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs │ │ └── DesignPattern.Interpreter.csproj.FileListAbsolute.txt ├── App.config ├── bin │ └── Debug │ │ ├── DesignPattern.Interpreter.exe.config │ │ ├── Manulife.ChengDu.DesignPattern.Interpreter.exe.config │ │ ├── Manulife.ChengDu.DesignPattern.Interpreter.vshost.exe.config │ │ └── Manulife.ChengDu.DesignPattern.Interpreter.vshost.exe.manifest ├── Expression │ ├── AbstractNode.cs │ ├── DistanceNode.cs │ ├── AndNode.cs │ ├── SentenseNode.cs │ └── ActionNode.cs └── Properties │ └── AssemblyInfo.cs ├── DesignPattern.Iterator ├── obj │ └── Debug │ │ ├── TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs │ │ ├── TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs │ │ ├── TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs │ │ └── DesignPattern.Iterator.csproj.FileListAbsolute.txt ├── App.config ├── bin │ └── Debug │ │ ├── DesignPattern.Iterator.exe.config │ │ ├── Manulife.ChengDu.DesignPattern.Iterator.exe.config │ │ ├── Manulife.ChengDu.DesignPattern.Iterator.vshost.exe.config │ │ └── Manulife.ChengDu.DesignPattern.Iterator.vshost.exe.manifest ├── Iterator │ └── AbstractIterator.cs ├── Aggregate │ └── AbstractObjectList.cs └── Properties │ └── AssemblyInfo.cs ├── DesignPattern.Mediator ├── obj │ └── Debug │ │ ├── TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs │ │ ├── TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs │ │ ├── TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs │ │ └── DesignPattern.Mediator.csproj.FileListAbsolute.txt ├── App.config ├── bin │ └── Debug │ │ ├── DesignPattern.Mediator.exe.config │ │ ├── Manulife.ChengDu.DesignPattern.Mediator.exe.config │ │ ├── Manulife.ChengDu.DesignPattern.Mediator.vshost.exe.config │ │ └── Manulife.ChengDu.DesignPattern.Mediator.vshost.exe.manifest ├── Mediator │ └── Mediator.cs ├── Colleague │ └── Component.cs └── Properties │ └── AssemblyInfo.cs ├── DesignPattern.Memento ├── obj │ └── Debug │ │ ├── TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs │ │ ├── TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs │ │ ├── TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs │ │ └── DesignPattern.Memento.csproj.FileListAbsolute.txt ├── App.config ├── bin │ └── Debug │ │ ├── DesignPattern.Memento.exe.config │ │ ├── Manulife.ChengDu.DesignPattern.Memento.exe.config │ │ ├── Manulife.ChengDu.DesignPattern.Memento.vshost.exe.config │ │ └── Manulife.ChengDu.DesignPattern.Memento.vshost.exe.manifest ├── Caretaker │ ├── MementoCaretaker.cs │ └── NewMementoCaretaker.cs ├── Memento │ └── ChessmanMemento.cs ├── Originator │ └── Chessman.cs └── Properties │ └── AssemblyInfo.cs ├── DesignPattern.Observer ├── obj │ └── Debug │ │ ├── TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs │ │ ├── TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs │ │ ├── TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs │ │ └── DesignPattern.Observer.csproj.FileListAbsolute.txt ├── App.config ├── bin │ └── Debug │ │ ├── DesignPattern.Observer.exe.config │ │ ├── Manulife.ChengDu.DesignPattern.Observer.exe.config │ │ ├── Manulife.ChengDu.DesignPattern.Observer.vshost.exe.config │ │ └── Manulife.ChengDu.DesignPattern.Observer.vshost.exe.manifest ├── Observer │ ├── IObserver.cs │ └── Player.cs ├── Subject │ ├── ConcreteAllyControlCenter.cs │ └── AllyControlCenter.cs ├── Program.cs └── Properties │ └── AssemblyInfo.cs ├── DesignPattern.Prototype ├── obj │ └── Debug │ │ ├── TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs │ │ ├── TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs │ │ ├── TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs │ │ └── DesignPattern.Prototype.csproj.FileListAbsolute.txt ├── App.config ├── bin │ └── Debug │ │ ├── DesignPattern.Prototype.exe.config │ │ ├── Manulife.ChengDu.DesignPattern.Prototype.exe.config │ │ ├── Manulife.ChengDu.DesignPattern.Prototype.vshost.exe.config │ │ └── Manulife.ChengDu.DesignPattern.Prototype.vshost.exe.manifest ├── PrototypeManager │ ├── OfficeDocument.cs │ ├── FAR.cs │ └── SRS.cs ├── ConcretePrototype │ └── Attachment.cs ├── PrepareAhead │ ├── Prototype.cs │ └── ConcretePrototype.cs └── Properties │ └── AssemblyInfo.cs ├── DesignPattern.Singleton ├── obj │ └── Debug │ │ ├── TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs │ │ ├── TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs │ │ ├── TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs │ │ └── DesignPattern.Singleton.csproj.FileListAbsolute.txt ├── App.config ├── bin │ └── Debug │ │ ├── DesignPattern.Singleton.exe.config │ │ ├── Manulife.ChengDu.DesignPattern.Singleton.exe.config │ │ ├── Manulife.ChengDu.DesignPattern.Singleton.vshost.exe.config │ │ └── Manulife.ChengDu.DesignPattern.Singleton.vshost.exe.manifest ├── CustomServer.cs └── Properties │ └── AssemblyInfo.cs ├── DesignPattern.Strategy ├── obj │ └── Debug │ │ ├── TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs │ │ ├── TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs │ │ ├── TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs │ │ └── DesignPattern.Strategy.csproj.FileListAbsolute.txt ├── Strategy │ ├── IDiscount.cs │ ├── StudentDiscount.cs │ ├── ChildrenDiscount.cs │ └── VIPDiscount.cs ├── App.config ├── bin │ └── Debug │ │ ├── DesignPattern.Strategy.exe.config │ │ ├── Manulife.ChengDu.DesignPattern.Strategy.exe.config │ │ ├── Manulife.ChengDu.DesignPattern.Strategy.vshost.exe.config │ │ └── Manulife.ChengDu.DesignPattern.Strategy.vshost.exe.manifest ├── Context │ └── MovieTicket.cs ├── AppConfigHelper.cs └── Properties │ └── AssemblyInfo.cs ├── DesignPattern.Visitor ├── obj │ └── Debug │ │ ├── TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs │ │ ├── TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs │ │ ├── TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs │ │ └── DesignPattern.Visitor.csproj.FileListAbsolute.txt ├── InitializeVersion │ └── Employee.cs ├── App.config ├── bin │ └── Debug │ │ ├── DesignPattern.Visitor.exe.config │ │ ├── Manulife.ChengDu.DesignPattern.Visitor.exe.config │ │ ├── Manulife.ChengDu.DesignPattern.Visitor.vshost.exe.config │ │ └── Manulife.ChengDu.DesignPattern.Visitor.vshost.exe.manifest ├── ObjectStructure │ └── EmployeeList.cs ├── AppConfigHelper.cs └── Properties │ └── AssemblyInfo.cs ├── DesignPattern.AbstractFactory ├── obj │ └── Debug │ │ ├── TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs │ │ ├── TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs │ │ ├── TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs │ │ └── DesignPattern.AbstractFactory.csproj.FileListAbsolute.txt ├── AbstractProduct │ ├── IButton.cs │ ├── IComboBox.cs │ └── ITextField.cs ├── AbstractFactory │ └── ISkinFactory.cs ├── ConcreteProduct │ ├── SpringButton.cs │ ├── SummerButton.cs │ ├── SpringComboBox.cs │ ├── SpringTextField.cs │ ├── SummerComboBox.cs │ └── SummerTextField.cs ├── App.config ├── bin │ └── Debug │ │ ├── DesignPattern.AbstractFactory.exe.config │ │ ├── Manulife.ChengDu.DesignPattern.AbstractFactory.vshost.exe.manifest │ │ ├── Manulife.ChengDu.DesignPattern.AbstractFactory.exe.config │ │ └── Manulife.ChengDu.DesignPattern.AbstractFactory.vshost.exe.config ├── ConcreteFactory │ ├── SpringSkinFactory.cs │ └── SummerSkinFactory.cs ├── Program.cs ├── AppConfigHelper.cs └── Properties │ └── AssemblyInfo.cs ├── DesignPattern.FactoryMethod ├── obj │ └── Debug │ │ ├── TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs │ │ ├── TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs │ │ ├── TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs │ │ └── DesignPattern.FactoryMethod.csproj.FileListAbsolute.txt ├── v1 │ ├── ILogger.cs │ ├── ILoggerFactory.cs │ ├── FileLogger.cs │ ├── DatabaseLogger.cs │ ├── FileLoggerFactory.cs │ └── DatabaseLoggerFactory.cs ├── v2 │ ├── ILogger.cs │ ├── DatabaseLogger.cs │ ├── ILoggerFactory.cs │ └── DatabaseLoggerFactory.cs ├── App.config ├── bin │ └── Debug │ │ ├── DesignPattern.FactoryMethod.exe.config │ │ ├── Manulife.ChengDu.DesignPattern.FactoryMethod.vshost.exe.manifest │ │ ├── Manulife.ChengDu.DesignPattern.FactoryMethod.exe.config │ │ └── Manulife.ChengDu.DesignPattern.FactoryMethod.vshost.exe.config ├── v3 │ ├── LoggerFactory.cs │ └── DatabaseLoggerFactory.cs ├── AppConfigHelper.cs ├── Properties │ └── AssemblyInfo.cs └── v0 │ └── LoggerFactory.cs ├── DesignPattern.SimpleFactory ├── obj │ └── Debug │ │ ├── TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs │ │ ├── TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs │ │ ├── TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs │ │ └── DesignPattern.SimpleFactory.csproj.FileListAbsolute.txt ├── App.config ├── v1 │ ├── IChartable.cs │ ├── LineChart.cs │ ├── PieChart.cs │ ├── HistogramChart.cs │ └── ChartFactory.cs ├── bin │ └── Debug │ │ ├── DesignPattern.SimpleFactory.exe.config │ │ ├── Manulife.ChengDu.DesignPattern.SimpleFactory.exe.config │ │ ├── Manulife.ChengDu.DesignPattern.SimpleFactory.vshost.exe.config │ │ └── Manulife.ChengDu.DesignPattern.SimpleFactory.vshost.exe.manifest ├── v2 │ └── AppConfigHelper.cs └── Properties │ └── AssemblyInfo.cs ├── DesignPattern.TemplateMethod ├── obj │ └── Debug │ │ ├── TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs │ │ ├── TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs │ │ ├── TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs │ │ └── DesignPattern.TemplateMethod.csproj.FileListAbsolute.txt ├── App.config ├── bin │ └── Debug │ │ ├── DesignPattern.TemplateMethod.exe.config │ │ ├── Manulife.ChengDu.DesignPattern.TemplateMethod.vshost.exe.manifest │ │ ├── Manulife.ChengDu.DesignPattern.TemplateMethod.exe.config │ │ └── Manulife.ChengDu.DesignPattern.TemplateMethod.vshost.exe.config ├── Program.cs ├── SavingAccount.cs ├── CurrentAccount.cs ├── AppConfigHelper.cs └── Properties │ └── AssemblyInfo.cs ├── DesignPattern.ChainOfResponsibility ├── obj │ └── Debug │ │ ├── TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs │ │ ├── TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs │ │ ├── TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs │ │ └── DesignPattern.ChainOfResponsibility.csproj.FileListAbsolute.txt ├── App.config ├── bin │ └── Debug │ │ ├── DesignPattern.ChainOfResponsibility.exe.config │ │ ├── Manulife.ChengDu.DesignPattern.ChainOfResponsibility.exe.config │ │ ├── Manulife.ChengDu.DesignPattern.ChainOfResponsibility.vshost.exe.config │ │ └── Manulife.ChengDu.DesignPattern.ChainOfResponsibility.vshost.exe.manifest └── PurchaseRequest.cs ├── .vs └── GofForCSharp │ └── v15 │ └── Server │ └── sqlite3 │ ├── storage.ide │ ├── storage.ide-shm │ └── storage.ide-wal └── README.md /DesignPattern.Facade/bin/Debug/Facade/src.txt: -------------------------------------------------------------------------------- 1 | Hello World! -------------------------------------------------------------------------------- /DesignPattern.Bridge/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /DesignPattern.Bridge/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /DesignPattern.Bridge/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /DesignPattern.Facade/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /DesignPattern.Facade/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /DesignPattern.Facade/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /DesignPattern.Proxy/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /DesignPattern.Proxy/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /DesignPattern.Proxy/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /DesignPatterm.Decorator/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /DesignPatterm.Decorator/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /DesignPatterm.Decorator/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /DesignPattern.Adapter/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /DesignPattern.Adapter/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /DesignPattern.Adapter/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /DesignPattern.Builder/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /DesignPattern.Builder/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /DesignPattern.Builder/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /DesignPattern.Command/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /DesignPattern.Command/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /DesignPattern.Command/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /DesignPattern.Composite/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /DesignPattern.Composite/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /DesignPattern.Composite/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /DesignPattern.Flyweight/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /DesignPattern.Flyweight/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /DesignPattern.Flyweight/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /DesignPattern.Interpreter/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /DesignPattern.Interpreter/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /DesignPattern.Interpreter/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /DesignPattern.Iterator/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /DesignPattern.Iterator/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /DesignPattern.Iterator/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /DesignPattern.Mediator/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /DesignPattern.Mediator/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /DesignPattern.Mediator/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /DesignPattern.Memento/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /DesignPattern.Memento/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /DesignPattern.Memento/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /DesignPattern.Observer/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /DesignPattern.Observer/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /DesignPattern.Observer/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /DesignPattern.Prototype/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /DesignPattern.Prototype/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /DesignPattern.Prototype/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /DesignPattern.Singleton/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /DesignPattern.Singleton/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /DesignPattern.Singleton/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /DesignPattern.Strategy/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /DesignPattern.Strategy/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /DesignPattern.Strategy/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /DesignPattern.Visitor/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /DesignPattern.Visitor/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /DesignPattern.Visitor/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /DesignPattern.AbstractFactory/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /DesignPattern.AbstractFactory/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /DesignPattern.AbstractFactory/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /DesignPattern.FactoryMethod/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /DesignPattern.FactoryMethod/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /DesignPattern.FactoryMethod/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /DesignPattern.SimpleFactory/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /DesignPattern.SimpleFactory/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /DesignPattern.SimpleFactory/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /DesignPattern.TemplateMethod/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /DesignPattern.TemplateMethod/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /DesignPattern.TemplateMethod/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /DesignPattern.ChainOfResponsibility/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /DesignPattern.ChainOfResponsibility/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /DesignPattern.ChainOfResponsibility/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /DesignPattern.Facade/bin/Debug/Facade/des.txt: -------------------------------------------------------------------------------- 1 | 233364362325233364362325Rovvy Gybvn!Rovvy Gybvn!Rovvy Gybvn!Rovvy Gybvn! -------------------------------------------------------------------------------- /.vs/GofForCSharp/v15/Server/sqlite3/storage.ide: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/steveleeCN87/GofForCSharp/HEAD/.vs/GofForCSharp/v15/Server/sqlite3/storage.ide -------------------------------------------------------------------------------- /.vs/GofForCSharp/v15/Server/sqlite3/storage.ide-shm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/steveleeCN87/GofForCSharp/HEAD/.vs/GofForCSharp/v15/Server/sqlite3/storage.ide-shm -------------------------------------------------------------------------------- /.vs/GofForCSharp/v15/Server/sqlite3/storage.ide-wal: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/steveleeCN87/GofForCSharp/HEAD/.vs/GofForCSharp/v15/Server/sqlite3/storage.ide-wal -------------------------------------------------------------------------------- /DesignPattern.Visitor/InitializeVersion/Employee.cs: -------------------------------------------------------------------------------- 1 | namespace DesignPattern.Visitor.InitializeVersion 2 | { 3 | public class Employee 4 | { 5 | } 6 | } -------------------------------------------------------------------------------- /DesignPattern.AbstractFactory/AbstractProduct/IButton.cs: -------------------------------------------------------------------------------- 1 | namespace DesignPattern.AbstractFactory.AbstractProduct 2 | { 3 | public interface IButton 4 | { 5 | void Display(); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /DesignPattern.AbstractFactory/AbstractProduct/IComboBox.cs: -------------------------------------------------------------------------------- 1 | namespace DesignPattern.AbstractFactory.AbstractProduct 2 | { 3 | public interface IComboBox 4 | { 5 | void Display(); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /DesignPattern.AbstractFactory/AbstractProduct/ITextField.cs: -------------------------------------------------------------------------------- 1 | namespace DesignPattern.AbstractFactory.AbstractProduct 2 | { 3 | public interface ITextField 4 | { 5 | void Display(); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /DesignPattern.Memento/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /DesignPatterm.Decorator/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /DesignPattern.Composite/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /DesignPattern.Flyweight/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /DesignPattern.Interpreter/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /DesignPattern.Iterator/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /DesignPattern.Mediator/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /DesignPattern.Observer/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /DesignPattern.Prototype/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /DesignPattern.Singleton/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /DesignPattern.ChainOfResponsibility/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /DesignPattern.Iterator/bin/Debug/DesignPattern.Iterator.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /DesignPattern.Mediator/bin/Debug/DesignPattern.Mediator.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /DesignPattern.Memento/bin/Debug/DesignPattern.Memento.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /DesignPattern.Observer/bin/Debug/DesignPattern.Observer.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /DesignPatterm.Decorator/bin/Debug/DesignPatterm.Decorator.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /DesignPattern.Command/Command/Command.cs: -------------------------------------------------------------------------------- 1 | namespace DesignPattern.Command.Command 2 | { 3 | /// 4 | /// 抽象命令类 5 | /// 6 | public abstract class Command 7 | { 8 | public abstract void Execute(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /DesignPattern.Composite/bin/Debug/DesignPattern.Composite.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /DesignPattern.Flyweight/bin/Debug/DesignPattern.Flyweight.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /DesignPattern.Interpreter/bin/Debug/DesignPattern.Interpreter.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /DesignPattern.Prototype/bin/Debug/DesignPattern.Prototype.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /DesignPattern.Singleton/bin/Debug/DesignPattern.Singleton.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /DesignPattern.Memento/bin/Debug/Manulife.ChengDu.DesignPattern.Memento.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /DesignPatterm.Decorator/bin/Debug/Manulife.ChengDu.DesignPatterm.Decorator.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /DesignPattern.Composite/bin/Debug/Manulife.ChengDu.DesignPattern.Composite.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /DesignPattern.Flyweight/bin/Debug/Manulife.ChengDu.DesignPattern.Flyweight.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /DesignPattern.Iterator/bin/Debug/Manulife.ChengDu.DesignPattern.Iterator.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /DesignPattern.Mediator/bin/Debug/Manulife.ChengDu.DesignPattern.Mediator.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /DesignPattern.Observer/bin/Debug/Manulife.ChengDu.DesignPattern.Observer.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /DesignPattern.Prototype/bin/Debug/Manulife.ChengDu.DesignPattern.Prototype.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /DesignPattern.Singleton/bin/Debug/Manulife.ChengDu.DesignPattern.Singleton.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /DesignPattern.Strategy/Strategy/IDiscount.cs: -------------------------------------------------------------------------------- 1 | namespace DesignPattern.Strategy.Strategy 2 | { 3 | /// 4 | /// 抽象策略类:折扣Discount 5 | /// 6 | public interface IDiscount 7 | { 8 | double Calculate(double price); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /DesignPatterm.Decorator/bin/Debug/Manulife.ChengDu.DesignPatterm.Decorator.vshost.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /DesignPattern.ChainOfResponsibility/bin/Debug/DesignPattern.ChainOfResponsibility.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /DesignPattern.Composite/bin/Debug/Manulife.ChengDu.DesignPattern.Composite.vshost.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /DesignPattern.Flyweight/bin/Debug/Manulife.ChengDu.DesignPattern.Flyweight.vshost.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /DesignPattern.Interpreter/bin/Debug/Manulife.ChengDu.DesignPattern.Interpreter.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /DesignPattern.Iterator/bin/Debug/Manulife.ChengDu.DesignPattern.Iterator.vshost.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /DesignPattern.Mediator/bin/Debug/Manulife.ChengDu.DesignPattern.Mediator.vshost.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /DesignPattern.Memento/bin/Debug/Manulife.ChengDu.DesignPattern.Memento.vshost.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /DesignPattern.Observer/bin/Debug/Manulife.ChengDu.DesignPattern.Observer.vshost.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /DesignPattern.Prototype/bin/Debug/Manulife.ChengDu.DesignPattern.Prototype.vshost.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /DesignPattern.Proxy/Subject/ISearcher.cs: -------------------------------------------------------------------------------- 1 | namespace DesignPattern.Proxy.Subject 2 | { 3 | /// 4 | /// 抽象主题类:抽象查询接口 5 | /// 6 | public interface ISearcher 7 | { 8 | string DoSearch(string userID, string keyword); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /DesignPattern.Singleton/bin/Debug/Manulife.ChengDu.DesignPattern.Singleton.vshost.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /DesignPattern.Interpreter/bin/Debug/Manulife.ChengDu.DesignPattern.Interpreter.vshost.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /DesignPattern.Interpreter/Expression/AbstractNode.cs: -------------------------------------------------------------------------------- 1 | namespace DesignPattern.Interpreter.Expression 2 | { 3 | /// 4 | /// 抽象表达式 5 | /// 6 | public abstract class AbstractNode 7 | { 8 | public abstract string Interpret(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /DesignPattern.ChainOfResponsibility/bin/Debug/Manulife.ChengDu.DesignPattern.ChainOfResponsibility.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /DesignPattern.ChainOfResponsibility/bin/Debug/Manulife.ChengDu.DesignPattern.ChainOfResponsibility.vshost.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /DesignPattern.SimpleFactory/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /DesignPattern.Prototype/PrototypeManager/OfficeDocument.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DesignPattern.Prototype.PrototypeManager 4 | { 5 | public interface OfficeDocument : ICloneable 6 | { 7 | new OfficeDocument Clone(); // 隐藏ICloneable的Clone接口方法定义 8 | void Display(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /DesignPattern.Facade/Facade/AbstractEncryptFacade.cs: -------------------------------------------------------------------------------- 1 | namespace DesignPattern.Facade.Facade 2 | { 3 | /// 4 | /// 抽象外观类 5 | /// 6 | public abstract class AbstractEncryptFacade 7 | { 8 | public abstract void FileEncrypt(string fileNameSrc, string fileNameDes); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /DesignPattern.FactoryMethod/v1/ILogger.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 DesignPattern.FactoryMethod.v1 8 | { 9 | public interface ILogger 10 | { 11 | void WriteLog(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /DesignPattern.FactoryMethod/v2/ILogger.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 DesignPattern.FactoryMethod.v2 8 | { 9 | public interface ILogger 10 | { 11 | void WriteLog(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /DesignPattern.SimpleFactory/v1/IChartable.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 DesignPattern.SimpleFactory.v1 8 | { 9 | public interface IChartable 10 | { 11 | void Display(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /DesignPattern.Mediator/Mediator/Mediator.cs: -------------------------------------------------------------------------------- 1 | using DesignPattern.Mediator.Colleague; 2 | 3 | namespace DesignPattern.Mediator.Mediator 4 | { 5 | /// 6 | /// 抽象中介者 7 | /// 8 | public abstract class Mediator 9 | { 10 | public abstract void ComponenetChanged(Component c); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /DesignPattern.FactoryMethod/v1/ILoggerFactory.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 DesignPattern.FactoryMethod.v1 8 | { 9 | public interface ILoggerFactory 10 | { 11 | ILogger CreateLogger(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /DesignPattern.SimpleFactory/bin/Debug/DesignPattern.SimpleFactory.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /DesignPattern.Memento/Caretaker/MementoCaretaker.cs: -------------------------------------------------------------------------------- 1 | using DesignPattern.Memento.Memento; 2 | 3 | namespace DesignPattern.Memento.Caretaker 4 | { 5 | /// 6 | /// 负责人:MementoCaretaker 7 | /// 8 | public class MementoCaretaker 9 | { 10 | public ChessmanMemento Memento { get; set; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /DesignPattern.Visitor/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /DesignPattern.Adapter/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /DesignPattern.Adapter/Target/IScoreOperation.cs: -------------------------------------------------------------------------------- 1 | namespace DesignPattern.Adapter.Target 2 | { 3 | /// 4 | /// 目标接口:抽象成绩操作类 5 | /// 6 | public interface IScoreOperation 7 | { 8 | // 成绩排序 9 | int[] Sort(int[] array); 10 | // 成绩查找 11 | int Search(int[] array, int key); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /DesignPattern.Builder/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /DesignPattern.Command/Receiver/HelpHandler.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DesignPattern.Command.Receiver 4 | { 5 | /// 6 | /// 请求接受者:帮助文档处理类 7 | /// 8 | public class HelpHandler 9 | { 10 | public void Display() 11 | { 12 | Console.WriteLine("正在显示帮助文档..."); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /DesignPattern.SimpleFactory/bin/Debug/Manulife.ChengDu.DesignPattern.SimpleFactory.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /DesignPattern.Strategy/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /DesignPattern.AbstractFactory/AbstractFactory/ISkinFactory.cs: -------------------------------------------------------------------------------- 1 | using DesignPattern.AbstractFactory.AbstractProduct; 2 | 3 | namespace DesignPattern.AbstractFactory.AbstractFactory 4 | { 5 | public interface ISkinFactory 6 | { 7 | IButton CreateButton(); 8 | ITextField CreateTextField(); 9 | IComboBox CreateComboBox(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /DesignPattern.SimpleFactory/bin/Debug/Manulife.ChengDu.DesignPattern.SimpleFactory.vshost.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /DesignPattern.Command/Receiver/WindowHandler.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DesignPattern.Command.Receiver 4 | { 5 | /// 6 | /// 请求接受者:帮助文档处理类 7 | /// 8 | public class WindowHandler 9 | { 10 | public void Minimize() 11 | { 12 | Console.WriteLine("正在最小化窗口至托盘..."); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /DesignPattern.AbstractFactory/ConcreteProduct/SpringButton.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DesignPattern.AbstractFactory.AbstractProduct; 3 | 4 | namespace DesignPattern.AbstractFactory.ConcreteProduct 5 | { 6 | public class SpringButton : IButton 7 | { 8 | public void Display() 9 | { 10 | Console.WriteLine("显示浅绿色按钮..."); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /DesignPattern.AbstractFactory/ConcreteProduct/SummerButton.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DesignPattern.AbstractFactory.AbstractProduct; 3 | 4 | namespace DesignPattern.AbstractFactory.ConcreteProduct 5 | { 6 | public class SummerButton : IButton 7 | { 8 | public void Display() 9 | { 10 | Console.WriteLine("显示浅蓝色按钮..."); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /DesignPattern.Adapter/bin/Debug/DesignPattern.Adapter.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /DesignPattern.Builder/bin/Debug/DesignPattern.Builder.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /DesignPattern.Proxy/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /DesignPattern.Visitor/bin/Debug/DesignPattern.Visitor.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /DesignPattern.AbstractFactory/ConcreteProduct/SpringComboBox.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DesignPattern.AbstractFactory.AbstractProduct; 3 | 4 | namespace DesignPattern.AbstractFactory.ConcreteProduct 5 | { 6 | public class SpringComboBox : IComboBox 7 | { 8 | public void Display() 9 | { 10 | Console.WriteLine("显示绿色边框下拉框..."); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /DesignPattern.AbstractFactory/ConcreteProduct/SpringTextField.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DesignPattern.AbstractFactory.AbstractProduct; 3 | 4 | namespace DesignPattern.AbstractFactory.ConcreteProduct 5 | { 6 | public class SpringTextField : ITextField 7 | { 8 | public void Display() 9 | { 10 | Console.WriteLine("显示绿色边框文本框..."); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /DesignPattern.AbstractFactory/ConcreteProduct/SummerComboBox.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DesignPattern.AbstractFactory.AbstractProduct; 3 | 4 | namespace DesignPattern.AbstractFactory.ConcreteProduct 5 | { 6 | public class SummerComboBox : IComboBox 7 | { 8 | public void Display() 9 | { 10 | Console.WriteLine("显示蓝色边框下拉框..."); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /DesignPattern.AbstractFactory/ConcreteProduct/SummerTextField.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DesignPattern.AbstractFactory.AbstractProduct; 3 | 4 | namespace DesignPattern.AbstractFactory.ConcreteProduct 5 | { 6 | public class SummerTextField : ITextField 7 | { 8 | public void Display() 9 | { 10 | Console.WriteLine("显示蓝色边框文本框..."); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /DesignPattern.Prototype/ConcretePrototype/Attachment.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DesignPattern.Prototype.ConcretePrototype 4 | { 5 | [Serializable] 6 | public class Attachment 7 | { 8 | public string Name { get; set; } 9 | 10 | public void Download() 11 | { 12 | Console.WriteLine("下载附件,文件名为:{0}", this.Name); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /DesignPattern.Strategy/bin/Debug/DesignPattern.Strategy.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /DesignPatterm.Decorator/Component.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 DesignPatterm.Decorator 8 | { 9 | /// 10 | /// 抽象界面构件类:抽象构件类 11 | /// 12 | public abstract class Component 13 | { 14 | public abstract void Display(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /DesignPattern.Facade/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /DesignPattern.FactoryMethod/v1/FileLogger.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 DesignPattern.FactoryMethod.v1 8 | { 9 | public class FileLogger : ILogger 10 | { 11 | public void WriteLog() 12 | { 13 | Console.WriteLine("文件日志记录..."); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /DesignPattern.Flyweight/Flyweight/IgoChessman.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DesignPattern.Flyweight.Flyweight 4 | { 5 | public abstract class IgoChessman 6 | { 7 | public abstract string GetColor(); 8 | 9 | public void Display(Coordinates coord) 10 | { 11 | Console.WriteLine("棋子颜色:{0},棋子位置:{1}", GetColor(), coord.X + "," + coord.Y); 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /DesignPattern.Proxy/bin/Debug/DesignPattern.Proxy.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /DesignPattern.FactoryMethod/v1/DatabaseLogger.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 DesignPattern.FactoryMethod.v1 8 | { 9 | public class DatabaseLogger : ILogger 10 | { 11 | public void WriteLog() 12 | { 13 | Console.WriteLine("数据库日志记录..."); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /DesignPattern.FactoryMethod/v2/DatabaseLogger.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 DesignPattern.FactoryMethod.v2 8 | { 9 | public class DatabaseLogger : ILogger 10 | { 11 | public void WriteLog() 12 | { 13 | Console.WriteLine("数据库日志记录..."); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /DesignPattern.Adapter/bin/Debug/Manulife.ChengDu.DesignPattern.Adapter.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /DesignPattern.Builder/PattenSample/Product.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 DesignPattern.Builder.PattenSample 8 | { 9 | public class Product 10 | { 11 | public string PartA { get; set; } 12 | public string PartB { get; set; } 13 | public string PartC { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /DesignPattern.Builder/bin/Debug/Manulife.ChengDu.DesignPattern.Builder.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /DesignPattern.Facade/bin/Debug/DesignPattern.Facade.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /DesignPattern.FactoryMethod/v2/ILoggerFactory.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 DesignPattern.FactoryMethod.v2 8 | { 9 | public interface ILoggerFactory 10 | { 11 | ILogger CreateLogger(); 12 | ILogger CreateLogger(string args); 13 | ILogger CreateLogger(object obj); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /DesignPattern.Visitor/bin/Debug/Manulife.ChengDu.DesignPattern.Visitor.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /DesignPattern.Singleton/CustomServer.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 DesignPattern.Singleton 8 | { 9 | /// 10 | /// 假设自己是一台服务器 11 | /// 12 | public class CustomServer 13 | { 14 | public string Name { get; set; } 15 | public int Size { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /DesignPattern.Strategy/Strategy/StudentDiscount.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DesignPattern.Strategy.Strategy 4 | { 5 | /// 6 | /// 具体策略类:学生票折扣StudentDiscount 7 | /// 8 | public class StudentDiscount : IDiscount 9 | { 10 | public double Calculate(double price) 11 | { 12 | Console.WriteLine("学生票:"); 13 | return price * 0.8; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /DesignPattern.Visitor/bin/Debug/Manulife.ChengDu.DesignPattern.Visitor.vshost.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /DesignPattern.Adapter/bin/Debug/Manulife.ChengDu.DesignPattern.Adapter.vshost.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /DesignPattern.Builder/bin/Debug/Manulife.ChengDu.DesignPattern.Builder.vshost.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /DesignPattern.Strategy/Strategy/ChildrenDiscount.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DesignPattern.Strategy.Strategy 4 | { 5 | /// 6 | /// 具体策略类:儿童票折扣ChildrenDiscount 7 | /// 8 | public class ChildrenDiscount : IDiscount 9 | { 10 | public double Calculate(double price) 11 | { 12 | Console.WriteLine("儿童票:"); 13 | return price - 10; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /DesignPattern.Strategy/bin/Debug/Manulife.ChengDu.DesignPattern.Strategy.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /DesignPattern.Strategy/bin/Debug/Manulife.ChengDu.DesignPattern.Strategy.vshost.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /DesignPattern.Command/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /DesignPattern.Proxy/bin/Debug/Manulife.ChengDu.DesignPattern.Proxy.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /DesignPattern.Bridge/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /DesignPattern.Proxy/bin/Debug/Manulife.ChengDu.DesignPattern.Proxy.vshost.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /DesignPattern.Strategy/Strategy/VIPDiscount.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DesignPattern.Strategy.Strategy 4 | { 5 | /// 6 | /// 具体策略类:VIP会员票VIPDiscount 7 | /// 8 | public class VIPDiscount : IDiscount 9 | { 10 | public double Calculate(double price) 11 | { 12 | Console.WriteLine("VIP票:"); 13 | Console.WriteLine("增加积分!"); 14 | return price * 0.5; 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /DesignPattern.Prototype/PrepareAhead/Prototype.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 DesignPattern.Prototype.PrepareAhead 8 | { 9 | public abstract class Prototype 10 | { 11 | // 自定义成员 12 | public string CustomAttr 13 | { 14 | get; set; 15 | } 16 | 17 | public abstract Prototype Clone(); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /DesignPattern.Facade/bin/Debug/Manulife.ChengDu.DesignPattern.Facade.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /DesignPattern.Observer/Observer/IObserver.cs: -------------------------------------------------------------------------------- 1 | using DesignPattern.Observer.Subject; 2 | 3 | namespace DesignPattern.Observer.Observer 4 | { 5 | /// 6 | /// 抽象观察类 - IObserver接口 7 | /// 8 | public interface IObserver 9 | { 10 | string Name { get; set; } 11 | void Help(); // 声明支援盟友的方法 12 | void BeAttacked(AllyControlCenter acc); // 声明遭受攻击的方法 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /DesignPattern.Command/bin/Debug/DesignPattern.Command.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /DesignPattern.Facade/bin/Debug/Manulife.ChengDu.DesignPattern.Facade.vshost.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /DesignPattern.Bridge/bin/Debug/DesignPattern.Bridge.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /DesignPattern.Bridge/ImageImplementor.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 DesignPattern.Bridge 8 | { 9 | /// 10 | /// 抽象操作系统实现类:实现类接口 11 | /// 12 | public interface ImageImplementor 13 | { 14 | // 显示像素矩阵 15 | void DoPaint(Matrix m); 16 | } 17 | 18 | public class Matrix 19 | { 20 | // 此处代码省略 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /DesignPattern.Proxy/RealSubject/Logger.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DesignPattern.Proxy.RealSubject 4 | { 5 | /// 6 | /// 业务类:日志记录类 7 | /// 8 | public class Logger 9 | { 10 | /// 11 | /// 模拟实现日志记录 12 | /// 13 | /// 14 | public void Log(string userID) 15 | { 16 | Console.WriteLine("更新数据库,用户 {0} 查询次数加1!", userID); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /DesignPattern.TemplateMethod/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /DesignPattern.Flyweight/Flyweight/BlackIgoChessman.cs: -------------------------------------------------------------------------------- 1 | namespace DesignPattern.Flyweight.Flyweight 2 | { 3 | // 具体享元类A 4 | public class BlackIgoChessman : IgoChessman 5 | { 6 | public override string GetColor() 7 | { 8 | return "黑色"; 9 | } 10 | } 11 | 12 | // 具体享元类B 13 | public class WhiteIgoChessman : IgoChessman 14 | { 15 | public override string GetColor() 16 | { 17 | return "白色"; 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /DesignPattern.FactoryMethod/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /DesignPattern.Flyweight/Flyweight/Coordinates.cs: -------------------------------------------------------------------------------- 1 | namespace DesignPattern.Flyweight.Flyweight 2 | { 3 | /// 4 | /// 外部状态:棋子坐标 5 | /// 6 | public class Coordinates 7 | { 8 | public int X { get; set; } 9 | public int Y { get; set; } 10 | 11 | public Coordinates() 12 | { 13 | 14 | } 15 | 16 | public Coordinates(int x, int y) 17 | { 18 | this.X = x; 19 | this.Y = y; 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /DesignPattern.SimpleFactory/v1/LineChart.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 DesignPattern.SimpleFactory.v1 8 | { 9 | public class LineChart : IChartable 10 | { 11 | public LineChart() 12 | { 13 | Console.WriteLine("创建折线图..."); 14 | } 15 | 16 | public void Display() 17 | { 18 | Console.WriteLine("显示折线图..."); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /DesignPattern.SimpleFactory/v1/PieChart.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 DesignPattern.SimpleFactory.v1 8 | { 9 | public class PieChart : IChartable 10 | { 11 | public PieChart() 12 | { 13 | Console.WriteLine("创建饼状图..."); 14 | } 15 | 16 | public void Display() 17 | { 18 | Console.WriteLine("显示饼状图..."); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /DesignPattern.Prototype/PrototypeManager/FAR.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DesignPattern.Prototype.PrototypeManager 4 | { 5 | public class FAR : OfficeDocument 6 | { 7 | public OfficeDocument Clone() 8 | { 9 | return new FAR(); 10 | } 11 | 12 | public void Display() 13 | { 14 | Console.WriteLine("<<可行性分析报告>>"); 15 | } 16 | 17 | object ICloneable.Clone() 18 | { 19 | return this.Clone(); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /DesignPattern.Prototype/PrototypeManager/SRS.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DesignPattern.Prototype.PrototypeManager 4 | { 5 | public class SRS : OfficeDocument 6 | { 7 | public OfficeDocument Clone() 8 | { 9 | return new SRS(); 10 | } 11 | 12 | public void Display() 13 | { 14 | Console.WriteLine("<<软件需求规格说明书>>"); 15 | } 16 | 17 | object ICloneable.Clone() 18 | { 19 | return this.Clone(); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /DesignPattern.AbstractFactory/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /DesignPattern.FactoryMethod/v1/FileLoggerFactory.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 DesignPattern.FactoryMethod.v1 8 | { 9 | public class FileLoggerFactory : ILoggerFactory 10 | { 11 | public ILogger CreateLogger() 12 | { 13 | // 创建文件日志记录器 14 | ILogger logger = new FileLogger(); 15 | // 创建文件,代码省略 16 | return logger; 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /DesignPattern.Memento/Memento/ChessmanMemento.cs: -------------------------------------------------------------------------------- 1 | namespace DesignPattern.Memento.Memento 2 | { 3 | /// 4 | /// 备忘录:ChessmanMemento 5 | /// 6 | public class ChessmanMemento 7 | { 8 | public string Label { get; set; } 9 | public int X { get; set; } 10 | public int Y { get; set; } 11 | 12 | public ChessmanMemento(string label, int x, int y) 13 | { 14 | Label = label; 15 | X = x; 16 | Y = y; 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /DesignPattern.SimpleFactory/v1/HistogramChart.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 DesignPattern.SimpleFactory.v1 8 | { 9 | public class HistogramChart : IChartable 10 | { 11 | public HistogramChart() 12 | { 13 | Console.WriteLine("创建柱状图..."); 14 | } 15 | 16 | public void Display() 17 | { 18 | Console.WriteLine("显示柱状图..."); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /DesignPattern.TemplateMethod/bin/Debug/DesignPattern.TemplateMethod.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /DesignPattern.FactoryMethod/bin/Debug/DesignPattern.FactoryMethod.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /DesignPattern.Builder/GameRoleDemo/Actor.cs: -------------------------------------------------------------------------------- 1 | namespace DesignPattern.Builder.GameRoleDemo 2 | { 3 | /// 4 | /// Actor 角色类 : 复杂产品,这里只列出部分成员变量 5 | /// 6 | public class Actor 7 | { 8 | // 角色类型 9 | public string Type { get; set; } 10 | // 性别 11 | public string Sex { get; set; } 12 | // 脸型 13 | public string Face { get; set; } 14 | // 服装 15 | public string Costume { get; set; } 16 | // 发型 17 | public string HairStyle { get; set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /DesignPattern.Interpreter/Expression/DistanceNode.cs: -------------------------------------------------------------------------------- 1 | namespace DesignPattern.Interpreter.Expression 2 | { 3 | /// 4 | /// 终结符表达式:距离解释 5 | /// 6 | public class DistanceNode : AbstractNode 7 | { 8 | private string distance; 9 | 10 | public DistanceNode(string distance) 11 | { 12 | this.distance = distance; 13 | } 14 | 15 | // 距离表达式的解释操作 16 | public override string Interpret() 17 | { 18 | return this.distance; 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /DesignPattern.Proxy/RealSubject/RealSearcher.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DesignPattern.Proxy.RealSubject 4 | { 5 | /// 6 | /// 真是主题类:具体查询器 7 | /// 8 | public class RealSearcher 9 | { 10 | /// 11 | /// 模拟查询商务信息 12 | /// 13 | /// 14 | public string DoSearch(string userID, string keyword) 15 | { 16 | Console.WriteLine("{0} 使用关键词 {1}", userID, keyword); 17 | return "返回具体内容"; 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /DesignPattern.AbstractFactory/bin/Debug/DesignPattern.AbstractFactory.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /DesignPattern.Command/bin/Debug/Manulife.ChengDu.DesignPattern.Command.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /DesignPattern.Bridge/bin/Debug/Manulife.ChengDu.DesignPattern.Bridge.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /DesignPattern.Command/bin/Debug/Manulife.ChengDu.DesignPattern.Command.vshost.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /DesignPattern.FactoryMethod/v1/DatabaseLoggerFactory.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 DesignPattern.FactoryMethod.v1 8 | { 9 | public class DatabaseLoggerFactory : ILoggerFactory 10 | { 11 | public ILogger CreateLogger() 12 | { 13 | // 连接数据库,代码省略 14 | // 创建数据库日志记录器对象 15 | ILogger logger = new DatabaseLogger(); 16 | // 初始化数据库日志记录器,代码省略 17 | return logger; 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /DesignPattern.Bridge/bin/Debug/Manulife.ChengDu.DesignPattern.Bridge.vshost.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /DesignPattern.Proxy/bin/Debug/Manulife.ChengDu.DesignPattern.Proxy.vshost.exe.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /DesignPattern.Adapter/bin/Debug/Manulife.ChengDu.DesignPattern.Adapter.vshost.exe.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /DesignPattern.Bridge/bin/Debug/Manulife.ChengDu.DesignPattern.Bridge.vshost.exe.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /DesignPattern.Builder/bin/Debug/Manulife.ChengDu.DesignPattern.Builder.vshost.exe.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /DesignPattern.Command/bin/Debug/Manulife.ChengDu.DesignPattern.Command.vshost.exe.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /DesignPattern.Facade/bin/Debug/Manulife.ChengDu.DesignPattern.Facade.vshost.exe.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /DesignPattern.Memento/bin/Debug/Manulife.ChengDu.DesignPattern.Memento.vshost.exe.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /DesignPattern.Visitor/bin/Debug/Manulife.ChengDu.DesignPattern.Visitor.vshost.exe.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /DesignPatterm.Decorator/bin/Debug/Manulife.ChengDu.DesignPatterm.Decorator.vshost.exe.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /DesignPattern.Composite/bin/Debug/Manulife.ChengDu.DesignPattern.Composite.vshost.exe.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /DesignPattern.FactoryMethod/v3/LoggerFactory.cs: -------------------------------------------------------------------------------- 1 | using DesignPattern.FactoryMethod.v1; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace DesignPattern.FactoryMethod.v3 9 | { 10 | public abstract class LoggerFactory 11 | { 12 | // 在工厂类中直接调用日志记录器的业务方法WriteLog() 13 | public void WriteLog() 14 | { 15 | ILogger logger = this.CreateLogger(); 16 | logger.WriteLog(); 17 | } 18 | 19 | public abstract ILogger CreateLogger(); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /DesignPattern.Flyweight/bin/Debug/Manulife.ChengDu.DesignPattern.Flyweight.vshost.exe.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /DesignPattern.Iterator/bin/Debug/Manulife.ChengDu.DesignPattern.Iterator.vshost.exe.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /DesignPattern.Mediator/bin/Debug/Manulife.ChengDu.DesignPattern.Mediator.vshost.exe.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /DesignPattern.Observer/bin/Debug/Manulife.ChengDu.DesignPattern.Observer.vshost.exe.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /DesignPattern.Prototype/bin/Debug/Manulife.ChengDu.DesignPattern.Prototype.vshost.exe.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /DesignPattern.Singleton/bin/Debug/Manulife.ChengDu.DesignPattern.Singleton.vshost.exe.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /DesignPattern.Strategy/bin/Debug/Manulife.ChengDu.DesignPattern.Strategy.vshost.exe.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /DesignPattern.Bridge/Image.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 DesignPattern.Bridge 8 | { 9 | /// 10 | /// 抽象图像类:抽象类 11 | /// 12 | public abstract class Image 13 | { 14 | protected ImageImplementor imageImpl; 15 | 16 | public void SetImageImplementor (ImageImplementor imageImpl) 17 | { 18 | this.imageImpl = imageImpl; 19 | } 20 | 21 | public abstract void ParstFile(string fileName); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /DesignPattern.Interpreter/bin/Debug/Manulife.ChengDu.DesignPattern.Interpreter.vshost.exe.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /DesignPattern.Mediator/Colleague/Component.cs: -------------------------------------------------------------------------------- 1 | namespace DesignPattern.Mediator.Colleague 2 | { 3 | /// 4 | /// 抽象同事类:抽象组件 5 | /// 6 | public abstract class Component 7 | { 8 | protected Mediator.Mediator mediator; 9 | 10 | public void SetMediator(Mediator.Mediator mediator) 11 | { 12 | this.mediator = mediator; 13 | } 14 | 15 | // 转发调用 16 | public void Changed() 17 | { 18 | mediator.ComponenetChanged(this); 19 | } 20 | 21 | public abstract void Update(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /DesignPattern.Prototype/PrepareAhead/ConcretePrototype.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 DesignPattern.Prototype.PrepareAhead 8 | { 9 | public class ConcretePrototype : Prototype 10 | { 11 | // 克隆方法 12 | public override Prototype Clone() 13 | { 14 | // 创建新对象 15 | Prototype prototype = new ConcretePrototype(); 16 | prototype.CustomAttr = this.CustomAttr; 17 | 18 | return prototype; 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /DesignPattern.AbstractFactory/bin/Debug/Manulife.ChengDu.DesignPattern.AbstractFactory.vshost.exe.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /DesignPattern.FactoryMethod/bin/Debug/Manulife.ChengDu.DesignPattern.FactoryMethod.vshost.exe.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /DesignPattern.SimpleFactory/bin/Debug/Manulife.ChengDu.DesignPattern.SimpleFactory.vshost.exe.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /DesignPattern.TemplateMethod/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 DesignPattern.TemplateMethod 8 | { 9 | public class Program 10 | { 11 | public static void Main(string[] args) 12 | { 13 | Account account = AppConfigHelper.GetAccountInstance() as Account; 14 | if (account != null) 15 | { 16 | account.Handle("张无忌", "123456"); 17 | } 18 | 19 | Console.ReadKey(); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /DesignPattern.TemplateMethod/bin/Debug/Manulife.ChengDu.DesignPattern.TemplateMethod.vshost.exe.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /DesignPattern.Composite/RefactoredVersion/AbstractFile.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 DesignPattern.Composite.RefactoredVersion 8 | { 9 | /// 10 | /// 抽象文件类:抽象构件 11 | /// 12 | public abstract class AbstractFile 13 | { 14 | public abstract void Add(AbstractFile file); 15 | public abstract void Remove(AbstractFile file); 16 | public abstract AbstractFile GetChild(int index); 17 | public abstract void KillVirus(); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /DesignPattern.TemplateMethod/bin/Debug/Manulife.ChengDu.DesignPattern.TemplateMethod.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /DesignPattern.ChainOfResponsibility/bin/Debug/Manulife.ChengDu.DesignPattern.ChainOfResponsibility.vshost.exe.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /DesignPattern.Iterator/Iterator/AbstractIterator.cs: -------------------------------------------------------------------------------- 1 | namespace DesignPattern.Iterator.Iterator 2 | { 3 | /// 4 | /// 抽象迭代器:AbstractIterator 5 | /// 6 | public interface AbstractIterator 7 | { 8 | void Next(); // 移动至下一个元素 9 | bool IsLast(); // 判断是否为最后一个元素 10 | void Previous(); // 移动至上一个元素 11 | bool IsFirst(); // 判断是否为第一个元素 12 | object GetNextItem(); // 获取下一个元素 13 | object GetPreviousItem(); // 获取上一个元素 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /DesignPattern.TemplateMethod/bin/Debug/Manulife.ChengDu.DesignPattern.TemplateMethod.vshost.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /DesignPattern.FactoryMethod/bin/Debug/Manulife.ChengDu.DesignPattern.FactoryMethod.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /DesignPattern.FactoryMethod/v3/DatabaseLoggerFactory.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using DesignPattern.FactoryMethod.v1; 7 | 8 | namespace DesignPattern.FactoryMethod.v3 9 | { 10 | public class DatabaseLoggerFactory : LoggerFactory 11 | { 12 | public override ILogger CreateLogger() 13 | { 14 | // 连接数据库,代码省略 15 | // 创建数据库日志记录器对象 16 | ILogger logger = new DatabaseLogger(); 17 | // 初始化数据库日志记录器,代码省略 18 | return logger; 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /DesignPattern.FactoryMethod/bin/Debug/Manulife.ChengDu.DesignPattern.FactoryMethod.vshost.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /DesignPattern.Command/Command/HelpCommand.cs: -------------------------------------------------------------------------------- 1 | using DesignPattern.Command.Receiver; 2 | 3 | namespace DesignPattern.Command.Command 4 | { 5 | /// 6 | /// 具体命令类:帮助命令 7 | /// 8 | public class HelpCommand : Command 9 | { 10 | private HelpHandler hander; 11 | 12 | public HelpCommand() 13 | { 14 | hander = new HelpHandler(); 15 | } 16 | 17 | // 命令执行方法,将调用请求接受者的业务方法 18 | public override void Execute() 19 | { 20 | if (hander != null) 21 | { 22 | hander.Display(); 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /DesignPattern.Proxy/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using DesignPattern.Proxy.Subject; 7 | 8 | namespace DesignPattern.Proxy 9 | { 10 | public class Program 11 | { 12 | public static void Main(string[] args) 13 | { 14 | ISearcher searcher = AppConfigHelper.GetProxyInstance() as ISearcher; 15 | if (searcher != null) 16 | { 17 | string result = searcher.DoSearch("杨过", "玉女心经"); 18 | } 19 | 20 | Console.ReadKey(); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /DesignPattern.AbstractFactory/bin/Debug/Manulife.ChengDu.DesignPattern.AbstractFactory.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /DesignPattern.Bridge/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 DesignPattern.Bridge 8 | { 9 | public class Program 10 | { 11 | public static void Main(string[] args) 12 | { 13 | Image image = (Image) AppConfigHelper.GetImageInstance(); 14 | ImageImplementor imageImpl = (ImageImplementor)AppConfigHelper.GetEnvInstance(); 15 | 16 | image.SetImageImplementor(imageImpl); 17 | image.ParstFile("小龙女"); 18 | 19 | Console.ReadKey(); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /DesignPattern.Builder/PattenSample/Builder.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 DesignPattern.Builder.PattenSample 8 | { 9 | public abstract class Builder 10 | { 11 | // 创建产品对象 12 | protected Product product = new Product(); 13 | 14 | public abstract void BuildPartA(); 15 | public abstract void BuildPartB(); 16 | public abstract void BuildPartC(); 17 | 18 | // 返回产品对象 19 | public Product GetResult() 20 | { 21 | return product; 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /DesignPattern.Builder/GameRoleDemo/ActorController.cs: -------------------------------------------------------------------------------- 1 | namespace DesignPattern.Builder.GameRoleDemo 2 | { 3 | /// 4 | /// 游戏角色创建控制器:指挥者(Director) 5 | /// 6 | public class ActorController 7 | { 8 | /// 9 | /// 逐步构建复杂产品对象 10 | /// 11 | public Actor Construct(ActorBuilder builder) 12 | { 13 | builder.BuildType(); 14 | builder.BuildSex(); 15 | builder.BuildFace(); 16 | builder.BuildCostume(); 17 | builder.BuildHairStyle(); 18 | 19 | return builder.CreateActor(); ; 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /DesignPattern.AbstractFactory/bin/Debug/Manulife.ChengDu.DesignPattern.AbstractFactory.vshost.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /DesignPattern.Interpreter/Expression/AndNode.cs: -------------------------------------------------------------------------------- 1 | namespace DesignPattern.Interpreter.Expression 2 | { 3 | /// 4 | /// 非终结符表达式:And解释 5 | /// 6 | public class AndNode : AbstractNode 7 | { 8 | private AbstractNode left; 9 | private AbstractNode right; 10 | 11 | public AndNode(AbstractNode left, AbstractNode right) 12 | { 13 | this.left = left; 14 | this.right = right; 15 | } 16 | 17 | // And表达式解释操作 18 | public override string Interpret() 19 | { 20 | return left.Interpret() + " 再 " + right.Interpret(); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /DesignPatterm.Decorator/ComponentDecorator.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 DesignPatterm.Decorator 8 | { 9 | /// 10 | /// 构件装饰类:抽象装饰类 11 | /// 12 | public class ComponentDecorator : Component 13 | { 14 | private Component component; 15 | 16 | public ComponentDecorator (Component component) 17 | { 18 | this.component = component; 19 | } 20 | 21 | public override void Display() 22 | { 23 | component.Display(); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /DesignPattern.Builder/GameRoleDemo/ActorBuilder.cs: -------------------------------------------------------------------------------- 1 | namespace DesignPattern.Builder.GameRoleDemo 2 | { 3 | /// 4 | /// 角色建造器 : 抽象建造者 5 | /// 6 | public abstract class ActorBuilder 7 | { 8 | protected Actor actor = new Actor(); 9 | 10 | public abstract void BuildType(); 11 | public abstract void BuildSex(); 12 | public abstract void BuildFace(); 13 | public abstract void BuildCostume(); 14 | public abstract void BuildHairStyle(); 15 | 16 | // 工厂方法 : 返回一个完整的游戏角色对象 17 | public Actor CreateActor() 18 | { 19 | return actor; 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /DesignPattern.Command/Command/MinimizeCommand.cs: -------------------------------------------------------------------------------- 1 | using DesignPattern.Command.Receiver; 2 | 3 | namespace DesignPattern.Command.Command 4 | { 5 | /// 6 | /// 具体命令类:最小化命令 7 | /// 8 | public class MinimizeCommand : Command 9 | { 10 | private WindowHandler handler; 11 | 12 | public MinimizeCommand() 13 | { 14 | handler = new WindowHandler(); 15 | } 16 | 17 | // 命令执行方法,将调用请求接受者的业务方法 18 | public override void Execute() 19 | { 20 | if (handler != null) 21 | { 22 | handler.Minimize(); 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /DesignPattern.Memento/Caretaker/NewMementoCaretaker.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using DesignPattern.Memento.Memento; 3 | 4 | namespace DesignPattern.Memento.Caretaker 5 | { 6 | /// 7 | /// 负责人:MementoCaretaker 8 | /// 9 | public class NewMementoCaretaker 10 | { 11 | private IList mementoList = new List(); 12 | 13 | public ChessmanMemento GetMemento(int i) 14 | { 15 | return mementoList[i]; 16 | } 17 | 18 | public void SetMemento(ChessmanMemento memento) 19 | { 20 | mementoList.Add(memento); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /DesignPattern.TemplateMethod/SavingAccount.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 DesignPattern.TemplateMethod 8 | { 9 | /// 10 | /// 具体子类:SavingAccount => 定期账户类 11 | /// 12 | public class SavingAccount : Account 13 | { 14 | // 重写父类的抽象基本方法 15 | public override void CalculateInterest() 16 | { 17 | Console.WriteLine("按定期利率计算利息!"); 18 | } 19 | 20 | // 重写父类的钩子方法 21 | public override bool IsAllowDisplay() 22 | { 23 | return false; 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /DesignPattern.TemplateMethod/CurrentAccount.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 DesignPattern.TemplateMethod 8 | { 9 | /// 10 | /// 具体子类:CurrentAccount => 活期账户类 11 | /// 12 | public class CurrentAccount : Account 13 | { 14 | // 重写父类的抽象基本方法 15 | public override void CalculateInterest() 16 | { 17 | Console.WriteLine("按活期利率计算利息!"); 18 | } 19 | 20 | // 重写父类的钩子方法 21 | public override bool IsAllowDisplay() 22 | { 23 | return base.IsAllowDisplay(); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /DesignPattern.SimpleFactory/v2/AppConfigHelper.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 DesignPattern.SimpleFactory.v2 8 | { 9 | public class AppConfigHelper 10 | { 11 | public static string GetChartType() 12 | { 13 | string chartType = null; 14 | try 15 | { 16 | chartType = System.Configuration.ConfigurationManager.AppSettings["charttype"]; 17 | } 18 | catch (Exception ex) 19 | { 20 | Console.WriteLine(ex.Message); 21 | } 22 | return chartType; 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /DesignPattern.Facade/Subsystem/FileWriter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DesignPattern.Facade.Subsystem 4 | { 5 | /// 6 | /// 文件保存类:子系统C 7 | /// 8 | public class FileWriter 9 | { 10 | public void Write(string encryptedStr, string fileNameDes) 11 | { 12 | Console.WriteLine("保存密文,写入文件:"); 13 | byte[] myByte = System.Text.Encoding.UTF8.GetBytes(encryptedStr); 14 | using (System.IO.FileStream fsWrite = new System.IO.FileStream(fileNameDes, System.IO.FileMode.Append)) 15 | { 16 | fsWrite.Write(myByte, 0, myByte.Length); 17 | }; 18 | 19 | Console.WriteLine("写入文件成功:100%"); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /DesignPattern.AbstractFactory/ConcreteFactory/SpringSkinFactory.cs: -------------------------------------------------------------------------------- 1 | using DesignPattern.AbstractFactory.AbstractFactory; 2 | using DesignPattern.AbstractFactory.AbstractProduct; 3 | using DesignPattern.AbstractFactory.ConcreteProduct; 4 | 5 | namespace DesignPattern.AbstractFactory.ConcreteFactory 6 | { 7 | public class SpringSkinFactory : ISkinFactory 8 | { 9 | public IButton CreateButton() 10 | { 11 | return new SpringButton(); 12 | } 13 | 14 | public IComboBox CreateComboBox() 15 | { 16 | return new SpringComboBox(); 17 | } 18 | 19 | public ITextField CreateTextField() 20 | { 21 | return new SpringTextField(); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /DesignPattern.AbstractFactory/ConcreteFactory/SummerSkinFactory.cs: -------------------------------------------------------------------------------- 1 | using DesignPattern.AbstractFactory.AbstractFactory; 2 | using DesignPattern.AbstractFactory.AbstractProduct; 3 | using DesignPattern.AbstractFactory.ConcreteProduct; 4 | 5 | namespace DesignPattern.AbstractFactory.ConcreteFactory 6 | { 7 | public class SummerSkinFactory : ISkinFactory 8 | { 9 | public IButton CreateButton() 10 | { 11 | return new SummerButton(); 12 | } 13 | 14 | public IComboBox CreateComboBox() 15 | { 16 | return new SummerComboBox(); 17 | } 18 | 19 | public ITextField CreateTextField() 20 | { 21 | return new SummerTextField(); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /DesignPattern.Builder/GameRoleDemo/AngelBuilder.cs: -------------------------------------------------------------------------------- 1 | namespace DesignPattern.Builder.GameRoleDemo 2 | { 3 | public class AngelBuilder : ActorBuilder 4 | { 5 | public override void BuildCostume() 6 | { 7 | actor.Costume = "白裙"; 8 | } 9 | 10 | public override void BuildFace() 11 | { 12 | actor.Face = "漂亮"; 13 | } 14 | 15 | public override void BuildHairStyle() 16 | { 17 | actor.HairStyle = "披肩长发"; 18 | } 19 | 20 | public override void BuildSex() 21 | { 22 | actor.Sex = "女"; 23 | } 24 | 25 | public override void BuildType() 26 | { 27 | actor.Type = "天使"; 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /DesignPatterm.Decorator/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 DesignPatterm.Decorator 8 | { 9 | public class Program 10 | { 11 | public static void Main(string[] args) 12 | { 13 | Component component = new Window(); 14 | // 一次装饰 15 | Component componentSB = new ScrollBarDecorator(component); 16 | componentSB.Display(); 17 | 18 | Console.WriteLine(); 19 | // 二次装饰 20 | Component componentBB = new BlackBorderDecorator(componentSB); 21 | componentBB.Display(); 22 | 23 | Console.ReadKey(); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /DesignPattern.Observer/Observer/Player.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DesignPattern.Observer.Subject; 3 | 4 | namespace DesignPattern.Observer.Observer 5 | { 6 | /// 7 | /// 具体观察者类:战队成员 8 | /// 9 | public class Player : IObserver 10 | { 11 | public string Name 12 | { 13 | get; 14 | set; 15 | } 16 | 17 | public void BeAttacked(AllyControlCenter acc) 18 | { 19 | Console.WriteLine("{0}:我正被攻击,速来援救!", this.Name); 20 | // 调用战队控制中心类的通知方法来通知盟友 21 | acc.NotifyObserver(this.Name); 22 | } 23 | 24 | public void Help() 25 | { 26 | Console.WriteLine("{0} :坚持住,立马来救你!", this.Name); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /DesignPattern.Proxy/obj/Debug/DesignPattern.Proxy.csproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- 1 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Proxy\bin\Debug\DesignPattern.Proxy.exe.config 2 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Proxy\bin\Debug\DesignPattern.Proxy.exe 3 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Proxy\bin\Debug\DesignPattern.Proxy.pdb 4 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Proxy\obj\Debug\DesignPattern.Proxy.csproj.CoreCompileInputs.cache 5 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Proxy\obj\Debug\DesignPattern.Proxy.exe 6 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Proxy\obj\Debug\DesignPattern.Proxy.pdb 7 | -------------------------------------------------------------------------------- /DesignPattern.Visitor/ObjectStructure/EmployeeList.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using DesignPattern.Visitor.Element; 3 | using DesignPattern.Visitor.Visitor; 4 | 5 | namespace DesignPattern.Visitor.ObjectStructure 6 | { 7 | /// 8 | /// 对象结构类:EmployeeList 9 | /// 10 | public class EmployeeList 11 | { 12 | private IList empList = new List(); 13 | 14 | public void AddEmployee(IEmployee emp) 15 | { 16 | this.empList.Add(emp); 17 | } 18 | 19 | public void Accept(Department handler) 20 | { 21 | foreach (var emp in empList) 22 | { 23 | emp.Accept(handler); 24 | } 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /DesignPattern.Facade/obj/Debug/DesignPattern.Facade.csproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- 1 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Facade\bin\Debug\DesignPattern.Facade.exe.config 2 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Facade\bin\Debug\DesignPattern.Facade.exe 3 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Facade\bin\Debug\DesignPattern.Facade.pdb 4 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Facade\obj\Debug\DesignPattern.Facade.csproj.CoreCompileInputs.cache 5 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Facade\obj\Debug\DesignPattern.Facade.exe 6 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Facade\obj\Debug\DesignPattern.Facade.pdb 7 | -------------------------------------------------------------------------------- /DesignPattern.ChainOfResponsibility/PurchaseRequest.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 DesignPattern.ChainOfResponsibility 8 | { 9 | /// 10 | /// 采购单:请求类 11 | /// 12 | public class PurchaseRequest 13 | { 14 | // 采购金额 15 | public double Amount { get; set; } 16 | // 采购单编号 17 | public string Number { get; set; } 18 | // 采购目的 19 | public string Purpose { get; set; } 20 | 21 | public PurchaseRequest(double amount, string number, string purpose) 22 | { 23 | Amount = amount; 24 | Number = number; 25 | Purpose = purpose; 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /DesignPattern.Strategy/Context/MovieTicket.cs: -------------------------------------------------------------------------------- 1 | using DesignPattern.Strategy.Strategy; 2 | 3 | namespace DesignPattern.Strategy.Context 4 | { 5 | /// 6 | /// 环境类:电影票MovieTicket 7 | /// 8 | public class MovieTicket 9 | { 10 | private double _price; 11 | private IDiscount _discount; 12 | 13 | public double Price 14 | { 15 | get 16 | { 17 | return _discount.Calculate(_price); 18 | } 19 | set 20 | { 21 | _price = value; 22 | } 23 | } 24 | 25 | public IDiscount Discount 26 | { 27 | set 28 | { 29 | _discount = value; 30 | } 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /DesignPattern.Memento/obj/Debug/DesignPattern.Memento.csproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- 1 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Memento\bin\Debug\DesignPattern.Memento.exe.config 2 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Memento\bin\Debug\DesignPattern.Memento.exe 3 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Memento\bin\Debug\DesignPattern.Memento.pdb 4 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Memento\obj\Debug\DesignPattern.Memento.csproj.CoreCompileInputs.cache 5 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Memento\obj\Debug\DesignPattern.Memento.exe 6 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Memento\obj\Debug\DesignPattern.Memento.pdb 7 | -------------------------------------------------------------------------------- /DesignPattern.Visitor/obj/Debug/DesignPattern.Visitor.csproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- 1 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Visitor\bin\Debug\DesignPattern.Visitor.exe.config 2 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Visitor\bin\Debug\DesignPattern.Visitor.exe 3 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Visitor\bin\Debug\DesignPattern.Visitor.pdb 4 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Visitor\obj\Debug\DesignPattern.Visitor.csproj.CoreCompileInputs.cache 5 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Visitor\obj\Debug\DesignPattern.Visitor.exe 6 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Visitor\obj\Debug\DesignPattern.Visitor.pdb 7 | -------------------------------------------------------------------------------- /DesignPattern.Facade/Facade/EncryptFacade.cs: -------------------------------------------------------------------------------- 1 | using DesignPattern.Facade.Subsystem; 2 | 3 | namespace DesignPattern.Facade.Facade 4 | { 5 | public class EncryptFacade 6 | { 7 | private FileReader reader; 8 | private CipherMachine cipher; 9 | private FileWriter writer; 10 | 11 | public EncryptFacade() 12 | { 13 | reader = new FileReader(); 14 | cipher = new CipherMachine(); 15 | writer = new FileWriter(); 16 | } 17 | 18 | public void FileEncrypt(string fileNameSrc, string fileNameDes) 19 | { 20 | string plainStr = reader.Read(fileNameSrc); 21 | string encryptedStr = cipher.Encrypt(plainStr); 22 | writer.Write(encryptedStr, fileNameDes); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /DesignPattern.Iterator/obj/Debug/DesignPattern.Iterator.csproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- 1 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Iterator\bin\Debug\DesignPattern.Iterator.exe.config 2 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Iterator\bin\Debug\DesignPattern.Iterator.exe 3 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Iterator\bin\Debug\DesignPattern.Iterator.pdb 4 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Iterator\obj\Debug\DesignPattern.Iterator.csproj.CoreCompileInputs.cache 5 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Iterator\obj\Debug\DesignPattern.Iterator.exe 6 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Iterator\obj\Debug\DesignPattern.Iterator.pdb 7 | -------------------------------------------------------------------------------- /DesignPattern.Mediator/obj/Debug/DesignPattern.Mediator.csproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- 1 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Mediator\bin\Debug\DesignPattern.Mediator.exe.config 2 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Mediator\bin\Debug\DesignPattern.Mediator.exe 3 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Mediator\bin\Debug\DesignPattern.Mediator.pdb 4 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Mediator\obj\Debug\DesignPattern.Mediator.csproj.CoreCompileInputs.cache 5 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Mediator\obj\Debug\DesignPattern.Mediator.exe 6 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Mediator\obj\Debug\DesignPattern.Mediator.pdb 7 | -------------------------------------------------------------------------------- /DesignPattern.Observer/obj/Debug/DesignPattern.Observer.csproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- 1 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Observer\bin\Debug\DesignPattern.Observer.exe.config 2 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Observer\bin\Debug\DesignPattern.Observer.exe 3 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Observer\bin\Debug\DesignPattern.Observer.pdb 4 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Observer\obj\Debug\DesignPattern.Observer.csproj.CoreCompileInputs.cache 5 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Observer\obj\Debug\DesignPattern.Observer.exe 6 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Observer\obj\Debug\DesignPattern.Observer.pdb 7 | -------------------------------------------------------------------------------- /DesignPatterm.Decorator/obj/Debug/DesignPatterm.Decorator.csproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- 1 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPatterm.Decorator\bin\Debug\DesignPatterm.Decorator.exe.config 2 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPatterm.Decorator\bin\Debug\DesignPatterm.Decorator.exe 3 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPatterm.Decorator\bin\Debug\DesignPatterm.Decorator.pdb 4 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPatterm.Decorator\obj\Debug\DesignPatterm.Decorator.csproj.CoreCompileInputs.cache 5 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPatterm.Decorator\obj\Debug\DesignPatterm.Decorator.exe 6 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPatterm.Decorator\obj\Debug\DesignPatterm.Decorator.pdb 7 | -------------------------------------------------------------------------------- /DesignPattern.Builder/GameRoleDemo/HeroBuilder.cs: -------------------------------------------------------------------------------- 1 | namespace DesignPattern.Builder.GameRoleDemo 2 | { 3 | /// 4 | /// 英雄建造器 : 具体建造者 5 | /// 6 | public class HeroBuilder : ActorBuilder 7 | { 8 | public override void BuildCostume() 9 | { 10 | actor.Costume = "盔甲"; 11 | } 12 | 13 | public override void BuildFace() 14 | { 15 | actor.Face = "英俊"; 16 | } 17 | 18 | public override void BuildHairStyle() 19 | { 20 | actor.HairStyle = "飘逸"; 21 | } 22 | 23 | public override void BuildSex() 24 | { 25 | actor.Sex = "男"; 26 | } 27 | 28 | public override void BuildType() 29 | { 30 | actor.Type = "英雄"; 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /DesignPattern.Composite/obj/Debug/DesignPattern.Composite.csproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- 1 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Composite\bin\Debug\DesignPattern.Composite.exe.config 2 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Composite\bin\Debug\DesignPattern.Composite.exe 3 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Composite\bin\Debug\DesignPattern.Composite.pdb 4 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Composite\obj\Debug\DesignPattern.Composite.csproj.CoreCompileInputs.cache 5 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Composite\obj\Debug\DesignPattern.Composite.exe 6 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Composite\obj\Debug\DesignPattern.Composite.pdb 7 | -------------------------------------------------------------------------------- /DesignPattern.Facade/Subsystem/CipherMachine.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Text; 3 | 4 | namespace DesignPattern.Facade.Subsystem 5 | { 6 | /// 7 | /// 数据加密类:子系统B 8 | /// 9 | public class CipherMachine 10 | { 11 | public string Encrypt(string plainText) 12 | { 13 | Console.WriteLine("数据加密,将明文转换为密文:"); 14 | StringBuilder result = new StringBuilder(); 15 | 16 | for (int i = 0; i < plainText.Length; i++) 17 | { 18 | string ch = Convert.ToString(plainText[i] % 7); 19 | result.Append(ch); 20 | } 21 | 22 | string encryptedResult = result.ToString(); 23 | Console.WriteLine(encryptedResult); 24 | return encryptedResult; 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /DesignPattern.Flyweight/obj/Debug/DesignPattern.Flyweight.csproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- 1 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Flyweight\bin\Debug\DesignPattern.Flyweight.exe.config 2 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Flyweight\bin\Debug\DesignPattern.Flyweight.exe 3 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Flyweight\bin\Debug\DesignPattern.Flyweight.pdb 4 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Flyweight\obj\Debug\DesignPattern.Flyweight.csproj.CoreCompileInputs.cache 5 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Flyweight\obj\Debug\DesignPattern.Flyweight.exe 6 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Flyweight\obj\Debug\DesignPattern.Flyweight.pdb 7 | -------------------------------------------------------------------------------- /DesignPattern.Builder/GameRoleDemo/DevilBuilder.cs: -------------------------------------------------------------------------------- 1 | namespace DesignPattern.Builder.GameRoleDemo 2 | { 3 | /// 4 | /// 恶魔角色建造器 :具体建造者 5 | /// 6 | public class DevilBuilder : ActorBuilder 7 | { 8 | public override void BuildCostume() 9 | { 10 | actor.Costume = "黑衣"; 11 | } 12 | 13 | public override void BuildFace() 14 | { 15 | actor.Face = "丑陋"; 16 | } 17 | 18 | public override void BuildHairStyle() 19 | { 20 | actor.HairStyle = "光头"; 21 | } 22 | 23 | public override void BuildSex() 24 | { 25 | actor.Sex = "妖"; 26 | } 27 | 28 | public override void BuildType() 29 | { 30 | actor.Type = "恶魔"; 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /DesignPattern.Interpreter/Expression/SentenseNode.cs: -------------------------------------------------------------------------------- 1 | namespace DesignPattern.Interpreter.Expression 2 | { 3 | /// 4 | /// 非终结符表达式:简单句子解释 5 | /// 6 | public class SentenseNode : AbstractNode 7 | { 8 | private AbstractNode direction; 9 | private AbstractNode action; 10 | private AbstractNode distance; 11 | 12 | public SentenseNode(AbstractNode direction, AbstractNode action, AbstractNode distance) 13 | { 14 | this.direction = direction; 15 | this.action = action; 16 | this.distance = distance; 17 | } 18 | 19 | // 简单句子解释操作 20 | public override string Interpret() 21 | { 22 | return direction.Interpret() + action.Interpret() + distance.Interpret(); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /DesignPattern.Builder/PattenSample/Director.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 DesignPattern.Builder.PattenSample 8 | { 9 | public class Director 10 | { 11 | private Builder builder; 12 | 13 | public Director(Builder builder) 14 | { 15 | this.builder = builder; 16 | } 17 | 18 | public void SetBuilder(Builder builder) 19 | { 20 | this.builder = builder; 21 | } 22 | 23 | // 产品构建与组装方法 24 | public Product Construct() 25 | { 26 | builder.BuildPartA(); 27 | builder.BuildPartB(); 28 | builder.BuildPartC(); 29 | 30 | return builder.GetResult(); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /DesignPattern.Facade/Subsystem/FileReader.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DesignPattern.Facade.Subsystem 4 | { 5 | /// 6 | /// 文件读取类:子系统A 7 | /// 8 | public class FileReader 9 | { 10 | public string Read(string fileNameSrc) 11 | { 12 | Console.WriteLine("读取文件,获取明文:"); 13 | string result = string.Empty; 14 | using (System.IO.FileStream fsRead = new System.IO.FileStream(fileNameSrc, System.IO.FileMode.Open)) 15 | { 16 | int fsLen = (int)fsRead.Length; 17 | byte[] heByte = new byte[fsLen]; 18 | int r = fsRead.Read(heByte, 0, heByte.Length); 19 | result = System.Text.Encoding.UTF8.GetString(heByte); 20 | } 21 | 22 | return result; 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /DesignPattern.Facade/Facade/NewEncryptFacade.cs: -------------------------------------------------------------------------------- 1 | using DesignPattern.Facade.Subsystem; 2 | 3 | namespace DesignPattern.Facade.Facade 4 | { 5 | public class NewEncryptFacade : AbstractEncryptFacade 6 | { 7 | private FileReader reader; 8 | private NewCipherMachine cipher; 9 | private FileWriter writer; 10 | 11 | public NewEncryptFacade() 12 | { 13 | reader = new FileReader(); 14 | cipher = new NewCipherMachine(); 15 | writer = new FileWriter(); 16 | } 17 | 18 | public override void FileEncrypt(string fileNameSrc, string fileNameDes) 19 | { 20 | string plainStr = reader.Read(fileNameSrc); 21 | string encryptedStr = cipher.Encrypt(plainStr); 22 | writer.Write(encryptedStr, fileNameDes); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /DesignPattern.Interpreter/obj/Debug/DesignPattern.Interpreter.csproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- 1 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Interpreter\bin\Debug\DesignPattern.Interpreter.exe.config 2 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Interpreter\bin\Debug\DesignPattern.Interpreter.exe 3 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Interpreter\bin\Debug\DesignPattern.Interpreter.pdb 4 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Interpreter\obj\Debug\DesignPattern.Interpreter.csproj.CoreCompileInputs.cache 5 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Interpreter\obj\Debug\DesignPattern.Interpreter.exe 6 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Interpreter\obj\Debug\DesignPattern.Interpreter.pdb 7 | -------------------------------------------------------------------------------- /DesignPattern.SimpleFactory/obj/Debug/DesignPattern.SimpleFactory.csproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- 1 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.SimpleFactory\bin\Debug\DesignPattern.SimpleFactory.exe.config 2 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.SimpleFactory\bin\Debug\DesignPattern.SimpleFactory.exe 3 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.SimpleFactory\bin\Debug\DesignPattern.SimpleFactory.pdb 4 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.SimpleFactory\obj\Debug\DesignPattern.SimpleFactory.csproj.CoreCompileInputs.cache 5 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.SimpleFactory\obj\Debug\DesignPattern.SimpleFactory.exe 6 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.SimpleFactory\obj\Debug\DesignPattern.SimpleFactory.pdb 7 | -------------------------------------------------------------------------------- /DesignPattern.Adapter/Adapter/OperationAdapter.cs: -------------------------------------------------------------------------------- 1 | using DesignPattern.Adapter.Adaptee; 2 | using DesignPattern.Adapter.Target; 3 | 4 | namespace DesignPattern.Adapter.Adapter 5 | { 6 | /// 7 | /// 适配器:成绩操作适配器类 8 | /// 9 | public class OperationAdapter : IScoreOperation 10 | { 11 | private QuickSortHelper sortTarget; 12 | private BinarySearchHelper searchTarget; 13 | 14 | public OperationAdapter() 15 | { 16 | sortTarget = new QuickSortHelper(); 17 | searchTarget = new BinarySearchHelper(); 18 | } 19 | 20 | public int Search(int[] array, int key) 21 | { 22 | return searchTarget.BinarySearch(array, key); 23 | } 24 | 25 | public int[] Sort(int[] array) 26 | { 27 | return sortTarget.QuickSort(array); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /DesignPattern.Adapter/Adaptee/BinarySearchHelper.cs: -------------------------------------------------------------------------------- 1 | namespace DesignPattern.Adapter.Adaptee 2 | { 3 | public class BinarySearchHelper 4 | { 5 | public int BinarySearch(int[] array, int key) 6 | { 7 | int low = 0; 8 | int high = array.Length - 1; 9 | 10 | while (low <= high) 11 | { 12 | int mid = (low + high) / 2; 13 | int midVal = array[mid]; 14 | 15 | if (midVal < key) 16 | { 17 | low = mid + 1; 18 | } 19 | else if (midVal > key) 20 | { 21 | high = mid - 1; 22 | } 23 | else 24 | { 25 | return 1; // 找到元素返回1 26 | } 27 | } 28 | 29 | return -1; // 未找到元素返回-1 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /DesignPattern.Command/Invoker/FunctionButton.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DesignPattern.Command.Invoker 4 | { 5 | /// 6 | /// 请求发送者:功能键 7 | /// 8 | public class FunctionButton 9 | { 10 | // 功能键名称 11 | public string Name { get; set; } 12 | // 维持一个抽象命令对象的引用 13 | private Command.Command command; 14 | 15 | public FunctionButton(string name) 16 | { 17 | this.Name = name; 18 | } 19 | 20 | // 为功能键注入命令 21 | public void SetCommand(Command.Command command) 22 | { 23 | this.command = command; 24 | } 25 | 26 | // 发送请求的方法 27 | public void OnClick() 28 | { 29 | Console.WriteLine("点击功能键:"); 30 | if (command != null) 31 | { 32 | command.Execute(); 33 | } 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /DesignPattern.Proxy/RealSubject/AccessValidator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DesignPattern.Proxy.RealSubject 4 | { 5 | /// 6 | /// 业务类:身份验证类 7 | /// 8 | public class AccessValidator 9 | { 10 | /// 11 | /// 模拟实现登录验证 12 | /// 13 | /// 14 | /// 15 | public bool Validate(string userID) 16 | { 17 | Console.WriteLine("在数据库中验证用户 {0} 是否是合法用户?", userID); 18 | if (userID.Equals("杨过", StringComparison.OrdinalIgnoreCase)) 19 | { 20 | Console.WriteLine("{0} 登录成功!", userID); 21 | return true; 22 | } 23 | else 24 | { 25 | Console.WriteLine("{0} 登录失败!", userID); 26 | return false; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /DesignPattern.Bridge/obj/Debug/DesignPattern.Bridge.csproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- 1 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Bridge\bin\Debug\DesignPattern.Bridge.exe.config 2 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Bridge\bin\Debug\DesignPattern.Bridge.exe 3 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Bridge\bin\Debug\DesignPattern.Bridge.pdb 4 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Bridge\obj\Debug\DesignPattern.Bridge.csprojAssemblyReference.cache 5 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Bridge\obj\Debug\DesignPattern.Bridge.csproj.CoreCompileInputs.cache 6 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Bridge\obj\Debug\DesignPattern.Bridge.exe 7 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Bridge\obj\Debug\DesignPattern.Bridge.pdb 8 | -------------------------------------------------------------------------------- /DesignPattern.Memento/Originator/Chessman.cs: -------------------------------------------------------------------------------- 1 | using DesignPattern.Memento.Memento; 2 | 3 | namespace DesignPattern.Memento.Originator 4 | { 5 | /// 6 | /// 原发器:Chessman 7 | /// 8 | public class Chessman 9 | { 10 | public string Label { get; set; } 11 | public int X { get; set; } 12 | public int Y { get; set; } 13 | 14 | public Chessman(string label, int x, int y) 15 | { 16 | Label = label; 17 | X = x; 18 | Y = y; 19 | } 20 | 21 | // 保存状态 22 | public ChessmanMemento Save() 23 | { 24 | return new ChessmanMemento(Label, X, Y); 25 | } 26 | 27 | // 恢复状态 28 | public void Restore(ChessmanMemento memento) 29 | { 30 | Label = memento.Label; 31 | X = memento.X; 32 | Y = memento.Y; 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /DesignPattern.Interpreter/Expression/ActionNode.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DesignPattern.Interpreter.Expression 4 | { 5 | /// 6 | /// 终结符表达式:动作解释 7 | /// 8 | public class ActionNode : AbstractNode 9 | { 10 | private string action; 11 | 12 | public ActionNode(string action) 13 | { 14 | this.action = action; 15 | } 16 | 17 | // 动作(移动方式)表达式的解释操作 18 | public override string Interpret() 19 | { 20 | if (action.Equals("move", StringComparison.OrdinalIgnoreCase)) 21 | { 22 | return "移动"; 23 | } 24 | else if (action.Equals("run", StringComparison.OrdinalIgnoreCase)) 25 | { 26 | return "快速移动"; 27 | } 28 | else 29 | { 30 | return "无效指令"; 31 | } 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /DesignPattern.Adapter/obj/Debug/DesignPattern.Adapter.csproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- 1 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Adapter\bin\Debug\DesignPattern.Adapter.exe.config 2 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Adapter\bin\Debug\DesignPattern.Adapter.exe 3 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Adapter\bin\Debug\DesignPattern.Adapter.pdb 4 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Adapter\obj\Debug\DesignPattern.Adapter.csprojAssemblyReference.cache 5 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Adapter\obj\Debug\DesignPattern.Adapter.csproj.CoreCompileInputs.cache 6 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Adapter\obj\Debug\DesignPattern.Adapter.exe 7 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Adapter\obj\Debug\DesignPattern.Adapter.pdb 8 | -------------------------------------------------------------------------------- /DesignPattern.Builder/obj/Debug/DesignPattern.Builder.csproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- 1 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Builder\bin\Debug\DesignPattern.Builder.exe.config 2 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Builder\bin\Debug\DesignPattern.Builder.exe 3 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Builder\bin\Debug\DesignPattern.Builder.pdb 4 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Builder\obj\Debug\DesignPattern.Builder.csprojAssemblyReference.cache 5 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Builder\obj\Debug\DesignPattern.Builder.csproj.CoreCompileInputs.cache 6 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Builder\obj\Debug\DesignPattern.Builder.exe 7 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Builder\obj\Debug\DesignPattern.Builder.pdb 8 | -------------------------------------------------------------------------------- /DesignPattern.Command/obj/Debug/DesignPattern.Command.csproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- 1 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Command\bin\Debug\DesignPattern.Command.exe.config 2 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Command\bin\Debug\DesignPattern.Command.exe 3 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Command\bin\Debug\DesignPattern.Command.pdb 4 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Command\obj\Debug\DesignPattern.Command.csprojAssemblyReference.cache 5 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Command\obj\Debug\DesignPattern.Command.csproj.CoreCompileInputs.cache 6 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Command\obj\Debug\DesignPattern.Command.exe 7 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Command\obj\Debug\DesignPattern.Command.pdb 8 | -------------------------------------------------------------------------------- /DesignPattern.FactoryMethod/AppConfigHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DesignPattern.FactoryMethod 4 | { 5 | public class AppConfigHelper 6 | { 7 | public static string GetLoggerFactoryName() 8 | { 9 | string factoryName = null; 10 | try 11 | { 12 | factoryName = System.Configuration.ConfigurationManager.AppSettings["LoggerFactory"]; 13 | } 14 | catch (Exception ex) 15 | { 16 | Console.WriteLine(ex.Message); 17 | } 18 | return factoryName; 19 | } 20 | 21 | public static object GetLoggerFactoryInstance() 22 | { 23 | string assemblyName = AppConfigHelper.GetLoggerFactoryName(); 24 | Type type = Type.GetType(assemblyName); 25 | 26 | var instance = Activator.CreateInstance(type); 27 | return instance; 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /DesignPattern.Strategy/obj/Debug/DesignPattern.Strategy.csproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- 1 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Strategy\bin\Debug\DesignPattern.Strategy.exe.config 2 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Strategy\bin\Debug\DesignPattern.Strategy.exe 3 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Strategy\bin\Debug\DesignPattern.Strategy.pdb 4 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Strategy\obj\Debug\DesignPattern.Strategy.csprojAssemblyReference.cache 5 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Strategy\obj\Debug\DesignPattern.Strategy.csproj.CoreCompileInputs.cache 6 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Strategy\obj\Debug\DesignPattern.Strategy.exe 7 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Strategy\obj\Debug\DesignPattern.Strategy.pdb 8 | -------------------------------------------------------------------------------- /DesignPattern.Bridge/WindowsImplementor.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 DesignPattern.Bridge 8 | { 9 | public class WindowsImplementor : ImageImplementor 10 | { 11 | public void DoPaint(Matrix m) 12 | { 13 | // 调用Windows的绘制函数绘制像素矩阵 14 | Console.WriteLine("在Windows系统中显示图像"); 15 | } 16 | } 17 | 18 | public class LinuxImplementor : ImageImplementor 19 | { 20 | public void DoPaint(Matrix m) 21 | { 22 | // 调用Windows的绘制函数绘制像素矩阵 23 | Console.WriteLine("在Linux系统中显示图像"); 24 | } 25 | } 26 | 27 | public class UnixImplementor : ImageImplementor 28 | { 29 | public void DoPaint(Matrix m) 30 | { 31 | // 调用Windows的绘制函数绘制像素矩阵 32 | Console.WriteLine("在Unix系统中显示图像"); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /DesignPattern.Builder/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using DesignPattern.Builder.GameRoleDemo; 7 | 8 | namespace DesignPattern.Builder 9 | { 10 | public class Program 11 | { 12 | public static void Main(string[] args) 13 | { 14 | ActorBuilder builder = (ActorBuilder)AppConfigHelper.GetConcreteBuilderInstance(); 15 | ActorController director = new ActorController(); 16 | Actor actor = director.Construct(builder); 17 | 18 | Console.WriteLine("角色类型:{0}", actor.Type); 19 | Console.WriteLine("角色性别:{0}", actor.Sex); 20 | Console.WriteLine("角色面容:{0}", actor.Face); 21 | Console.WriteLine("角色服装:{0}", actor.Costume); 22 | Console.WriteLine("角色发型:{0}", actor.HairStyle); 23 | 24 | Console.ReadKey(); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /DesignPatterm.Decorator/Window.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 DesignPatterm.Decorator 8 | { 9 | /// 10 | /// 窗体类:具体构件类 11 | /// 12 | public class Window : Component 13 | { 14 | public override void Display() 15 | { 16 | Console.WriteLine("显示窗体!"); 17 | } 18 | } 19 | 20 | /// 21 | /// 文本框类:具体构件类 22 | /// 23 | public class TextBox : Component 24 | { 25 | public override void Display() 26 | { 27 | Console.WriteLine("显示文本框!"); 28 | } 29 | } 30 | 31 | /// 32 | /// 列表框类:具体构件类 33 | /// 34 | public class ListBox : Component 35 | { 36 | public override void Display() 37 | { 38 | Console.WriteLine("显示列表框!"); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /DesignPattern.Prototype/obj/Debug/DesignPattern.Prototype.csproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- 1 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Prototype\bin\Debug\DesignPattern.Prototype.exe.config 2 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Prototype\bin\Debug\DesignPattern.Prototype.exe 3 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Prototype\bin\Debug\DesignPattern.Prototype.pdb 4 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Prototype\obj\Debug\DesignPattern.Prototype.csprojAssemblyReference.cache 5 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Prototype\obj\Debug\DesignPattern.Prototype.csproj.CoreCompileInputs.cache 6 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Prototype\obj\Debug\DesignPattern.Prototype.exe 7 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Prototype\obj\Debug\DesignPattern.Prototype.pdb 8 | -------------------------------------------------------------------------------- /DesignPattern.Singleton/obj/Debug/DesignPattern.Singleton.csproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- 1 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Singleton\bin\Debug\DesignPattern.Singleton.exe.config 2 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Singleton\bin\Debug\DesignPattern.Singleton.exe 3 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Singleton\bin\Debug\DesignPattern.Singleton.pdb 4 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Singleton\obj\Debug\DesignPattern.Singleton.csprojAssemblyReference.cache 5 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Singleton\obj\Debug\DesignPattern.Singleton.csproj.CoreCompileInputs.cache 6 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Singleton\obj\Debug\DesignPattern.Singleton.exe 7 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.Singleton\obj\Debug\DesignPattern.Singleton.pdb 8 | -------------------------------------------------------------------------------- /DesignPattern.Observer/Subject/ConcreteAllyControlCenter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DesignPattern.Observer.Subject 4 | { 5 | public class ConcreteAllyControlCenter : AllyControlCenter 6 | { 7 | public ConcreteAllyControlCenter(string allyName) 8 | { 9 | Console.WriteLine("系统通知:{0} 战队组建成功!", this.AllyName); 10 | Console.WriteLine("-------------------------------------------------------"); 11 | this.AllyName = allyName; 12 | } 13 | 14 | // 实现通知方法 15 | public override void NotifyObserver(string playerName) 16 | { 17 | Console.WriteLine("通知:盟友们,{0} 正遭受敌军攻击,速去抢救!", playerName); 18 | foreach (var player in playerList) 19 | { 20 | if (!player.Name.Equals(playerName, StringComparison.OrdinalIgnoreCase)) 21 | { 22 | player.Help(); 23 | } 24 | } 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /DesignPattern.Composite/InitializeVersion/ImageFile.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 DesignPattern.Composite.InitializeVersion 8 | { 9 | public class ImageFile 10 | { 11 | private string name; 12 | 13 | public ImageFile(string name) 14 | { 15 | this.name = name; 16 | } 17 | 18 | public void KillVirus() 19 | { 20 | // 此处模拟杀毒操作 21 | Console.WriteLine("---- 对图像文件‘{0}’进行杀毒", name); 22 | } 23 | } 24 | 25 | public class TextFile 26 | { 27 | private string name; 28 | 29 | public TextFile(string name) 30 | { 31 | this.name = name; 32 | } 33 | 34 | public void KillVirus() 35 | { 36 | // 此处模拟杀毒操作 37 | Console.WriteLine("---- 对文本文件‘{0}’进行杀毒", name); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /DesignPattern.Observer/Subject/AllyControlCenter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using DesignPattern.Observer.Observer; 4 | 5 | namespace DesignPattern.Observer.Subject 6 | { 7 | /// 8 | /// 抽象目标类:战队控制中心 9 | /// 10 | public abstract class AllyControlCenter 11 | { 12 | public string AllyName { get; set; } 13 | protected IList playerList = new List(); 14 | 15 | public void Join(IObserver observer) 16 | { 17 | playerList.Add(observer); 18 | Console.WriteLine("通知:{0} 加入 {1} 战队", observer.Name, this.AllyName); 19 | } 20 | 21 | public void Quit(IObserver observer) 22 | { 23 | playerList.Remove(observer); 24 | Console.WriteLine("通知:{0} 退出 {1} 战队", observer.Name, this.AllyName); 25 | } 26 | 27 | // 声明抽象通知方法 28 | public abstract void NotifyObserver(string name); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 23种设计模式(C#实现) 2 | ![设计模式](http://images.cnblogs.com/cnblogs_com/SteveLee/1284061/o_1196176726-1_u_1.jpg) 3 | 4 | Creation 创造模式 5 | 6 |   ① 01.单例(Singleton)模式 7 | 8 |   ② 02.简单工厂(Simple Factory)模式 9 | 10 |   ③ 03.工厂方法(Factory Method)模式 11 | 12 |   ④ 04.抽象工厂(Abstract Factory)模式 13 | 14 |   ⑤ 05.原型(Prototype)模式 15 | 16 |   ⑥ 06.建造者(Builder)模式 17 | 18 | Structural 结构模式 19 | 20 |   ① 07.适配器(Adapter)模式 21 | 22 |   ② 08.桥接(Bridge)模式 23 | 24 |   ③ 09.组合(Composite)模式 25 | 26 |   ④ 10.装饰(Decorator)模式 27 | 28 |   ⑤ 11.外观(Facade)模式 29 | 30 |   ⑥ 12.享元(Flyweight)模式 31 | 32 |   ⑦ 13.代理(Proxy)模式 33 | 34 | Behavior 行为模式 35 | 36 |   ① 14.职责链(Chain of Responsibility)模式 37 | 38 |   ② 15.观察者(Observer)模式 39 | 40 |   ③ 16.访问者(Visitor)模式 41 | 42 |   ④ 17.模板方法(Template Method)模式 43 | 44 |   ⑤ 18.策略(Strategy)模式 45 | 46 |   ⑥ 19.命令(Command)模式 47 | 48 |   ⑦ 20.备忘录(Memento)模式 49 | 50 |   ⑧ 21.迭代器(Iterator)模式 51 | 52 |   ⑨ 22.中介者(Mediator)模式 53 | 54 |   ⑩ 23.解释器(Interpreter)模式 55 | -------------------------------------------------------------------------------- /DesignPattern.FactoryMethod/obj/Debug/DesignPattern.FactoryMethod.csproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- 1 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.FactoryMethod\bin\Debug\DesignPattern.FactoryMethod.exe.config 2 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.FactoryMethod\bin\Debug\DesignPattern.FactoryMethod.exe 3 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.FactoryMethod\bin\Debug\DesignPattern.FactoryMethod.pdb 4 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.FactoryMethod\obj\Debug\DesignPattern.FactoryMethod.csprojAssemblyReference.cache 5 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.FactoryMethod\obj\Debug\DesignPattern.FactoryMethod.csproj.CoreCompileInputs.cache 6 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.FactoryMethod\obj\Debug\DesignPattern.FactoryMethod.exe 7 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.FactoryMethod\obj\Debug\DesignPattern.FactoryMethod.pdb 8 | -------------------------------------------------------------------------------- /DesignPattern.TemplateMethod/obj/Debug/DesignPattern.TemplateMethod.csproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- 1 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.TemplateMethod\bin\Debug\DesignPattern.TemplateMethod.exe.config 2 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.TemplateMethod\bin\Debug\DesignPattern.TemplateMethod.exe 3 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.TemplateMethod\bin\Debug\DesignPattern.TemplateMethod.pdb 4 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.TemplateMethod\obj\Debug\DesignPattern.TemplateMethod.csprojAssemblyReference.cache 5 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.TemplateMethod\obj\Debug\DesignPattern.TemplateMethod.csproj.CoreCompileInputs.cache 6 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.TemplateMethod\obj\Debug\DesignPattern.TemplateMethod.exe 7 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.TemplateMethod\obj\Debug\DesignPattern.TemplateMethod.pdb 8 | -------------------------------------------------------------------------------- /DesignPattern.Iterator/Aggregate/AbstractObjectList.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using DesignPattern.Iterator.Iterator; 4 | 5 | namespace DesignPattern.Iterator.Aggregate 6 | { 7 | /// 8 | /// 抽象聚合类:AbstractObjectList 9 | /// 10 | public abstract class AbstractObjectList 11 | { 12 | protected IList objectList = new List(); 13 | 14 | public AbstractObjectList (IList objectList) 15 | { 16 | this.objectList = objectList; 17 | } 18 | 19 | public void AddObject(object obj) 20 | { 21 | this.objectList.Add(obj); 22 | } 23 | 24 | public void RemoveObject(object obj) 25 | { 26 | this.objectList.Remove(obj); 27 | } 28 | 29 | public IList GetObjectList() 30 | { 31 | return this.objectList; 32 | } 33 | 34 | // 声明创建迭代器对象的抽象工厂方法 35 | public abstract AbstractIterator CreateIterator(); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /DesignPattern.Proxy/AppConfigHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Reflection; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace DesignPattern.Proxy 9 | { 10 | public class AppConfigHelper 11 | { 12 | public static string GetProxyName() 13 | { 14 | string factoryName = null; 15 | try 16 | { 17 | factoryName = System.Configuration.ConfigurationManager.AppSettings["ProxyName"]; 18 | } 19 | catch (Exception ex) 20 | { 21 | Console.WriteLine(ex.Message); 22 | } 23 | return factoryName; 24 | } 25 | 26 | public static object GetProxyInstance() 27 | { 28 | string assemblyName = AppConfigHelper.GetProxyName(); 29 | Type type = Type.GetType(assemblyName); 30 | 31 | var instance = Activator.CreateInstance(type); 32 | return instance; 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /DesignPattern.Visitor/AppConfigHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Reflection; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace DesignPattern.Visitor 9 | { 10 | public class AppConfigHelper 11 | { 12 | public static string GetDeptName() 13 | { 14 | string factoryName = null; 15 | try 16 | { 17 | factoryName = System.Configuration.ConfigurationManager.AppSettings["DeptName"]; 18 | } 19 | catch (Exception ex) 20 | { 21 | Console.WriteLine(ex.Message); 22 | } 23 | return factoryName; 24 | } 25 | 26 | public static object GetDeptInstance() 27 | { 28 | string assemblyName = AppConfigHelper.GetDeptName(); 29 | Type type = Type.GetType(assemblyName); 30 | 31 | var instance = Activator.CreateInstance(type); 32 | return instance; 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /DesignPattern.AbstractFactory/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using DesignPattern.AbstractFactory.AbstractFactory; 7 | using DesignPattern.AbstractFactory.AbstractProduct; 8 | 9 | namespace DesignPattern.AbstractFactory 10 | { 11 | public class Program 12 | { 13 | public static void Main(string[] args) 14 | { 15 | ISkinFactory skinFactory = (ISkinFactory) AppConfigHelper.GetSkinFactoryInstance(); 16 | if (skinFactory == null) 17 | { 18 | Console.WriteLine("读取当前选中皮肤类型失败..."); 19 | } 20 | 21 | IButton button = skinFactory.CreateButton(); 22 | ITextField textField = skinFactory.CreateTextField(); 23 | IComboBox comboBox = skinFactory.CreateComboBox(); 24 | 25 | button.Display(); 26 | textField.Display(); 27 | comboBox.Display(); 28 | 29 | Console.ReadKey(); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /DesignPattern.AbstractFactory/obj/Debug/DesignPattern.AbstractFactory.csproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- 1 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.AbstractFactory\bin\Debug\DesignPattern.AbstractFactory.exe.config 2 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.AbstractFactory\bin\Debug\DesignPattern.AbstractFactory.exe 3 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.AbstractFactory\bin\Debug\DesignPattern.AbstractFactory.pdb 4 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.AbstractFactory\obj\Debug\DesignPattern.AbstractFactory.csprojAssemblyReference.cache 5 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.AbstractFactory\obj\Debug\DesignPattern.AbstractFactory.csproj.CoreCompileInputs.cache 6 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.AbstractFactory\obj\Debug\DesignPattern.AbstractFactory.exe 7 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.AbstractFactory\obj\Debug\DesignPattern.AbstractFactory.pdb 8 | -------------------------------------------------------------------------------- /DesignPattern.Adapter/AppConfigHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Reflection; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace DesignPattern.Adapter 9 | { 10 | public class AppConfigHelper 11 | { 12 | public static string GetAdapterName() 13 | { 14 | string factoryName = null; 15 | try 16 | { 17 | factoryName = System.Configuration.ConfigurationManager.AppSettings["AdapterName"]; 18 | } 19 | catch (Exception ex) 20 | { 21 | Console.WriteLine(ex.Message); 22 | } 23 | return factoryName; 24 | } 25 | 26 | public static object GetAdapterInstance() 27 | { 28 | string assemblyName = AppConfigHelper.GetAdapterName(); 29 | Type type = Type.GetType(assemblyName); 30 | 31 | var instance = Activator.CreateInstance(type); 32 | return instance; 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /DesignPattern.Facade/AppConfigHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Reflection; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace DesignPattern.Facade 9 | { 10 | public class AppConfigHelper 11 | { 12 | public static string GetFacadeName() 13 | { 14 | string factoryName = null; 15 | try 16 | { 17 | factoryName = System.Configuration.ConfigurationManager.AppSettings["EncryptFacadeName"]; 18 | } 19 | catch (Exception ex) 20 | { 21 | Console.WriteLine(ex.Message); 22 | } 23 | return factoryName; 24 | } 25 | 26 | public static object GetFacadeInstance() 27 | { 28 | string assemblyName = AppConfigHelper.GetFacadeName(); 29 | Type type = Type.GetType(assemblyName); 30 | 31 | var instance = Activator.CreateInstance(type); 32 | return instance; 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /DesignPattern.Strategy/AppConfigHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Reflection; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace DesignPattern.Strategy 9 | { 10 | public class AppConfigHelper 11 | { 12 | public static string GetStrategyName() 13 | { 14 | string factoryName = null; 15 | try 16 | { 17 | factoryName = System.Configuration.ConfigurationManager.AppSettings["DiscountStrategy"]; 18 | } 19 | catch (Exception ex) 20 | { 21 | Console.WriteLine(ex.Message); 22 | } 23 | return factoryName; 24 | } 25 | 26 | public static object GetStrategyInstance() 27 | { 28 | string assemblyName = AppConfigHelper.GetStrategyName(); 29 | Type type = Type.GetType(assemblyName); 30 | 31 | var instance = Activator.CreateInstance(type); 32 | return instance; 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /DesignPattern.FactoryMethod/v2/DatabaseLoggerFactory.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 DesignPattern.FactoryMethod.v2 8 | { 9 | public class DatabaseLoggerFactory : ILoggerFactory 10 | { 11 | public ILogger CreateLogger() 12 | { 13 | // 使用默认方式连接数据库,代码省略 14 | ILogger logger = new DatabaseLogger(); 15 | // 初始化数据库日志记录器,代码省略 16 | return logger; 17 | } 18 | 19 | public ILogger CreateLogger(string args) 20 | { 21 | // 使用参数args作为连接字符串来连接数据库,代码省略 22 | ILogger logger = new DatabaseLogger(); 23 | // 初始化数据库日志记录器,代码省略 24 | return logger; 25 | } 26 | 27 | public ILogger CreateLogger(object obj) 28 | { 29 | // 使用封装在参数obj中的连接字符串来连接数据库,代码省略 30 | ILogger logger = new DatabaseLogger(); 31 | // 使用封装在参数obj中的数据来初始化数据库日志记录器,代码省略 32 | return logger; 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /DesignPattern.TemplateMethod/AppConfigHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Reflection; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace DesignPattern.TemplateMethod 9 | { 10 | public class AppConfigHelper 11 | { 12 | public static string GetAccountTypeName() 13 | { 14 | string factoryName = null; 15 | try 16 | { 17 | factoryName = System.Configuration.ConfigurationManager.AppSettings["AccountType"]; 18 | } 19 | catch (Exception ex) 20 | { 21 | Console.WriteLine(ex.Message); 22 | } 23 | return factoryName; 24 | } 25 | 26 | public static object GetAccountInstance() 27 | { 28 | string assemblyName = AppConfigHelper.GetAccountTypeName(); 29 | Type type = Type.GetType(assemblyName); 30 | 31 | var instance = Activator.CreateInstance(type); 32 | return instance; 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /DesignPattern.AbstractFactory/AppConfigHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Reflection; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace DesignPattern.AbstractFactory 9 | { 10 | public class AppConfigHelper 11 | { 12 | public static string GetSkinFactoryName() 13 | { 14 | string factoryName = null; 15 | try 16 | { 17 | factoryName = System.Configuration.ConfigurationManager.AppSettings["SkinFactory"]; 18 | } 19 | catch (Exception ex) 20 | { 21 | Console.WriteLine(ex.Message); 22 | } 23 | return factoryName; 24 | } 25 | 26 | public static object GetSkinFactoryInstance() 27 | { 28 | string assemblyName = AppConfigHelper.GetSkinFactoryName(); 29 | Type type = Type.GetType(assemblyName); 30 | 31 | var instance = Activator.CreateInstance(type); 32 | return instance; 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /DesignPattern.Builder/AppConfigHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Reflection; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace DesignPattern.Builder 9 | { 10 | public class AppConfigHelper 11 | { 12 | public static string GetConcreteBuilderName() 13 | { 14 | string factoryName = null; 15 | try 16 | { 17 | factoryName = System.Configuration.ConfigurationManager.AppSettings["ConcreteBuilder"]; 18 | } 19 | catch (Exception ex) 20 | { 21 | Console.WriteLine(ex.Message); 22 | } 23 | return factoryName; 24 | } 25 | 26 | public static object GetConcreteBuilderInstance() 27 | { 28 | string assemblyName = AppConfigHelper.GetConcreteBuilderName(); 29 | Type type = Type.GetType(assemblyName); 30 | 31 | var instance = Activator.CreateInstance(type); 32 | return instance; 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /DesignPattern.Observer/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using DesignPattern.Observer.Observer; 7 | using DesignPattern.Observer.Subject; 8 | 9 | namespace DesignPattern.Observer 10 | { 11 | public class Program 12 | { 13 | public static void Main(string[] args) 14 | { 15 | // Step1.定义观察者对象 16 | AllyControlCenter acc = new ConcreteAllyControlCenter("金庸群侠"); 17 | // Step2.定义4个观察者对象 18 | IObserver playerA = new Player() { Name = "杨过" }; 19 | acc.Join(playerA); 20 | IObserver playerB = new Player() { Name = "令狐冲" }; 21 | acc.Join(playerB); 22 | IObserver playerC = new Player() { Name = "张无忌" }; 23 | acc.Join(playerC); 24 | IObserver playerD = new Player() { Name = "段誉" }; 25 | acc.Join(playerD); 26 | // Step3.当某盟友遭受攻击 27 | playerA.BeAttacked(acc); 28 | 29 | Console.ReadKey(); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /DesignPattern.SimpleFactory/v1/ChartFactory.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 DesignPattern.SimpleFactory.v1 8 | { 9 | public class ChartFactory 10 | { 11 | public static IChartable GetChart(string type) 12 | { 13 | IChartable chart = null; 14 | 15 | if (type.Equals("histogram", StringComparison.OrdinalIgnoreCase)) 16 | { 17 | chart = new HistogramChart(); 18 | Console.WriteLine("初始化设置柱状图..."); 19 | } 20 | else if (type.Equals("pie", StringComparison.OrdinalIgnoreCase)) 21 | { 22 | chart = new PieChart(); 23 | Console.WriteLine("初始化设置饼状图..."); 24 | } 25 | else if (type.Equals("line", StringComparison.OrdinalIgnoreCase)) 26 | { 27 | chart = new PieChart(); 28 | Console.WriteLine("初始化设置折线图..."); 29 | } 30 | 31 | return chart; 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /DesignPattern.Flyweight/FlyweightFactory/IgoChessmanFactory.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using DesignPattern.Flyweight.Flyweight; 3 | 4 | namespace DesignPattern.Flyweight.FlyweightFactory 5 | { 6 | /// 7 | /// 享元工厂类 8 | /// 9 | public class IgoChessmanFactory 10 | { 11 | private static readonly IgoChessmanFactory instance = new IgoChessmanFactory(); // 使用单例模式实现享元 12 | private static Hashtable ht; // 使用Hashtable来存储享元对象,充当享元池 13 | 14 | private IgoChessmanFactory() 15 | { 16 | ht = new Hashtable(); 17 | IgoChessman blackChess = new BlackIgoChessman(); 18 | ht.Add("b", blackChess); 19 | IgoChessman whiteChess = new WhiteIgoChessman(); 20 | ht.Add("w", whiteChess); 21 | } 22 | 23 | public static IgoChessmanFactory GetInstance() 24 | { 25 | return instance; 26 | } 27 | 28 | public IgoChessman GetIgoChessman(string color) 29 | { 30 | IgoChessman chess = ht[color] as IgoChessman; 31 | return chess; 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /DesignPattern.Singleton/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // 有关程序集的一般信息由以下 6 | // 控制。更改这些特性值可修改 7 | // 与程序集关联的信息。 8 | [assembly: AssemblyTitle("DesignPattern.Singleton")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("DesignPattern.Singleton")] 13 | [assembly: AssemblyCopyright("")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | //将 ComVisible 设置为 false 将使此程序集中的类型 18 | //对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, 19 | //请将此类型的 ComVisible 特性设置为 true。 20 | [assembly: ComVisible(false)] 21 | 22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID 23 | [assembly: Guid("6952ec7b-598f-4f3b-86a7-dd7955dfa503")] 24 | 25 | // 程序集的版本信息由下列四个值组成: 26 | // 27 | // 主版本 28 | // 次版本 29 | // 生成号 30 | // 修订号 31 | // 32 | //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, 33 | // 方法是按如下所示使用“*”: : 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /DesignPattern.Bridge/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // 有关程序集的一般信息由以下 6 | // 控制。更改这些特性值可修改 7 | // 与程序集关联的信息。 8 | [assembly: AssemblyTitle("DesignPattern.Bridge")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("DesignPattern.Bridge")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | //将 ComVisible 设置为 false 将使此程序集中的类型 18 | //对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, 19 | //请将此类型的 ComVisible 特性设置为 true。 20 | [assembly: ComVisible(false)] 21 | 22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID 23 | [assembly: Guid("464f6dc5-4119-449e-afc8-ad32c19599b0")] 24 | 25 | // 程序集的版本信息由下列四个值组成: 26 | // 27 | // 主版本 28 | // 次版本 29 | // 生成号 30 | // 修订号 31 | // 32 | //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, 33 | // 方法是按如下所示使用“*”: : 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /DesignPattern.Facade/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // 有关程序集的一般信息由以下 6 | // 控制。更改这些特性值可修改 7 | // 与程序集关联的信息。 8 | [assembly: AssemblyTitle("DesignPattern.Facade")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("DesignPattern.Facade")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | //将 ComVisible 设置为 false 将使此程序集中的类型 18 | //对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, 19 | //请将此类型的 ComVisible 特性设置为 true。 20 | [assembly: ComVisible(false)] 21 | 22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID 23 | [assembly: Guid("9ced1465-730a-4476-a74e-6b554c34f894")] 24 | 25 | // 程序集的版本信息由下列四个值组成: 26 | // 27 | // 主版本 28 | // 次版本 29 | // 生成号 30 | // 修订号 31 | // 32 | //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, 33 | // 方法是按如下所示使用“*”: : 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /DesignPattern.Proxy/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // 有关程序集的一般信息由以下 6 | // 控制。更改这些特性值可修改 7 | // 与程序集关联的信息。 8 | [assembly: AssemblyTitle("DesignPattern.Proxy")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("DesignPattern.Proxy")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | //将 ComVisible 设置为 false 将使此程序集中的类型 18 | //对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, 19 | //请将此类型的 ComVisible 特性设置为 true。 20 | [assembly: ComVisible(false)] 21 | 22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID 23 | [assembly: Guid("4d8e3d4b-86e7-4ded-9aae-1be2e341cc8d")] 24 | 25 | // 程序集的版本信息由下列四个值组成: 26 | // 27 | // 主版本 28 | // 次版本 29 | // 生成号 30 | // 修订号 31 | // 32 | //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, 33 | // 方法是按如下所示使用“*”: : 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /DesignPattern.Adapter/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // 有关程序集的一般信息由以下 6 | // 控制。更改这些特性值可修改 7 | // 与程序集关联的信息。 8 | [assembly: AssemblyTitle("DesignPattern.Adapter")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("DesignPattern.Adapter")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | //将 ComVisible 设置为 false 将使此程序集中的类型 18 | //对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, 19 | //请将此类型的 ComVisible 特性设置为 true。 20 | [assembly: ComVisible(false)] 21 | 22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID 23 | [assembly: Guid("0d7c66ba-a283-462f-8cd0-605a1401ea28")] 24 | 25 | // 程序集的版本信息由下列四个值组成: 26 | // 27 | // 主版本 28 | // 次版本 29 | // 生成号 30 | // 修订号 31 | // 32 | //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, 33 | // 方法是按如下所示使用“*”: : 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /DesignPattern.Builder/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // 有关程序集的一般信息由以下 6 | // 控制。更改这些特性值可修改 7 | // 与程序集关联的信息。 8 | [assembly: AssemblyTitle("DesignPattern.Builder")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("DesignPattern.Builder")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | //将 ComVisible 设置为 false 将使此程序集中的类型 18 | //对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, 19 | //请将此类型的 ComVisible 特性设置为 true。 20 | [assembly: ComVisible(false)] 21 | 22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID 23 | [assembly: Guid("27cd2fac-453c-42ad-8917-41ee3a2c7c4c")] 24 | 25 | // 程序集的版本信息由下列四个值组成: 26 | // 27 | // 主版本 28 | // 次版本 29 | // 生成号 30 | // 修订号 31 | // 32 | //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, 33 | // 方法是按如下所示使用“*”: : 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /DesignPattern.Command/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // 有关程序集的一般信息由以下 6 | // 控制。更改这些特性值可修改 7 | // 与程序集关联的信息。 8 | [assembly: AssemblyTitle("DesignPattern.Command")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("DesignPattern.Command")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | //将 ComVisible 设置为 false 将使此程序集中的类型 18 | //对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, 19 | //请将此类型的 ComVisible 特性设置为 true。 20 | [assembly: ComVisible(false)] 21 | 22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID 23 | [assembly: Guid("9f6ca974-91ea-4de1-95db-98425261f523")] 24 | 25 | // 程序集的版本信息由下列四个值组成: 26 | // 27 | // 主版本 28 | // 次版本 29 | // 生成号 30 | // 修订号 31 | // 32 | //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, 33 | // 方法是按如下所示使用“*”: : 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /DesignPattern.Memento/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // 有关程序集的一般信息由以下 6 | // 控制。更改这些特性值可修改 7 | // 与程序集关联的信息。 8 | [assembly: AssemblyTitle("DesignPattern.Memento")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("DesignPattern.Memento")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | //将 ComVisible 设置为 false 将使此程序集中的类型 18 | //对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, 19 | //请将此类型的 ComVisible 特性设置为 true。 20 | [assembly: ComVisible(false)] 21 | 22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID 23 | [assembly: Guid("6945631e-5a7b-4f6d-8c8b-f41dcef29dd9")] 24 | 25 | // 程序集的版本信息由下列四个值组成: 26 | // 27 | // 主版本 28 | // 次版本 29 | // 生成号 30 | // 修订号 31 | // 32 | //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, 33 | // 方法是按如下所示使用“*”: : 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /DesignPattern.SimpleFactory/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // 有关程序集的一般信息由以下 6 | // 控制。更改这些特性值可修改 7 | // 与程序集关联的信息。 8 | [assembly: AssemblyTitle("DesignPattern.SimpleFactory")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("DesignPattern.SimpleFactory")] 13 | [assembly: AssemblyCopyright("")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | //将 ComVisible 设置为 false 将使此程序集中的类型 18 | //对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, 19 | //请将此类型的 ComVisible 特性设置为 true。 20 | [assembly: ComVisible(false)] 21 | 22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID 23 | [assembly: Guid("4d75c9ca-3513-447f-8686-d2fbc00e212f")] 24 | 25 | // 程序集的版本信息由下列四个值组成: 26 | // 27 | // 主版本 28 | // 次版本 29 | // 生成号 30 | // 修订号 31 | // 32 | //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, 33 | // 方法是按如下所示使用“*”: : 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /DesignPattern.Visitor/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // 有关程序集的一般信息由以下 6 | // 控制。更改这些特性值可修改 7 | // 与程序集关联的信息。 8 | [assembly: AssemblyTitle("DesignPattern.Visitor")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("DesignPattern.Visitor")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | //将 ComVisible 设置为 false 将使此程序集中的类型 18 | //对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, 19 | //请将此类型的 ComVisible 特性设置为 true。 20 | [assembly: ComVisible(false)] 21 | 22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID 23 | [assembly: Guid("3209fad8-60bf-4644-ad16-8364b61bdcfe")] 24 | 25 | // 程序集的版本信息由下列四个值组成: 26 | // 27 | // 主版本 28 | // 次版本 29 | // 生成号 30 | // 修订号 31 | // 32 | //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, 33 | // 方法是按如下所示使用“*”: : 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /DesignPatterm.Decorator/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // 有关程序集的一般信息由以下 6 | // 控制。更改这些特性值可修改 7 | // 与程序集关联的信息。 8 | [assembly: AssemblyTitle("DesignPatterm.Decorator")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("DesignPatterm.Decorator")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | //将 ComVisible 设置为 false 将使此程序集中的类型 18 | //对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, 19 | //请将此类型的 ComVisible 特性设置为 true。 20 | [assembly: ComVisible(false)] 21 | 22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID 23 | [assembly: Guid("e3e5a70e-e612-4c2f-8ef3-8092d77c1284")] 24 | 25 | // 程序集的版本信息由下列四个值组成: 26 | // 27 | // 主版本 28 | // 次版本 29 | // 生成号 30 | // 修订号 31 | // 32 | //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, 33 | // 方法是按如下所示使用“*”: : 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /DesignPattern.ChainOfResponsibility/obj/Debug/DesignPattern.ChainOfResponsibility.csproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- 1 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.ChainOfResponsibility\bin\Debug\DesignPattern.ChainOfResponsibility.exe.config 2 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.ChainOfResponsibility\bin\Debug\DesignPattern.ChainOfResponsibility.exe 3 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.ChainOfResponsibility\bin\Debug\DesignPattern.ChainOfResponsibility.pdb 4 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.ChainOfResponsibility\obj\Debug\DesignPattern.ChainOfResponsibility.csprojAssemblyReference.cache 5 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.ChainOfResponsibility\obj\Debug\DesignPattern.ChainOfResponsibility.csproj.CoreCompileInputs.cache 6 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.ChainOfResponsibility\obj\Debug\DesignPattern.ChainOfResponsibility.exe 7 | C:\Users\Administrator\Desktop\DesignPatternDemos-master\DesignPattern.ChainOfResponsibility\obj\Debug\DesignPattern.ChainOfResponsibility.pdb 8 | -------------------------------------------------------------------------------- /DesignPattern.Composite/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // 有关程序集的一般信息由以下 6 | // 控制。更改这些特性值可修改 7 | // 与程序集关联的信息。 8 | [assembly: AssemblyTitle("DesignPattern.Composite")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("DesignPattern.Composite")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | //将 ComVisible 设置为 false 将使此程序集中的类型 18 | //对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, 19 | //请将此类型的 ComVisible 特性设置为 true。 20 | [assembly: ComVisible(false)] 21 | 22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID 23 | [assembly: Guid("00415199-8cfc-40d2-bd2b-f6a20ae95aa3")] 24 | 25 | // 程序集的版本信息由下列四个值组成: 26 | // 27 | // 主版本 28 | // 次版本 29 | // 生成号 30 | // 修订号 31 | // 32 | //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, 33 | // 方法是按如下所示使用“*”: : 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /DesignPattern.Flyweight/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // 有关程序集的一般信息由以下 6 | // 控制。更改这些特性值可修改 7 | // 与程序集关联的信息。 8 | [assembly: AssemblyTitle("DesignPattern.Flyweight")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("DesignPattern.Flyweight")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | //将 ComVisible 设置为 false 将使此程序集中的类型 18 | //对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, 19 | //请将此类型的 ComVisible 特性设置为 true。 20 | [assembly: ComVisible(false)] 21 | 22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID 23 | [assembly: Guid("48eb2e96-7e70-49a4-9b51-81f809dbcc03")] 24 | 25 | // 程序集的版本信息由下列四个值组成: 26 | // 27 | // 主版本 28 | // 次版本 29 | // 生成号 30 | // 修订号 31 | // 32 | //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, 33 | // 方法是按如下所示使用“*”: : 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /DesignPattern.Iterator/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // 有关程序集的一般信息由以下 6 | // 控制。更改这些特性值可修改 7 | // 与程序集关联的信息。 8 | [assembly: AssemblyTitle("DesignPattern.Iterator")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("DesignPattern.Iterator")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | //将 ComVisible 设置为 false 将使此程序集中的类型 18 | //对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, 19 | //请将此类型的 ComVisible 特性设置为 true。 20 | [assembly: ComVisible(false)] 21 | 22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID 23 | [assembly: Guid("8a8c9b81-1128-45c6-b183-5da74d768fe4")] 24 | 25 | // 程序集的版本信息由下列四个值组成: 26 | // 27 | // 主版本 28 | // 次版本 29 | // 生成号 30 | // 修订号 31 | // 32 | //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, 33 | // 方法是按如下所示使用“*”: : 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /DesignPattern.Mediator/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // 有关程序集的一般信息由以下 6 | // 控制。更改这些特性值可修改 7 | // 与程序集关联的信息。 8 | [assembly: AssemblyTitle("DesignPattern.Mediator")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("DesignPattern.Mediator")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | //将 ComVisible 设置为 false 将使此程序集中的类型 18 | //对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, 19 | //请将此类型的 ComVisible 特性设置为 true。 20 | [assembly: ComVisible(false)] 21 | 22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID 23 | [assembly: Guid("0fbaed0c-a733-402e-b85b-de92cf0afebe")] 24 | 25 | // 程序集的版本信息由下列四个值组成: 26 | // 27 | // 主版本 28 | // 次版本 29 | // 生成号 30 | // 修订号 31 | // 32 | //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, 33 | // 方法是按如下所示使用“*”: : 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /DesignPattern.Observer/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // 有关程序集的一般信息由以下 6 | // 控制。更改这些特性值可修改 7 | // 与程序集关联的信息。 8 | [assembly: AssemblyTitle("DesignPattern.Observer")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("DesignPattern.Observer")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | //将 ComVisible 设置为 false 将使此程序集中的类型 18 | //对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, 19 | //请将此类型的 ComVisible 特性设置为 true。 20 | [assembly: ComVisible(false)] 21 | 22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID 23 | [assembly: Guid("c6d19763-0207-46ed-b9aa-59c82edc0c28")] 24 | 25 | // 程序集的版本信息由下列四个值组成: 26 | // 27 | // 主版本 28 | // 次版本 29 | // 生成号 30 | // 修订号 31 | // 32 | //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, 33 | // 方法是按如下所示使用“*”: : 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /DesignPattern.Prototype/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // 有关程序集的一般信息由以下 6 | // 控制。更改这些特性值可修改 7 | // 与程序集关联的信息。 8 | [assembly: AssemblyTitle("DesignPattern.Prototype")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("DesignPattern.Prototype")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | //将 ComVisible 设置为 false 将使此程序集中的类型 18 | //对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, 19 | //请将此类型的 ComVisible 特性设置为 true。 20 | [assembly: ComVisible(false)] 21 | 22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID 23 | [assembly: Guid("c58ca655-ece9-43ef-b283-74020830c691")] 24 | 25 | // 程序集的版本信息由下列四个值组成: 26 | // 27 | // 主版本 28 | // 次版本 29 | // 生成号 30 | // 修订号 31 | // 32 | //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, 33 | // 方法是按如下所示使用“*”: : 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /DesignPattern.Strategy/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // 有关程序集的一般信息由以下 6 | // 控制。更改这些特性值可修改 7 | // 与程序集关联的信息。 8 | [assembly: AssemblyTitle("DesignPattern.Strategy")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("DesignPattern.Strategy")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | //将 ComVisible 设置为 false 将使此程序集中的类型 18 | //对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, 19 | //请将此类型的 ComVisible 特性设置为 true。 20 | [assembly: ComVisible(false)] 21 | 22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID 23 | [assembly: Guid("07cd6cfc-e324-4c06-bc3b-efd16877cacf")] 24 | 25 | // 程序集的版本信息由下列四个值组成: 26 | // 27 | // 主版本 28 | // 次版本 29 | // 生成号 30 | // 修订号 31 | // 32 | //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, 33 | // 方法是按如下所示使用“*”: : 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /DesignPattern.Interpreter/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // 有关程序集的一般信息由以下 6 | // 控制。更改这些特性值可修改 7 | // 与程序集关联的信息。 8 | [assembly: AssemblyTitle("DesignPattern.Interpreter")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("DesignPattern.Interpreter")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | //将 ComVisible 设置为 false 将使此程序集中的类型 18 | //对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, 19 | //请将此类型的 ComVisible 特性设置为 true。 20 | [assembly: ComVisible(false)] 21 | 22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID 23 | [assembly: Guid("9740746e-e4fa-4954-8a56-ab9c3e932b0d")] 24 | 25 | // 程序集的版本信息由下列四个值组成: 26 | // 27 | // 主版本 28 | // 次版本 29 | // 生成号 30 | // 修订号 31 | // 32 | //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, 33 | // 方法是按如下所示使用“*”: : 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /DesignPattern.FactoryMethod/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // 有关程序集的一般信息由以下 6 | // 控制。更改这些特性值可修改 7 | // 与程序集关联的信息。 8 | [assembly: AssemblyTitle("DesignPattern.FactoryMethod")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("DesignPattern.FactoryMethod")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | //将 ComVisible 设置为 false 将使此程序集中的类型 18 | //对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, 19 | //请将此类型的 ComVisible 特性设置为 true。 20 | [assembly: ComVisible(false)] 21 | 22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID 23 | [assembly: Guid("cedf3f69-12fc-428d-82ab-3e67e0f8ddf7")] 24 | 25 | // 程序集的版本信息由下列四个值组成: 26 | // 27 | // 主版本 28 | // 次版本 29 | // 生成号 30 | // 修订号 31 | // 32 | //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, 33 | // 方法是按如下所示使用“*”: : 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /DesignPattern.FactoryMethod/v0/LoggerFactory.cs: -------------------------------------------------------------------------------- 1 | using DesignPattern.FactoryMethod.v1; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace DesignPattern.FactoryMethod.v0 9 | { 10 | public class LoggerFactory 11 | { 12 | // 简单工厂方法 13 | public static ILogger CreateLogger(string args) 14 | { 15 | if (args.Equals("db", StringComparison.OrdinalIgnoreCase)) 16 | { 17 | // 连接数据库,代码省略 18 | // 创建数据库日志记录器对象 19 | ILogger logger = new DatabaseLogger(); 20 | // 初始化数据库日志记录器,代码省略 21 | return logger; 22 | } 23 | else if(args.Equals("file", StringComparison.OrdinalIgnoreCase)) 24 | { 25 | // 创建日志文件,代码省略 26 | // 创建文件日志记录器对象 27 | ILogger logger = new FileLogger(); 28 | // 初始化文件日志记录器,代码省略 29 | return logger; 30 | } 31 | else 32 | { 33 | return null; 34 | } 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /DesignPattern.TemplateMethod/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // 有关程序集的一般信息由以下 6 | // 控制。更改这些特性值可修改 7 | // 与程序集关联的信息。 8 | [assembly: AssemblyTitle("DesignPattern.TemplateMethod")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("DesignPattern.TemplateMethod")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | //将 ComVisible 设置为 false 将使此程序集中的类型 18 | //对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, 19 | //请将此类型的 ComVisible 特性设置为 true。 20 | [assembly: ComVisible(false)] 21 | 22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID 23 | [assembly: Guid("ff989778-a40f-40c9-8c95-6f8ae2028341")] 24 | 25 | // 程序集的版本信息由下列四个值组成: 26 | // 27 | // 主版本 28 | // 次版本 29 | // 生成号 30 | // 修订号 31 | // 32 | //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, 33 | // 方法是按如下所示使用“*”: : 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /DesignPattern.AbstractFactory/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // 有关程序集的一般信息由以下 6 | // 控制。更改这些特性值可修改 7 | // 与程序集关联的信息。 8 | [assembly: AssemblyTitle("DesignPattern.AbstractFactory")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("DesignPattern.AbstractFactory")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | //将 ComVisible 设置为 false 将使此程序集中的类型 18 | //对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, 19 | //请将此类型的 ComVisible 特性设置为 true。 20 | [assembly: ComVisible(false)] 21 | 22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID 23 | [assembly: Guid("13bf0335-5802-44b9-87e1-1780e7585bed")] 24 | 25 | // 程序集的版本信息由下列四个值组成: 26 | // 27 | // 主版本 28 | // 次版本 29 | // 生成号 30 | // 修订号 31 | // 32 | //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, 33 | // 方法是按如下所示使用“*”: : 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | --------------------------------------------------------------------------------