コード例 #1
0
        protected override void OnActivated(EventArgs e)
        {
            if (!isInitialized)
            {
                controlContainer.Theme        = Theme;
                controlContainer.Style        = Style;
                controlContainer.StyleManager = StyleManager;

                MaximizeBox = false;
                MinimizeBox = false;
                Movable     = false;

                TopMost         = true;
                FormBorderStyle = FormBorderStyle.FixedDialog;

                Size = new Size(400, 200);

                Taskbar myTaskbar = new Taskbar();
                switch (myTaskbar.Position)
                {
                case TaskbarPosition.Left:
                    Location = new Point(myTaskbar.Bounds.Width + 5, myTaskbar.Bounds.Height - Height - 5);
                    break;

                case TaskbarPosition.Top:
                    Location = new Point(myTaskbar.Bounds.Width - Width - 5, myTaskbar.Bounds.Height + 5);
                    break;

                case TaskbarPosition.Right:
                    Location = new Point(myTaskbar.Bounds.X - Width - 5, myTaskbar.Bounds.Height - Height - 5);
                    break;

                case TaskbarPosition.Bottom:
                    Location = new Point(myTaskbar.Bounds.Width - Width - 5, myTaskbar.Bounds.Y - Height - 5);
                    break;

                case TaskbarPosition.Unknown:
                default:
                    Location = new Point(Screen.PrimaryScreen.Bounds.Width - Width - 5, Screen.PrimaryScreen.Bounds.Height - Height - 5);
                    break;
                }

                controlContainer.Location = new Point(0, 60);
                controlContainer.Size     = new Size(Width - 40, Height - 80);
                controlContainer.Anchor   = AnchorStyles.Top | AnchorStyles.Right | AnchorStyles.Bottom | AnchorStyles.Left;

                StyleManager.UpdateOwnerForm();

                isInitialized = true;

                MoveAnimation myMoveAnim = new MoveAnimation();
                myMoveAnim.Start(controlContainer, new Point(20, 60), TransitionType.EaseInOutCubic, 15);
            }

            base.OnActivated(e);
        }
コード例 #2
0
        public void Unroll()
        {
            Apply();
            m_rolled = false;
            Point pos = CalculateTargetLocation(m_rolled, Location);

            if (AnimatedRolling)
            {
                m_moveAnim.Start(this, pos, ROLLING_TRANSITION, ROLLING_DURATION);
            }
            else
            {
                Location = pos;
            }
            if (Unrolled != null)
            {
                Unrolled(this, new EventArgs());
            }
        }
コード例 #3
0
        private void lnk_go_Click(object sender, EventArgs e)
        {
            MoveAnimation move = new MoveAnimation();

            move.Start(MessageBar, new Point(0, 0), TransitionType.EaseInCubic, 20);

            if (tbx_doc.Text.Length != 0)
            {
                if (rbt_cnpj.Checked)
                {
                    if (ValidarCNPJ(tbx_doc.Text))
                    {
                        MessageBar.Style = MetroColorStyle.Green;
                        MessageBar.Text  = ValidarCPF(tbx_doc.Text).ToString();
                    }
                    else
                    {
                        MessageBar.Style = MetroColorStyle.Red;
                        MessageBar.Text  = ValidarCPF(tbx_doc.Text).ToString();
                    }
                }
                else if (rbt_cpf.Checked)
                {
                    if (ValidarCPF(tbx_doc.Text))
                    {
                        MessageBar.Style = MetroColorStyle.Green;
                        MessageBar.Text  = ValidarCPF(tbx_doc.Text).ToString();
                    }
                    else
                    {
                        MessageBar.Style = MetroColorStyle.Red;
                        MessageBar.Text  = ValidarCPF(tbx_doc.Text).ToString();
                    }
                }
                else if (rbt_pis.Checked)
                {
                    if (ValidarPIS(tbx_doc.Text))
                    {
                        MessageBar.Style = MetroColorStyle.Green;
                        MessageBar.Text  = ValidarCPF(tbx_doc.Text).ToString();
                    }
                    else
                    {
                        MessageBar.Style = MetroColorStyle.Red;
                        MessageBar.Text  = ValidarCPF(tbx_doc.Text).ToString();
                    }
                }
            }
            else
            {
                MessageBar.Style = MetroColorStyle.Red;
                MessageBar.Text  = "Opps! Nada foi digitado...";
            }
        }
コード例 #4
0
ファイル: MSwitchAnmation.cs プロジェクト: ywscr/MomoForm
        private void MoveTo(Control target, Point targetLocation)
        {
            if (target == null)
            {
                count -= 1; return;
            }

            target.Visible = true;
            var animation = new MoveAnimation(target, Speed, Duration);

            animation.TargetLocation = targetLocation;
            animation.Start();
            animation.AnimationExecuted += Animation_AnimationExecuted;
        }
