예제 #1
0
        /// <summary>
        /// Makes a chokepoint within the Current Attacks widget visible by making sure both
        /// the widget and chokepoint expandos are expanded, scrolling it into view and flashing
        /// the chokepoint title.
        /// </summary>
        /// <seealso cref="tmrReveal_Tick"/>
        /// <param name="arg">The ChokePoint to make visible.</param>
        public void Reveal(object arg)
        {
            ChokePoint cp = arg as ChokePoint;

            if (cp == null)
            {
                return;
            }

            if (!expandos.ContainsKey(cp))
            {
                return; // not shown in current attacks list
            }
            if (tmrReveal.Enabled)
            {
                return; // another Reveal() in progress
            }
            Expando expChokepoint     = expandos[cp];
            Expando expCurrentAttacks = (Expando)this.Parent;

            if (!expChokepoint.CanCollapse)
            {
                return; // cp list disabled, no events
            }
            if (expCurrentAttacks.Collapsed)
            {
                expChokepoint.Expand(); // no animation
                expCurrentAttacks.Collapsed = false;
            }
            if (expChokepoint.Collapsed)
            {
                expChokepoint.Collapsed = false; // animate
            }
            tmrReveal.Tag = expChokepoint;
            tmrReveal.Start();
        }