SigningLocale Property
Collapse the table of content
Expand the table of content

XpsSignatureDefinition.SigningLocale Property

 

Gets or sets the legal jurisdiction where the package is signed.

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

public string SigningLocale { get; set; }

Property Value

Type: System.String

A String that represents the jurisdiction, for example, "State of Utah, United States." The default value is null.

This property corresponds to the SigningLocation element of signature definitions in XML Paper Specification (XPS) packages. Notice the difference in the names.

The original producer of the XML Paper Specification (XPS) package can set this property. Optionally, the signer can set the property at the time of signing the package if no one else has already signed.

For more information about the SigningLocation element, 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:
© 2016 Microsoft