SignEvent.ReturnStatus Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets the return status of the OnSign event.
public:
property bool ReturnStatus { bool get(); void set(bool value); };
public bool ReturnStatus { get; set; }
member this.ReturnStatus : bool with get, set
Public Property ReturnStatus As Boolean
Property Value
Implements
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.<span class="label">ReturnStatus</span> = true;
}
else
{
thisSignature.Sign();
e.<span class="label">ReturnStatus</span> = true;
}
}
else
{
e.<span class="label">ReturnStatus</span> = false;
}
}
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.