@@ -39,9 +39,12 @@ public abstract class BaseNode
39
39
/// <summary>Gets or sets the parent node.</summary>
40
40
public BaseNode ParentNode { get ; internal set ; }
41
41
42
- /// <summary>Gets a value indicating whether this node is wrapped into an other node.</summary>
42
+ /// <summary>Gets a value indicating whether this node is wrapped into an other node. </summary>
43
43
public bool IsWrapped => ParentNode is BaseWrapperNode ;
44
44
45
+ /// <summary>All nodes that are wrapped can't be selected except classnodes because they have a context menu</summary>
46
+ public bool CanBeSelected => ! IsWrapped || ( this is ClassNode ) ;
47
+
45
48
/// <summary>Gets or sets a value indicating whether this node is hidden.</summary>
46
49
public bool IsHidden { get ; set ; }
47
50
@@ -236,6 +239,15 @@ public virtual void ClearSelection()
236
239
/// <returns>The calculated height.</returns>
237
240
public abstract int CalculateDrawnHeight ( DrawContext context ) ;
238
241
242
+ /// <summary>
243
+ /// Called when this node has been created, initialized and the parent node has been assigned. For some nodes
244
+ /// Additional work has to be performed, this work can be done in a derived method of this method.
245
+ /// </summary>
246
+ public virtual void PerformPostInitWork ( )
247
+ {
248
+ // nop
249
+ }
250
+
239
251
/// <summary>Updates the node from the given <paramref name="spot"/>. Sets the <see cref="Name"/> and <see cref="Comment"/> of the node.</summary>
240
252
/// <param name="spot">The spot.</param>
241
253
public virtual void Update ( HotSpot spot )
@@ -367,7 +379,7 @@ protected void AddSelection(DrawContext context, int x, int y, int height)
367
379
Contract . Requires ( context != null ) ;
368
380
Contract . Requires ( context . Graphics != null ) ;
369
381
370
- if ( y > context . ClientArea . Bottom || y + height < 0 || IsWrapped )
382
+ if ( y > context . ClientArea . Bottom || y + height < 0 || ! CanBeSelected )
371
383
{
372
384
return ;
373
385
}
0 commit comments