public void CloseWindow(bool clientInitiated = false) { if (!clientInitiated) { QueuePacket(new CloseWindowPacket(CurrentWindow.ID)); } CurrentWindow.CopyToInventory(Inventory); CurrentWindow.Dispose(); CurrentWindow = InventoryWindow; }
/// <summary> /// Override to add custom disposing code. /// </summary> /// <param name="isDisposing"></param> protected virtual void Dispose(bool isDisposing) { if (_alreadyDisposed) { return; } if (isDisposing) { if (CurrentWindow != null) { CurrentWindow.Dispose(); } } _alreadyDisposed = true; }