Share via


ProvideObjectAttribute 클래스

정의

VSPackage가 인터페이스에서 만들 수 있는 개체를 제공한다는 것을 Visual Studio에 ILocalRegistry알릴 수 있습니다. 이 클래스는 상속될 수 없습니다.

public ref class ProvideObjectAttribute sealed : Microsoft::VisualStudio::Shell::RegistrationAttribute
public ref class ProvideObjectAttribute sealed : Microsoft::VisualStudio::Shell::RegistrationAttribute
[System.AttributeUsage(System.AttributeTargets.Class, AllowMultiple=true, Inherited=true)]
public sealed class ProvideObjectAttribute : Microsoft.VisualStudio.Shell.RegistrationAttribute
[<System.AttributeUsage(System.AttributeTargets.Class, AllowMultiple=true, Inherited=true)>]
type ProvideObjectAttribute = class
    inherit RegistrationAttribute
Public NotInheritable Class ProvideObjectAttribute
Inherits RegistrationAttribute
상속
ProvideObjectAttribute
특성

예제

관리되는 샘플에서 클래스의 ProvideObjectAttribute 구현을 찾을 수 있습니다. 이 및 자동 등록에 사용되는 다른 모든 특성의 표준 위치는 샘플에 사용되는 언어에 따라 VsPkg.cs, VsPkg.vb 또는 VsPkg.cpp 클래스의 Microsoft.VisualStudio.Package 구현과 인접합니다.

설명

호출 시기

인터페이스에서 ProvideObjectAttribute 만들 수 있는 개체를 Microsoft.VisualStudio.Package제공하는 경우 -derived 클래스에 ILocalRegistry특성을 적용합니다.

기본 사용

클래스는 ProvideObjectAttribute 인터페이스에서 만들 수 있는 개체를 제공하는 Visual Studio에 ILocalRegistry알릴 수 있습니다. 레지스트리의 HKEY_CLASSES_ROOT\CLSID 섹션에서 개체를 전역적으로 등록하는 대신 항상 이 특성을 사용합니다. 를 ProvideObjectAttribute사용하여 파생 클래스 또는 를 구현하는 클래스를 수정 Microsoft.VisualStudio.Package합니다 IVsPackage.

이 특성 클래스는 regpkg.exe 같은 외부 등록 도구에 대한 데이터를 제공하는 데만 사용됩니다. VSPackage의 런타임 동작에는 영향을 주지 않습니다. 자세한 내용은 VSPackage 등록을 참조하세요.

참고

C#은 모든 특성 클래스의 이름에 "Attribute"라는 단어를 자동으로 추가합니다. C# 코드에서 이 특성을 로 참조합니다 ProvideObject.

레지스트리 항목

  • 클래스에서 만든 ProvideObjectAttribute 레지스트리 항목은 다음과 같습니다.

  • <VSROOT>\CLSID\{ObjectGuid}

  • <VSROOT>\CLSID\{ObjectGuid}\@=ObjectType.FullName

  • <VSROOT>\CLSID\{ObjectGuid}\InprocServer32=mscoree.dll

  • <VSROOT>\CLSID\{ObjectGuid}\Class=ObjectType.FullName

  • <VSROOT>\CLSID\{ObjectGuid}\Assembly=ObjectType.Assembly.FullName

  • <VSROOT>\CLSID\{ObjectGuid}\ThreadingModel=Both

  • <VSROOT>\CLSID\{PackageGuid}\CodeBase=context. Codebase

생성자

ProvideObjectAttribute(Type)

이 생성자는 지정된 개체 형식의 새 ProvideObjectAttribute 개체를 만듭니다.

속성

ObjectType

ObjectType 속성은 생성자에 설정된 개체 형식을 반환합니다.

RegisterUsing

레지스트리에서 Codebase 항목 또는 어셈블리 항목을 지정하는 중에서 선택합니다. 등록하는 동안 재정의할 수 있습니다.

TypeId

RegistrationAttribute 파생 클래스가 System.ComponentModel.TypeDescriptor.GetAttributes(...)에서 작동하도록 하려면 TypeID 속성을 재정의합니다. 이 속성에서 파생된 특성은 클래스에 적용할 수 있는 인스턴스에 대한 더 나은 제어가 필요한 경우에만 이 속성을 재정의해야 합니다.

(다음에서 상속됨 RegistrationAttribute)

메서드

GetPackageRegKeyPath(Guid)

VSPackage의 레지스트리 경로(애플리케이션의 레지스트리 루트를 기준으로)를 가져옵니다.

(다음에서 상속됨 RegistrationAttribute)
Register(RegistrationAttribute+RegistrationContext)

regpkg.exe 같은 외부 등록 도구에서 호출할 때 VSPackage에 대한 등록 정보를 제공합니다. 자세한 내용은 VSPackage 등록을 참조하세요.

Unregister(RegistrationAttribute+RegistrationContext)

이 특성을 등록 취소합니다.

적용 대상