Aspose.Tasks for C++
Aspose::Tasks::WorkingTime Class Reference

Represents a working time during a weekday. More...

#include <WorkingTime.h>

Inherits System::Object.

Public Member Functions

System::DateTime get_From () const
 Gets the beginning of a working time. More...
 
System::DateTime get_To () const
 Gets the end of a working time. More...
 
 WorkingTime (System::DateTime fromTime, System::DateTime toTime)
 Initializes a new instance of the WorkingTime class with a interval with the specified start and finish times. More...
 
 WorkingTime (System::TimeSpan fromTime, System::TimeSpan toTime)
 Initializes a new instance of the WorkingTime class with an interval item with the specified start and finish times. More...
 
 WorkingTime (int32_t fromHours, int32_t toHours)
 Initializes a new instance of the WorkingTime class with an interval item with the specified start and finish times. More...
 
bool Equals (System::SharedPtr< System::Object > obj) override
 Checks that the objects are equal. More...
 
int32_t GetHashCode () const override
 Returns a hash code value for the instance of the WorkingTime class. More...
 

Detailed Description

Represents a working time during a weekday.

Constructor & Destructor Documentation

◆ WorkingTime() [1/3]

Aspose::Tasks::WorkingTime::WorkingTime ( System::DateTime  fromTime,
System::DateTime  toTime 
)

Initializes a new instance of the WorkingTime class with a interval with the specified start and finish times.

Parameters
fromTimeinterval start time
toTimeinterval end time

◆ WorkingTime() [2/3]

Aspose::Tasks::WorkingTime::WorkingTime ( System::TimeSpan  fromTime,
System::TimeSpan  toTime 
)

Initializes a new instance of the WorkingTime class with an interval item with the specified start and finish times.

Parameters
fromTimeInterval's start time represented by TimeSpan struct.
toTimeInterval's end time represented by TimeSpan struct.

The overload of WorkingTime ctor can be used to initialize interval's start and end using TimeSpans:

[C#]
var wt = new WorkingTime(new TimeSpan(9, 0, 0), new TimeSpan(18, 0, 0));
WorkingTime(System::DateTime fromTime, System::DateTime toTime)
Initializes a new instance of the WorkingTime class with a interval with the specified start and fini...
Exceptions
ArgumentExceptionWhen toTime less than of equal to toTime argument or when interval between fromTime and toTime is greater than 24 hours.

◆ WorkingTime() [3/3]

Aspose::Tasks::WorkingTime::WorkingTime ( int32_t  fromHours,
int32_t  toHours 
)

Initializes a new instance of the WorkingTime class with an interval item with the specified start and finish times.

Parameters
fromHoursInterval's start time represented by whole number of hours (0-24).
toHoursInterval's end time represented by whole number of hours (0-24).

The overload of WorkingTime ctor can be used to initialize interval's start and end using whole hours:

[C#]
var wt = new WorkingTime(9, 13);
Exceptions
ArgumentExceptionWhen toTime less than of equal to toTime argument or when interval between fromTime and toTime is greater than 24 hours.

Member Function Documentation

◆ Equals()

bool Aspose::Tasks::WorkingTime::Equals ( System::SharedPtr< System::Object >  obj)
override

Checks that the objects are equal.

Parameters
objSecond object to compare.
Returns
True if the objects are equal, false otherwise.

◆ get_From()

System::DateTime Aspose::Tasks::WorkingTime::get_From ( ) const

Gets the beginning of a working time.

◆ get_To()

System::DateTime Aspose::Tasks::WorkingTime::get_To ( ) const

Gets the end of a working time.

◆ GetHashCode()

int32_t Aspose::Tasks::WorkingTime::GetHashCode ( ) const
override

Returns a hash code value for the instance of the WorkingTime class.

Returns
returns a hash code value for this object.