Ejemplo n.º 1
0
        protected virtual void DoApplyBuff(Mobile m)
        {
            if (m == null || m.Deleted || !ApplyBuff(m))
            {
                return;
            }

            if (SoundID > 0)
            {
                m.PlaySound(SoundID);
            }

            if (EffectID > 0)
            {
                m.FixedParticles(EffectID, 10, 15, 5018, EffectLayer.Waist);
            }

            if (IconID > 0)
            {
                m.Send(new AddBuffPacket(m, new BuffInfo((BuffIcon)IconID, LabelNumber)));
            }

            if (DelayTimer != null && DelayTimer.Running)
            {
                DelayTimer.Stop();
            }

            DelayTimer = Timer.DelayCall(BuffDuration, DoRemoveBuff, m);
        }
Ejemplo n.º 2
0
        public virtual void Dispose()
        {
            if (IsDisposed)
            {
                return;
            }

            IsDisposed = true;

            if (DelayTimer != null)
            {
                DelayTimer.Stop();
                DelayTimer = null;
            }

            Source   = null;
            Map      = null;
            EffectID = -1;
            Hue      = 0;
            Speed    = 0;
            Duration = 0;
            Render   = EffectRender.Normal;
            Delay    = TimeSpan.Zero;
            Callback = null;
            Sending  = false;
        }
Ejemplo n.º 3
0
        public virtual void Send()
        {
            if (IsDisposed || Source == null || Sending)
            {
                return;
            }

            Sending = true;

            if (Delay > TimeSpan.Zero)
            {
                DelayTimer = Timer.DelayCall(
                    Delay,
                    () =>
                {
                    if (DelayTimer != null)
                    {
                        DelayTimer.Stop();
                        DelayTimer = null;
                    }

                    if (OnSend())
                    {
                        OnAfterSend();
                    }
                });
            }
            else
            {
                if (OnSend())
                {
                    OnAfterSend();
                }
            }
        }
        public void Stop()
        {
            // Stop timers
            DelayTimer.Stop();
            if (DurationTimer != null)
            {
                DurationTimer.Stop();
                DurationTimer.Dispose();
                DurationTimer = null;
            }

            // Not visible
            Opacity = 0;
        }
Ejemplo n.º 5
0
 private void Form_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyData == Keys.Escape)
     {
         InstrumentoPreview.Dock     = DockStyle.None;
         InstrumentoPreview.Location = new Point(12, 128);
         FormBorderStyle             = FormBorderStyle.FixedDialog;
         WindowState        = FormWindowState.Normal;
         DelayLabel.Visible = false;
         DelayTimer.Stop();
         labelTransposicao.Visible = true;
         TransSemitones.Visible    = true;
         StopPlaying();
     }
 }
Ejemplo n.º 6
0
        protected virtual void DoRemoveBuff(Mobile m)
        {
            if (m == null || m.Deleted || !RemoveBuff(m))
            {
                return;
            }

            if (IconID > 0)
            {
                m.Send(new RemoveBuffPacket(m, (BuffIcon)IconID));
            }

            if (DelayTimer != null && DelayTimer.Running)
            {
                DelayTimer.Stop();
            }

            DelayTimer = null;
        }
Ejemplo n.º 7
0
        protected virtual void DoRemoveBuff(Mobile from)
        {
            if (from == null || from.Deleted)
            {
                return;
            }

            if (RemoveBuff(from))
            {
                from.Send(new RemoveBuffPacket(from, (BuffIcon)IconID));

                if (DelayTimer != null && DelayTimer.Running)
                {
                    DelayTimer.Stop();
                }

                DelayTimer = null;
            }
        }
Ejemplo n.º 8
0
        /// <summary>
        /// Handles the timer tick when using a populate delay.
        /// </summary>
        /// <param name="sender">The source object.</param>
        /// <param name="e">The event arguments.</param>
        private void PopulateDropDown(object sender, EventArgs e)
        {
            if (DelayTimer != null)
            {
                DelayTimer.Stop();
            }

            // Update the prefix/search text.
            SearchText = Text;

            // The Populated event enables advanced, custom filtering. The
            // client needs to directly update the ItemsSource collection or
            // call the Populate method on the control to continue the
            // display process if Cancel is set to true.
            PopulatingEventArgs populating = new PopulatingEventArgs(SearchText);

            OnPopulating(populating);
            if (!populating.Cancel)
            {
                PopulateComplete();
            }
        }
Ejemplo n.º 9
0
        private void DelayTimer_Tick(object sender, EventArgs e)
        {
            if (card1 != null && card2 != null)
            {
                if (card1.Number == card2.Number && card1.Suit != card2.Suit)
                {
                    picBox2.Hide();
                    picBox1.Hide();
                    matched = matched + 2;
                }
            }

            card1.Flip();
            card2.Flip();
            picBox2.Image = card2.CurrentImage;
            picBox1.Image = card1.CurrentImage;
            card1         = null;
            card2         = null;
            DelayTimer.Stop();
            foreach (PictureBox box in boxes)
            {
                box.Enabled = true;
            }
        }
Ejemplo n.º 10
0
 private void DelayTimer_Tick(object sender, EventArgs e)
 {
     DelayTimer.Enabled = false;
     DelayTimer.Stop();
     Close();
 }
Ejemplo n.º 11
0
 private void DelayTimer_Tick(object sender, EventArgs e)
 {
     DelayTimer.Stop();
     LoadApplication();
 }