protected void OnChildFrameClosed(ClientFrame child) { if (null != childFrames) { childFrames.Remove(child); } }
public void Close() { if (!isopen) { return; } isopen = false; UIManager.Instance().RemoveFrame(this); if (null != childFrames) { List <ClientFrame> handles = new List <ClientFrame>(childFrames.Count); handles.AddRange(childFrames); for (int i = 0; i < handles.Count; ++i) { handles[i].Close(); } handles.Clear(); childFrames.Clear(); } OnCloseFrame(); if (null != parentFrame) { parentFrame.OnChildFrameClosed(this); parentFrame = null; } if (null != instance) { Object.Destroy(instance); instance = null; } Logger.LogFormat("[{0}] HasBeenClosed ID = {1}", GetType().Name, frameId); }
public void CloseFrame <T>(int frameId = -1) where T : ClientFrame, new() { if (!mActiveFrames.ContainsKey(typeof(T))) { return; } var frames = mActiveFrames[typeof(T)]; ClientFrame frame = null; for (int i = 0; i < frames.Count; ++i) { if (frames[i].frameId == frameId) { frame = frames[i]; break; } } if (null != frame) { frame.Close(); } }