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

복사할 구성 요소입니다.

예제

다음 예제에서는 이벤트 로그를 만들고 이벤트 로그 구성 요소의 속성을 복사하는 클래스 MyInstallClassEventLogInstaller정의합니다. 또한 .와 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)

설명

설치 관리자는 라이브 구성 요소에서 사용할 수 있는 모든 정보를 가져와서 설치 시 사용하기 위해 저장해야 합니다.

적용 대상