XpsSignatureDefinition.SpotId Vlastnost

Definice

Získá nebo nastaví jedinečný identifikátor pro tento XpsSignatureDefinition.

public:
 property Nullable<Guid> SpotId { Nullable<Guid> get(); void set(Nullable<Guid> value); };
public Guid? SpotId { get; set; }
member this.SpotId : Nullable<Guid> with get, set
Public Property SpotId As Nullable(Of Guid)

Hodnota vlastnosti

Nullable<Guid>

A (Nullable), Guid která představuje ID definice podpisu. Výchozí hodnota je null.

Příklady

Následující příklad ukazuje, jak nastavit tuto vlastnost.


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();
    }
}

Private Sub SignatureDefinitionCommandHandler(sender As Object, e As RoutedEventArgs)
    Using sigDefDialog As New SignatureDefinition()
        If sigDefDialog.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
            Dim signatureDefinition As New XpsSignatureDefinition With {
                .RequestedSigner = sigDefDialog.RequestedSigner.Text,
                .Intent = sigDefDialog.Intent.Text,
                .SigningLocale = sigDefDialog.SigningLocale.Text
            }
            Try
                signatureDefinition.SignBy = Date.Parse(sigDefDialog.SignBy.Text)
            Catch e1 As FormatException
            End Try
            signatureDefinition.SpotId = Guid.NewGuid()
            Dim docSeq As IXpsFixedDocumentSequenceReader = _xpsDocument.FixedDocumentSequenceReader '_xpsDocument is type System.Windows.Xps.Packaging.XpsDocument
            Dim doc As IXpsFixedDocumentReader = docSeq.FixedDocuments(0)
            doc.AddSignatureDefinition(signatureDefinition)
            doc.CommitSignatureDefinition()
            InitializeSignatureDisplay()
        End If
    End Using
End Sub

Poznámky

Chcete-li propojit prvek Signature s tímto XpsSignatureDefinition, je nutné nastavit Id atribut Signature na hodnotu SpotId vlastnosti. Další informace o Signature prvcích najdete ve schématu Open Packaging Conventions .

Další informace o SpotID atributu SignatureDefinition prvku v balíčku XPS (XML Paper Specification) naleznete v kapitole 10 ve specifikaci XML Paper Specification (XPS), kterou můžete získat v XPS: Specifikace a stažení licencí.

Platí pro