CodeProperty2 介面

定義原始程式檔中屬性建構的物件。

命名空間:  EnvDTE80
組件:  EnvDTE80 (在 EnvDTE80.dll 中)

語法

'宣告
<GuidAttribute("33770C02-21B7-4224-A577-6877BDBA60EA")> _
Public Interface CodeProperty2 _
    Inherits CodeProperty
[GuidAttribute("33770C02-21B7-4224-A577-6877BDBA60EA")]
public interface CodeProperty2 : CodeProperty
[GuidAttribute(L"33770C02-21B7-4224-A577-6877BDBA60EA")]
public interface class CodeProperty2 : CodeProperty
[<GuidAttribute("33770C02-21B7-4224-A577-6877BDBA60EA")>]
type CodeProperty2 =  
    interface
        interface CodeProperty
    end
public interface CodeProperty2 extends CodeProperty

CodeProperty2 型別會公開下列成員。

屬性

  名稱 說明
公用屬性 Access (繼承自 CodeProperty)。
公用屬性 Access 取得或設定這個項目的存取屬性。
公用屬性 Attributes (繼承自 CodeProperty)。
公用屬性 Attributes 取得父物件所有屬性的集合。
公用屬性 Children (繼承自 CodeProperty)。
公用屬性 Children 取得物件的集合,此集合包含在這個 CodeProperty2 物件中。
公用屬性 Collection (繼承自 CodeProperty)。
公用屬性 Collection 取得集合,此集合包含支援此屬性的 CodeProperty 物件。
公用屬性 Comment (繼承自 CodeProperty)。
公用屬性 Comment 取得或設定與此程式碼項目關聯的註解。
公用屬性 DocComment (繼承自 CodeProperty)。
公用屬性 DocComment 取得或設定目前程式碼模型元素的文件註解。
公用屬性 DTE (繼承自 CodeProperty)。
公用屬性 DTE 取得最上層的擴充性物件。
公用屬性 EndPoint (繼承自 CodeProperty)。
公用屬性 EndPoint 取得編輯點,此編輯點為程式碼項目結尾的位置。
公用屬性 Extender[String] (繼承自 CodeProperty)。
公用屬性 Extender[String] 取得要求的擴充項 (如果適用於這個物件)。
公用屬性 ExtenderCATID (繼承自 CodeProperty)。
公用屬性 ExtenderCATID 取得物件的擴充項分類 ID (CATID)。
公用屬性 ExtenderNames (繼承自 CodeProperty)。
公用屬性 ExtenderNames 取得物件的可用擴充項清單。
公用屬性 FullName (繼承自 CodeProperty)。
公用屬性 FullName 取得物件檔案的完整路徑和名稱。
公用屬性 Getter (繼承自 CodeProperty)。
公用屬性 Getter 取得或設定物件,用以定義程式碼以傳回某一屬性。
公用屬性 InfoLocation (繼承自 CodeProperty)。
公用屬性 InfoLocation 取得程式碼模型的功能。
公用屬性 IsCodeType (繼承自 CodeProperty)。
公用屬性 IsCodeType 取得值,指出是否可以從這個物件取得 CodeType 物件。
公用屬性 IsDefault 設定或取得是否為預設屬性。
公用屬性 IsGeneric 取得值,指出屬性是否為泛型。
公用屬性 IsShared 取得或設定屬性的共用狀態。
公用屬性 Kind (繼承自 CodeProperty)。
公用屬性 Kind 取得列舉型別,指出物件的型別。
公用屬性 Language (繼承自 CodeProperty)。
公用屬性 Language 取得程式語言,用以撰寫程式碼。
公用屬性 Name (繼承自 CodeProperty)。
公用屬性 Name 取得或設定物件的名稱。
公用屬性 OverrideKind 取得或設定屬性上的覆寫修飾詞。
公用屬性 Parameters 取得這個屬性所有參數的 CodeParameter2 物件。
公用屬性 Parent (繼承自 CodeProperty)。
公用屬性 Parent 取得 CodeProperty 物件的直接上層父物件。
公用屬性 Parent2 取得項目的父代。
公用屬性 ProjectItem (繼承自 CodeProperty)。
公用屬性 ProjectItem 取得與指定物件關聯的 ProjectItem
公用屬性 Prototype[Int32] (繼承自 CodeProperty)。
公用屬性 Prototype[Int32] 傳回具有這個物件 Stub 定義的字串。
公用屬性 ReadWrite 傳回屬性為可讀、可寫或可讀寫。
公用屬性 Setter (繼承自 CodeProperty)。
公用屬性 Setter 取得或設定物件,用以定義程式碼以設定屬性。
公用屬性 StartPoint (繼承自 CodeProperty)。
公用屬性 StartPoint 取得 TextPoint 物件,定義程式碼項目的開頭。
公用屬性 Type (繼承自 CodeProperty)。
公用屬性 Type 取得或設定物件,代表程式設計的類型。

回頁首

方法

  名稱 說明
公用方法 AddAttribute(String, String, Object) (繼承自 CodeProperty)。
公用方法 AddAttribute(String, String, Object) 建立新的屬性程式碼建構,並在正確位置插入程式碼。
公用方法 AddParameter 將參數加入至屬性定義。
公用方法 GetEndPoint(vsCMPart) (繼承自 CodeProperty)。
公用方法 GetEndPoint(vsCMPart) TextPoint 物件,用以標示程式碼項目定義的結尾。
公用方法 GetStartPoint(vsCMPart) (繼承自 CodeProperty)。
公用方法 GetStartPoint(vsCMPart) TextPoint 物件,用以定義程式碼項目定義的開頭。
公用方法 RemoveParameter 從屬性的簽章中移除參數。

回頁首

備註

CodeProperty2 物件代表一項屬性,並決定如何以不同語言定義屬性。 例如,Visual Basic 有兩項個別函式,一項是用來取得值,另一項是用來放置這個值。 兩者共同形成一項屬性。 而在 Visual C# 中則是,只要一個宣告形式就可宣告屬性,並且宣告它同時擁有 getter 和 setter。

注意事項注意事項

在特定類型的編輯之後,程式碼模型項目 (例如類別、結構、函式、屬性、委派等) 的值可能不具決定性,表示其值不一定維持相同。 如需詳細資訊,請參閱使用程式碼模型探索程式碼 (Visual Basic) 的<程式碼模型項目值可以變更>一節。

請參閱

參考

EnvDTE80 命名空間

其他資源

HOW TO:編譯和執行 Automation 物件模型程式碼範例

使用程式碼模型探索程式碼 (Visual Basic)

使用程式碼模型探索程式碼 (Visual C#)