當前位置: 首頁>>代碼示例>>C#>>正文


C# Transition.add方法代碼示例

本文整理匯總了C#中Transitions.Transition.add方法的典型用法代碼示例。如果您正苦於以下問題:C# Transition.add方法的具體用法?C# Transition.add怎麽用?C# Transition.add使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Transitions.Transition的用法示例。


在下文中一共展示了Transition.add方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: LabelMain_MouseLeave

 private void LabelMain_MouseLeave(object sender, EventArgs e)
 {
     Transition T = new Transition(new TransitionType_EaseInEaseOut(400));
     T.add(this, "ForeColor", Color.Silver);
     T.add(LabelMain, "ForeColor", Color.Silver);
     T.run();
 }
開發者ID:ptx-console,項目名稱:cheetah-web-browser,代碼行數:7,代碼來源:LabelButton.cs

示例2: Move

 public void Move(PlayingCard card, Point position)
 {
     var t = new Transition(new TransitionType_EaseInEaseOut(500));
     t.add(card, "Left", position.X);
     t.add(card, "Top", position.Y);
     t.run();
 }
開發者ID:nerdumdigitalis,項目名稱:Kani,代碼行數:7,代碼來源:CardMover.cs

示例3: transitionPictures

        /// <summary>
        /// Performs a random tarnsition between the two pictures.
        /// </summary>
        public void transitionPictures()
        {
            // We randomly choose where the current image is going to 
            // slide off to (and where we are going to slide the inactive
            // image in from)...
            int iDestinationLeft = (m_Random.Next(2) == 0) ? Width : -Width;
            int iDestinationTop = (m_Random.Next(3) - 1) * Height;

            // We move the inactive image to this location...
            SuspendLayout();
            m_InactivePicture.Top = iDestinationTop;
            m_InactivePicture.Left = iDestinationLeft;
            m_InactivePicture.BringToFront();
            ResumeLayout();

            // We perform the transition which moves the active image off the
            // screen, and the inactive one onto the screen...
            Transition t = new Transition(new TransitionType_EaseInEaseOut(1000));
            t.add(m_InactivePicture, "Left", 0);
            t.add(m_InactivePicture, "Top", 0);
            t.add(m_ActivePicture, "Left", iDestinationLeft);
            t.add(m_ActivePicture, "Top", iDestinationTop);
            t.run();

            // We swap over which image is active and inactive for next time
            // the function is called...
            PictureBox tmp = m_ActivePicture;
            m_ActivePicture = m_InactivePicture;
            m_InactivePicture = tmp;
        }
開發者ID:CreeperLava,項目名稱:ME3Explorer,代碼行數:33,代碼來源:KittenPuppyControl.cs

示例4: cmdSwap_Click

        /// <summary>
        /// Called when the "Swap" button is pressed.
        /// </summary>
        private void cmdSwap_Click(object sender, EventArgs e)
        {
            // We swap over the group-boxes that show the "Bounce" and 
            // "Throw and Catch" transitions. The active one is animated 
            // left off the screen and the inactive one is animated right
            // onto the screen...

            // We work out which box is currently on screen and
            // which is off screen...
            Control ctrlOnScreen, ctrlOffScreen;
            if (gbBounce.Left == GROUP_BOX_LEFT)
            {
                ctrlOnScreen = gbBounce;
                ctrlOffScreen = gbThrowAndCatch;
            }
            else
            {
                ctrlOnScreen = gbThrowAndCatch;
                ctrlOffScreen = gbBounce;
            }
            ctrlOnScreen.SendToBack();
            ctrlOffScreen.BringToFront();

            // We create a transition to animate the two boxes simultaneously. One is
            // animated onto the screen, the other off the screen.

            // The ease-in-ease-out transition acclerates the rate of change for the 
            // first half of the animation, and decelerates during the second half.

            Transition t = new Transition(new TransitionType_EaseInEaseOut(1000));
            t.add(ctrlOnScreen, "Left", -1 * ctrlOnScreen.Width);
            t.add(ctrlOffScreen, "Left", GROUP_BOX_LEFT);
            t.run();
        }
開發者ID:ZakiMohammed,項目名稱:dot-net-transitions,代碼行數:37,代碼來源:Form1.cs

示例5: FadePicBoxes

 private void FadePicBoxes(float xOpacity, float plusOpacity)
 {
     var fade = new Transition(new TransitionType_Linear(400));
     fade.add(pictureBoxX, "Opacity", xOpacity);
     fade.add(pictureBoxPlus, "Opacity", plusOpacity);
     fade.run();
 }
開發者ID:RodrigoVarasLopez,項目名稱:ardupilot-mega,代碼行數:7,代碼來源:ConfigAccelerometerCalibrationQuad.cs

示例6: AssistantGoUp

 private void AssistantGoUp()
 {
     //debug.Visible = true;
     Transition t = new Transition(new TransitionType_Deceleration(500));
     t.add(this, "Top", ScreenHeight/3);
        t.add(MicPanel, "Top", ScreenHeight/3*2-Mic.Height-10);
        //t.add(MessagePanelz, "Height", this.Height - 200);
     hidden = false;
     t.run();
     t.TransitionCompletedEvent += new EventHandler<Transition.Args>(t_TransitionCompletedEvent);
 }
