public void Add(AnimatedControl control, int milliseconds) { if (m_Controls.Where(n => n.Control.Equals(control)).Count() == 0) { m_Controls.Add(new AnimatorNode(control, milliseconds >= m_RefreshPeriod ? milliseconds / m_RefreshPeriod : 1)); } }
public void SetInterval(AnimatedControl control, int milliseconds) { try { AnimatorNode node = m_Controls.Find(n => n.Control.Equals(control)); node.Interval = milliseconds >= m_RefreshPeriod ? milliseconds / m_RefreshPeriod : 1; } catch (ArgumentNullException) { System.Diagnostics.Debug.WriteLine("Animator.SetInterval ArgumentNullException"); } }
public void Remove(AnimatedControl control) { try { AnimatorNode node = m_Controls.Find(n => n.Control.Equals(control)); node.TickCount = 0; m_Controls.Remove(node); } catch (ArgumentNullException) { System.Diagnostics.Debug.WriteLine("Animator.Remove ArgumentNullException"); } }
public void Draw(AnimatedControl control) { try { AnimatorNode node = m_Controls.Find(n => n.Control.Equals(control)); node.TickCount = 1; RunTimer(true); } catch (ArgumentNullException) { System.Diagnostics.Debug.WriteLine("Animator.Draw ArgumentNullException"); } }
public int GetInterval(AnimatedControl control) { int interval = -1; try { AnimatorNode node = m_Controls.Find(n => n.Control.Equals(control)); interval = node.Interval * m_RefreshPeriod; } catch (ArgumentNullException) { System.Diagnostics.Debug.WriteLine("Animator.GetInterval ArgumentNullException"); } return(interval); }
public AnimatorNode(AnimatedControl control, int interval) { Control = control; Interval = interval; TickCount = 0; }