Click or drag to resize

TextDocument Class

Stores notes as markdown annotated text.
Inheritance Hierarchy

Namespace: Altaxo.Text
Assembly: AltaxoBase (in AltaxoBase.dll) Version: 4.8.3179.0 (4.8.3179.0)
Syntax
C#
public class TextDocument : SuspendableDocumentNodeWithSingleAccumulatedData<EventArgs>, 
	IProjectItem, IDocumentLeafNode, INamedObject, IChangedEventSource, ISuspendableByToken, 
	ITunnelingEventSource, IDisposable, ITreeNodeWithParent<IDocumentLeafNode>, ITreeNode<IDocumentLeafNode>, 
	INodeWithParentNode<IDocumentLeafNode>, INameOwner, IEventIndicatedDisposable, ICloneable, 
	IHasDocumentReferences, ICopyFrom, IPropertyBagOwner

The TextDocument type exposes the following members.

Constructors
 NameDescription
Public methodTextDocument Initializes a new instance of the TextDocument class.
Public methodTextDocument(TextDocument) Initializes a new instance of the TextDocument class by copying the content from another instance.
Top
Properties
 NameDescription
Protected propertyAccumulatedEventData Gets the accumulated event data.
(Inherited from SuspendableDocumentNodeWithSingleAccumulatedDataT)
Public propertyCreationTimeUtc The date/time of creation of this graph.
Protected propertyDebug_AbsolutePath Gets the absolute path of the node for debugging purposes.
(Inherited from SuspendableDocumentNodeBase)
Public propertyFolder Gets the directory part of the document name with trailing DirectorySeparatorChar. If the document is located in the root folder, the RootFolderName (an empty string) is returned.
Public propertyImages Local images for this markdown, stored in a dictionary. The key is a Guid which is created when the image is pasted into the markdown document. The value is a memory stream image proxy.
Public propertyIsDisposed Gets a value indicating whether this instance is disposed.
(Inherited from SuspendableDocumentNodeBase)
Public propertyIsDisposeInProgress Gets a value indicating whether for this instance dispose is in progress, or the instance is already disposed.
(Inherited from SuspendableDocumentNodeBase)
Public propertyIsHyphenationEnabled Gets or sets a value indicating whether hyphenation is enabled.
Public propertyIsResumeInProgress Gets a value indicating whether this instance is currently resuming the events.
(Inherited from SuspendableDocumentNode)
Public propertyIsSomeoneListeningToChanges Gets a value indicating whether someone is listening to changes. For this, either the ParentObject or the Changed event must be set.
(Inherited from SuspendableDocumentNodeBase)
Public propertyIsSuspended Gets a value indicating whether this instance is suspended.
(Inherited from SuspendableDocumentNode)
Public propertyIsSuspendedOrResumeInProgress Gets a value indicating whether this instance is suspended or resume is currently in progress.
(Inherited from SuspendableDocumentNode)
Public propertyLastChangeTimeUtc The date/time when this graph was changed.
Public propertyName Gets the name of this document node. Null is returned if the name is not set or unknown. The set accessor will for most nodes throw a InvalidOperationException, since the name can only be set on IProjectItems.
(Overrides SuspendableDocumentNodeBaseName)
Public propertyNotes Notes concerning this graph.
Public propertyParentObject Get / sets the parent object of this table.
(Overrides SuspendableDocumentNodeBaseParentObject)
Public propertyPropertyBag Gets the property bag. If the property bag is empty or not created, it is allowed to return null.
Public propertyPropertyBagNotNull Gets the property bag. If there is no property bag, a new bag is created and then returned.
Public propertyReferencedImageUrls Gets or sets the collection of all referenced image Urls. A value of null means that the markdown text is not parsed and thus we do not have references evaluated. We use this only in the serialization code to serialize only those local images which are referenced in the markdown.
Public propertyShortName Gets the short name (i.e. without the folder name) of this document.
Public propertySourceText Gets or sets the source text of the markdown document.
Public propertyStyleName The name of the style used to visualize the markdown. If this string is null or empty, the current global defined style of the current Altaxo instance will be used.
Top
Methods
 NameDescription