コード例 #5
0
        private void tbx_doc_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (!char.IsDigit(e.KeyChar) && e.KeyChar != 08 && e.KeyChar != 46 && e.KeyChar != 45)
            {
                MoveAnimation move = new MoveAnimation();

                e.Handled = true;

                MessageBar.Style = MetroColorStyle.Red;
                MessageBar.Text  = "Opps! Este campo só aceita números...";

                move.Start(MessageBar, new Point(0, 0), TransitionType.EaseInCubic, 20);
            }
        }
コード例 #6
0
ファイル: PlayerActor.cs プロジェクト: snowhork/dungeon
        public override void TurnStart()
        {
            print("trunstart");
            _selector.Selectable = true;
            var vectors = new IntVector[]
            {
                new IntVector(1, 0),
                new IntVector(0, 1),
                new IntVector(-1, 0),
                new IntVector(0, -1),
            };

            var moveArrows = new List <MoveArrow>();

            foreach (var vector in vectors)
            {
                var move = new Move(IntTransform, MapInfo, vector);
                if (!move.IsValid)
                {
                    continue;
                }
                var moveArrow = Instantiate(_moveArrowPref);
                moveArrow.transform.position = transform.position +
                                               new Vector3(vector.X * Const.MapChipWidth, 0,
                                                           vector.Y * Const.MapChipWidth);
                moveArrows.Add(moveArrow);
                moveArrow.OnSelected.Subscribe(_ =>
                {
                    move.Execute();
                    var anim = new MoveAnimation(transform, moveArrow.transform.position);
                    StartCoroutine(anim.Start());
                    _selector.Selectable = false;
                    anim.OnAnimationFinished.Subscribe(__ =>
                    {
                        foreach (var arrow in moveArrows)
                        {
                            Destroy(arrow.gameObject);
                        }
                        moveArrows.Clear();
                        ActionFinishedSubject.OnNext(Unit.Default);
                    });
                });
            }
        }
コード例 #7
0
        // Token: 0x06000418 RID: 1048 RVA: 0x0000E224 File Offset: 0x0000C424
        protected override void OnActivated(EventArgs e)
        {
            if (!this.isInitialized)
            {
                base.MaximizeBox     = false;
                base.MinimizeBox     = false;
                base.Movable         = false;
                base.TopMost         = true;
                base.FormBorderStyle = FormBorderStyle.FixedDialog;
                base.Size            = new Size(400, 200);
                Taskbar taskbar = new Taskbar();
                switch (taskbar.Position)
                {
                case TaskbarPosition.Left:
                    base.Location = new Point(taskbar.Bounds.Width + 5, taskbar.Bounds.Height - base.Height - 5);
                    goto IL_1A2;

                case TaskbarPosition.Top:
                    base.Location = new Point(taskbar.Bounds.Width - base.Width - 5, taskbar.Bounds.Height + 5);
                    goto IL_1A2;

                case TaskbarPosition.Right:
                    base.Location = new Point(taskbar.Bounds.X - base.Width - 5, taskbar.Bounds.Height - base.Height - 5);
                    goto IL_1A2;

                case TaskbarPosition.Bottom:
                    base.Location = new Point(taskbar.Bounds.Width - base.Width - 5, taskbar.Bounds.Y - base.Height - 5);
                    goto IL_1A2;
                }
                base.Location = new Point(Screen.PrimaryScreen.Bounds.Width - base.Width - 5, Screen.PrimaryScreen.Bounds.Height - base.Height - 5);
IL_1A2:
                this.controlContainer.Location = new Point(0, 60);
                this.controlContainer.Size     = new Size(base.Width - 40, base.Height - 80);
                this.controlContainer.Anchor   = (AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right);
                this.isInitialized             = true;
                MoveAnimation moveAnimation = new MoveAnimation();
                moveAnimation.Start(this.controlContainer, new Point(20, 60), TransitionType.EaseInOutCubic, 15);
            }
            base.OnActivated(e);
        }
