@@ -39,9 +39,12 @@ public abstract class BaseNode
3939 /// <summary>Gets or sets the parent node.</summary>
4040 public BaseNode ParentNode { get ; internal set ; }
4141
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>
4343 public bool IsWrapped => ParentNode is BaseWrapperNode ;
4444
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+
4548 /// <summary>Gets or sets a value indicating whether this node is hidden.</summary>
4649 public bool IsHidden { get ; set ; }
4750
@@ -236,6 +239,15 @@ public virtual void ClearSelection()
236239 /// <returns>The calculated height.</returns>
237240 public abstract int CalculateDrawnHeight ( DrawContext context ) ;
238241
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+
239251 /// <summary>Updates the node from the given <paramref name="spot"/>. Sets the <see cref="Name"/> and <see cref="Comment"/> of the node.</summary>
240252 /// <param name="spot">The spot.</param>
241253 public virtual void Update ( HotSpot spot )
@@ -367,7 +379,7 @@ protected void AddSelection(DrawContext context, int x, int y, int height)
367379 Contract . Requires ( context != null ) ;
368380 Contract . Requires ( context . Graphics != null ) ;
369381
370- if ( y > context . ClientArea . Bottom || y + height < 0 || IsWrapped )
382+ if ( y > context . ClientArea . Bottom || y + height < 0 || ! CanBeSelected )
371383 {
372384 return ;
373385 }
0 commit comments