├── .vs
└── ChainOfResponsibility
│ └── v15
│ ├── Server
│ └── sqlite3
│ │ ├── db.lock
│ │ ├── storage.ide-shm
│ │ ├── storage.ide-wal
│ │ └── storage.ide
│ └── .suo
├── ChainOfResponsibility
├── obj
│ └── Debug
│ │ ├── TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
│ │ ├── TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
│ │ ├── TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs
│ │ ├── ChainOfResponsibility.csproj.CoreCompileInputs.cache
│ │ ├── ChainOfResponsibility.exe
│ │ ├── ChainOfResponsibility.pdb
│ │ ├── DesignTimeResolveAssemblyReferencesInput.cache
│ │ ├── ChainOfResponsibility.csprojAssemblyReference.cache
│ │ └── ChainOfResponsibility.csproj.FileListAbsolute.txt
├── bin
│ └── Debug
│ │ ├── ChainOfResponsibility.exe
│ │ ├── ChainOfResponsibility.pdb
│ │ └── ChainOfResponsibility.exe.config
├── App.config
├── NewVehicle.cs
├── Delivery.cs
├── Insurance.cs
├── MakePayment.cs
├── SelectVehicle.cs
├── GenerateServiceBook.cs
├── Program.cs
├── Properties
│ └── AssemblyInfo.cs
└── ChainOfResponsibility.csproj
└── ChainOfResponsibility.sln
/.vs/ChainOfResponsibility/v15/Server/sqlite3/db.lock:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/ChainOfResponsibility/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/ChainOfResponsibility/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/ChainOfResponsibility/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/ChainOfResponsibility/obj/Debug/ChainOfResponsibility.csproj.CoreCompileInputs.cache:
--------------------------------------------------------------------------------
1 | 2355fff404a2721fe6d39c267de18e326c35c02f
2 |
--------------------------------------------------------------------------------
/.vs/ChainOfResponsibility/v15/.suo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/akshayblevel/ChainOfResponsibility-Design-Pattern/HEAD/.vs/ChainOfResponsibility/v15/.suo
--------------------------------------------------------------------------------
/ChainOfResponsibility/bin/Debug/ChainOfResponsibility.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/akshayblevel/ChainOfResponsibility-Design-Pattern/HEAD/ChainOfResponsibility/bin/Debug/ChainOfResponsibility.exe
--------------------------------------------------------------------------------
/ChainOfResponsibility/bin/Debug/ChainOfResponsibility.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/akshayblevel/ChainOfResponsibility-Design-Pattern/HEAD/ChainOfResponsibility/bin/Debug/ChainOfResponsibility.pdb
--------------------------------------------------------------------------------
/ChainOfResponsibility/obj/Debug/ChainOfResponsibility.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/akshayblevel/ChainOfResponsibility-Design-Pattern/HEAD/ChainOfResponsibility/obj/Debug/ChainOfResponsibility.exe
--------------------------------------------------------------------------------
/ChainOfResponsibility/obj/Debug/ChainOfResponsibility.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/akshayblevel/ChainOfResponsibility-Design-Pattern/HEAD/ChainOfResponsibility/obj/Debug/ChainOfResponsibility.pdb
--------------------------------------------------------------------------------
/.vs/ChainOfResponsibility/v15/Server/sqlite3/storage.ide-shm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/akshayblevel/ChainOfResponsibility-Design-Pattern/HEAD/.vs/ChainOfResponsibility/v15/Server/sqlite3/storage.ide-shm
--------------------------------------------------------------------------------
/.vs/ChainOfResponsibility/v15/Server/sqlite3/storage.ide-wal:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/akshayblevel/ChainOfResponsibility-Design-Pattern/HEAD/.vs/ChainOfResponsibility/v15/Server/sqlite3/storage.ide-wal
--------------------------------------------------------------------------------
/ChainOfResponsibility/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/ChainOfResponsibility/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/akshayblevel/ChainOfResponsibility-Design-Pattern/HEAD/ChainOfResponsibility/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
--------------------------------------------------------------------------------
/ChainOfResponsibility/obj/Debug/ChainOfResponsibility.csprojAssemblyReference.cache:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/akshayblevel/ChainOfResponsibility-Design-Pattern/HEAD/ChainOfResponsibility/obj/Debug/ChainOfResponsibility.csprojAssemblyReference.cache
--------------------------------------------------------------------------------
/ChainOfResponsibility/bin/Debug/ChainOfResponsibility.exe.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/ChainOfResponsibility/NewVehicle.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 ChainOfResponsibility
8 | {
9 | public abstract class NewVehicle
10 | {
11 | protected NewVehicle process;
12 |
13 | public void SetProcess(NewVehicle process)
14 | {
15 | this.process = process;
16 | }
17 |
18 | public abstract void Proceed(string request);
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/ChainOfResponsibility/Delivery.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 ChainOfResponsibility
8 | {
9 | public class Delivery : NewVehicle
10 | {
11 | public override void Proceed(string request)
12 | {
13 | try
14 | {
15 | Console.WriteLine("Delivery Process Started");
16 |
17 | if (process != null)
18 | {
19 | process.Proceed(request);
20 | }
21 | }
22 | catch (Exception err)
23 | {
24 | Console.WriteLine("Error while delivering vehicle.");
25 | process = null;
26 | }
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/ChainOfResponsibility/Insurance.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 ChainOfResponsibility
8 | {
9 | public class Insurance : NewVehicle
10 | {
11 | public override void Proceed(string request)
12 | {
13 | try
14 | {
15 | Console.WriteLine("Insurance Process Started");
16 |
17 | if (process != null)
18 | {
19 | process.Proceed(request);
20 | }
21 | }
22 | catch (Exception err)
23 | {
24 | Console.WriteLine("Error while doing insurance.");
25 | process = null;
26 | }
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/ChainOfResponsibility/MakePayment.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 ChainOfResponsibility
8 | {
9 | public class MakePayment : NewVehicle
10 | {
11 | public override void Proceed(string request)
12 | {
13 | try
14 | {
15 | Console.WriteLine("Payment Process Started");
16 |
17 | if (process != null)
18 | {
19 | process.Proceed(request);
20 | }
21 | }
22 | catch (Exception err)
23 | {
24 | Console.WriteLine("Error while doing payment.");
25 | process = null;
26 | }
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/ChainOfResponsibility/obj/Debug/ChainOfResponsibility.csproj.FileListAbsolute.txt:
--------------------------------------------------------------------------------
1 | D:\AKKI_DEV\RND\DP\ChainOfResponsibility\ChainOfResponsibility\bin\Debug\ChainOfResponsibility.exe.config
2 | D:\AKKI_DEV\RND\DP\ChainOfResponsibility\ChainOfResponsibility\bin\Debug\ChainOfResponsibility.exe
3 | D:\AKKI_DEV\RND\DP\ChainOfResponsibility\ChainOfResponsibility\bin\Debug\ChainOfResponsibility.pdb
4 | D:\AKKI_DEV\RND\DP\ChainOfResponsibility\ChainOfResponsibility\obj\Debug\ChainOfResponsibility.csprojAssemblyReference.cache
5 | D:\AKKI_DEV\RND\DP\ChainOfResponsibility\ChainOfResponsibility\obj\Debug\ChainOfResponsibility.csproj.CoreCompileInputs.cache
6 | D:\AKKI_DEV\RND\DP\ChainOfResponsibility\ChainOfResponsibility\obj\Debug\ChainOfResponsibility.exe
7 | D:\AKKI_DEV\RND\DP\ChainOfResponsibility\ChainOfResponsibility\obj\Debug\ChainOfResponsibility.pdb
8 |
--------------------------------------------------------------------------------
/ChainOfResponsibility/SelectVehicle.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 ChainOfResponsibility
8 | {
9 | public class SelectVehicle : NewVehicle
10 | {
11 | public override void Proceed(string request)
12 | {
13 | try
14 | {
15 | Console.WriteLine("Vehicle Selection Process Started");
16 |
17 | if (process != null)
18 | {
19 | process.Proceed(request);
20 | }
21 | }
22 | catch (Exception err)
23 | {
24 | Console.WriteLine("Error while selecting vehicle.");
25 | process = null;
26 | }
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/ChainOfResponsibility/GenerateServiceBook.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 ChainOfResponsibility
8 | {
9 | public class GenerateServiceBook : NewVehicle
10 | {
11 | public override void Proceed(string request)
12 | {
13 | try
14 | {
15 | Console.WriteLine("Generating Service Book Process Started");
16 |
17 | if (process != null)
18 | {
19 | process.Proceed(request);
20 | }
21 | }
22 | catch (Exception err)
23 | {
24 | Console.WriteLine("Error while generating service book.");
25 | process = null;
26 | }
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/ChainOfResponsibility/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 ChainOfResponsibility
8 | {
9 | class Program
10 | {
11 | static void Main(string[] args)
12 | {
13 | NewVehicle selection = new SelectVehicle();
14 | NewVehicle payment = new MakePayment();
15 | NewVehicle serviceBook = new GenerateServiceBook();
16 | NewVehicle insurance = new Insurance();
17 | NewVehicle delivery = new Delivery();
18 |
19 | selection.SetProcess(payment);
20 | payment.SetProcess(serviceBook);
21 | serviceBook.SetProcess(insurance);
22 | insurance.SetProcess(delivery);
23 |
24 | selection.Proceed("Honda Splendor");
25 |
26 | Console.ReadLine();
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/ChainOfResponsibility.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 15
4 | VisualStudioVersion = 15.0.28307.136
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ChainOfResponsibility", "ChainOfResponsibility\ChainOfResponsibility.csproj", "{9F083407-5853-44CA-91DF-E9A052CB6847}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {9F083407-5853-44CA-91DF-E9A052CB6847}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {9F083407-5853-44CA-91DF-E9A052CB6847}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {9F083407-5853-44CA-91DF-E9A052CB6847}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {9F083407-5853-44CA-91DF-E9A052CB6847}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {EE34D43C-1605-434D-8570-7E41A5AEC83D}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/ChainOfResponsibility/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("ChainOfResponsibility")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("ChainOfResponsibility")]
13 | [assembly: AssemblyCopyright("Copyright © 2018")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("9f083407-5853-44ca-91df-e9a052cb6847")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/ChainOfResponsibility/ChainOfResponsibility.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {9F083407-5853-44CA-91DF-E9A052CB6847}
8 | Exe
9 | ChainOfResponsibility
10 | ChainOfResponsibility
11 | v4.6.1
12 | 512
13 | true
14 | true
15 |
16 |
17 | AnyCPU
18 | true
19 | full
20 | false
21 | bin\Debug\
22 | DEBUG;TRACE
23 | prompt
24 | 4
25 |
26 |
27 | AnyCPU
28 | pdbonly
29 | true
30 | bin\Release\
31 | TRACE
32 | prompt
33 | 4
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/.vs/ChainOfResponsibility/v15/Server/sqlite3/storage.ide:
--------------------------------------------------------------------------------
1 | SQLite format 3 @ .A
--------------------------------------------------------------------------------