次の方法で共有


SignEvent.ReturnStatus プロパティ

OnSign イベントのリターン状態を取得または設定します。

名前空間: Microsoft.Office.Interop.InfoPath
アセンブリ: Microsoft.Office.Interop.InfoPath (microsoft.office.interop.infopath.dll 内)

構文

'宣言
<DispIdAttribute(101)> _
Property ReturnStatus As Boolean
'使用
Dim instance As SignEvent
Dim value As Boolean

value = instance.ReturnStatus

instance.ReturnStatus = value
[DispIdAttribute(101)] 
bool ReturnStatus { get; set; }

コメント

SignEventObject オブジェクトの ReturnStatus プロパティが false に設定されている場合は、[デジタル署名ウィザード] ダイアログ ボックスが開き、ユーザーが閉じない限り表示されたままになります。

次の例では、ReturnStatus プロパティが OnSign イベント ハンドラで false に設定された場合、[デジタル署名ウィザード] が再び表示され、署名できるデータのセットに別の署名を追加できます。署名できるデータの最初のセットで 3 つの署名が既に存在する場合、ReturnStatus プロパティが true に設定されて OnSign イベント ハンドラが終了します。これにより、[デジタル署名ウィザード] が閉じ、警告が表示されます。

[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;
 }
}

関連項目

参照

SignEvent インターフェイス
SignEvent のメンバ
Microsoft.Office.Interop.InfoPath 名前空間