_XDocumentEventSink2_Event.OnSign 事件

定义

在通过“数字签名”向导选定一组已签名数据用于签名之后发生。

public:
 event Microsoft::Office::Interop::InfoPath::SemiTrust::_XDocumentEventSink2_OnSignEventHandler ^ OnSign;
event Microsoft.Office.Interop.InfoPath.SemiTrust._XDocumentEventSink2_OnSignEventHandler OnSign;
member this.OnSign : Microsoft.Office.Interop.InfoPath.SemiTrust._XDocumentEventSink2_OnSignEventHandler 
Event OnSign As _XDocumentEventSink2_OnSignEventHandler 

事件类型

示例

在以下示例中,通过使用 对象的 方法,通过从 InfoPath 设计器用户界面的“工具”菜单中选择“编程”将 OnSign 事件添加到表单而创建的示例中,将使用 Sign() 对象的 方法 SignatureObject 将数字签名添加到表单:

public void <span class="label">OnSign</span>(SignEvent e)
{
// The OnSign handler can be customized only in fully trusted form templates.
Signature thisSignature = e.SignedDataBlock.Signatures.Create();

// You can add other pieces of information to sign by modifying the signature
// template in thisSignature.SignatureBlockXmlNode.
thisSignature.Sign();
e.ReturnStatus = true;
}

在以下示例中,通过使用 对象的 方法,通过从 InfoPath 设计器用户界面的“工具”菜单中选择“编程”将 OnSign 事件添加到表单而创建的示例中,将使用 Sign() 对象的 方法 SignatureObject 将数字签名添加到表单:

public void <span class="label">OnSign</span>(SignEvent e)
{
// The OnSign handler can be customized only in fully trusted form templates.
Signature thisSignature = e.SignedDataBlock.Signatures.Create();

// You can add other pieces of information to sign by modifying the signature
// template in thisSignature.SignatureBlockXmlNode.
thisSignature.Sign();
e.ReturnStatus = true;
}

注解

可以使用 OnSign 事件将其他数据添加到数字签名中。 例如,可以添加受信任时间戳服务器中的数据,也可以添加事务的服务器端副署。 如果当前用户不是特定组的成员,还可以使用 OnSign 事件阻止签名。

适用于