共用方式為


XpsSignatureDefinition.RequestedSigner 屬性

定義

取得或設定人員的識別,該人員要求簽署 (或已經簽署) 套件。

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

屬性值

String 表示簽署者,例如「Mary Jones, Marketing Dept」。預設值為 null

範例

下列範例將示範如何設定這個屬性。


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

備註

這個屬性會對應至 SignerName XML 紙張規格 (XPS) 套件中的 專案屬性 SignatureDefinition 。 請注意名稱的差異。

如需屬性的詳細資訊 SignerName ,請參閱 XML 紙張規格的第 10 章, (XPS) 規格,您可以在 XPS:規格和授權下載取得。

適用於