protected virtual void OnSend() { if (IsDisposed) { return; } LastAutoRefresh = DateTime.UtcNow; RegisterInstance(); if (Parent is SuperGump) { ((SuperGump)Parent).AddChild(this); Children.TrimExcess(); } if (InstancePoller == null) { InitPollTimer(); } else if (!InstancePoller.Running) { InstancePoller.Running = EnablePolling; } Linked.AsEnumerable().ForEach(g => g.OnLinkSend(this)); Linked.TrimExcess(); if (Modal && User != null && User.Holding != null) { Timer.DelayCall(TimeSpan.FromSeconds(1.0), User.DropHolding); } }
protected virtual void OnRefreshed() { if (IsDisposed) { return; } LastAutoRefresh = DateTime.UtcNow; RegisterInstance(); if (Parent is SuperGump) { ((SuperGump)Parent).AddChild(this); } if (InstancePoller == null) { InitPollTimer(); } else if (!InstancePoller.Running) { InstancePoller.Running = EnablePolling; } Linked.AsEnumerable().ForEach(g => g.OnLinkRefreshed(this)); }
protected virtual void OnHidden(bool all) { if (!IsDisposed) { Linked.AsEnumerable().ForEach(g => g.OnLinkHidden(this)); } }
protected virtual void OnHidden(bool all) { if (IsDisposed) { return; } Linked.AsEnumerable().ForEach(g => g.OnLinkHidden(this)); Linked.TrimExcess(); }
public void Dispose() { if (IsDisposed) { return; } IsDisposed = true; //Console.WriteLine("SuperGump Disposing: {0} (0x{1:X})", GetType(), Serial); //GC.SuppressFinalize(this); VitaNexCore.TryCatch(OnDispose); VitaNexCore.TryCatch(UnregisterInstance); NextButtonID = 1; NextSwitchID = 0; NextTextInputID = 0; if (InstancePoller != null) { VitaNexCore.TryCatch(InstancePoller.Dispose); InstancePoller = null; } VitaNexCore.TryCatch( () => { Buttons.Clear(); TileButtons.Clear(); Switches.Clear(); Radios.Clear(); TextInputs.Clear(); LimitedTextInputs.Clear(); Entries.Clear(); Entries.TrimExcess(); Layout.Clear(); }); VitaNexCore.TryCatch(() => Linked.AsEnumerable().ForEach(Unlink)); VitaNexCore.TryCatch(() => Children.AsEnumerable().ForEach(RemoveChild)); IsOpen = false; Hidden = false; Parent = null; User = null; VitaNexCore.TryCatch(OnDisposed); }
protected virtual void OnClosed(bool all) { if (IsDisposed) { return; } UnregisterInstance(); if (InstancePoller != null) { InstancePoller.Dispose(); InstancePoller = null; } Linked.AsEnumerable().ForEach(g => g.OnLinkClosed(this)); }
protected virtual void OnSendFail() { if (IsDisposed) { return; } UnregisterInstance(); if (Parent is SuperGump) { ((SuperGump)Parent).RemoveChild(this); } if (InstancePoller != null) { InstancePoller.Dispose(); InstancePoller = null; } Linked.AsEnumerable().ForEach(g => g.OnLinkSendFail(this)); }