Design Pattern Examples
Overview of object-oriented design patterns
Program Class Reference

Contains all the top-level Design Pattern Examples. More...

Collaboration diagram for Program:
Collaboration graph

Classes

struct  Exercise
 Represents a single exercise or example for a design pattern. More...
 
struct  Options
 Represents the command line options provided to the program, if any. More...
 

Private Member Functions

string GetVersion ()
 Helper method to get the version of this assembly.
 
void Help (Exercise[] exercises)
 Helper method to show usage information for this program.
 
void ShowVersion ()
 Helper method to show just the version of the application.
 
bool ParseOptions (string[] args, Exercise[] exercises, ref Options options)
 Helper method to parse the given options and store the results in the given Options structure. Displays help if requested and returns false.
 
void Run (string[] args)
 Run the specified examples.
 

Static Private Member Functions

static void Main (string[] args)
 Main entry point into this example program.
 

Detailed Description

Contains all the top-level Design Pattern Examples.

Definition at line 19 of file Program.cs.

Member Function Documentation

◆ GetVersion()

string GetVersion ( )
inlineprivate

Helper method to get the version of this assembly.

Returns
The version as a string.

Definition at line 69 of file Program.cs.

Referenced by Program.Help(), and Program.ShowVersion().

◆ Help()

void Help ( Exercise[]  exercises)
inlineprivate

Helper method to show usage information for this program.

Parameters
exercisesList of Exercise objects for which to show the names.

Definition at line 84 of file Program.cs.

References exercises, Program.GetVersion(), and Program.Exercise.name.

Referenced by Program.ParseOptions().

◆ Main()

static void Main ( string[]  args)
inlinestaticprivate

Main entry point into this example program.

Parameters
argsCommand line arguments.

Definition at line 213 of file Program.cs.

References Program.Run().

◆ ParseOptions()

bool ParseOptions ( string[]  args,
Exercise[]  exercises,
ref Options  options 
)
inlineprivate

Helper method to parse the given options and store the results in the given Options structure. Displays help if requested and returns false.

Parameters
argsList of arguments passed on the command line.
exercisesList of Exercise objects to display if help is needed.
optionsAn Options structure to be filled in by command line parameters.
Returns
true if the command lines were valid and help was not asked. Otherwise, a command line option was not valid or help was requested.

Definition at line 129 of file Program.cs.

References exercises, Program.Help(), and Program.ShowVersion().

Referenced by Program.Run().

◆ Run()

◆ ShowVersion()

void ShowVersion ( )
inlineprivate

Helper method to show just the version of the application.

Definition at line 114 of file Program.cs.

References Program.GetVersion().

Referenced by Program.ParseOptions().


The documentation for this class was generated from the following file: