Share via


GraphPathSerializationDictionary 類別

CommonPaths 可讓您重新對應在 DGML 中的某些屬性值。

例如,檔案路徑最好是相對於方案,如此一來,當方案移動時,還是可以找到該檔案。 要解決這個問題,您可以定義名為 "SolutionDir"的路徑並具有完整路徑值。 然後,只要在使用 "$(name)" 語法的 DGML 中找到它,GraphSerializer 就會取代這個路徑,其中 name 是您提供的路徑識別碼,且它會寫出檔案結尾的路徑區塊中所使用的路徑的定義。 當載入此 DGML 文件時,目前 CommonPaths 中的值會取代路徑,然後以這些新值展開所有變數參考。

因此,電腦中的方案資料夾可能在 C 磁碟機中,而另一台電腦的 D 磁碟機和所有功能仍正常運作。

繼承階層架構

Object
  Microsoft.VisualStudio.GraphModel.GraphPathSerializationDictionary

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

語法

'宣告
Public Class GraphPathSerializationDictionary _
    Implements IDictionary(Of String, String),  _
    ICollection(Of KeyValuePair(Of String, String)), IEnumerable(Of KeyValuePair(Of String, String)),  _
    IEnumerable
public class GraphPathSerializationDictionary : IDictionary<string, string>, 
    ICollection<KeyValuePair<string, string>>, IEnumerable<KeyValuePair<string, string>>, 
    IEnumerable
public ref class GraphPathSerializationDictionary : IDictionary<String^, String^>, 
    ICollection<KeyValuePair<String^, String^>>, IEnumerable<KeyValuePair<String^, String^>>, 
    IEnumerable
type GraphPathSerializationDictionary =  
    class 
        interface IDictionary<string, string>
        interface ICollection<KeyValuePair<string, string>>
        interface IEnumerable<KeyValuePair<string, string>>
        interface IEnumerable 
    end
public class GraphPathSerializationDictionary implements IDictionary<String, String>, ICollection<KeyValuePair<String, String>>, IEnumerable<KeyValuePair<String, String>>, IEnumerable

GraphPathSerializationDictionary 類型會公開下列成員。

建構函式

  名稱 描述
公用方法 GraphPathSerializationDictionary() 建立空的共用路徑清單。
公用方法 GraphPathSerializationDictionary(GraphPathSerializationDictionary) 從另一個物件建立 CommonPaths 的複本。

回頁首

屬性

  名稱 描述
公用屬性 Count 取得集合中的路徑數目
公用屬性 IsReadOnly 取得,指出 System.Collections.Generic.ICollection 集合是否為唯讀。
公用屬性 Item 取得或設定具有指定索引鍵的元素。
公用屬性 Keys 取得 System.Collections.Generic.ICollection,其中包含 System.Collections.Generic.IDictionary 的索引鍵。
公用屬性 Names 傳回目前路徑名稱的快照
公用屬性 Values 取得 System.Collections.Generic.ICollection,其中包含 System.Collections.Generic.IDictionary 的值。

回頁首

方法

  名稱 描述
公用方法 Add(KeyValuePair<String, String>) 加入有指定名稱和值的路徑。已忽略空路徑。 結尾斜線已移除。
公用方法 Add(String, String) 加入有指定名稱和值的路徑。已忽略空路徑。 結尾斜線已移除。
公用方法 AddDefaultPaths 加入可以使用目前處理序環境找到的預設路徑。
公用方法 Clear 從 System.Collections.Generic.ICollection 中移除所有項目。
公用方法 Contains 判斷指定的連結是否在此集合中。
公用方法 ContainsKey 判斷 System.Collections.Generic.IDictionary 是否包含具有指定索引鍵的項目。
公用方法 CopyTo 從 System.Array 的特定索引處開始,將 System.Collections.Generic.ICollection 的項目複製到 System.Array。
公用方法 Equals 判斷指定的物件是否等於目前的物件。 (繼承自 Object)。
受保護的方法 Finalize 在記憶體回收開始前,允許物件嘗試釋放資源,並執行其他清除作業。 (繼承自 Object)。
公用方法 GetEnumerator 傳回可逐一查看集合的列舉程式。
公用方法 GetHashCode 做為預設雜湊函式。 (繼承自 Object)。
公用方法 GetPath 取得具有指定之名稱的路徑值。
公用方法 GetType 取得目前實例 Type 的屬性。 (繼承自 Object)。
公用方法 LookupName 尋找具有指定值的路徑名稱
受保護的方法 MemberwiseClone 建立目前 Object 的淺層複製 (Shallow Copy) 。 (繼承自 Object)。
公用方法 Remove(KeyValuePair<String, String>) 從 System.Collections.Generic.ICollection 中移除第一個出現的指定物件。
公用方法 Remove(String) 從 System.Collections.Generic.ICollection 中移除第一個出現的指定物件。
公用方法 ToString 傳回代表目前物件的字串。 (繼承自 Object)。
公用方法 TryGetValue 取得與指定索引鍵關聯的值。

回頁首

事件

  名稱 描述
公用事件 CommonPathsAdded 這個事件可以用於在 AddCommonPaths 呼叫後插入自訂的一般路徑。

回頁首

明確介面實作

  名稱 描述
明確介面實作私用方法 IEnumerable.GetEnumerator 傳回可逐一查看集合的列舉程式。

回頁首

執行緒安全

這個類型的任何 Public static (在 Visual Basic 中為 Shared) 成員都是安全執行緒。不保證任何執行個體成員是安全執行緒。

請參閱

參考

Microsoft.VisualStudio.GraphModel 命名空間