XpsSignatureDefinition.SignBy プロパティ

定義

署名を要求されている署名者が指定されたドキュメントの部分に署名する必要がある期限の日時を取得または設定します。Gets or sets the date and time by which the requested signer must sign the parts of the specified document.

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

プロパティ値

Nullable<DateTime>

署名者がパッケージに署名する必要がある期限を表す (Nullable) DateTimeA (Nullable) DateTime that represents the deadline by which the signer must sign the package. 既定値は null です。The default value is null.

このプロパティを設定する方法を次の例に示します。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();
    }
}


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

注釈

SignByパッケージ内の署名定義の要素の詳細については、 XML Paper Specification (XPS)XML Paper Specification (XPS)XPSXPS XPS: 仕様」と「ライセンスダウンロード」を参照してください。For more information about the SignBy element of signature definitions in XML Paper Specification (XPS)XML Paper Specification (XPS) packages, see the XPSXPS specification, which you can obtain at XPS: Specification and License Downloads.

適用対象