C# Класс HandCoded.Finance.Calendar

Calendar instances implement the rules for determining if a Date is a business day in the location it represents.

The rules for public holidays vary from country to country but with the exception of special occaisions (e.g. royal weddings, funerals, etc.) can usually be predicted years in advance.

On first reference this class bootstraps an initial set of Calendar instances by processing a XML data file.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
ForName ( string name ) : Calendar

If a Calendar with the given name exists in the extent set then a reference to it is returned to the caller.

IsBusinessDay ( Date date ) : bool

Determines if the Date provided falls on a business day in this Calendar (e.g. not a holiday or weekend).

ToString ( ) : string

Produces a debugging string describing the instance.

Защищенные методы

Метод Описание
Calendar ( string name ) : System

Constructs a Calendar instance with a given name.

ToDebug ( ) : string

Produces a debugging string describing the state of the instance.

Приватные методы

Метод Описание
Calendar ( ) : System

Initialises the Calendar cache by parsing a standard set of definitions held in a XML file distributed with the toolkit.

ConvertMonth ( string name ) : int
ConvertWeekday ( string name ) : int
ConvertWhen ( string name ) : int
ParseCalendars ( string uri ) : void

Parses the XML data file indicated by the URI to extract default sets of calendars.

Описание методов

Calendar() защищенный Метод

Constructs a Calendar instance with a given name.
protected Calendar ( string name ) : System
name string The reference name for the instance.
Результат System

ForName() публичный статический Метод

If a Calendar with the given name exists in the extent set then a reference to it is returned to the caller.
public static ForName ( string name ) : Calendar
name string The required Calendar name.
Результат Calendar

IsBusinessDay() публичный абстрактный Метод

Determines if the Date provided falls on a business day in this Calendar (e.g. not a holiday or weekend).
public abstract IsBusinessDay ( Date date ) : bool
date Date The to be tested.
Результат bool

ToDebug() защищенный Метод

Produces a debugging string describing the state of the instance.
protected ToDebug ( ) : string
Результат string

ToString() публичный Метод

Produces a debugging string describing the instance.
public ToString ( ) : string
Результат string