1- using System ;
1+ using System ;
22using System . Collections . Generic ;
33using System . Diagnostics ;
44using System . Diagnostics . Contracts ;
@@ -55,15 +55,15 @@ public abstract class BaseNode
5555 public event NodeEventHandler NameChanged ;
5656 public event NodeEventHandler CommentChanged ;
5757
58- protected readonly GrowingList < bool > levelsOpen = new GrowingList < bool > ( false ) ;
58+ protected GrowingList < bool > LevelsOpen { get ; } = new GrowingList < bool > ( false ) ;
5959
6060 [ ContractInvariantMethod ]
6161 private void ObjectInvariants ( )
6262 {
6363 Contract . Invariant ( name != null ) ;
6464 Contract . Invariant ( comment != null ) ;
6565 Contract . Invariant ( Offset . ToInt32 ( ) >= 0 ) ;
66- Contract . Invariant ( levelsOpen != null ) ;
66+ Contract . Invariant ( LevelsOpen != null ) ;
6767 }
6868
6969 public static BaseNode CreateInstanceFromType ( Type nodeType )
@@ -80,7 +80,7 @@ protected BaseNode()
8080 Name = $ "N{ nodeIndex ++ : X08} ";
8181 Comment = string . Empty ;
8282
83- levelsOpen [ 0 ] = true ;
83+ LevelsOpen [ 0 ] = true ;
8484 }
8585
8686 public abstract void GetUserInterfaceInfo ( out string name , out Image icon ) ;
@@ -166,15 +166,15 @@ public virtual void Update(HotSpot spot)
166166 /// <param name="level">The level to toggle.</param>
167167 internal void ToggleLevelOpen ( int level )
168168 {
169- levelsOpen [ level ] = ! levelsOpen [ level ] ;
169+ LevelsOpen [ level ] = ! LevelsOpen [ level ] ;
170170 }
171171
172172 /// <summary>Sets the specific level.</summary>
173173 /// <param name="level">The level to set.</param>
174174 /// <param name="open">True to open.</param>
175175 internal void SetLevelOpen ( int level , bool open )
176176 {
177- levelsOpen [ level ] = open ;
177+ LevelsOpen [ level ] = open ;
178178 }
179179
180180 /// <summary>Adds a <see cref="HotSpot"/> the user can interact with.</summary>
@@ -336,7 +336,7 @@ protected int AddOpenClose(ViewInfo view, int x, int y)
336336 return x + Icons . Dimensions ;
337337 }
338338
339- return AddIcon ( view , x , y , levelsOpen [ view . Level ] ? Icons . OpenCloseOpen : Icons . OpenCloseClosed , 0 , HotSpotType . OpenClose ) ;
339+ return AddIcon ( view , x , y , LevelsOpen [ view . Level ] ? Icons . OpenCloseOpen : Icons . OpenCloseClosed , 0 , HotSpotType . OpenClose ) ;
340340 }
341341
342342 /// <summary>Draws a type drop icon if the node is selected.</summary>
0 commit comments