다음을 통해 공유


ProvideCodeGeneratorAttribute 클래스

사용자 지정 도구를 제공하는 Visual Studio 확장에서 패키지 클래스에 특성을 적용합니다.

이 API는 CLS 규격이 아닙니다. 

상속 계층 구조

Object
  Attribute
    RegistrationAttribute
      Microsoft.VisualStudio.TextTemplating.VSHost.ProvideCodeGeneratorAttribute

네임스페이스:  Microsoft.VisualStudio.TextTemplating.VSHost
어셈블리:  Microsoft.VisualStudio.TextTemplating.VSHost.12.0(Microsoft.VisualStudio.TextTemplating.VSHost.12.0.dll)

구문

‘선언
<AttributeUsageAttribute(AttributeTargets.Class, AllowMultiple := True, Inherited := False)> _
<CLSCompliantAttribute(False)> _
Public NotInheritable Class ProvideCodeGeneratorAttribute _
    Inherits RegistrationAttribute
[AttributeUsageAttribute(AttributeTargets.Class, AllowMultiple = true, Inherited = false)]
[CLSCompliantAttribute(false)]
public sealed class ProvideCodeGeneratorAttribute : RegistrationAttribute
[AttributeUsageAttribute(AttributeTargets::Class, AllowMultiple = true, Inherited = false)]
[CLSCompliantAttribute(false)]
public ref class ProvideCodeGeneratorAttribute sealed : public RegistrationAttribute
[<Sealed>]
[<AttributeUsageAttribute(AttributeTargets.Class, AllowMultiple = true, Inherited = false)>]
[<CLSCompliantAttribute(false)>]
type ProvideCodeGeneratorAttribute =  
    class 
        inherit RegistrationAttribute 
    end
public final class ProvideCodeGeneratorAttribute extends RegistrationAttribute

ProvideCodeGeneratorAttribute 형식에서는 다음과 같은 멤버를 노출합니다.

생성자

  이름 설명
Public 메서드 ProvideCodeGeneratorAttribute

위쪽

속성

  이름 설명
Public 속성 Description 이 생성기에 대한 사람이 읽을 수 있는 설명입니다.
Public 속성 GeneratesDesignTimeSource true이면 이 코드 생성기는 디자인 타임 소스 코드를 제공합니다.
Public 속성 Name 이 생성기의 이름입니다.솔루션 탐색기에 이 생성자를 적용하려면 사용자 지정 도구 속성을 이름에 설정합니다.
Public 속성 ProjectSystem 이 코드 생성기가 등록된 프로젝트 시스템입니다.
Public 속성 RegisterCodeBase true이면 생성기가 코드베이스, 즉 특정 어셈블리 파일 위치를 사용하여 등록됩니다.false이면 어셈블리가 GAC에 있습니다.
Public 속성 Type 코드 생성기를 구현하는 형식입니다.
Public 속성 TypeId (RegistrationAttribute에서 상속됨)

위쪽

메서드

  이름 설명
Public 메서드 Equals 인프라입니다. 이 인스턴스가 지정된 개체와 같은지 여부를 나타내는 값을 반환합니다. (Attribute에서 상속됨)
Public 메서드 GetHashCode 이 인스턴스의 해시 코드를 반환합니다. (Attribute에서 상속됨)
Public 메서드 GetType 현재 인스턴스의 Type을 가져옵니다. (Object에서 상속됨)
Public 메서드 IsDefaultAttribute 파생 클래스에서 재정의된 경우 이 인스턴스의 값이 파생 클래스의 기본값인지 여부를 나타냅니다. (Attribute에서 상속됨)
Public 메서드 Match 파생 클래스에서 재정의된 경우 이 인스턴스가 지정된 개체와 같은지 여부를 나타내는 값을 반환합니다. (Attribute에서 상속됨)
Public 메서드 Register (RegistrationAttribute.Register(RegistrationContext)을(를) 재정의함)
Public 메서드 ToString 현재 개체를 나타내는 문자열을 반환합니다. (Object에서 상속됨)
Public 메서드 Unregister (RegistrationAttribute.Unregister(RegistrationContext)을(를) 재정의함)

위쪽

필드

  이름 설명
Public 필드정적 멤버 AspNetProjectGuid ASP.Net 프로젝트 시스템 패키지의 Guid입니다.
Public 필드정적 멤버 CSharpProjectGuid C# 프로젝트 시스템 패키지의 Guid입니다.
Public 필드정적 멤버 VisualBasicProjectGuid Visual Basic 프로젝트 시스템 패키지의 Guid입니다.

위쪽

명시적 인터페이스 구현

  이름 설명
명시적 인터페이스 구현Private 메서드 System#Runtime#InteropServices#_Attribute#GetIDsOfNames 이름 집합을 해당하는 디스패치 식별자 집합에 매핑합니다. (Attribute에서 상속됨)
명시적 인터페이스 구현Private 메서드 System#Runtime#InteropServices#_Attribute#GetTypeInfo 인터페이스의 형식 정보를 가져오는 데 사용할 수 있는 개체의 형식 정보를 검색합니다. (Attribute에서 상속됨)
명시적 인터페이스 구현Private 메서드 System#Runtime#InteropServices#_Attribute#GetTypeInfoCount 개체에서 제공하는 형식 정보 인터페이스의 수를 검색합니다(0 또는 1). (Attribute에서 상속됨)
명시적 인터페이스 구현Private 메서드 System#Runtime#InteropServices#_Attribute#Invoke 개체에서 노출하는 메서드와 속성에 대한 액세스를 제공합니다. (Attribute에서 상속됨)

위쪽

설명

이 특성은 Visual Studio 확장을 사용자 지정 도구로 등록합니다. 사용자가 이 특성을 가진 확장을 설치하면 솔루션 탐색기에서 이 기능을 사용하여 사용자 지정 도구 실행을 통해 파일을 생성할 수 있습니다.

이 특성은 단일 파일 생성기 등록에 설명된 등록 작업을 자동으로 수행합니다.

특성을 생성자 클래스가 아닌 패키지 클래스에 적용해야 합니다.

ProvideCodeGeneratorExtensionAttribute을 참조하십시오.

예제

[ProvideCodeGenerator(typeof(MyGenerator), "MyCustomTool", "My custom tool", true, ProjectSystem = ProvideCodeGeneratorAttribute.CSharpProjectGuid)]
internal sealed partial class MyPackage : Microsoft.VisualStudio.Shell
.Package
{ ... }
internal class MyGenerator : Microsoft.VisualStudio.Shell.Interop.IVsSingleFileGenerator
{ ... }

스레드로부터의 안전성

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

참고 항목

참조

Microsoft.VisualStudio.TextTemplating.VSHost 네임스페이스