Class LoadOptions

LoadOptions class

Allows to specify additional load parameters when loading a project from file or stream.

public class LoadOptions

Constructors

NameDescription
LoadOptions()Initializes a new instance of the LoadOptions class.

Properties

NameDescription
CancellationToken { get; set; }Gets or sets a token which can be used to cancel a project loading operation.
Encoding { get; set; }Gets or sets encoding which is used to read a project from HTML, MPX, XER and Primavera XML formats. The default encoding is UTF8.
ErrorHandler { get; set; }Gets or sets a callback method to handle xml parse errors.
Password { get; set; }Gets or sets a protection password.
PrimaveraReadOptions { get; set; }Gets or sets a specified instance of the PrimaveraReadOptions class which can be used to customize the behavior of loading Primavera formats (Primavera P6 XER or Primavera P6 Xml).

Examples

Shows how to load the password-protected project using <see cref=“Aspose.Tasks.LoadOptions”/> instance.

using (var stream = new FileStream(DataDir + "PasswordProtectedProject.mpp", FileMode.Open))
{
    var options = new LoadOptions
    {
        Password = "password"
    };
    var project = new Project(stream, options);
    Console.WriteLine(project.Get(Prj.Name));
}

See Also