Aspose.Tasks Task actual properties

Hi, everyone!

I am using Aspose.Tasks to Parse *.mpp files. I’m new to this library and I want to clarify some points adout actual properies that are obtained and set via Get and Set methods. How to find out if the property does not exists? For example task.Get(Tsk.Actual) returns DateTime, that can never be null, as the DateTime is struct and not nullable. So what will it return if the task has not started yet?

Best regards
Thanks for answer in advance

@EndureEverything,

almost in all such cases when value is not present, the default value of DateTime is returned (DateTime.MinValue).

So you can perform check in the following way:

if (task.Get(Tsk.ActualStart)  != DateTime.MinValue)
{
    // value exists.
}

or

if (task.Get(Tsk.ActualStart)  > DateTime.MinValue)
{
    // value exists.
}

1 Like