Share via


SubmitToHostConnection 클래스

호스팅 환경에 데이터를 전송하는 연결을 나타냅니다.

상속 계층 구조

System.Object
  Microsoft.Office.InfoPath.DataConnection
    Microsoft.Office.InfoPath.SubmitToHostConnection

네임스페이스:  Microsoft.Office.InfoPath
어셈블리:  Microsoft.Office.InfoPath(Microsoft.Office.InfoPath.dll)

구문

‘선언
Public MustInherit Class SubmitToHostConnection _
    Inherits DataConnection
‘사용 방법
Dim instance As SubmitToHostConnection
public abstract class SubmitToHostConnection : DataConnection

주의

이 연결 형식은 InfoPath 양식 편집 환경을 컨트롤로 호스팅하는 응용 프로그램에서 열린 양식 서식 파일에서 사용됩니다. 호스트 응용 프로그램 코드에 양식을 전송하는 이벤트를 처리하는 메서드를 만드는 방법에 대한 정보를 비롯하여 InfoPath를 컨트롤로 호스팅하는 방법에 대한 자세한 내용은 MSDN의 InfoPath Developer Portal (영문)에 있는 "사용자 지정 WinForm 응용 프로그램에서 InfoPath 양식 편집 환경 호스팅" 문서를 참조하십시오.

양식 서식 파일의 비즈니스 논리에서 참조할 수 있는 데이터를 호스팅 환경에 전송하는 데이터 연결을 만들려면 리본 메뉴의 데이터 탭에서 데이터 연결 명령을 사용합니다. Submit 이벤트가 발생했을 때 실행할 이벤트 처리기를 만드는 방법은 방법: 이벤트 처리기 추가를 참조하십시오.

다음 예제에서는 양식을 전송하기 전에 양식 서식 파일의 비즈니스 논리에서 사용자 지정 작업을 수행하는 코드의 작성 패턴을 보여 줍니다.

public void FormEvents_Submit(object sender, SubmitEventArgs e)
{
   // Get the data connection defined in the form template from the 
   // DataConnections collection and cast to the SubmitToHostConnection
   // type.
   SubmitToHostConnection submitConnection = 
      (SubmitToHostConnection)(DataConnections["MyHostConnection"]);

   // Write code here to do custom actions that are not 
   // supported by rules or other declarative settings.  

   // Execute the submit operation against the connection.
   submitConnection.Execute();

}

Public Sub FormEvents_Submit(ByVal sender As Object, _
   ByVal e As SubmitEventArg)
   ' Get the data connection defined in the form template from the
   ' DataConnections collection and cast to the SubmitToHostConnection
   ' type.
   Dim submitConnection As SubmitToHostConnection = _
      DirectCast(DataConnections("MyHostConnection"), _
      SubmitToHostConnection)

   ' Write code here to do custom actions that are not 
   ' supported by rules or other declarative settings.

   ' Execute the submit operation against the connection.
   submitConnection.Execute()
End Sub

스레드 보안

이 형식의 모든 공용 static (Visual Basic의Shared ) 멤버는 스레드로부터 안전합니다. 모든 인스턴스 멤버는 스레드로부터 안전하지 않을 수도 있습니다.

참고 항목

참조

SubmitToHostConnection 멤버

Microsoft.Office.InfoPath 네임스페이스