Protected methodAccumulateChangeData Accumulates the change data of the child. Currently only a flag is set to signal that the table has changed.
(Inherited from SuspendableDocumentNodeWithSingleAccumulatedDataT)
Protected methodAccumulatedChangeData_SetBackAfterResumeAndSuspend Sets the change data without further processing. This function is infrastructure and intended to use only in OnResume after the parent has suspended this node again.
(Inherited from SuspendableDocumentNodeWithSingleAccumulatedDataT)
Protected methodAccumulatedEventData_Clear Clears the accumulated event data.
(Inherited from SuspendableDocumentNodeWithSingleAccumulatedDataT)
Protected methodAccumulatedEventData_HasZeroOrOneEventArg Determines whether there is no or only one single event arg accumulated. If this is the case, the return value is true. If there is one event arg accumulated, it is returned in the argument singleEventArg. The return value is false if there is more than one event arg accumulated. In this case the singleEventArg is null on return, and the calling function should use AccumulatedEventData to enumerate all accumulated event args.
(Inherited from SuspendableDocumentNodeWithSingleAccumulatedDataT)
Public methodAddImage Adds the provided image to the document, and returns a name for that image.
Public methodAddImagesFrom Adds the local images from another TextDocument to the local images of this instance.
Protected methodChildCloneFromT Clones a node that is intended to use as child node of this instance (e.g. in collections). Consider using ChildCloneToMemberT(T, T) instead if the child node is stored in a member of this instance.
(Inherited from SuspendableDocumentNode)
Protected methodChildCloneToMemberT Sets a member variable that holds a child with a cloned instance of another variable. If an old instance member (provided in myChild exists and can not be used, it is disposed first. The node is then cloned using System.ICloneable. The resulting node's ParentObject is then set to this instance in order to maintain the parent-child relationship.
(Inherited from SuspendableDocumentNode)
Protected methodChildCloneToMemberAltT Set a member variable that holds a child node of this instance. The child node may or may not implement IDocumentLeafNode. The value to set may or may not implement ICloneable. If it implements ICloneable, then the member variable is set to a clone of the value. Otherwise, the member variable is set directly with the value. It helps to ensure the correct order: first, the child node is set to the new instance and then the old child node is disposed.
(Inherited from SuspendableDocumentNode)
Protected methodChildCopyToMemberT Copies a document node from another source into a member of this instance. If an old instance member (provided in myChild exists and can not be used, it is disposed first. The node is then copied using either Main.ICopyFrom or System.ICloneable. The resulting node's ParentObject is then set to this instance in order to maintain the parent-child relationship.
(Inherited from SuspendableDocumentNode)
Protected methodChildCopyToMemberOrCreateNewT Copies a document node from another source into a member of this instance. If an old instance member (provided in myChild exists and can not be used, it is disposed first. If the node is not null, the node is then copied using either Main.ICopyFrom or System.ICloneable. If the node is null, a new node is created using the provided generation function. The resulting node's ParentObject is then set to this instance in order to maintain the parent-child relationship.
(Inherited from SuspendableDocumentNode)
Protected methodChildDisposeMemberT Helper function to dispose a child node of this instance. It helps to ensure the correct order: first, the child node is set to null and only then the child node is disposed.
(Inherited from SuspendableDocumentNodeBase)
Protected methodChildSetMemberT Set a member variable that holds a child node of this instance. It helps to ensure the correct order: first, the child node is set to the new instance and then the old child node is disposed.
(Inherited from SuspendableDocumentNode)
Protected methodChildSetMemberAltT Set a member variable that holds a child node of this instance. The child node may or may not implement IDocumentLeafNode. It helps to ensure the correct order: first, the child node is set to the new instance and then the old child node is disposed.
(Inherited from SuspendableDocumentNode)
Public methodCloneCreates a new object that is a copy of the current instance.
Public methodCopyFrom(Object) Try to copy from another object. Should try to copy even if the object to copy from is not of the same type, but a base type. In this case only the base properties should be copied.
Protected methodCopyFrom(TextDocument) 
Public methodCountEvent Counts the number of events during the suspend state. Every call to this function will increment the event counter by 1 (but only in the suspended state). The event counter will be reset to zero when the object is resumed.
(Inherited from SuspendableDocumentNode)
Public methodDispose Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
(Inherited from SuspendableDocumentNodeBase)
Protected methodDispose(Boolean)
(Inherited from SuspendableDocumentNode)
Public methodEhChildChanged Used by childs of this object to inform us about a change in their state.
(Inherited from SuspendableDocumentNode)
Public methodEhParentTunnelingEventHappened Is called by the parent when a tunneling event happened in the parent.
(Inherited from SuspendableDocumentNode)
Protected methodEhSelfChanged Called if some (simple) member or property of this instance itself has changed.
(Inherited from SuspendableDocumentNode)
Public methodEhSelfTunnelingEventHappened(TunnelingEventArgs) Is called by this instance if a tunneling event happened into this instance. The tunneling event triggers the TunneledEvent and is additionally distributed to all childs of this instance.
(Inherited from SuspendableDocumentNodeBase)
Public methodEhSelfTunnelingEventHappened(TunnelingEventArgs, Boolean) Is called by this instance if a tunneling event happened into this instance. The tunneling event triggers the TunneledEvent and is - depending on the provided parameter - also distributed to all childs of this instance.
(Inherited from SuspendableDocumentNode)
Public methodEnumerateFromHereToLeaves Enumerates all document node including this node, its child nodes, its child-child nodes up to the leaf nodes.
(Inherited from SuspendableDocumentNode)
Public methodEqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
Protected methodFinalize Finalizes an instance of the SuspendableDocumentNodeBase class.
(Inherited from SuspendableDocumentNodeBase)
Public methodGetChildObjectNamed Retrieves the child node of this instance with the name
C#
name
.
(Inherited from SuspendableDocumentNode)
Protected methodGetDocumentNodeChildrenWithName Infrastructure: Gets all child nodes of this instance along with its name, and optionally, a method to set the member variable which holds that child node to null. The returned enumeration is used to (i) provide default implementations for GetChildObjectNamed(String) and GetNameOfChildObject(IDocumentLeafNode) and (ii) to dispose all child objects when this instance (the parent) is disposed.
(Overrides SuspendableDocumentNodeGetDocumentNodeChildrenWithName)
Public methodGetHashCodeServes as the default hash function.
(Inherited from Object)
Public methodGetNameOfChildObject Gets the name of child node.
(Inherited from SuspendableDocumentNode)
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Protected methodHandleHighPriorityChildChangeCases Handles the case when a child changes, and a reaction is neccessary independently on the suspend state of the table.
(Inherited from SuspendableDocumentNode)
Protected methodHandleLowPriorityChildChangeCases Processes the event args e when this object is not suspended. This function serves two purposes: i) updating some cached data of this object by processing the event args of the child, and ii) optional transforming the event args, for instance to a new type, which afterwards is send to the parent and is used as event args in the [E:Changed] event of this object. The transformed event args is not used if this object is suspended (in this case the original event args is used).
(Inherited from SuspendableDocumentNode)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
Protected methodNotifyChildrenTunnelingEventHappened Notifies the child nodes of this instance that a tunneling event has happened.
(Inherited from SuspendableDocumentNode)
Protected methodOnAboutToBeResumed Is called when the suspend level is still 1 (one), but is about to fall to zero, i.e. shortly before the call to OnResume(Int32). This function is not called before OnResumeSilently(Int32)!
(Inherited from SuspendableDocumentNode)
Protected methodOnChanged Fires the change event with the EventArgs provided in the argument.
(Inherited from SuspendableDocumentNodeBase)
Protected methodOnNameChanged Fires both a Changed and a TunnelingEvent when the name has changed. The event arg of the Changed event is an instance of NamedObjectCollectionChangedEventArgs. The event arg of the Tunneling event is an instance of DocumentPathChangedEventArgs.
Protected methodOnResume Is called when the object is resumed, i.e. change notifications are allowed again. During the execution of this function, the [P:IsResumeInProgress] property will return true to indicate that the resume is currently in progress.
(Inherited from SuspendableDocumentNode)
Protected methodOnResumeSilently Is called when the suspend level falls down from 1 to zero by a call to ResumeSilently. This implementation disarma the suspendTokens of the childs of this object, deletes any accumulated events, and does not send any change event to the parent or the listeners of the Change event.
(Inherited from SuspendableDocumentNode)
Protected methodOnSuspended Called when the suspend level has just gone from 0 to 1, i.e. the object was suspended.
(Inherited from SuspendableDocumentNode)
Protected methodOnTunnelingEvent Fires the TunneledEvent event.
(Inherited from SuspendableDocumentNodeBase)
Public methodResume(ISuspendToken) Resumes changed events by calling Resume for the provided suspend token, and setting the reference to the suspend token to null. If Event data were accumulated during the suspended state, a changed event is triggered for each event data.
(Inherited from SuspendableDocumentNodeBase)
Public methodResume(ISuspendToken, EventFiring) Resumes changed events, either with taking the accumulated event data into account (see Resume(ISuspendToken)) or discarding the accumulated event data (see ResumeSilently(ISuspendToken), depending on the provided argument eventFiring.
(Inherited from SuspendableDocumentNodeBase)
Public methodResumeCompleteTemporarily Resumes the object completely for only a short time. Thus, if object was suspended before, it will be suspended again when the function returns.
(Inherited from SuspendableDocumentNode)
Public methodResumeCompleteTemporarilyGetToken Resumes the object completely for the time the returned token is referenced and not disposed. The return value is a token that had 'absorbed' the suspend count of the object, resulting in the suspend count of the object dropped to 0 (zero). When the returned token is finally disposed, the suspend count of the object is increased again by the 'absorbed' suspend count.
(Inherited from SuspendableDocumentNode)
Public methodResumeSilently Resumes changed events by calling Resume for the provided suspend token, and setting the reference to the suspend token to null. All event data accumulated during the suspended state are discarded, and thus no change event is triggered even if the instance has changed during the suspended state.
(Inherited from SuspendableDocumentNodeBase)
Public methodSetDisposeInProgress Sets the flag that dispose is in progress for this node and all child nodes recursively.
(Inherited from SuspendableDocumentNode)
Protected methodSetMemberAndRaiseSelfChangedT(NullableT, NullableT) Sets a member variable of this instance and raise a change event with Empty if the new value is different from the old value. The comparison is done using the IEquatableT interface of the member variable. Note: to set members that implement IDocumentNode please use the Child... functions.
(Inherited from SuspendableDocumentNodeBase)
Protected methodSetMemberAndRaiseSelfChangedT(T, T) Sets a member variable of this instance and raise a change event with Empty if the new value is different from the old value. The comparison is done using the IEquatableT interface of the member variable. Note: to set members that implement IDocumentNode please use the Child... functions.
(Inherited from SuspendableDocumentNodeBase)
Protected methodSetMemberEnumAndRaiseSelfChangedT Sets a member variable (which is an Enum) of this instance and raise a change event with Empty if the new value is different from the old value. The comparison is done using the IEquatableT interface of the member variable. Note: to set members that implement IDocumentNode please use the Child... functions.
(Inherited from SuspendableDocumentNodeBase)
Public methodSuspendGetToken Suspend will increase the SuspendLevel.
(Inherited from SuspendableDocumentNode)
Public methodToStringReturns a string that represents the current object.
(Inherited from Object)
Public methodTryGetName Tests if this item already has a name.
(Overrides SuspendableDocumentNodeBaseTryGetName(String))
Public methodVisitDocumentReferences Visits the document references of this instance. All proxies that this instance contain should be reported by the ReportProxies function. This function is responsible for processing of the proxies, for instance to relocated the path.
Top
Events
 NameDescription
Public eventChangedFired when something in the object has changed, and the object is not suspended.
(Inherited from SuspendableDocumentNodeBase)
Public eventTunneledEvent The event that is fired when the object is disposed. First argument is the sender, second argument is the original source, and third argument is the event arg.
(Inherited from SuspendableDocumentNodeBase)
Top
Fields
 NameDescription
Protected field_accumulatedEventData Holds the accumulated change data.
(Inherited from SuspendableDocumentNodeWithSingleAccumulatedDataT)
Protected field_creationTime The date/time of creation of this document.
Protected field_documentProperties The graph properties, key is a string, value is a property (arbitrary object) you want to store here.
Protected field_lastChangeTime The date/time when this document was changed.
Protected field_name The name of the document.
Protected field_notes Notes concerning this document.
Protected field_parent The parent object this instance belongs to.
(Inherited from SuspendableDocumentNodeBase)
Protected field_suspendTokensOfChildsStores the suspend tokens of the suspended childs of this object.
(Inherited from SuspendableDocumentNode)
Top
Extension Methods
 NameDescription
Public Extension MethodGetProjectFolderPropertyDocuments Gets the project folder property documents down the project folder hierarchie.
(Defined by PropertyExtensions)
Public Extension MethodGetPropertyBags Gets the property bags in the hierarchy. The first bag in the enumeration is the bag that owns the owner. Then the bags of the folders in which the owner is located, its parent folders, and then UserSettings, ApplicationSettings, and BuiltinSettings follow.
(Defined by PropertyExtensions)
Public Extension MethodGetPropertyContext Gets the property context of the document node. If the provided node is not implementing IPropertyBagOwner, the parent nodes of this node are searched, until a node which implements IPropertyBagOwner is found.
(Defined by PropertyExtensions)
Public Extension MethodGetPropertyHierarchy Gets the property bags in the hierarchal order. The first bag in the enumeration is the bag that owns the owner. Then the bags of the folders in which the owner is located, its parent folders, and then UserSettings, ApplicationSettings, and BuiltinSettings follow.
(Defined by PropertyExtensions)
Public Extension MethodGetPropertyValueT Gets the property value. The property is searched in the provided owner, then in the containing folder, and then the hierarchy down to the built-in property bag.
(Defined by PropertyExtensions)
Public Extension MethodGetPropertyValueT Gets the property value. The property is searched in the provided owner, then in the containing folder, and then the hierarchy down to the built-in property bag.
(Defined by PropertyExtensions)
Public Extension MethodShowPropertyDialog
(Defined by TextDocumentOtherActions)
Public Extension MethodShowRenameDialog
(Defined by TextDocumentOtherActions)
Top
See Also