GraphPathSerializationDictionary Class

Definition

The CommonPaths provides a way to remap certain attribute values in the DGML. For example, it is nice to have a file path be relative to the solution so the file can be found when that solution is moved. To solve this you can define a path called "SolutionDir" with the value of the full path. Then the GraphSerializer will substitute this path wherever it is found in the DGML with the syntax "$(name)" where name is the Id of the path you provided and it will write out the definition of the paths that are used in a Paths block at the end of the file.

<DirectedGraph> <Nodes> <Node Id="$(vsinstalldir);\common7\ide\microsoft.visualstudio.dll"/> </Nodes> <Paths> <Path Id="vsinstalldir" Value="c:\program files\Microsoft Visual Studio 10"/> </Path> </DirectedGraph>

When this DGML document is loaded the paths will be substituted with the values in the current CommonPaths and then all the variable references will be expanded with these new values. So this way a solution folder on your machine might be on the C: drive some place, and on the d: drive on another machine and everything will still just work as expected.

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))
Inheritance
GraphPathSerializationDictionary
Implements

Constructors

GraphPathSerializationDictionary()

Create empty list of common paths.

GraphPathSerializationDictionary(GraphPathSerializationDictionary)

Create a copy of the CommonPaths from another object.

Properties

Count

Get the number of paths in the collection

IsReadOnly

Gets a value indicating whether the System.Collections.Generic.ICollection is read-only.

Item[String]

Gets or sets the element with the specified key.

Keys

Gets an System.Collections.Generic.ICollection containing the keys of the System.Collections.Generic.IDictionary.

Names

Return a snapshot of the current path names

Values

Gets an System.Collections.Generic.ICollection containing the values of the System.Collections.Generic.IDictionary.

Methods

Add(KeyValuePair<String,String>)

Add a path with the given name and value. An empty path is ignored. Trailing slash is removed.

Add(String, String)

Add a path with the given name and value. An empty path is ignored. Trailing slash is removed.

AddDefaultPaths()

Add the default paths that we can find using the current process Environment.

Clear()

Removes all items from the System.Collections.Generic.ICollection.

Contains(KeyValuePair<String,String>)

Determines if the given link is in this collection.

ContainsKey(String)

Determines whether the System.Collections.Generic.IDictionary contains an element with the specified key.

CopyTo(KeyValuePair<String,String>[], Int32)

Copies the elements of the System.Collections.Generic.ICollection to an System.Array, starting at a particular System.Array index.

GetEnumerator()

Returns an enumerator that iterates through the collection.

GetPath(String)

Get the value of the path with the given name.

LookupName(String)

Find the name of the path with the specified value

Remove(KeyValuePair<String,String>)

Removes the first occurrence of a specific object from the System.Collections.Generic.ICollection.

Remove(String)

Removes the first occurrence of a specific object from the System.Collections.Generic.ICollection.

TryGetValue(String, String)

Gets the value associated with the specified key.

Events

CommonPathsAdded

This event can be used to inject custom common paths after AddCommonPaths is called.

Explicit Interface Implementations

IEnumerable.GetEnumerator()

Returns an enumerator that iterates through the collection.

Extension Methods

AddRange<TKey,TValue>(IDictionary<TKey,TValue>, IDictionary<TKey,TValue>, Boolean)
GetOrDefault<TK,TV>(IDictionary<TK,TV>, TK)
EmptyIfNull<T>(IEnumerable<T>)

Applies to