[]
        
(Showing Draft Content)

C1.Win.C1DynamicHelp.TopicMap

TopicMap Class

Class used to store combinations of topics and user actions that cause their display.

Inheritance
TopicMap
Namespace: C1.Win.C1DynamicHelp
Assembly: C1.Win.C1DynamicHelp.4.8.dll
Syntax
public class TopicMap : Dictionary<object, MapItem>, IDictionary<object, MapItem>, ICollection<KeyValuePair<object, MapItem>>, IDictionary, ICollection, IReadOnlyDictionary<object, MapItem>, IReadOnlyCollection<KeyValuePair<object, MapItem>>, IEnumerable<KeyValuePair<object, MapItem>>, IEnumerable, ISerializable, IDeserializationCallback
Remarks

This class is a dictionary that associates UI elements to MapItem objects that specify a help topic to display and the user action that causes the display (control getting focus, mouse hovering).

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.

It can contain items of two different types: MapItemType.Dynamic and MapItemType.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 Save() method and then loaded with the Load() 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.

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 Refresh() 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 Refresh() method more than once (or, for example, it can be done on timer).

Properties

Name Description
Conflicts

Gets an array of conflicting map items.

HasChanges

Gets a value that determines whether the TopicMap has changed since it was initialized (read from an XML file).

this[object]

Gets or sets the value associated with the specified key.

XmlSource

Gets or sets an XmlDocument value representing a TopicMap created in authoring mode (so it consists of dynamic map items, static map items aren't included), which is saved to an XML file.

Methods

Name Description
Add(object, MapItem)

Adds the specified uiElement and value to the TopicMap.

Add(string, MapItem)

Adds the specified path and value to the TopicMap.

Contains(string)

Determines whether the TopicMap contains the specified key.

Load()

Loads the TopicMap contents from an XML file with the same name as the HelpSource with .xml extension.

Load(string)

Loads the TopicMap contents from an XML file.

OnTopicMapChanged(EventArgs)

Raises the TopicMapChanged event.

OnTopicMapSaved(EventArgs)

Raises the TopicMapSaved event.

Refresh()

Refreshes topic map items with the ItemType property set to Dynamic. 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.

Remove(object)

Removes the value with the specified uiElement from the TopicMap

Remove(string)

Removes the value with the specified path from the TopicMap

Save()

Saves the TopicMap contents to an XML file with the same name as the HelpSource with .xml extension.

Save(string)

Saves the TopicMap contents to an XML file with a given name/location.

Events

Name Description
TopicMapChanged

Fires after changes were made in the topic map.

TopicMapSaved

Fires after the topic map is saved to an XML file.