Example #1
0
        internal void DeferAfter(RollingStoneBase stone)
        {
            if (stone == null)
            {
                return;
            }

            this.window.DeferWindowPos(stone.window);
        }
Example #2
0
        internal void ShowAfter(RollingStoneBase stone)
        {
            if (stone == null)
            {
                return;
            }

            this.window.MoveAndPlaceAfter(stone.window);
        }
Example #3
0
 protected override void Dispose(bool disposing)
 {
     stone = null;
     base.Dispose(disposing);
 }
Example #4
0
 public StoneWindow(RollingStoneBase stone) : base()
 {
     this.stone = stone;
     Text       = "Krento Stone";
     Name       = "StoneWindow";
 }
Example #5
0
        /// <summary>
        /// Delegate for mouse up event
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The <see cref="System.Windows.Forms.MouseEventArgs"/> instance containing the event data.</param>
        private void MouseUpInternalHandler(object sender, MouseEventArgs e)
        {
            isMouseDown = false;
            window.StopTimer(mouseTimer);
            bool ignore = mouseIgnore;

            if (FadeActive)
            {
                ignore = true;
            }

            mouseIgnore = false;
            Update(true);

            if (window.Dragged)
            {
                manager.DeleteWindow.Hide();
                int       offset          = (int)(manager.StoneSize - maxSize * scale) + 4;
                Rectangle dangerousBounds = this.window.Bounds;
                int       hOffset         = offset;
                int       vOffset         = offset;

                if (Left < manager.DeleteWindow.Left)
                {
                    hOffset = -offset;
                }

                if (Top < manager.DeleteWindow.Top)
                {
                    vOffset = -offset;
                }

                dangerousBounds.Offset(hOffset, vOffset);
                dangerousBounds.Size = new Size((int)MaxSize, (int)MaxSize);

                if ((manager.DeleteWindow.RecycleArea.IntersectsWith(dangerousBounds)) && (canRemove))
                {
                    manager.RemoveStoneRequest(this.Order, 1);
                }
                else
                {
                    RollingStoneBase nearest = manager.FindNearestStone(this, this.Left, this.Top);
                    if (nearest != null)
                    {
                        manager.Stones.Remove(this);
                        int newIndex = nearest.Order;
                        manager.Stones.Insert(newIndex, this);
                        manager.UpdateAngles();
                        manager.RotateRequest(0);
                        manager.FlushCurrentCircle();
                    }
                    else
                    {
                        manager.UpdateAngles();
                        manager.RotateRequest(0);
                        manager.FlushCurrentCircle();
                    }
                }
            }

            if ((!ignore) && (clicked) && (e.Button == MouseButtons.Left))
            {
                clicked = false;
                if (KeyboardInfo.ModifierKeys == Keys.None)
                {
                    Run();
                }
            }
        }