XpsSignatureDefinition.Intent Property

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Gets or sets the string value of the signature intention agreement that the signer is signing against.

Namespace:   System.Windows.Xps.Packaging
Assembly:  ReachFramework (in ReachFramework.dll)

public string Intent { get; set; }

Property Value

Type: System.String

A String that represents the intention agreement; for example, "I have read and agree." The default value is null.

For more information about the Intent element of signature definitions in XML Paper Specification (XPS) packages, see chapter 10 in the XML Paper Specification (XPS) specification, which you can obtain at XPS: Specification and License Downloads.

The following example shows how to set this property.


private void SignatureDefinitionCommandHandler(object sender, RoutedEventArgs e)
{
    SignatureDefinition sigDefDialog = new SignatureDefinition();
    if (sigDefDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
    {
        XpsSignatureDefinition signatureDefinition = new XpsSignatureDefinition();
        signatureDefinition.RequestedSigner = sigDefDialog.RequestedSigner.Text;
        signatureDefinition.Intent = sigDefDialog.Intent.Text;
        signatureDefinition.SigningLocale = sigDefDialog.SigningLocale.Text;
        try
        {
            signatureDefinition.SignBy = DateTime.Parse(sigDefDialog.SignBy.Text);
        }
        catch (FormatException)
        {
        }
        signatureDefinition.SpotId = Guid.NewGuid();
        IXpsFixedDocumentSequenceReader docSeq = _xpsDocument.FixedDocumentSequenceReader; //_xpsDocument is type System.Windows.Xps.Packaging.XpsDocument
        IXpsFixedDocumentReader doc = docSeq.FixedDocuments[0];
        doc.AddSignatureDefinition(signatureDefinition);
        doc.CommitSignatureDefinition();
        InitializeSignatureDisplay();
    }
}

.NET Framework
Available since 3.0
Return to top
Show: