Partager via


SignEventObject - Interface

Objet Event utilisé lors de l'événement OnSign.

Espace de noms :  Microsoft.Office.Interop.InfoPath.SemiTrust
Assembly :  Microsoft.Office.Interop.InfoPath.SemiTrust (dans Microsoft.Office.Interop.InfoPath.SemiTrust.dll)

Syntaxe

'Déclaration
<GuidAttribute("096cd71d-0786-11d1-95fa-0080c78ee3bb")> _
Public Interface SignEventObject _
    Inherits SignEvent, DocReturnEvent, DocEvent
'Utilisation
Dim instance As SignEventObject
[GuidAttribute("096cd71d-0786-11d1-95fa-0080c78ee3bb")]
public interface SignEventObject : SignEvent, 
    DocReturnEvent, DocEvent

Remarques

Ce type est le wrapper d’une coclasse requise par le code managé pour l’interopérabilité COM. Utilisez ce type pour accéder aux membres de l’interface COM implémentée par cette coclasse. Pour plus d’informations sur l’interface COM et pour accéder à un lien vers les descriptions de ses membres, voirSignEvent.

Utilisez la propriété SignedDataBlock de l'objet SignedDataBlockObject pour déterminer quel ensemble de données, pouvant être signé, déclenche l'événement OnSign. L'événement OnSign ne peut être personnalisé que pour un modèle de formulaire avec autorisation totale.

Exemples

Dans l'exemple suivant, l'objet SignEvent est utilisé pour ajouter une signature et un horodatage à un objet SignedDataBlockObject :

[InfoPathEventHandler(EventType=InfoPathEventType.OnSign)]
public void OnSign(SignEvent e)
{
    Signature signature = e.SignedDataBlock.Signatures.Create();
    signature.Sign();
    // Countersign the signature with a trusted timestamp.
    // Get the XML node storing the signature block.
    IXMLDOMNode oNodeSig = signature.SignatureBlockXmlNode;
    IXMLDOMNode oNodeSigValue = oNodeSig.selectSingleNode(".//*[local-name(.)=’signatureValue’]");
    // Get time stamp from timestamp service (fictitious).
    MyTrustedTimeStampingService s = new MyTrustedTimeStampingService();
    string strVerifiedTimeStamp = s.AddTimeStamp(oNodeSigValue.text);
 
    //Add the value returned from the timestamping service to the 
    //unsigned part of the signature block.
    IXMLDOMNode oNodeObj = oNodeSig.selectSingleNode(".//*[local-name(.)=’Object’]");
    IXMLDOMNode oNode = oNodeObj.cloneNode(false);
    oNode.text = strVerifiedTimeStamp;
    oNodeObj.parentNode.appendChild(oNode);
    e.ReturnStatus = true;
}

Voir aussi

Référence

SignEventObject - Membres

Microsoft.Office.Interop.InfoPath.SemiTrust - Espace de noms