public void RemoveInstance()
 {
     lock (LockInstance)
     {
         if (instance != null)
         {
             Ship     = null;
             instance = null;
         }
     }
 }
        public static FormShipEditorInfo Instance(ShipData ship, CatDatExtractor cde)
        {
            lock (LockInstance)
            {
                if (instance == null)
                {
                    instance = new FormShipEditorInfo(ship, cde);
                }

                return(instance);
            }
        }
 public void RemoveInstance()
 {
     lock (LockInstance)
     {
         if (instance != null)
         {
             ShipInfoForm.RemoveInstance();
             ShipInfoForm = null;
             ShipCargoForm.RemoveInstance();
             ShipCargoForm = null;
             instance      = null;
         }
     }
 }
 public void ChangeFormState()
 {
     if (ShipInfoForm == null)
     {
         ShipInfoForm          = FormShipEditorInfo.Instance(Ship, cde);
         ShipInfoForm.TopLevel = false;
         tabPageShipInfo.Controls.Add(ShipInfoForm);
         ShipInfoForm.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
         ShipInfoForm.Dock            = DockStyle.Fill;
         ShipInfoForm.ChangeFormState();
         ShipInfoForm.Show();
     }
     if (ShipCargoForm == null)
     {
         ShipCargoForm          = FormShipEditorCargo.Instance(Ship, cde);
         ShipCargoForm.TopLevel = false;
         tabPageShipCargo.Controls.Add(ShipCargoForm);
         ShipCargoForm.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
         ShipCargoForm.Dock            = DockStyle.Fill;
         ShipCargoForm.ChangeFormState();
         ShipCargoForm.Show();
     }
 }