Add VisitorPattern example
This commit is contained in:
@@ -30,6 +30,8 @@ Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "StrategyPattern", "src\Stra
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "TemplatePattern", "src\TemplatePattern\TemplatePattern.xproj", "{E657BF85-C23A-46DE-B837-6939D51C3321}"
|
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "TemplatePattern", "src\TemplatePattern\TemplatePattern.xproj", "{E657BF85-C23A-46DE-B837-6939D51C3321}"
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "VisitorPattern", "src\VisitorPattern\VisitorPattern.xproj", "{CDDB889F-3038-4796-95B1-47E1834DA93D}"
|
||||||
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
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}.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.ActiveCfg = Release|Any CPU
|
||||||
{E657BF85-C23A-46DE-B837-6939D51C3321}.Release|Any CPU.Build.0 = 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
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
@@ -91,5 +97,6 @@ Global
|
|||||||
{0B5B470D-45A4-4F6B-8DAD-D0116C40B6FB} = {3820200F-354C-41E6-8F34-B301F5D621C2}
|
{0B5B470D-45A4-4F6B-8DAD-D0116C40B6FB} = {3820200F-354C-41E6-8F34-B301F5D621C2}
|
||||||
{01B9D869-AF89-4919-8445-79206848FB5F} = {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}
|
{E657BF85-C23A-46DE-B837-6939D51C3321} = {3820200F-354C-41E6-8F34-B301F5D621C2}
|
||||||
|
{CDDB889F-3038-4796-95B1-47E1834DA93D} = {3820200F-354C-41E6-8F34-B301F5D621C2}
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
EndGlobal
|
EndGlobal
|
||||||
|
|||||||
@@ -20,7 +20,8 @@
|
|||||||
"ObserverPattern": "1.0.0-*",
|
"ObserverPattern": "1.0.0-*",
|
||||||
"StatePattern": "1.0.0-*",
|
"StatePattern": "1.0.0-*",
|
||||||
"StrategyPattern": "1.0.0-*",
|
"StrategyPattern": "1.0.0-*",
|
||||||
"TemplatePattern": "1.0.0-*"
|
"TemplatePattern": "1.0.0-*",
|
||||||
|
"VisitorPattern": "1.0.0-*"
|
||||||
},
|
},
|
||||||
|
|
||||||
"frameworks": {
|
"frameworks": {
|
||||||
|
|||||||
19
src/VisitorPattern/Properties/AssemblyInfo.cs
Normal file
19
src/VisitorPattern/Properties/AssemblyInfo.cs
Normal file
@@ -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")]
|
||||||
21
src/VisitorPattern/VisitorPattern.xproj
Normal file
21
src/VisitorPattern/VisitorPattern.xproj
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<PropertyGroup>
|
||||||
|
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
|
||||||
|
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
|
||||||
|
<PropertyGroup Label="Globals">
|
||||||
|
<ProjectGuid>cddb889f-3038-4796-95b1-47e1834da93d</ProjectGuid>
|
||||||
|
<RootNamespace>VisitorPattern</RootNamespace>
|
||||||
|
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
|
||||||
|
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
|
||||||
|
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<SchemaVersion>2.0</SchemaVersion>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
|
||||||
|
</Project>
|
||||||
24
src/VisitorPattern/VisitorPatternExamples.cs
Normal file
24
src/VisitorPattern/VisitorPatternExamples.cs
Normal file
@@ -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. ";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
13
src/VisitorPattern/project.json
Normal file
13
src/VisitorPattern/project.json
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"version": "1.0.0-*",
|
||||||
|
|
||||||
|
"dependencies": {
|
||||||
|
"NETStandard.Library": "1.6.0"
|
||||||
|
},
|
||||||
|
|
||||||
|
"frameworks": {
|
||||||
|
"netstandard1.6": {
|
||||||
|
"imports": "dnxcore50"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user