GraphPathSerializationDictionary 类
CommonPaths 允许您重新映射 DGML 中的某些属性值。
例如,相对解决方案给出文件路径非常好,这样当解决方案被移动时,文件就会被建立。 若要解决此问题,您可以通过完整路径的值将路径定义为“SolutionDir”。 然后 GraphSerializer 将替换为路径,实际上在带有语法 “$ (名称) 的” DGML 中找到名称为您提供路径的 ID 的位置,并将在该文件的末尾写出用于路径块的定义。 当加载 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.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 | 确定指定的链接是否在此集合中。 |
![]() |
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 的浅表副本。 (继承自 Object。) |
![]() |
Remove(KeyValuePair<String, String>) | 从 System.Collections.Generic.ICollection 中移除特定对象的第一个匹配项。 |
![]() |
Remove(String) | 从 System.Collections.Generic.ICollection 中移除特定对象的第一个匹配项。 |
![]() |
ToString | 返回表示当前对象的字符串。 (继承自 Object。) |
![]() |
TryGetValue | 获取与指定的键相关联的值。 |
页首
事件
名称 | 说明 | |
---|---|---|
![]() |
CommonPathsAdded | 在调用 AddCommonPaths 后,该事件可用于插入自定义通用路径。 |
页首
显式接口实现
名称 | 说明 | |
---|---|---|
![]() ![]() |
IEnumerable.GetEnumerator | 返回一个循环访问集合的枚举器。 |
页首
线程安全
此类型的任何公共 static(在 Visual Basic 中为 Shared) 成员都是线程安全的。但不保证所有实例成员都是线程安全的。