Notes to Self: Object Model stuff I Might Use in my Add-in
- Application.ActiveDocument: the currently-displayed Map
- Application.Visible: enables/disables the MM UI
- DocumentObject.Guid, DocumentObject.ResetDirty: this seems like a generic object type within the MM object model — might be useful for manipulating a whole collection of different objects at once
- Document.Attributes: collection of document’s custom attributes
- Document.AssignMapMarkers(): assigns a map markers template to the document
- Document.Range(): returns a new Range collection of all the specified objects (topics, boundaries, relationships) in the document
- Topic.AllSubTopics: subtopics connected to the topic
- Topic.Document: the document in which the Topic is found
- Topic.Icons, Topic.UserIcons
- Topic.IsFirstSibling: TRUE if the topic is the first in a set of siblings
- Topic.IsMainTopic: TRUE if the topic is a child of the Central topic
- Topic.IsSubTopic: TRUE if the topic is a child of another topic
- Topic.SubTopics, Topic.UnfilteredSubTopics
- Topic.Synchronization: ????
- Topic.TopicPrefix: sets the prefix for the topic — something to do with “numbering”
- Topic.CreateHyperlinkToTopicByGuid(): Cool! This could be used to hyperlink topics in ToDoList back to their original Topics. Might be useful to sync properties, attributes automatically.
- Topic.NewTopicFinder(): helpful for traversing sub-topics from the current topic.
- Topic.ResetDirty(): resets dirty bit of this and all subsequent objects. [Could be used to determine if a Topic has been changed since last “sync”.]
- Topics.AddWithGuid(): creates new Topic with a given Guid
- CustomAttributes.GetAttributeValue(), CustomAttributes.SetAttributeValue()
- Task.Topic: the parent Topic for this object
- Icons.AddStockIcon(), Icons.AddCustomIcon()
Notes to Self: Questions to Research
- What’s the difference between a CustomProperty and a CustomAttribute?
- Attributes are persistent
- Nick Duffill has more info here
- Is a TextLabel the same thing as a Text Marker?
- What’s the difference between a CategoryMarker, a CustomIconMarker and a CustomIcon?
- What Events are available to which to respond (such as Topic.Moved)?
- Nick Duffill alludes to “topic-delete” and “topic-add” here
- There is the Topics.Item property…
- If so, could I reset the Dirty flag on the Topic in the ToDoList, but leave open the possibility that the ToDoList overall is still “Dirty” and prompt the user to save unsaved changes?
Notes to Self: MM-specific Objects to Manipulate
There’s all these new Object types defined in the MM object model:
- BusinessTypeRegistry/Business Topics (see Nick Duffill’s expert explanation of these Object classes here)
- External Topics
- Map Parts
- Control Strips
Notes to Self: Code Tidbits
“use the Document.Range() method to iterate over all Objects” (Create and Use Custom Attributes)
Iterate over Topics (includes sample code for using the TopicFinder, an iterator)
Work with the Object ID (includes reference to FindByGuid() method that finds DocumentObjects by GUID in any Range, such as Document.Range)
Get an Object’s Type (which refers to an enumeration of DocumentObject that includes mmDocumentObjectTypeTopic)