Share via


GraphPathSerializationDictionary Class

The CommonPaths lets you 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. 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 a solution folder on your computer might be on drive C someplace, and on drive D on another computer and everything will still just work as expected.

Inheritance Hierarchy

Object
  Microsoft.VisualStudio.GraphModel.GraphPathSerializationDictionary

Namespace:  Microsoft.VisualStudio.GraphModel
Assembly:  Microsoft.VisualStudio.GraphModel (in Microsoft.VisualStudio.GraphModel.dll)

Syntax

'Declaration
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

The GraphPathSerializationDictionary type exposes the following members.

Constructors

  Name Description
Public method GraphPathSerializationDictionary() Create empty list of common paths.
Public method GraphPathSerializationDictionary(GraphPathSerializationDictionary) Create a copy of the CommonPaths from another object.

Top

Properties

  Name Description
Public property Count Get the number of paths in the collection
Public property IsReadOnly Gets a value indicating whether the System.Collections.Generic.ICollection is read-only.
Public property Item Gets or sets the element that has the specified key.
Public property Keys Gets an System.Collections.Generic.ICollection that contains the keys of the System.Collections.Generic.IDictionary.
Public property Names Return a snapshot of the current path names
Public property Values Gets an System.Collections.Generic.ICollection that contains the values of the System.Collections.Generic.IDictionary.

Top

Methods

  Name Description
Public method Add(KeyValuePair<String, String>) Add a path with the given name and value. An empty path is ignored. Trailing slash is removed.
Public method Add(String, String) Add a path with the given name and value. An empty path is ignored. Trailing slash is removed.
Public method AddDefaultPaths Add the default paths that we can find using the current process Environment.
Public method Clear Removes all items from the System.Collections.Generic.ICollection.
Public method Contains Determines if the given link is in this collection.
Public method ContainsKey Determines whether the System.Collections.Generic.IDictionary contains an element that has the specified key.
Public method CopyTo Copies the elements of the System.Collections.Generic.ICollection to an System.Array, starting at a particular System.Array index.
Public method Equals Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public method GetEnumerator Returns an enumerator that iterates through the collection.
Public method GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
Public method GetPath Get the value of the path with the given name.
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Public method LookupName Find the name of the path with the specified value
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public method Remove(KeyValuePair<String, String>) Removes the first occurrence of a specific object from the System.Collections.Generic.ICollection.
Public method Remove(String) Removes the first occurrence of a specific object from the System.Collections.Generic.ICollection.
Public method ToString Returns a string that represents the current object. (Inherited from Object.)
Public method TryGetValue Gets the value associated with the specified key.

Top

Events

  Name Description
Public event CommonPathsAdded This event can be used to insert custom common paths after AddCommonPaths is called.

Top

Explicit Interface Implementations

  Name Description
Explicit interface implemetationPrivate method IEnumerable.GetEnumerator Returns an enumerator that iterates through the collection.

Top

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

Microsoft.VisualStudio.GraphModel Namespace