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

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

#include <WorkingTime.h>

Inherits 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

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
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));

Exceptions
ArgumentExceptionWhen toTime less than of equal to toTime argument or when interval between fromTime and toTime is greater than 24 hours.
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

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.
System::DateTime Aspose::Tasks::WorkingTime::get_From ( ) const

Gets the beginning of a working time.

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

Gets the end of a working time.

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.