# C1.Win.C1DynamicHelp.TopicMap

## Content

<div class="doc-site-dotnet-api-container">



  <h1 id="C1_Win_C1DynamicHelp_TopicMap" data-uid="C1.Win.C1DynamicHelp.TopicMap" class="text-break">TopicMap Class
</h1>
  <div class="markdown level0 summary"><p>Class used to store combinations of topics and user actions that cause their display.</p>
</div>
  <div class="markdown level0 conceptual"></div>
  <div class="inheritance">
    <h5>Inheritance</h5>
    <div class="level0"><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></div>
    <div class="level1"><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.dictionary-2">Dictionary</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a>, <a class="xref" href="C1.Win.C1DynamicHelp.MapItem.html">MapItem</a>&gt;</div>
    <div class="level2"><span class="xref">TopicMap</span></div>
  </div>
  <div class="implements">
    <h5>Implements</h5>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.idictionary-2">IDictionary</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a>, <a class="xref" href="C1.Win.C1DynamicHelp.MapItem.html">MapItem</a>&gt;</div>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.icollection-1">ICollection</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.keyvaluepair-2">KeyValuePair</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a>, <a class="xref" href="C1.Win.C1DynamicHelp.MapItem.html">MapItem</a>&gt;&gt;</div>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.idictionary">IDictionary</a></div>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.icollection">ICollection</a></div>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.ireadonlydictionary-2">IReadOnlyDictionary</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a>, <a class="xref" href="C1.Win.C1DynamicHelp.MapItem.html">MapItem</a>&gt;</div>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.ireadonlycollection-1">IReadOnlyCollection</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.keyvaluepair-2">KeyValuePair</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a>, <a class="xref" href="C1.Win.C1DynamicHelp.MapItem.html">MapItem</a>&gt;&gt;</div>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1">IEnumerable</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.keyvaluepair-2">KeyValuePair</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a>, <a class="xref" href="C1.Win.C1DynamicHelp.MapItem.html">MapItem</a>&gt;&gt;</div>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.ienumerable">IEnumerable</a></div>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.runtime.serialization.iserializable">ISerializable</a></div>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.runtime.serialization.ideserializationcallback">IDeserializationCallback</a></div>
  </div>
  <h6><strong>Namespace</strong>: <a class="xref" href="C1.Win.C1DynamicHelp.html">C1.Win.C1DynamicHelp</a></h6>
  <h6><strong>Assembly</strong>: C1.Win.C1DynamicHelp.4.8.dll</h6>
  <h5 id="C1_Win_C1DynamicHelp_TopicMap_syntax">Syntax</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public class TopicMap : Dictionary&lt;object, MapItem&gt;, IDictionary&lt;object, MapItem&gt;, ICollection&lt;KeyValuePair&lt;object, MapItem&gt;&gt;, IDictionary, ICollection, IReadOnlyDictionary&lt;object, MapItem&gt;, IReadOnlyCollection&lt;KeyValuePair&lt;object, MapItem&gt;&gt;, IEnumerable&lt;KeyValuePair&lt;object, MapItem&gt;&gt;, IEnumerable, ISerializable, IDeserializationCallback</code></pre>
  </div>
  <div class="codewrapper">
    <pre><code class="lang-vbnet hljs">Public Class TopicMap
    Inherits Dictionary(Of Object, MapItem)
    Implements IDictionary(Of Object, MapItem), ICollection(Of KeyValuePair(Of Object, MapItem)), IDictionary, ICollection, IReadOnlyDictionary(Of Object, MapItem), IReadOnlyCollection(Of KeyValuePair(Of Object, MapItem)), IEnumerable(Of KeyValuePair(Of Object, MapItem)), IEnumerable, ISerializable, IDeserializationCallback</code></pre>
  </div>
  <h5 id="C1_Win_C1DynamicHelp_TopicMap_remarks"><strong>Remarks</strong></h5>
  <div class="markdown level0 remarks"><p>This class is a dictionary that associates UI elements to <a class="xref" href="C1.Win.C1DynamicHelp.MapItem.html">MapItem</a> objects that specify a 
