private void RefreshRootDesignerLayout()
        {
            if (!this.HasActiveDesigner)
            {
                _eventHandlersLayout.Layouts.Clear();
                this.DesignerLayouts.Clear();
                _designersParser = new ContainedDesignersParser(this.ContainedDesigners);

                foreach (StateInitializationDesigner stateInitializationDesigner in this.DesignersParser.StateInitializationDesigners)
                {
                    DesignerLayout layout = new DesignerLayout(stateInitializationDesigner);
                    this.DesignerLayouts[stateInitializationDesigner.Activity] = layout;
                    _eventHandlersLayout.Layouts.Add(layout);
                }

                // we now add the EventDrivenDesigners
                foreach (EventDrivenDesigner eventDrivenDesigner in this.DesignersParser.EventDrivenDesigners)
                {
                    DesignerLayout layout = new DesignerLayout(eventDrivenDesigner);
                    this.DesignerLayouts[eventDrivenDesigner.Activity] = layout;
                    _eventHandlersLayout.Layouts.Add(layout);
                }

                foreach (StateFinalizationDesigner stateFinalizationDesigner in this.DesignersParser.StateFinalizationDesigners)
                {
                    DesignerLayout layout = new DesignerLayout(stateFinalizationDesigner);
                    this.DesignerLayouts[stateFinalizationDesigner.Activity] = layout;
                    _eventHandlersLayout.Layouts.Add(layout);
                }

                this.RootDesignerLayout = _statesLayout;
            }
            else
                this.RootDesignerLayout = _eventDrivenLayout;
        }
 private void RefreshRootDesignerLayout()
 {
     if (!this.HasActiveDesigner)
     {
         this._eventHandlersLayout.Layouts.Clear();
         this.DesignerLayouts.Clear();
         this._designersParser = new ContainedDesignersParser(this.ContainedDesigners);
         foreach (StateInitializationDesigner designer in this.DesignersParser.StateInitializationDesigners)
         {
             DesignerLayout item = new DesignerLayout(designer);
             this.DesignerLayouts[designer.Activity] = item;
             this._eventHandlersLayout.Layouts.Add(item);
         }
         foreach (EventDrivenDesigner designer2 in this.DesignersParser.EventDrivenDesigners)
         {
             DesignerLayout layout2 = new DesignerLayout(designer2);
             this.DesignerLayouts[designer2.Activity] = layout2;
             this._eventHandlersLayout.Layouts.Add(layout2);
         }
         foreach (StateFinalizationDesigner designer3 in this.DesignersParser.StateFinalizationDesigners)
         {
             DesignerLayout layout3 = new DesignerLayout(designer3);
             this.DesignerLayouts[designer3.Activity] = layout3;
             this._eventHandlersLayout.Layouts.Add(layout3);
         }
         this.RootDesignerLayout = this._statesLayout;
     }
     else
     {
         this.RootDesignerLayout = this._eventDrivenLayout;
     }
 }