Compartir a través de


Interfaz SignEventObject

Objeto de evento que se utiliza durante el evento OnSign.

Espacio de nombres:  Microsoft.Office.Interop.InfoPath.SemiTrust
Ensamblado:  Microsoft.Office.Interop.InfoPath.SemiTrust (en Microsoft.Office.Interop.InfoPath.SemiTrust.dll)

Sintaxis

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

Comentarios

Este tipo es un contenedor para una coclase que requiere el código administrado para la interoperabilidad con COM. Use este tipo para acceder a los miembros de la interfaz COM que implementa esta coclase. Encontrará información sobre la interfaz COM, así como vínculos a las descripciones de sus miembros, enSignEvent.

Utilice la propiedad SignedDataBlock del objeto SignedDataBlockObject para determinar qué conjunto de datos, que se puede firmar, está desencadenando el evento OnSign. Es posible personalizar el evento OnSign sólo para una plantilla de formulario de plena confianza.

Ejemplos

En el siguiente ejemplo, se usa el objeto SignEvent para agregar una firma y marca de tiempo a un objeto 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;
}

Vea también

Referencia

Miembros SignEventObject

Espacio de nombres Microsoft.Office.Interop.InfoPath.SemiTrust