help topic to display and the user action that causes the display (control getting focus, mouse hovering).</p>
<p>This class allows you to add items, remove items, and obtain a count of the items in the collection.
The TopicMap class has members that allow users to check whether the map has changed since it 
was created and to persist the map to and from XML.</p>
<p>It can contain items of two different types: <a class="xref" href="C1.Win.C1DynamicHelp.MapItemType.html">MapItemType</a>.Dynamic and <a class="xref" href="C1.Win.C1DynamicHelp.MapItemType.html">MapItemType</a>.Static.
Map items with dynamic type are created in authoring mode, and only items of this type can be saved to an XML file with the
<a class="xref" href="C1.Win.C1DynamicHelp.TopicMap.Save.html#C1_Win_C1DynamicHelp_TopicMap_Save">Save()</a> method and then loaded with the <a class="xref" href="C1.Win.C1DynamicHelp.TopicMap.Load.html#C1_Win_C1DynamicHelp_TopicMap_Load">Load()</a> method.
As opposed to dynamic map items, static map items are created at design time and aren't saved to or loaded from XML file.</p>
<p>Dynamic map items use a "control path" string (the name of the UI element itself prepended with the names of all its ancestors up
to the form level) as the UI element identifier. So, if you include controls that are created dynamically, at run time, 
you need to call the <a class="xref" href="C1.Win.C1DynamicHelp.TopicMap.Refresh.html#C1_Win_C1DynamicHelp_TopicMap_Refresh">Refresh()</a> method that finds UI elements by their "control path" and adds
them to the dynamic help system. As the controls on the form can be created dynamically, you may need to call the
<a class="xref" href="C1.Win.C1DynamicHelp.TopicMap.Refresh.html#C1_Win_C1DynamicHelp_TopicMap_Refresh">Refresh()</a> method more than once (or, for example, it can be done on timer).</p>
</div>
  <h3 id="properties">Properties
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="C1_Win_C1DynamicHelp_TopicMap_Conflicts" data-uid="C1.Win.C1DynamicHelp.TopicMap.Conflicts">
          <a class="xref" href="C1.Win.C1DynamicHelp.TopicMap.Conflicts.html#C1_Win_C1DynamicHelp_TopicMap_Conflicts">Conflicts</a>
        </td>
        <td class="markdown level1 summary"><p>Gets an array of conflicting map items.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_C1DynamicHelp_TopicMap_HasChanges" data-uid="C1.Win.C1DynamicHelp.TopicMap.HasChanges">
          <a class="xref" href="C1.Win.C1DynamicHelp.TopicMap.HasChanges.html#C1_Win_C1DynamicHelp_TopicMap_HasChanges">HasChanges</a>
        </td>
        <td class="markdown level1 summary"><p>Gets a value that determines whether the <a class="xref" href="C1.Win.C1DynamicHelp.TopicMap.html">TopicMap</a> has changed since it was initialized (read from an XML file).</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_C1DynamicHelp_TopicMap_Item_System_Object_" data-uid="C1.Win.C1DynamicHelp.TopicMap.Item(System.Object)">
          <a class="xref" href="C1.Win.C1DynamicHelp.TopicMap.Item.html#C1_Win_C1DynamicHelp_TopicMap_Item_System_Object_">this[object]</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets the value associated with the specified key.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_C1DynamicHelp_TopicMap_XmlSource" data-uid="C1.Win.C1DynamicHelp.TopicMap.XmlSource">
          <a class="xref" href="C1.Win.C1DynamicHelp.TopicMap.XmlSource.html#C1_Win_C1DynamicHelp_TopicMap_XmlSource">XmlSource</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets an <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.xml.xmldocument">XmlDocument</a> value representing a <a class="xref" href="C1.Win.C1DynamicHelp.TopicMap.html">TopicMap</a>
