Unable to add automatic outlining node with the same definition key but with different data payload.

SyntaxEditor for WPF Forum

Posted 7 years ago by Erwin Liong
Version: 16.1.0634
Platform: .NET 4.5
Environment: Windows 7 (64-bit)

Hi Actipro,

I have derived an OutliningNodeDefinition class, say DerivedNodeDefinition.

In my outlining source (derived from RangeOutliningSourceBase), I have added a node with a new instance of DerivedNodeDefinition.
I have passed in data payload to each of the instance of DerivedNodeDefinition. This is to avoid having the DerivedNodeDefinition from parsing through the snapshot content in GetCollapsedContent .

When AddNode is requested at the same offset with the same DerivedNodeDefinition key (but with different data payload), the OutliningManager.Automatic.cs skipped the request to add the node if the key is already present. (See Line 111).

Furthermore, client is not allowed to remove node from IOutliningSource.

Is there a way to work around this? Is the check at line 111 necessary? Should the code at least update to the newer version of NodeDefinition?

Thank you.

Comments (1)

Answer - Posted 7 years ago by Actipro Software Support - Cleveland, OH, USA


In normal usage scenarios, I don't believe the code at line 111 causes any problems and keeps things efficient.  If you have a different payload though, then you should have your node definition return a unique Key for that payload.  That would ensure that the node gets updated in this scenario.

Actipro Software Support

The latest build of this product (v24.1.2) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.