XpsSignatureDefinition.SpotId Property

 

Gets or sets a unique identifier for this XpsSignatureDefinition.

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

public Nullable<Guid> SpotId { get; set; }

Property Value

Type: System.Nullable<Guid>

A (Nullable) Guid that represents the ID of the signature definition. The default value is null.

To link a Signature element to this XpsSignatureDefinition, you must set the Id attribute of the Signature to the value of the SpotId property. For more information about Signature elements, see the Open Packaging Conventions schema.

For more information about the SpotID attribute of the SignatureDefinition element in an XML Paper Specification (XPS) package, 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: