ModelBusEnabledTextTransformation 클래스

텍스트 템플릿의 코드에서 Visual Studio ModelBus에 액세스하려면 템플릿에 대한 template 지시문의 inherits 특성에 이 클래스를 지정하고 hostspecific 특성을 true로 설정합니다. 템플릿 코드에서 SModelBus 및 SComponentModel 서비스를 가져올 수 있습니다.

상속 계층 구조

System.Object
  Microsoft.VisualStudio.TextTemplating.TextTransformation
    Microsoft.VisualStudio.TextTemplating.VSHost.ModelingTextTransformation
      Microsoft.VisualStudio.TextTemplating.Modeling.ModelBusEnabledTextTransformation

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

구문

‘선언
Public MustInherit Class ModelBusEnabledTextTransformation _
    Inherits ModelingTextTransformation
public abstract class ModelBusEnabledTextTransformation : ModelingTextTransformation
public ref class ModelBusEnabledTextTransformation abstract : public ModelingTextTransformation
[<AbstractClass>]
type ModelBusEnabledTextTransformation =  
    class
        inherit ModelingTextTransformation
    end
public abstract class ModelBusEnabledTextTransformation extends ModelingTextTransformation

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

생성자

  이름 설명
Protected 메서드 ModelBusEnabledTextTransformation

위쪽

속성

  이름 설명
Public 속성 CurrentIndent 생성된 텍스트 출력의 각 줄 맨 앞에 추가되는 현재 들여쓰기 텍스트를 가져옵니다. (TextTransformation에서 상속됨)
Public 속성 Errors 인프라입니다. 텍스트 템플릿 변환 프로세스에 대한 오류 컬렉션을 가져옵니다. (TextTransformation에서 상속됨)
Protected 속성 GenerationEnvironment 텍스트 템플릿 변환 프로세스가 생성된 텍스트 출력을 어셈블하는 데 사용하는 문자열을 가져오거나 설정합니다. (TextTransformation에서 상속됨)
Protected 속성 ModelBus 이 기본 클래스가 제공하는 Visual Studio ModelBus 서비스를 가져옵니다.
Protected 속성 ServiceProvider Visual Studio ModelBus를 포함하는 서비스 공급자를 반환합니다.호스트에서 서비스 공급자를 사용하지 마십시오. (ModelingTextTransformation.ServiceProvider을(를) 재정의함)
Public 속성 Session (ModelingTextTransformation에서 상속됨)
Protected 속성 SkipValidation true인 경우 ValidateStore()는 유효성 검사를 실행하지 않고 false를 반환합니다.기본값은 false입니다. (ModelingTextTransformation에서 상속됨)
Protected 속성 Store 모델링 저장소를 가져옵니다. (ModelingTextTransformation에서 상속됨)

위쪽

메서드

  이름 설명
