Struct Duration
Namespace: Aspose.Tasks
Assembly: Aspose.Tasks.dll (25.2.0)
Represents duration in a project.
public struct Duration : IEquatable<duration>
Implements
Inherited Members
object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Properties
IsElapsed
Gets a value indicating whether time unit is elapsed.
public bool IsElapsed { get; }
Property Value
IsEstimated
Gets a value indicating whether time unit is estimated.
public bool IsEstimated { get; }
Property Value
TimeSpan
Gets Aspose.Tasks.Duration.TimeSpan instance of this Duration object.
public TimeSpan TimeSpan { get; }
Property Value
TimeUnit
Gets time unit type for this object.
public TimeUnitType TimeUnit { get; }
Property Value
Methods
Add(Duration)
Adds specified duration to this duration.
public Duration Add(Duration d)
Parameters
d
Duration
specified Aspose.Tasks.Duration to add to this instance.
Returns
New duration object that represents the value of this instance plus the specified duration value.
Add(double)
Adds specified double value to this duration.
public Duration Add(double val)
Parameters
val
double
the specified System.Double value to add to this instance.
Returns
New duration object that represents the value of this instance plus the specified duration value.
Convert(TimeUnitType)
Converts Duration object to another duration with specified time units.
public Duration Convert(TimeUnitType timeUnitType)
Parameters
timeUnitType
TimeUnitType
the specified time unit type.
Returns
returns new duration with the specified unit type.
Equals(Duration)
Returns a value indicating whether this instance is equal to a specified object.
public bool Equals(Duration other)
Parameters
other
Duration
The object to compare with this instance.
Returns
Returns True if other Duration instance has the same TimeSpan and TimeUnit values as this instance; otherwise, false.
Equals(object)
Returns a value indicating whether this instance is equal to a specified object.
public override bool Equals(object obj)
Parameters
obj
object
The object to compare with this instance.
Returns
True if the specified object is a Duration that has the same TimeSpan and TimeUnit values as this instance; otherwise, false.
GetHashCode()
Returns a hash code value for this object.
public override int GetHashCode()
Returns
returns a hash code value for this duration instance.
Parse(Project, string)
Converts the specified string to the instance of Aspose.Tasks.Duration struct.
public static Duration Parse(Project p, string value)
Parameters
p
Project
the specified instance of Aspose.Tasks.Project class to convert duration for.
value
string
the specified string to convert.
Returns
Returns the converted instance of Aspose.Tasks.Duration struct.
ParseTimeSpan(string)
Parses duration string in format “PT–H–M–S–”.
public static TimeSpan ParseTimeSpan(string value)
Parameters
value
string
the specified string to parse.
Returns
returns parsed instance of the Aspose.Tasks.Duration.TimeSpan struct.
Subtract(Duration)
Subtracts specified duration from this duration instance.
public Duration Subtract(Duration d)
Parameters
d
Duration
the specified Aspose.Tasks.Duration instance to subtract from this instance.
Returns
New duration object that represents the value of this instance minus the specified duration value.
Subtract(double)
Subtracts specified double value from this duration instance.
public Duration Subtract(double val)
Parameters
val
double
specified System.Double value to subtract from this instance.
Returns
New duration object that represents the value of this instance minus the specified duration value.
ToDouble()
Converts Duration object to System.Double value.
public double ToDouble()
Returns
Converted value.
ToString()
Returns a string representation of this instance.
public override string ToString()
Returns
a string representation of this instance.
Operators
operator ==(Duration, Duration)
Returns a value indicating whether this instance is equal to a specified object.
public static bool operator ==(Duration a, Duration b)
Parameters
a
Duration
The first duration.
b
Duration
The second duration.
Returns
a value indicating whether this instance is equal to a specified object
operator !=(Duration, Duration)
Returns a value indicating whether this instance is not equal to a specified object.
public static bool operator !=(Duration a, Duration b)
Parameters
a
Duration
The first duration.
b
Duration
The second duration.
Returns
a value indicating whether this instance is not equal to a specified object </duration>