C# Class DatesGenerator.ModelParameterDateSequence

Inheritance: ModelParameterArray, IExportableContainer
Mostrar archivo Open project: fairmat/ModelingTools Class Usage Examples

Public Methods

Method Description
AddPeriod ( DateFrequency frequency, System.DateTime date, int periods, bool add ) : System.DateTime

Adds a certain number of time to the specified date. The amount of time to be added is based on the value of the frequency and the number of periods to add to the start date.

ExportObjects ( bool recursive ) : List

Gets the objects exported from this parameter.

GetObjectData ( SerializationInfo info, StreamingContext context ) : void

Initializes the serialization information of the current object.

GetStringKind ( ) : string

Gets the kind of data represented by this object.

ModelParameterDateSequence ( System.DateTime startDate, System.DateTime endDate, DateFrequency frequency ) : System

Initializes the object.

ModelParameterDateSequence ( SerializationInfo info, StreamingContext context ) : System

Initializes the object based on the serialized data.

ModelParameterDateSequence ( string startDateExpression, string endDateExpression, string frequencyExpression ) : System

Initializes the object.

Parse ( IProject p_Context ) : bool

Parses the object.

ParsePreview ( IProject p_Context, System.DateTime minDate, System.DateTime maxDate ) : bool

Parses the object for preview purposes.

Private Methods

Method Description
GenerateBackward ( ) : List

Generates the list of dates from the end date.

GenerateForward ( ) : List

Generates the list of dates from the start date.

GetDate ( Project project, string expression ) : System.DateTime

Parses the given expression in order to find the date represented by the expression.

GetDateFrequency ( Project project, string expression ) : DateFrequency

Parses the given expression in order to find the frequency represented by the expression.

InitializeObject ( Project context ) : bool

Initializes the object based on the current expressions using the given object as context.

SetupExportedIDs ( ) : void

Ids for exported objects must be univoque

Validation ( IProject p_Context ) : bool

Validates the data of the object.

Method Details

AddPeriod() public method

Adds a certain number of time to the specified date. The amount of time to be added is based on the value of the frequency and the number of periods to add to the start date.
public AddPeriod ( DateFrequency frequency, System.DateTime date, int periods, bool add ) : System.DateTime
frequency DateFrequency The frequency of the dates generation.
date System.DateTime The reference date.
periods int The number of periods to add to the start date.
add bool A value indicating if the period has to be added.
return System.DateTime

ExportObjects() public method

Gets the objects exported from this parameter.
public ExportObjects ( bool recursive ) : List
recursive bool True if export has to be recursive; otherwise false.
return List

GetObjectData() public method

Initializes the serialization information of the current object.
public GetObjectData ( SerializationInfo info, StreamingContext context ) : void
info System.Runtime.Serialization.SerializationInfo The SerializationInfo to populate with data.
context System.Runtime.Serialization.StreamingContext The StreamingContext that contains contextual information /// about the destination.
return void

GetStringKind() public method

Gets the kind of data represented by this object.
public GetStringKind ( ) : string
return string

ModelParameterDateSequence() public method

Initializes the object.
public ModelParameterDateSequence ( System.DateTime startDate, System.DateTime endDate, DateFrequency frequency ) : System
startDate System.DateTime The start date.
endDate System.DateTime The end date.
frequency DateFrequency The frequency of the dates generated.
return System

ModelParameterDateSequence() public method

Initializes the object based on the serialized data.
public ModelParameterDateSequence ( SerializationInfo info, StreamingContext context ) : System
info System.Runtime.Serialization.SerializationInfo The SerializationInfo that holds the serialized object data.
context System.Runtime.Serialization.StreamingContext The StreamingContext that contains contextual /// information about the source.
return System

ModelParameterDateSequence() public method

Initializes the object.
public ModelParameterDateSequence ( string startDateExpression, string endDateExpression, string frequencyExpression ) : System
startDateExpression string The expression for the start date.
endDateExpression string The expression for the end date.
frequencyExpression string The expression for the frequency.
return System

Parse() public method

Parses the object.
public Parse ( IProject p_Context ) : bool
p_Context IProject The project in which to parse the object.
return bool

ParsePreview() public method

Parses the object for preview purposes.
public ParsePreview ( IProject p_Context, System.DateTime minDate, System.DateTime maxDate ) : bool
p_Context IProject The project in which to parse the object.
minDate System.DateTime The minimum date of the preview.
maxDate System.DateTime The maximum date of the preview.
return bool