From d5d4fc3f86fcd1e58fc369763f3e0195da015cf6 Mon Sep 17 00:00:00 2001 From: Petrutiu Mihai Date: Wed, 6 Jul 2016 11:54:25 +0300 Subject: [PATCH] Add VisitorPattern example --- BehavioralPatterns.sln | 7 ++++++ src/BehavioralPatterns/project.json | 3 ++- src/VisitorPattern/Properties/AssemblyInfo.cs | 19 +++++++++++++++ src/VisitorPattern/VisitorPattern.xproj | 21 ++++++++++++++++ src/VisitorPattern/VisitorPatternExamples.cs | 24 +++++++++++++++++++ src/VisitorPattern/project.json | 13 ++++++++++ 6 files changed, 86 insertions(+), 1 deletion(-) create mode 100644 src/VisitorPattern/Properties/AssemblyInfo.cs create mode 100644 src/VisitorPattern/VisitorPattern.xproj create mode 100644 src/VisitorPattern/VisitorPatternExamples.cs create mode 100644 src/VisitorPattern/project.json diff --git a/BehavioralPatterns.sln b/BehavioralPatterns.sln index 6d8a44f..fbcd77c 100644 --- a/BehavioralPatterns.sln +++ b/BehavioralPatterns.sln @@ -30,6 +30,8 @@ Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "StrategyPattern", "src\Stra EndProject Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "TemplatePattern", "src\TemplatePattern\TemplatePattern.xproj", "{E657BF85-C23A-46DE-B837-6939D51C3321}" EndProject +Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "VisitorPattern", "src\VisitorPattern\VisitorPattern.xproj", "{CDDB889F-3038-4796-95B1-47E1834DA93D}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -76,6 +78,10 @@ Global {E657BF85-C23A-46DE-B837-6939D51C3321}.Debug|Any CPU.Build.0 = Debug|Any CPU {E657BF85-C23A-46DE-B837-6939D51C3321}.Release|Any CPU.ActiveCfg = Release|Any CPU {E657BF85-C23A-46DE-B837-6939D51C3321}.Release|Any CPU.Build.0 = Release|Any CPU + {CDDB889F-3038-4796-95B1-47E1834DA93D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CDDB889F-3038-4796-95B1-47E1834DA93D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CDDB889F-3038-4796-95B1-47E1834DA93D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CDDB889F-3038-4796-95B1-47E1834DA93D}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -91,5 +97,6 @@ Global {0B5B470D-45A4-4F6B-8DAD-D0116C40B6FB} = {3820200F-354C-41E6-8F34-B301F5D621C2} {01B9D869-AF89-4919-8445-79206848FB5F} = {3820200F-354C-41E6-8F34-B301F5D621C2} {E657BF85-C23A-46DE-B837-6939D51C3321} = {3820200F-354C-41E6-8F34-B301F5D621C2} + {CDDB889F-3038-4796-95B1-47E1834DA93D} = {3820200F-354C-41E6-8F34-B301F5D621C2} EndGlobalSection EndGlobal diff --git a/src/BehavioralPatterns/project.json b/src/BehavioralPatterns/project.json index 5327460..3d641c8 100644 --- a/src/BehavioralPatterns/project.json +++ b/src/BehavioralPatterns/project.json @@ -20,7 +20,8 @@ "ObserverPattern": "1.0.0-*", "StatePattern": "1.0.0-*", "StrategyPattern": "1.0.0-*", - "TemplatePattern": "1.0.0-*" + "TemplatePattern": "1.0.0-*", + "VisitorPattern": "1.0.0-*" }, "frameworks": { diff --git a/src/VisitorPattern/Properties/AssemblyInfo.cs b/src/VisitorPattern/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..905ed96 --- /dev/null +++ b/src/VisitorPattern/Properties/AssemblyInfo.cs @@ -0,0 +1,19 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Hewlett-Packard Company")] +[assembly: AssemblyProduct("VisitorPattern")] +[assembly: AssemblyTrademark("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("cddb889f-3038-4796-95b1-47e1834da93d")] diff --git a/src/VisitorPattern/VisitorPattern.xproj b/src/VisitorPattern/VisitorPattern.xproj new file mode 100644 index 0000000..9d610ba --- /dev/null +++ b/src/VisitorPattern/VisitorPattern.xproj @@ -0,0 +1,21 @@ + + + + 14.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + + cddb889f-3038-4796-95b1-47e1834da93d + VisitorPattern + .\obj + .\bin\ + v4.6.1 + + + + 2.0 + + + diff --git a/src/VisitorPattern/VisitorPatternExamples.cs b/src/VisitorPattern/VisitorPatternExamples.cs new file mode 100644 index 0000000..c460d41 --- /dev/null +++ b/src/VisitorPattern/VisitorPatternExamples.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace VisitorPattern +{ + public class VisitorPatternExamples + { + public VisitorPatternExamples() + { + } + + public static void Run() + { + + } + + public static string GetDescription() + { + return @"Visitor pattern allows for one or more operation to be applied to a set of objects at runtime, decoupling the operations from the object structure. "; + } + } +} diff --git a/src/VisitorPattern/project.json b/src/VisitorPattern/project.json new file mode 100644 index 0000000..864b9a5 --- /dev/null +++ b/src/VisitorPattern/project.json @@ -0,0 +1,13 @@ +{ + "version": "1.0.0-*", + + "dependencies": { + "NETStandard.Library": "1.6.0" + }, + + "frameworks": { + "netstandard1.6": { + "imports": "dnxcore50" + } + } +}