created in authoring mode (so it consists of dynamic map items, static map items aren't included), which is saved to an XML file.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="methods">Methods
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="C1_Win_C1DynamicHelp_TopicMap_Add_System_Object_C1_Win_C1DynamicHelp_MapItem_" data-uid="C1.Win.C1DynamicHelp.TopicMap.Add(System.Object,C1.Win.C1DynamicHelp.MapItem)">
          <a class="xref" href="C1.Win.C1DynamicHelp.TopicMap.Add.html#C1_Win_C1DynamicHelp_TopicMap_Add_System_Object_C1_Win_C1DynamicHelp_MapItem_">Add(object, MapItem)</a>
        </td>
        <td class="markdown level1 summary"><p>Adds the specified <code class="paramref">uiElement</code> and value to the <a class="xref" href="C1.Win.C1DynamicHelp.TopicMap.html">TopicMap</a>.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_C1DynamicHelp_TopicMap_Add_System_String_C1_Win_C1DynamicHelp_MapItem_" data-uid="C1.Win.C1DynamicHelp.TopicMap.Add(System.String,C1.Win.C1DynamicHelp.MapItem)">
          <a class="xref" href="C1.Win.C1DynamicHelp.TopicMap.Add.html#C1_Win_C1DynamicHelp_TopicMap_Add_System_String_C1_Win_C1DynamicHelp_MapItem_">Add(string, MapItem)</a>
        </td>
        <td class="markdown level1 summary"><p>Adds the specified <code class="paramref">path</code> and value to the <a class="xref" href="C1.Win.C1DynamicHelp.TopicMap.html">TopicMap</a>.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_C1DynamicHelp_TopicMap_Contains_System_String_" data-uid="C1.Win.C1DynamicHelp.TopicMap.Contains(System.String)">
          <a class="xref" href="C1.Win.C1DynamicHelp.TopicMap.Contains.html#C1_Win_C1DynamicHelp_TopicMap_Contains_System_String_">Contains(string)</a>
        </td>
        <td class="markdown level1 summary"><p>Determines whether the <a class="xref" href="C1.Win.C1DynamicHelp.TopicMap.html">TopicMap</a> contains the specified key.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_C1DynamicHelp_TopicMap_Load" data-uid="C1.Win.C1DynamicHelp.TopicMap.Load">
          <a class="xref" href="C1.Win.C1DynamicHelp.TopicMap.Load.html#C1_Win_C1DynamicHelp_TopicMap_Load">Load()</a>
        </td>
        <td class="markdown level1 summary"><p>Loads the <a class="xref" href="C1.Win.C1DynamicHelp.TopicMap.html">TopicMap</a> contents from an XML file with the same name as the <a class="xref" href="C1.Win.C1DynamicHelp.C1DynamicHelp.HelpSource.html#C1_Win_C1DynamicHelp_C1DynamicHelp_HelpSource">HelpSource</a> with .xml extension.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_C1DynamicHelp_TopicMap_Load_System_String_" data-uid="C1.Win.C1DynamicHelp.TopicMap.Load(System.String)">
          <a class="xref" href="C1.Win.C1DynamicHelp.TopicMap.Load.html#C1_Win_C1DynamicHelp_TopicMap_Load_System_String_">Load(string)</a>
        </td>
        <td class="markdown level1 summary"><p>Loads the <a class="xref" href="C1.Win.C1DynamicHelp.TopicMap.html">TopicMap</a> contents from an XML file.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_C1DynamicHelp_TopicMap_OnTopicMapChanged_System_EventArgs_" data-uid="C1.Win.C1DynamicHelp.TopicMap.OnTopicMapChanged(System.EventArgs)">
          <a class="xref" href="C1.Win.C1DynamicHelp.TopicMap.OnTopicMapChanged.html#C1_Win_C1DynamicHelp_TopicMap_OnTopicMapChanged_System_EventArgs_">OnTopicMapChanged(EventArgs)</a>
        </td>
        <td class="markdown level1 summary"><p>Raises the <a class="xref" href="C1.Win.C1DynamicHelp.TopicMap.TopicMapChanged.html">TopicMapChanged</a> event.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_C1DynamicHelp_TopicMap_OnTopicMapSaved_System_EventArgs_" data-uid="C1.Win.C1DynamicHelp.TopicMap.OnTopicMapSaved(System.EventArgs)">
          <a class="xref" href="C1.Win.C1DynamicHelp.TopicMap.OnTopicMapSaved.html#C1_Win_C1DynamicHelp_TopicMap_OnTopicMapSaved_System_EventArgs_">OnTopicMapSaved(EventArgs)</a>
        </td>
        <td class="markdown level1 summary"><p>Raises the <a class="xref" href="C1.Win.C1DynamicHelp.TopicMap.TopicMapSaved.html">TopicMapSaved</a> event.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_C1DynamicHelp_TopicMap_Refresh" data-uid="C1.Win.C1DynamicHelp.TopicMap.Refresh">
          <a class="xref" href="C1.Win.C1DynamicHelp.TopicMap.Refresh.html#C1_Win_C1DynamicHelp_TopicMap_Refresh">Refresh()</a>
        </td>
        <td class="markdown level1 summary"><p>Refreshes topic map items with the <a class="xref" href="C1.Win.C1DynamicHelp.MapItem.ItemType.html#C1_Win_C1DynamicHelp_MapItem_ItemType">ItemType</a> property set to <a class="xref" href="C1.Win.C1DynamicHelp.MapItemType.html#C1_Win_C1DynamicHelp_MapItemType_Dynamic">Dynamic</a>.
For every control path in the map that does not yet have a UI element found for it, it tries to find a UI element.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_C1DynamicHelp_TopicMap_Remove_System_Object_" data-uid="C1.Win.C1DynamicHelp.TopicMap.Remove(System.Object)">
          <a class="xref" href="C1.Win.C1DynamicHelp.TopicMap.Remove.html#C1_Win_C1DynamicHelp_TopicMap_Remove_System_Object_">Remove(object)</a>
        </td>
        <td class="markdown level1 summary"><p>Removes the value with the specified <code class="paramref">uiElement</code> from the <a class="xref" href="C1.Win.C1DynamicHelp.TopicMap.html">TopicMap</a></p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_C1DynamicHelp_TopicMap_Remove_System_String_" data-uid="C1.Win.C1DynamicHelp.TopicMap.Remove(System.String)">
          <a class="xref" href="C1.Win.C1DynamicHelp.TopicMap.Remove.html#C1_Win_C1DynamicHelp_TopicMap_Remove_System_String_">Remove(string)</a>
        </td>
        <td class="markdown level1 summary"><p>Removes the value with the specified <code class="paramref">path</code> from the <a class="xref" href="C1.Win.C1DynamicHelp.TopicMap.html">TopicMap</a></p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_C1DynamicHelp_TopicMap_Save" data-uid="C1.Win.C1DynamicHelp.TopicMap.Save">
          <a class="xref" href="C1.Win.C1DynamicHelp.TopicMap.Save.html#C1_Win_C1DynamicHelp_TopicMap_Save">Save()</a>
        </td>
        <td class="markdown level1 summary"><p>Saves the <a class="xref" href="C1.Win.C1DynamicHelp.TopicMap.html">TopicMap</a> contents to an XML file with the same name as the <a class="xref" href="C1.Win.C1DynamicHelp.C1DynamicHelp.HelpSource.html#C1_Win_C1DynamicHelp_C1DynamicHelp_HelpSource">HelpSource</a> with .xml extension.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_C1DynamicHelp_TopicMap_Save_System_String_" data-uid="C1.Win.C1DynamicHelp.TopicMap.Save(System.String)">
          <a class="xref" href="C1.Win.C1DynamicHelp.TopicMap.Save.html#C1_Win_C1DynamicHelp_TopicMap_Save_System_String_">Save(string)</a>
        </td>
        <td class="markdown level1 summary"><p>Saves the <a class="xref" href="C1.Win.C1DynamicHelp.TopicMap.html">TopicMap</a> contents to an XML file with a given name/location.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="events">Events
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="C1_Win_C1DynamicHelp_TopicMap_TopicMapChanged" data-uid="C1.Win.C1DynamicHelp.TopicMap.TopicMapChanged">
          <a class="xref" href="C1.Win.C1DynamicHelp.TopicMap.TopicMapChanged.html">TopicMapChanged</a>
        </td>
        <td class="markdown level1 summary"><p>Fires after changes were made in the topic map.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_C1DynamicHelp_TopicMap_TopicMapSaved" data-uid="C1.Win.C1DynamicHelp.TopicMap.TopicMapSaved">
          <a class="xref" href="C1.Win.C1DynamicHelp.TopicMap.TopicMapSaved.html">TopicMapSaved</a>
        </td>
        <td class="markdown level1 summary"><p>Fires after the topic map is saved to an XML file.</p>
</td>
      </tr>
    </tbody>
  </table>

</div>