コード例 #8
0
        protected override void OnActivated(EventArgs e)
        {
            if (!isInitialized)
            {
                controlContainer.Theme        = Theme;
                controlContainer.Style        = Style;
                controlContainer.StyleManager = StyleManager;

                MaximizeBox = false;
                MinimizeBox = false;
                Movable     = true;

                TopMost = true;

                Size = new Size(500, 300);

                if (enableTaskBar == true)
                {
                    Taskbar myTaskbar = new Taskbar();
                    switch (myTaskbar.Position)
                    {
                    case TaskbarPosition.Left:
                        Location = new Point(myTaskbar.Bounds.Width + 5, myTaskbar.Bounds.Height - Height - 5);
                        break;

                    case TaskbarPosition.Top:
                        Location = new Point(myTaskbar.Bounds.Width - Width - 5, myTaskbar.Bounds.Height + 5);
                        break;

                    case TaskbarPosition.Right:
                        Location = new Point(myTaskbar.Bounds.X - Width - 5, myTaskbar.Bounds.Height - Height - 5);
                        break;

                    case TaskbarPosition.Bottom:
                        Location = new Point(myTaskbar.Bounds.Width - Width - 5, myTaskbar.Bounds.Y - Height - 5);
                        break;

                    case TaskbarPosition.Unknown:
                    default:
                        Location = new Point(Screen.PrimaryScreen.Bounds.Width - Width - 5, Screen.PrimaryScreen.Bounds.Height - Height - 5);
                        break;
                    }
                }
                controlContainer.Location = new Point(0, 60);
                controlContainer.Size     = new Size(Width - 40, Height - 80);
                controlContainer.Anchor   = AnchorStyles.Top | AnchorStyles.Right | AnchorStyles.Bottom | AnchorStyles.Left;

                controlContainer.AutoScroll          = false;
                controlContainer.HorizontalScrollbar = false;
                controlContainer.VerticalScrollbar   = false;
                controlContainer.Refresh();

                if (StyleManager != null)
                {
                    StyleManager.Update();
                }

                isInitialized = true;

                MoveAnimation myMoveAnim = new MoveAnimation();
                myMoveAnim.Start(controlContainer, new Point(20, 60), TransitionType.EaseInOutCubic, 15);
            }

            base.OnActivated(e);
        }
コード例 #9
0
        protected override void OnActivated(EventArgs e)
        {
            if (!this.isInitialized)
            {
                this.controlContainer.Theme        = base.Theme;
                this.controlContainer.Style        = base.Style;
                this.controlContainer.StyleManager = base.StyleManager;
                base.MaximizeBox = false;
                base.MinimizeBox = false;
                base.Movable     = true;
                base.TopMost     = true;
                base.Size        = new System.Drawing.Size(400, 200);
                Taskbar taskbar = new Taskbar();
                switch (taskbar.Position)
                {
                case TaskbarPosition.Unknown:
                {
                    Rectangle bounds    = Screen.PrimaryScreen.Bounds;
                    Rectangle rectangle = Screen.PrimaryScreen.Bounds;
                    base.Location = new Point(bounds.Width - base.Width - 5, rectangle.Height - base.Height - 5);
                    break;
                }

                case TaskbarPosition.Left:
                {
                    Rectangle bounds1    = taskbar.Bounds;
                    Rectangle rectangle1 = taskbar.Bounds;
                    base.Location = new Point(bounds1.Width + 5, rectangle1.Height - base.Height - 5);
                    break;
                }

                case TaskbarPosition.Top:
                {
                    Rectangle bounds2    = taskbar.Bounds;
                    Rectangle rectangle2 = taskbar.Bounds;
                    base.Location = new Point(bounds2.Width - base.Width - 5, rectangle2.Height + 5);
                    break;
                }

                case TaskbarPosition.Right:
                {
                    Rectangle bounds3    = taskbar.Bounds;
                    Rectangle rectangle3 = taskbar.Bounds;
                    base.Location = new Point(bounds3.X - base.Width - 5, rectangle3.Height - base.Height - 5);
                    break;
                }

                case TaskbarPosition.Bottom:
                {
                    Rectangle bounds4    = taskbar.Bounds;
                    Rectangle rectangle4 = taskbar.Bounds;
                    base.Location = new Point(bounds4.Width - base.Width - 5, rectangle4.Y - base.Height - 5);
                    break;
                }

                default:
                {
                    goto case TaskbarPosition.Unknown;
                }
                }
                this.controlContainer.Location            = new Point(0, 60);
                this.controlContainer.Size                = new System.Drawing.Size(base.Width - 40, base.Height - 80);
                this.controlContainer.Anchor              = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
                this.controlContainer.AutoScroll          = false;
                this.controlContainer.HorizontalScrollbar = false;
                this.controlContainer.VerticalScrollbar   = false;
                this.controlContainer.Refresh();
                if (base.StyleManager != null)
                {
                    base.StyleManager.Update();
                }
                this.isInitialized = true;
                MoveAnimation moveAnimation = new MoveAnimation();
                moveAnimation.Start(this.controlContainer, new Point(20, 60), TransitionType.EaseInOutCubic, 15);
            }
            base.OnActivated(e);
        }
コード例 #10
0
        private void MessageBar_Click(object sender, EventArgs e)
        {
            MoveAnimation move = new MoveAnimation();

            move.Start(MessageBar, new Point(0, -40), TransitionType.EaseInCubic, 20);
        }