@gshah,
Thank you for writing to Aspose support team.
For normal fields like Date (i.e Request Entered) you may please check first if it has minimum value or not. If it has minimum value, it shall be declared as empty. Otherwise get the StartText of the task. If it is null, then it is normal date field and if it is not null, then some text is writeen in the date field like N/A.
var path = @"Annual MS Project Tracking - 2018.mpp";
Project proj = new Project(path);
var task = proj.RootTask.Children.GetById(1);//Check it with 608 (N/A), 610 (Empty), 1 (Normal Date)
Console.WriteLine(task.Get(Tsk.Start));
string Text;
if (task.Get(Tsk.Start) == DateTime.MinValue)
{
Console.WriteLine("Request Entered = Empty");
}
else
{
Text = task.Get(Tsk.StartText);
if (Text == null)
{
Console.WriteLine("Its normal date {0}", task.Get(Tsk.Start));
}
else
{
Console.WriteLine("Request Entered = {0}", task.Get(Tsk.StartText));
}
}
For extended attributes like Date2 (Issued Date) you need to check first if the current task contains this extended attribute or not. If it does not contain this extended attribute, then it is NA. Otherwise if it contains this attribute, then get the extended attribute value from it.
var task2 = proj.RootTask.Children.GetById(609);// Check it with 608(NA) and 609(10/5/17 08:00:00)
var IssuedDate = (from data in task2.ExtendedAttributes
where data.AttributeDefinition.Alias == "Issued Date"
select data.Value).ToList();
if(IssuedDate.Count() > 0)
{
//It contains this attribute. Value can be extracted
Console.WriteLine("Task Issued date = {0}", IssuedDate[0]);
}
else
{
//It does not contain thi attribute. It is NA
Console.WriteLine("Task Issued date = NA");
}