Bagikan melalui


XpsSignatureDefinition.Intent Properti

Definisi

Mendapatkan atau menetapkan nilai string dari perjanjian niat tanda tangan yang ditandatangani oleh penanda tangan.

public:
 property System::String ^ Intent { System::String ^ get(); void set(System::String ^ value); };
public string Intent { get; set; }
member this.Intent : string with get, set
Public Property Intent As String

Nilai Properti

String yang mewakili perjanjian niat; misalnya, "Saya telah membaca dan menyetujui." Nilai defaultnya adalah null.

Contoh

Contoh berikut menunjukkan cara mengatur properti ini.


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

Keterangan

Untuk informasi selengkapnya tentang Intent elemen definisi tanda tangan dalam paket Spesifikasi Kertas XML (XPS), lihat bab 10 dalam spesifikasi Spesifikasi Kertas XML (XPS), yang dapat Anda peroleh di XPS: Spesifikasi dan Unduhan Lisensi.

Berlaku untuk