static bool EnumEvents(TreeNode node) { if (node == null) { return(true); } if (node.Left != null) { if (!EnumEvents(node.Left)) { return(false); } } LoginEvent e = node.Data as LoginEvent; if (e.eventTime > now) { return(false); } TreeNode right = node.Right; RemoveEvent(e); e.FireEvent(); if (right != null) { return(EnumEvents(right)); } return(false); }
public static void AddEvent(LoginEvent e) { if (e.Node != null) { return; } m_numEvents++; e.Node = m_tree.AddData(e); }
public static void RemoveEvent(LoginEvent e) { if (e.Node == null) { return; } m_numEvents--; m_tree.RemoveNode(e.Node); e.Node = null; }