Protected 메서드 AddDomainModel 저장소에서 로드할 도메인 모델 형식을 추가합니다.Initialize()를 호출하기 전에 각 도메인 모델에 대해 이 메서드를 호출합니다. (ModelingTextTransformation에서 상속됨)
Public 메서드 ClearIndent CurrentIndent 를 빈 문자열로 다시 설정합니다. (TextTransformation에서 상속됨)
Public 메서드 Dispose() TextTransformation 에서 사용하는 모든 리소스를 해제합니다. (TextTransformation에서 상속됨)
Protected 메서드 Dispose(Boolean) (ModelingTextTransformation에서 상속됨)
Public 메서드 Equals 지정한 Object가 현재 Object와 같은지 여부를 확인합니다. (Object에서 상속됨)
Public 메서드 Error 텍스트 템플릿 변환 프로세스 중에 발생하는 오류에 대한 정보를 저장할 새 오류를 만듭니다. (TextTransformation에서 상속됨)
Protected 메서드 Finalize 가비지 수집기가 회수하기 전에 Object가 리소스를 해제하고 다른 정리 작업을 수행할 수 있게 합니다.가비지 수집기에 의해 호출됩니다. (TextTransformation에서 상속됨)
Public 메서드 GetHashCode 특정 형식에 대한 해시 함수 역할을 합니다. (Object에서 상속됨)
Public 메서드 GetType 현재 인스턴스의 Type을 가져옵니다. (Object에서 상속됨)
Public 메서드 Initialize AddModel()을 사용하여 지정한 모델을 로드하고 호스트에서 템플릿을 처리할 수 있도록 준비합니다. (ModelingTextTransformation에서 상속됨)
Protected 메서드 MemberwiseClone 현재 Object의 단순 복사본을 만듭니다. (Object에서 상속됨)
Protected 메서드 OnSessionChanged 제공된 세션이 마지막으로 기억된 세션과 다를 때마다 호출됩니다.읽을 모델 파일의 새 스냅숏을 준비하기 위해 정적 modelbus 인스턴스를 지웁니다. (ModelingTextTransformation.OnSessionChanged(ITextTemplatingSession, ITextTemplatingSession)을(를) 재정의함)
Public 메서드 PopIndent CurrentIndent 에서 가장 최근에 추가된 텍스트를 제거합니다. (TextTransformation에서 상속됨)
Public 메서드 PushIndent 생성된 텍스트 출력의 각 줄 맨 앞에 추가되는 CurrentIndent에 텍스트를 추가합니다. (TextTransformation에서 상속됨)
Protected 메서드 ReportError ModelBus 오류에서 텍스트 템플릿 오류로 변환합니다.범주 값에 따라 이 오류 또는 경고를 호출합니다.
Public 메서드 ToString 현재 개체를 나타내는 문자열을 반환합니다. (Object에서 상속됨)
Public 메서드 TransformText 파생 클래스에서 재정의되는 경우 변환의 텍스트 출력을 생성합니다. (TextTransformation에서 상속됨)
Protected 메서드 ValidateStore 지정된 유효성 검사 범주를 사용하여 저장소의 유효성을 검사합니다.오류가 있으면 true를 반환합니다. (ModelingTextTransformation에서 상속됨)
Public 메서드 Warning 텍스트 템플릿 변환 프로세스 중에 발생하는 오류에 대한 정보를 저장할 새 경고를 만듭니다. (TextTransformation에서 상속됨)
Public 메서드 Write(String) 지정된 문자열의 복사본을 생성된 텍스트 출력에 추가합니다. (TextTransformation에서 상속됨)
Public 메서드 Write(String, array<Object[]) 0개 이상의 서식 사양을 포함하는 서식 지정 문자열을 생성된 텍스트 출력에 추가합니다.각 서식 사양은 해당 개체 인수의 문자열 표현으로 바뀝니다. (TextTransformation에서 상속됨)
Public 메서드 WriteLine(String) 지정된 문자열과 기본 줄 종결자의 복사본을 생성된 텍스트 출력에 추가합니다. (TextTransformation에서 상속됨)
Public 메서드 WriteLine(String, array<Object[]) 0개 이상의 서식 사양을 포함하는 서식 지정 문자열과 기본 줄 종결자를 생성된 텍스트 출력에 추가합니다.각 서식 사양은 해당 개체 인수의 문자열 표현으로 바뀝니다. (TextTransformation에서 상속됨)

위쪽

설명

템플릿에서 이 텍스트 변환을 사용하려면 template 지시문에서 hostspecific 특성을 true로 설정해야 합니다.

예제

<#@ template debug="false" hostspecific="true" language="C#" inherits="Microsoft.VisualStudio.TextTemplating.Modeling.ModelBusEnabledTextTransformation" #>
<#@ assembly name="Microsoft.VisualStudio.TextTemplating.Modeling.10.0.dll" #>
<#@ assembly name="Microsoft.VisualStudio.Modeling.Sdk.Integration.10.0.dll" #>
<#@ import namespace="Microsoft.VisualStudio.Modeling.Integration" #>
<#@ output extension=".txt" #>
<# IModelBus modelbus = this.ServiceProvider.GetService(typeof(SModelBus)) as IModelBus; 
...
#>

스레드로부터의 안전성

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

참고 항목

참조

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