This project has moved. For the latest updates, please go here.

Delete IT After- Settings Tab - Immediately

Topics: Errors, Examples, Setup
Feb 18, 2016 at 6:03 AM
Hi,

I am trying to set the 'Delete It After' on the settings tab to 'Immediately' by using

taskdef.Settings.DeleteExpiredTaskAfter = TimeSpan.zero

which should work according to the wrapper
But instead it disables the option. I feel like I am missing something here.
Any help will be appreciated

Thanks
Coordinator
Feb 18, 2016 at 6:43 PM
Actually, the library's documentation says, "A TimeSpan value of 1 second indicates the task is set to delete when done. A value of TimeSpan.Zero indicates that the task should not be deleted."
Marked as answer by dahall on 2/18/2016 at 11:43 AM
Feb 19, 2016 at 4:54 AM
Edited Feb 19, 2016 at 5:15 AM
Thanks for the reply. I tried giving

taskdef.Settings.DeleteExpiredTaskAfter = TimeSpan.FromSeconds(1);

but the Task created in system's task scheduler shows '1 second' instead of 'Immediately' .
Coordinator
Feb 19, 2016 at 3:36 PM
I see the problem now. When I originally wrote the library, there were not nullable types supported in either C# or VB.NET. The native library uses strings that can have the following values:
  • 'null' == 'Never delete'
  • 'PT0S' (or TimeSpan.Zero) == 'Immediately'
  • 'PTxx' == other times
I needed a solution that would work without nullable types, so I chose to implement the library using Microsoft's solution for the V1 library, which is:
  • TimeSpan.Zero == 'Never delete'
  • TimeSpan.FromSeconds(1) == 'Immediately'
  • TimeSpan (other) == other times
I believe this is the discrepancy you're seeing. Sorry for the confusion.
Marked as answer by dahall on 2/19/2016 at 8:36 AM