GraphPathSerializationDictionary 类

定义

CommonPath 提供了一种在 DGML 中重新映射某些属性值的方法。 例如,最好让文件路径相对于解决方案,以便在移动该解决方案时找到该文件。 若要解决此问题,可以使用完整路径的值定义名为“SolutionDir”的路径。 然后,GraphSerializer 会将此路径替换为语法“$ (name) ”,其中 name 是你提供的路径的 ID,它将写出文件末尾的 Paths 块中使用的路径的定义。

<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
实现

构造函数

GraphPathSerializationDictionary()

Create通用路径的空列表。

GraphPathSerializationDictionary(GraphPathSerializationDictionary)

从另一个对象Create CommonPaths 的副本。

属性

Count

获取集合中的路径数

IsReadOnly

获取一个值,该值指示 System.Collections.Generic.ICollection 是否为只读。

Item[String]

获取或设置具有指定键的元素。

Keys

获取包含 System.Collections.Generic.IDictionary 的键的 System.Collections.Generic.ICollection。

Names

返回当前路径名称快照

Values

获取包含 System.Collections.Generic.IDictionary 值的 System.Collections.Generic.ICollection。

方法

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,则返回空枚举。

适用于