public void Close()
 {
     if (!this.IsOpen)
     {
         return;
     }
     this.IsOpen = false;
     if (this.Window != null)
     {
         for (int i = 0; i < this.Window.Elements.Count; i++)
         {
             ArcenUI_Element element = this.Window.Elements[i];
             if (!(element.Controller is WindowTogglingButtonController))
             {
                 continue;
             }
             WindowTogglingButtonController otherControllerAsType  = (WindowTogglingButtonController)element.Controller;
             ToggleableWindowController     otherRelatedController = otherControllerAsType.GetRelatedController();
             if (!otherRelatedController.IsOpen)
             {
                 continue;
             }
             otherRelatedController.Close();
         }
     }
 }
        public override void HandleClick()
        {
            ToggleableWindowController controller = this.GetRelatedController();

            if (controller.IsOpen)
            {
                controller.Close();
            }
            else
            {
                controller.Open();
                if (this.Window != null && this.Window.Controller is WindowControllerAbstractBase)
                {
                    ((WindowControllerAbstractBase)this.Window.Controller).CloseWindowsOtherThanThisOne(controller);
                }
            }
        }
 public void CloseWindowsOtherThanThisOne(ToggleableWindowController controller)
 {
     for (int i = 0; i < this.Window.Elements.Count; i++)
     {
         ArcenUI_Element element = this.Window.Elements[i];
         if (!(element.Controller is WindowTogglingButtonController))
         {
             continue;
         }
         WindowTogglingButtonController otherControllerAsType  = (WindowTogglingButtonController)element.Controller;
         ToggleableWindowController     otherRelatedController = otherControllerAsType.GetRelatedController();
         if (otherRelatedController == controller)
         {
             continue;
         }
         if (!otherRelatedController.IsOpen)
         {
             continue;
         }
         otherRelatedController.Close();
     }
 }