ComponentInstaller.CopyFromComponent(IComponent) 메서드

정의

파생 클래스에서 재정의한 경우 설치 시 필요한 모든 속성을 지정한 구성 요소에서 복사합니다.

public:
 abstract void CopyFromComponent(System::ComponentModel::IComponent ^ component);
public abstract void CopyFromComponent (System.ComponentModel.IComponent component);
abstract member CopyFromComponent : System.ComponentModel.IComponent -> unit
Public MustOverride Sub CopyFromComponent (component As IComponent)

매개 변수

component
IComponent

복사할 구성 요소 입니다.

예제

다음 예제에서는 클래스를 정의 MyInstallClass이벤트 로그를 작성 하 고 복사 로그 이벤트의 속성에 구성 요소는 EventLogInstaller합니다. 또한 확인 여부를 ServiceInstaller 동일한 종류의로 설치를 수행할 수는 EventLogInstaller합니다.

EventLogInstaller^ myEventLogInstaller = gcnew EventLogInstaller;
// Create a source for the specified event log, on local computer.
EventLog::CreateEventSource( "MyEventSource", "MyEventLog", "." );
// Create an event log instance and associate it with the log .
EventLog^ myEventLog = gcnew EventLog( "MyEventLog",".","MyEventSource" );
// Copy the properties that are required at install time from
// the event log component to the installer.
myEventLogInstaller->CopyFromComponent( myEventLog );
EventLogInstaller myEventLogInstaller = new EventLogInstaller();
// Create a source for the specified event log, on local computer.
EventLog.CreateEventSource("MyEventSource","MyEventLog", ".");
// Create an event log instance and associate it with the log .
EventLog myEventLog = new EventLog("MyEventLog", ".", "MyEventSource");
// Copy the properties that are required at install time from
// the event log component to the installer.
myEventLogInstaller.CopyFromComponent(myEventLog);
Dim myEventLogInstaller As New EventLogInstaller()
' Create a source for the specified event log, on local computer.
EventLog.CreateEventSource("MyEventSource", "MyEventLog", ".")
' Create an event log instance and associate it with the log .
Dim myEventLog As New EventLog("MyEventLog", ".", "MyEventSource")
' Copy the properties that are required at install time from
' the event log component to the installer.
myEventLogInstaller.CopyFromComponent(myEventLog)

설명

설치 관리자는 라이브 구성 요소에서 가능한 모든 정보를 사용 하 고 설치 중에 사용할 수 있도록 저장 해야 합니다.

적용 대상