EncodingHelper 類別

公用程式類別,會從檔案的位元組順序標記取得檔案的編碼方式。

繼承階層架構

System.Object
  Microsoft.VisualStudio.TextTemplating.EncodingHelper

命名空間:  Microsoft.VisualStudio.TextTemplating
組件:  Microsoft.VisualStudio.TextTemplating.10.0 (在 Microsoft.VisualStudio.TextTemplating.10.0.dll 中)

語法

'宣告
Public NotInheritable Class EncodingHelper
public static class EncodingHelper
public ref class EncodingHelper abstract sealed
[<AbstractClass>]
[<Sealed>]
type EncodingHelper =  class end
public final class EncodingHelper

EncodingHelper 型別會公開下列成員。

方法

  名稱 說明
公用方法靜態成員 GetEncoding 從指定之檔案的位元組順序標記判斷該檔案的編碼方式。

回頁首

備註

當使用者建立文字範本時,他們可以指定想要讓文字範本主應用程式用來建立產生之文字的編碼方式。 如果使用者不指定編碼方式,主機可以嘗試呼叫這個方法來決定文字範本的編碼方式。 接著主機可以使用同樣的編碼方式建立產生的文字。

執行緒安全

這個型別的任何 Public static (在 Visual Basic 中為 Shared) 成員都具備執行緒安全。並非所有的執行個體成員都是安全執行緒。

請參閱

參考

Microsoft.VisualStudio.TextTemplating 命名空間

其他資源

位元組順序標記

程式碼產生和 T4 文字範本

How to: Specify File Output Types in Text Templates

T4 文字範本指示詞