Share via


SignEvent.ReturnStatus property

Gets or sets the return status of the OnSign event.

Namespace:  Microsoft.Office.Interop.InfoPath
Assembly:  Microsoft.Office.Interop.InfoPath (in Microsoft.Office.Interop.InfoPath.dll)

Syntax

'Declaration
Property ReturnStatus As Boolean
    Get
    Set
'Usage
Dim instance As SignEvent
Dim value As Boolean

value = instance.ReturnStatus

instance.ReturnStatus = value
bool ReturnStatus { get; set; }

Property value

Type: System.Boolean

Implements

DocReturnEvent.ReturnStatus

Remarks

If the ReturnStatus property of the SignEventObject object is set to false, the Digital Signature Wizard dialog will be displayed until the user exits the dialog.

Examples

In the following example, if the ReturnStatus property is set to false in the OnSign event handler, then the Digital Signatures Wizard will be displayed again to add another signature to the set of data which can be signed. For the first set of data which can be signed, if three signatures already exist, the , the OnSign event handler will exit with the ReturnStatus property set to true, which closes the Digital Signatures Wizard and displays an alert:

[InfoPathEventHandler(EventType=InfoPathEventType.OnSign)]
public void OnSign(SignEvent e)
{
 Signature thisSignature = e.SignedDataBlock.Signatures.Create();

 // check if the current signed data block is the first signed data block in list
 // if it is the first signed data block, then do special handling
 // else use the default handler (triggered by e.ReturnStatus = false)

 if ( e.SignedDataBlock.Name == thisXDocument.SignedDataBlocks[0].Name )
 {
  // check the number of signatures in the first signed data block
  // if there are three signatures, don’t add another signature  and set ReturnStatus to true)
  // else add the signature (use the Sign() method to show the wizard) and don’t do anything else (ReturnStatus is true)
  if ( thisXDocument.SignedDataBlocks[0].Signatures.Count > 3 )
  {
   thisXDocument.UI.Alert("Only 3 signatures are allowed on this set of data : " + e.SignedDataBlock.Name );
   e.ReturnStatus = true;
  }
  else
  {
   thisSignature.Sign();
   e.ReturnStatus = true;
  }
 }
 else
 {
  e.ReturnStatus = false;
 }
}

See also

Reference

SignEvent interface

SignEvent members

ReturnStatus overload

Microsoft.Office.Interop.InfoPath namespace