C# Class HandCoded.Finance.Weekend

The Weekend class provides a mechanism to test if a Date falls on a weekend (e.g. non-working day). In traditionally Christian countries Saturday and Sunday are non-working but other religions have selected other days.
Datei anzeigen Open project: formicary/fpml-toolkit-csharp Class Usage Examples

Public Properties

Property Type Description
FRI_SAT Weekend
SAT_SUN Weekend
THU_FRI Weekend

Public Methods

Method Description
ForName ( string name ) : Weekend

Attempts to find a Weekend instance in the extent with the given reference name.

IsWeekend ( Date date ) : bool

Determines if the given Date falls on a weekend.

Protected Methods

Method Description
Weekend ( string name ) : System

Constructs a Weekend instance with the given name and adds it to the extent set.

Private Methods

Method Description
IsFriOrSat ( Date date ) : bool

Tests is a Date falls on a Friday or a Saturday.

IsSatOrSun ( Date date ) : bool

Tests is a Date falls on a Saturday or a Sunday.

IsThuOrFri ( Date date ) : bool

Tests is a Date falls on a Thursday or a Friday.

Method Details

ForName() public static method

Attempts to find a Weekend instance in the extent with the given reference name.
public static ForName ( string name ) : Weekend
name string The reference name for the required instance.
return Weekend

IsWeekend() public abstract method

Determines if the given Date falls on a weekend.
public abstract IsWeekend ( Date date ) : bool
date Date The to check.
return bool

Weekend() protected method

Constructs a Weekend instance with the given name and adds it to the extent set.
protected Weekend ( string name ) : System
name string The name used to reference this instance.
return System

Property Details

FRI_SAT public_oe static_oe property

A Weekend instance that detects Jewish style (Friday & Saturday) weekends.
public static Weekend,HandCoded.Finance FRI_SAT
return Weekend

SAT_SUN public_oe static_oe property

A Weekend instance that detects Christian style (Saturday & Sunday) weekends.
public static Weekend,HandCoded.Finance SAT_SUN
return Weekend

THU_FRI public_oe static_oe property

A Weekend instance that detects Islamic style (Thursday & Friday) weekends.
public static Weekend,HandCoded.Finance THU_FRI
return Weekend