開發者ID:codedit,項目名稱:SpeechAssistant,代碼行數:11,代碼來源:Main.cs

示例7: AnimateShowFormTrigger

 private void AnimateShowFormTrigger()
 {
     this.Show();
     Transition t = new Transition(new TransitionType_Deceleration(100));
     int tempY = this.Location.Y;
     this.CenterToScreen();
     int centerY = this.Location.Y;
     this.Top = tempY;
     t.add(this, "Top", centerY);
     t.add(this, "Opacity", 1.0);
     t.run();
 }
開發者ID:nodegin,項目名稱:dhs,代碼行數:12,代碼來源:MainForm.cs

示例8: SlideOut

        public void SlideOut()
        {
            this.Location = new Point(FindForm().Width, 66);
            this.Visible = true;
            this.BackColor = Color.Silver;
            this.BringToFront();

            var t = new Transition(new TransitionType_EaseInEaseOut(400));
            t.TransitionCompletedEvent += ShowTransitionCompletedEvent;
            t.add(this, "Left", 15);
            t.add(this, "BackColor", Color.White);
            t.run();
        }
開發者ID:CustomerFX,項目名稱:SalesLogixMobileDeveloperTools,代碼行數:13,代碼來源:ActionPanel.cs

示例9: Ask

 public void Ask(string question)
 {
     if (question == "quit")
     {
         HideAssistant();
         Application.Exit();
     }
     if (asked == 3)
     {
         Transition t = new Transition(new TransitionType_Deceleration(500));
         t.add(MessagePanelz, "Top", MessagePanelz.Location.Y - 290);
         t.run();
         asked = 0;
     }
     DisplayQuestion(question);
     try
     {
         string uriString = "http://infini-dev.com/WISA/WISA.php"; //post request to server and get response
         WebClient myWebClient = new WebClient();
         NameValueCollection PostParams = new NameValueCollection();
         PostParams.Add("request", question);
         byte[] responseArray =
         myWebClient.UploadValues(uriString, "POST", PostParams);
         string response = Encoding.ASCII.GetString(responseArray);
         DisplayResponse(response);
     }
     catch
     {
         DisplayResponse("I'm sorry, I could not connect to the server");
     }
     asked++;
 }
開發者ID:codedit,項目名稱:SpeechAssistant,代碼行數:32,代碼來源:Main.cs

示例10: swipe

        public void swipe(bool show = true)
        {
            this.Visible = true;
            Transition _transasition = new Transitions.Transition(new TransitionType_EaseInEaseOut(500));
            _transasition.add(this, "Left", show ? 0 : this.Width);
            _transasition.run();

            while (this.Left != (show ? 0 : this.Width))
            {
                Application.DoEvents();
            }

            if (!show)
            {
                closed(new EventArgs());
                _owner.Resize -= owner_Resize;
                _owner.Controls.Remove(this);
                this.Dispose();
            }
            else
            {
                _loaded = true;
                ResizeForm();
                shown(new EventArgs());
            }
        }
開發者ID:juliooscar,項目名稱:Pharma,代碼行數:26,代碼來源:pnlSlider.cs

示例11: SetErrorMessageOpacity

        private void SetErrorMessageOpacity()
        {
            if (_presenter.HasError)
            {
                // Todo - is this the prob? maybe single log trasition
                var t = new Transition(new TransitionType_Acceleration(1000));
                t.add(PBOX_WarningIcon, "Opacity", 1.0F);
                t.add(LBL_Error, "Opacity", 1.0F);
                t.run();

                //Transition.runChain(_ErrorTransition);
            }
            else
            {
                _NoErrorTransition.run();
            }
        }
開發者ID:ECain,項目名稱:MissionPlanner,代碼行數:17,代碼來源:ConfigCameraStab.cs

示例12: Activate

        public void Activate()
        {
            _presenter = new ConfigCameraStabModel(MainV2.comPort);
            presenterBindingSource.DataSource = _presenter;

            var delay = new Transition(new TransitionType_Linear(2000));
            var fadeIn = new Transition(new TransitionType_Linear(800));
            fadeIn.add(PBOX_WarningIcon, "Opacity", 1.0F);
            fadeIn.add(LBL_Error, "Opacity", 1.0F);
           
            _ErrorTransition = new[] { delay, fadeIn };

            _NoErrorTransition = new Transition(new TransitionType_Linear(10));
            _NoErrorTransition.add(PBOX_WarningIcon, "Opacity", 0.0F);
            _NoErrorTransition.add(LBL_Error, "Opacity", 0.0F);
             
            //setup button actions
            foreach (var btn in Controls.Cast<Control>().OfType<Button>())
                btn.Click += HandleButtonClick;


            _presenter.PropertyChanged += (s, e) =>
                    {
                        if (e.PropertyName == "HasError")
                        {
                            SetErrorMessageOpacity();
                        }
                    };
            
            _presenter.PropertyChanged += CheckCommandStates;
            LNK_wiki.MouseEnter += (s, e) => FadeLinkTo((LinkLabel)s, Color.CornflowerBlue);
            LNK_wiki.MouseLeave += (s, e) => FadeLinkTo((LinkLabel)s, Color.WhiteSmoke);

            SetErrorMessageOpacity();

            // Fix for mono bug where binding sources do not respect INPC notifications on POCOs
            if (MainV2.MONO)
            {
                _presenter.PropertyChanged += (s, e) => presenterBindingSource.ResetBindings(false);
            }

            _presenter.Load();
        }
