GraphPathSerializationDictionary 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
CommonPaths 提供方法來重新對應 DGML 中的特定屬性值。 例如,最好讓檔案路徑相對於方案,以便在移動該解決方案時找到檔案。 若要解決此問題,您可以使用完整路徑的值來定義名為 「SolutionDir」 的路徑。 然後,GraphSerializer 會以語法 「$ (name) 」 取代這個路徑,其中 name 是您提供的路徑標識碼,它會寫出在檔案結尾之 Path 區塊中使用的路徑定義。
<DirectedGraph><Nodes><Node Id=“$ (vsinstalldir) ;\common7\ide\microsoft.visualstudio.dll”/></Nodes<>path<>path Id=“vsinstalldir” Value=“c:\program files\Microsoft Visual Studio 10”/<>/Path></DirectedGraph>
載入此 DGML 檔時,路徑會以目前 CommonPaths 中的值取代,然後所有變數參考都會以這些新值展開。 如此一來,您電腦上的解決方案資料夾可能位於 C: 磁碟驅動器一些位置,而位於另一部電腦上的 d:磁碟驅動器上,所有專案仍會如預期般運作。
public ref class GraphPathSerializationDictionary : System::Collections::Generic::ICollection<System::Collections::Generic::KeyValuePair<System::String ^, System::String ^>>, System::Collections::Generic::IDictionary<System::String ^, System::String ^>, System::Collections::Generic::IEnumerable<System::Collections::Generic::KeyValuePair<System::String ^, System::String ^>>
public class GraphPathSerializationDictionary : System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<string,string>>, System.Collections.Generic.IDictionary<string,string>, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string,string>>
type GraphPathSerializationDictionary = class
interface IDictionary<string, string>
interface ICollection<KeyValuePair<string, string>>
interface seq<KeyValuePair<string, string>>
interface IEnumerable
Public Class GraphPathSerializationDictionary
Implements ICollection(Of KeyValuePair(Of String, String)), IDictionary(Of String, String), IEnumerable(Of KeyValuePair(Of String, String))
- 繼承
-
GraphPathSerializationDictionary
- 實作
-
ICollection<KeyValuePair<String,String>> ICollection<KeyValuePair<TKey,TValue>> IDictionary<String,String> IEnumerable<KeyValuePair<String,String>> IEnumerable<KeyValuePair<TKey,TValue>> IEnumerable<T> IEnumerable
建構函式
GraphPathSerializationDictionary() |
Create 一般路徑的空白清單。 |
GraphPathSerializationDictionary(GraphPathSerializationDictionary) |
Create 另一個物件的 CommonPaths 複本。 |
屬性
Count |
取得集合中的路徑數目 |
IsReadOnly |
取得值,指出 System.Collections.Generic.ICollection 是否為唯讀。 |
Item[String] |
取得或設定具有指定索引鍵的項目。 |
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(KeyValuePair<String,String>) |
判斷指定的連結是否在此集合中。 |
ContainsKey(String) |
判斷 System.Collections.Generic.IDictionary 是否包含具有指定索引鍵的專案。 |
CopyTo(KeyValuePair<String,String>[], Int32) |
從特定的 System.Array 索引開始,將 System.Collections.Generic.ICollection 的專案複製到 System.Array。 |
GetEnumerator() |
傳回逐一查看集合的列舉值。 |
GetPath(String) |
取得具有指定名稱的路徑值。 |
LookupName(String) |
尋找具有指定值的路徑名稱 |
Remove(KeyValuePair<String,String>) |
從 System.Collections.Generic.ICollection 中移除第一個出現的特定物件。 |
Remove(String) |
從 System.Collections.Generic.ICollection 中移除第一個出現的特定物件。 |
TryGetValue(String, String) |
取得與指定索引鍵關聯的值。 |
事件
CommonPathsAdded |
呼叫 AddCommonPaths 之後,這個事件可用來插入自定義的通用路徑。 |
明確介面實作
IEnumerable.GetEnumerator() |
傳回逐一查看集合的列舉值。 |
擴充方法
AddRange<TKey,TValue>(IDictionary<TKey,TValue>, IDictionary<TKey,TValue>, Boolean) |
將一個字典內容新增至另一個字典 |
GetOrDefault<TK,TV>(IDictionary<TK,TV>, TK) |
依指定的索引鍵取得值。 |
EmptyIfNull<T>(IEnumerable<T>) |
如果此列舉不是 Null,則傳回此列舉。 如果是 null,則傳回空列舉。 |