開發者ID:ECain,項目名稱:MissionPlanner,代碼行數:43,代碼來源:ConfigCameraStab.cs

示例13: ConfigMount

        public ConfigMount()
        {
            InitializeComponent();
            PBOX_WarningIcon.Opacity = 0.0F;
            LBL_Error.Opacity = 0.0F;

            var delay = new Transition(new TransitionType_Linear(2000));
            var fadeIn = new Transition(new TransitionType_Linear(800));
            fadeIn.add(PBOX_WarningIcon, "Opacity", 1.0F);
            fadeIn.add(LBL_Error, "Opacity", 1.0F);

            _ErrorTransition = new[] { delay, fadeIn };

            _NoErrorTransition = new Transition(new TransitionType_Linear(10));
            _NoErrorTransition.add(PBOX_WarningIcon, "Opacity", 0.0F);
            _NoErrorTransition.add(LBL_Error, "Opacity", 0.0F);

            //setup button actions
            foreach (var btn in Controls.Cast<Control>().OfType<Button>())
                btn.Click += HandleButtonClick;

            LNK_wiki.MouseEnter += (s, e) => FadeLinkTo((LinkLabel)s, Color.CornflowerBlue);
            LNK_wiki.MouseLeave += (s, e) => FadeLinkTo((LinkLabel)s, Color.WhiteSmoke);

            SetErrorMessageOpacity();

            if (MainV2.cs.firmware == MainV2.Firmwares.ArduPlane)
            {
                mavlinkComboBoxTilt.Items.AddRange(Enum.GetNames(typeof(Channelap)));
                mavlinkComboBoxRoll.Items.AddRange(Enum.GetNames(typeof(Channelap)));
                mavlinkComboBoxPan.Items.AddRange(Enum.GetNames(typeof(Channelap)));
            }
            else
            {
                mavlinkComboBoxTilt.Items.AddRange(Enum.GetNames(typeof(Channelac)));
                mavlinkComboBoxRoll.Items.AddRange(Enum.GetNames(typeof(Channelac)));
                mavlinkComboBoxPan.Items.AddRange(Enum.GetNames(typeof(Channelac)));
            }
        }
開發者ID:unluckyprince,項目名稱:ardupilot-mega,代碼行數:39,代碼來源:ConfigMount.cs

示例14: buttonBack_Click

 private void buttonBack_Click(object sender, EventArgs e)
 {
     var t = new Transition(new TransitionType_EaseInEaseOut(400));
     t.TransitionCompletedEvent += HideTransitionCompletedEvent;
     t.add(this, "Left", FindForm().Width);
     t.add(this, "BackColor", Color.Silver);
     t.run();
 }
開發者ID:CustomerFX,項目名稱:SalesLogixMobileDeveloperTools,代碼行數:8,代碼來源:ActionPanel.cs

示例15: ShowMenu

        public void ShowMenu(string menuName)
        {
            if (menuName.Equals(CurrentlyFocused.Name))
                return;

            MetroMenuItem target = GetMenuItem(menuName);

            if (target == null)
                throw new InvalidOperationException("Menu by the name of " + menuName + " could not be found..");

            this.Invoke(delegate()
            {
                //-- Don't want this control resize as it's losing focus..
                CurrentlyFocused.Control.Anchor = AnchorStyles.Left | AnchorStyles.Top;

                //-- Should I also make it invisible? Will this improve performance? Since technically the control doesn't have
                //-- to be drawn..
                //CurrentlyFocused.Control.Visible = false;

                //-- Make sure the control that will be focused is the same size as the parent.
                target.Control.Size = this.Size;

                //-- Definitely want this control to resize with the parent now - it's in focus!
                target.Control.Anchor = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right | AnchorStyles.Bottom;

                if (target.MenuTransition == MetroMenuTransition.Instant)
                {
                    target.Control.Left = 0;
                    target.Control.BringToFront();
                }
                else if (target.MenuTransition == MetroMenuTransition.EaseIn)
                {
                    int direction = 1;

                    if (MenuItems.IndexOf(target) < MenuItems.IndexOf(CurrentlyFocused))
                        direction = -1;

                    target.Control.Left = this.Width * direction;
                    target.Control.BringToFront();

                    Transition t = new Transition(new TransitionType_EaseInEaseOut(500));
                    t.add(target.Control, "Left", 0);
                    t.add(CurrentlyFocused.Control, "Left", -this.Width * direction);
                    t.run();
                }
            });

            CurrentlyFocused = target;
        }
開發者ID:bberak,項目名稱:PokerDotNet,代碼行數:49,代碼來源:MetroFlowMenu.cs


注:本文中的Transitions.Transition.add方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。