private async Task AnimateButtons() { Button1.Scale = 0; Button2.Scale = 0; Button3.Scale = 0; Button4.Scale = 0; Button5.Scale = 0; Button6.Scale = 0; Button7.Scale = 0; Button8.Scale = 0; Button9.Scale = 0; Button0.Scale = 0; ButtonX.Scale = 0; await Task.Delay(300); var tasks = new Task[] { Button1.ScaleTo(1, 200), Button2.ScaleTo(1, 200), Button3.ScaleTo(1, 200), Button4.ScaleTo(1, 200), Button5.ScaleTo(1, 200), Button6.ScaleTo(1, 200), Button7.ScaleTo(1, 200), Button8.ScaleTo(1, 200), Button9.ScaleTo(1, 200), Button0.ScaleTo(1, 200), ButtonX.ScaleTo(1, 200) }; await Task.WhenAll(tasks); }
void Start() { m_ButtonScript3 = m_Button_3.GetComponent <Button3>(); m_ButtonScript4 = m_Button_4.GetComponent <Button4>(); m_ButtonScript5 = m_Button_5.GetComponent <Button5>(); m_ButtonScript6 = m_Button_6.GetComponent <Button6>(); }
void ReleaseDesignerOutlets() { if (Button1 != null) { Button1.Dispose(); Button1 = null; } if (Button2 != null) { Button2.Dispose(); Button2 = null; } if (Button3 != null) { Button3.Dispose(); Button3 = null; } if (Button4 != null) { Button4.Dispose(); Button4 = null; } if (Button5 != null) { Button5.Dispose(); Button5 = null; } if (Button6 != null) { Button6.Dispose(); Button6 = null; } if (Image1 != null) { Image1.Dispose(); Image1 = null; } if (Image2 != null) { Image2.Dispose(); Image2 = null; } if (WebView1 != null) { WebView1.Dispose(); WebView1 = null; } }
private bool Handle6() { if (Solution == null || Position == Solution.Length) { return(false); } Button6.AddInteractionPunch(0.2f); Handle(6); return(false); }
public MainMenu(String filePath) { InitializeComponent(); this.filePath = filePath; label1.BackColor = Color.Transparent; button1.ButtonStyle(); button2.ButtonStyle(); button3.ButtonStyle(); button4.ButtonStyle(); button5.ButtonStyle(); Button6.ButtonStyle(); }
private void Button5_Click(object sender, EventArgs e) { bool Encontrou = false; if (ListaDispositivosNaSessao.Count >= int.Parse(EditQuantidade.Text)) { MessageBox.Show("Quantidade máxima de dispositivos atingida."); return; } else { for (int i = 0; i <= ListaComputador.Count - 1; i++) { Grid1.Focus(); Grid1.CurrentCell = Grid1.Rows[i].Cells[0]; if (ListaComputador[i].a == EditIdDispositivoCliente.Text) { Encontrou = true; if (ListaComputador[i].b == "S") { ComputadorVO Computador = new ComputadorVO(); Computador.Id = ListaComputador[i].Id; Computador.a = ListaComputador[i].a; Computador.b = ListaComputador[i].b; ListaDispositivosNaSessao.Add(Computador); } else { MessageBox.Show("Dispositivo não liberado para uso."); return; } break; } } } if (!Encontrou) { MessageBox.Show("Dispositivo não localizado na base de dados."); } Button6.PerformClick(); // Exercício: E se o dispositivo já tiver na sessão? }
public void ClickButton(int value) { foreach (var digit in value.ToString()) { if (digit == '1') { Button1.Click(); } if (digit == '2') { Button2.Click(); } if (digit == '3') { Button3.Click(); } if (digit == '4') { Button4.Click(); } if (digit == '5') { Button5.Click(); } if (digit == '6') { Button6.Click(); } if (digit == '7') { Button7.Click(); } if (digit == '8') { Button8.Click(); } if (digit == '9') { Button9.Click(); } if (digit == '0') { Button0.Click(); } } }
//Timers para animacion private void Timer1_Tick(object sender, EventArgs e) { circularProgressBar1.Value += 1; circularProgressBar1.Text = circularProgressBar1.Value.ToString(); circularProgressBar1.Minimum = 0; circularProgressBar1.Maximum = 100; if (circularProgressBar1.Value == 100) { timer1.Stop(); circularProgressBar1.Value = 0; circularProgressBar1.Text = circularProgressBar1.Value.ToString(); PictureBox1.Show(); circularProgressBar1.Hide(); Button13.Show(); Button6.Hide(); Button4.Hide(); OpenFileDialog buscar = new OpenFileDialog { InitialDirectory = @"C:\Program Files\Game_Booster\Juegos", Title = "Game Booster", CheckFileExists = true, CheckPathExists = true, DefaultExt = "url", Filter = "Ver mas juegos (*.url)|*.url|Todos los juegos (*.lnk)|*.lnk", FilterIndex = 1, }; if (buscar.ShowDialog() == DialogResult.OK) { Process.Start(buscar.FileName); Process process = new Process(); ProcessStartInfo startInfo = new ProcessStartInfo { WindowStyle = ProcessWindowStyle.Hidden, FileName = "cmd.exe", Arguments = @"/C timeout /t 3 /nobreak & TASKKILL /IM explorer.exe /F & exit" }; process.StartInfo = startInfo; process.Start(); } } }
private void Timer2_Tick(object sender, EventArgs e) { circularProgressBar2.Value += 2; circularProgressBar2.Text = circularProgressBar2.Value.ToString(); circularProgressBar2.Minimum = 0; circularProgressBar2.Maximum = 100; if (circularProgressBar2.Value == 100) { timer2.Stop(); circularProgressBar2.Value = 0; circularProgressBar2.Text = circularProgressBar2.Value.ToString(); Button1.Show(); circularProgressBar2.Hide(); Button6.Show(); Button13.Hide(); Button4.Show(); Process.Start(@"C:\Program Files\Game_Booster\Scrips\cerrar.vbs"); } }
void Awake() { thisLoggingID = loggingID++; Buttons = new KMSelectable[] { Button0, Button1, Button2, Button3, Button4, Button5, Button6, Button7, Button8, Button9 }; transform.Find("Background").GetComponent <MeshRenderer>().material.color = new Color(1, 0.1f, 0.1f); MeshRenderer mr = transform.Find("Wiring").GetComponent <MeshRenderer>(); mr.materials[0].color = new Color(0.1f, 0.1f, 0.1f); mr.materials[1].color = new Color(0.3f, 0.3f, 0.3f); mr.materials[2].color = new Color(0.1f, 0.4f, 0.8f); transform.Find("Main Display").Find("Edge").GetComponent <MeshRenderer>().material.color = new Color(0, 0, 0); transform.Find("Stage Display").Find("Edge").GetComponent <MeshRenderer>().material.color = new Color(0, 0, 0); Button0.OnInteract += Handle0; Button1.OnInteract += Handle1; Button2.OnInteract += Handle2; Button3.OnInteract += Handle3; Button4.OnInteract += Handle4; Button5.OnInteract += Handle5; Button6.OnInteract += Handle6; Button7.OnInteract += Handle7; Button8.OnInteract += Handle8; Button9.OnInteract += Handle9; Color c = new Color(.71f, .70f, .68f); //new Color(0.91f, 0.88f, 0.86f); Button0.GetComponent <MeshRenderer>().material.color = c; Button1.GetComponent <MeshRenderer>().material.color = c; Button2.GetComponent <MeshRenderer>().material.color = c; Button3.GetComponent <MeshRenderer>().material.color = c; Button4.GetComponent <MeshRenderer>().material.color = c; Button5.GetComponent <MeshRenderer>().material.color = c; Button6.GetComponent <MeshRenderer>().material.color = c; Button7.GetComponent <MeshRenderer>().material.color = c; Button8.GetComponent <MeshRenderer>().material.color = c; Button9.GetComponent <MeshRenderer>().material.color = c; GetComponent <KMBombModule>().OnActivate += ActivateModule; }
public ConverterDigits() { TBLayout.SuspendLayout(); Controls.Add(TBLayout); Controls.Add(TextArea); Controls.Add(TextLine); Name = "ConverterDigits"; Button7.AddColor1(); Button7.Click += new EventHandler(InsertText); Button8.AddColor1(); Button8.Click += new EventHandler(InsertText); Button9.AddColor1(); Button9.Click += new EventHandler(InsertText); ButtonBackspace.AddColor1(); ButtonBackspace.Click += new EventHandler(Backspace); ButtonC.AddColor1(); ButtonC.Click += new EventHandler(InsertText); ButtonD.AddColor1(); ButtonD.Click += new EventHandler(InsertText); ButtonDelete.AddColor1(); ButtonDelete.Click += new EventHandler(Delete); ButtonEnter.AddColor1(); ButtonEnter.Click += new EventHandler(GetAnswer); ButtonI.AddColor1(); ButtonI.Click += new EventHandler(InsertText); ButtonL.AddColor1(); ButtonL.Click += new EventHandler(InsertText); ButtonM.AddColor1(); ButtonM.Click += new EventHandler(InsertText); ButtonV.AddColor1(); ButtonV.Click += new EventHandler(InsertText); ButtonX.AddColor1(); ButtonX.Click += new EventHandler(InsertText); Button0.AddColor1(); Button0.Click += new EventHandler(InsertText); Button1.AddColor1(); Button1.Click += new EventHandler(InsertText); Button2.AddColor1(); Button2.Click += new EventHandler(InsertText); Button3.AddColor1(); Button3.Click += new EventHandler(InsertText); Button4.AddColor1(); Button4.Click += new EventHandler(InsertText); Button5.AddColor1(); Button5.Click += new EventHandler(InsertText); Button6.AddColor1(); Button6.Click += new EventHandler(InsertText); TextArea.AddColor1(); TextLine.AddColor1(); TBLayout.Controls.AddRange(new Control[] { Button7, Button8, Button9, ButtonD, ButtonEnter, Button4, Button5, Button6, ButtonC, ButtonBackspace, Button1, Button2, Button3, ButtonL, ButtonDelete, Button0, ButtonI, ButtonV, ButtonX, ButtonM }); ResumeLayout(false); PerformLayout(); TBLayout.ResumeLayout(false); }
public override void ViewDidLoad() { base.ViewDidLoad(); Button0.SetCommand(_viewModel.Button0Action); Button1.SetCommand(_viewModel.Button1Action); Button2.SetCommand(_viewModel.Button2Action); Button3.SetCommand(_viewModel.Button3Action); Button4.SetCommand(_viewModel.Button4Action); Button5.SetCommand(_viewModel.Button5Action); Button6.SetCommand(_viewModel.Button6Action); Button7.SetCommand(_viewModel.Button7Action); Button8.SetCommand(_viewModel.Button8Action); Button9.SetCommand(_viewModel.Button9Action); LeftButton.SetCommand(_viewModel.LeftButtonAction); CommaButton.SetCommand(_viewModel.CommaButtonAction); RightButton.SetCommand(_viewModel.RightButtonAction); AddRecordButton.SetCommand(_viewModel.AddRecordAction); DeleteButton.SetCommand(_viewModel.DeleteButtonAction); IncomeButton.SetCommand(_viewModel.IncomeButtonAction); ExpensesButton.SetCommand(_viewModel.ExpensesButtonAction); TransferButton.SetCommand(_viewModel.TransferButtonAction); _bindings.Add(this.SetBinding(() => _viewModel.SignText, () => SignLabel.Text)); _bindings.Add(this.SetBinding(() => _viewModel.LeftButtonText, () => LeftButtonText)); _bindings.Add(this.SetBinding(() => _viewModel.RightButtonText, () => RightButtonText)); _bindings.Add(this.SetBinding(() => _viewModel.AmountLabelText, () => AmountLabel.Text)); _bindings.Add(this.SetBinding(() => _viewModel.IncomeButtonColor, () => IncomeButton.BackgroundColor).ConvertSourceToTarget(x => x.ToNative())); _bindings.Add(this.SetBinding(() => _viewModel.TransButtonColor, () => TransferButton.BackgroundColor).ConvertSourceToTarget(x => x.ToNative())); _bindings.Add(this.SetBinding(() => _viewModel.ExpensesButtonColor, () => ExpensesButton.BackgroundColor).ConvertSourceToTarget(x => x.ToNative())); HolderView.ApplyStyle(_viewModel.MainStyling); TemplatesButton.ApplyStyle(_viewModel.MainStyling); RightButton.ApplyStyle(_viewModel.MainStyling); LeftButton.ApplyStyle(_viewModel.MainStyling); MiddleImageView.ApplyStyle(_viewModel.MainStyling); }
private void playBackPress(string key) { switch (key) { case "Q": Button1.PerformClick(); break; case "W": Button2.PerformClick(); break; case "E": Button3.PerformClick(); break; case "R": Button4.PerformClick(); break; case "A": Button5.PerformClick(); break; case "S": Button6.PerformClick(); break; case "D": Button7.PerformClick(); break; case "F": Button8.PerformClick(); break; case "Y": Button9.PerformClick(); break; case "U": Button10.PerformClick(); break; case "I": Button11.PerformClick(); break; case "O": Button12.PerformClick(); break; case "H": Button13.PerformClick(); break; case "J": Button14.PerformClick(); break; case "K": Button15.PerformClick(); break; case "L": Button16.PerformClick(); break; } }
void ReleaseDesignerOutlets() { if (Button0 != null) { Button0.Dispose(); Button0 = null; } if (Button1 != null) { Button1.Dispose(); Button1 = null; } if (Button2 != null) { Button2.Dispose(); Button2 = null; } if (Button3 != null) { Button3.Dispose(); Button3 = null; } if (Button4 != null) { Button4.Dispose(); Button4 = null; } if (Button5 != null) { Button5.Dispose(); Button5 = null; } if (Button6 != null) { Button6.Dispose(); Button6 = null; } if (Button7 != null) { Button7.Dispose(); Button7 = null; } if (Button8 != null) { Button8.Dispose(); Button8 = null; } if (Button9 != null) { Button9.Dispose(); Button9 = null; } if (ButtonAsterisc != null) { ButtonAsterisc.Dispose(); ButtonAsterisc = null; } if (ButtonSharp != null) { ButtonSharp.Dispose(); ButtonSharp = null; } if (CallButton != null) { CallButton.Dispose(); CallButton = null; } if (Display != null) { Display.Dispose(); Display = null; } if (PhoneNumberText != null) { PhoneNumberText.Dispose(); PhoneNumberText = null; } if (TranslateButton != null) { TranslateButton.Dispose(); TranslateButton = null; } }
void Awake() { if (ignoredModules == null) { ignoredModules = GetComponent <KMBossModule>().GetIgnoredModules("Forget Me Not", new string[] { "14", "42", "501", "A>N<D", "Bamboozling Time Keeper", "Black Arrows", "Brainf---", "Busy Beaver", "Don't Touch Anything", "Floor Lights", "Forget Any Color", "Forget Enigma", "Forget Everything", "Forget Infinity", "Forget It Not", "Forget Maze Not", "Forget Me Later", "Forget Me Not", "Forget Perspective", "Forget The Colors", "Forget Them All", "Forget This", "Forget Us Not", "Iconic", "Keypad Directionality", "Kugelblitz", "Multitask", "OmegaDestroyer", "OmegaForest", "Organization", "Password Destroyer", "Purgatory", "RPS Judging", "Security Council", "Shoddy Chess", "Simon Forgets", "Simon's Stages", "Souvenir", "Tallordered Keys", "The Time Keeper", "Timing is Everything", "The Troll", "Turn The Key", "The Twin", "Übermodule", "Ultimate Custom Night", "The Very Annoying Button", "Whiteout" }); } thisLoggingID = loggingID++; Buttons = new KMSelectable[] { Button0, Button1, Button2, Button3, Button4, Button5, Button6, Button7, Button8, Button9 }; transform.Find("Background").GetComponent <MeshRenderer>().material.color = new Color(1, 0.1f, 0.1f); MeshRenderer mr = transform.Find("Wiring").GetComponent <MeshRenderer>(); mr.materials[0].color = new Color(0.1f, 0.1f, 0.1f); mr.materials[1].color = new Color(0.3f, 0.3f, 0.3f); mr.materials[2].color = new Color(0.1f, 0.4f, 0.8f); transform.Find("Main Display").Find("Edge").GetComponent <MeshRenderer>().material.color = new Color(0, 0, 0); transform.Find("Stage Display").Find("Edge").GetComponent <MeshRenderer>().material.color = new Color(0, 0, 0); Button0.OnInteract += Handle0; Button1.OnInteract += Handle1; Button2.OnInteract += Handle2; Button3.OnInteract += Handle3; Button4.OnInteract += Handle4; Button5.OnInteract += Handle5; Button6.OnInteract += Handle6; Button7.OnInteract += Handle7; Button8.OnInteract += Handle8; Button9.OnInteract += Handle9; Color c = new Color(.71f, .70f, .68f); //new Color(0.91f, 0.88f, 0.86f); Button0.GetComponent <MeshRenderer>().material.color = c; Button1.GetComponent <MeshRenderer>().material.color = c; Button2.GetComponent <MeshRenderer>().material.color = c; Button3.GetComponent <MeshRenderer>().material.color = c; Button4.GetComponent <MeshRenderer>().material.color = c; Button5.GetComponent <MeshRenderer>().material.color = c; Button6.GetComponent <MeshRenderer>().material.color = c; Button7.GetComponent <MeshRenderer>().material.color = c; Button8.GetComponent <MeshRenderer>().material.color = c; Button9.GetComponent <MeshRenderer>().material.color = c; GetComponent <KMBombModule>().OnActivate += ActivateModule; }
/// <summary> /// 1:This is my "play" button, this uses StoryBoard and Thickness animations so that once the button is pressed the colorful bars move out of the way of the play area. /// 2:A Doubleanimation is used to "draw" the play area. It changes the opacity of the buttons from 0 to 1. /// 3: Once the buttons been pressed the "play" button becomes dissabled. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Button_Click_2(object sender, RoutedEventArgs e) { #region The animations for the sticks are here //Animation for stick 1 var sb = new Storyboard(); var ta = new ThicknessAnimation(); ta.BeginTime = new TimeSpan(0); ta.SetValue(Storyboard.TargetNameProperty, "stick1"); Storyboard.SetTargetProperty(ta, new PropertyPath(MarginProperty)); ta.From = new Thickness(94, 0, 182, 0); ta.To = new Thickness(94, 0, 500, 0); ta.Duration = new Duration(TimeSpan.FromSeconds(1)); sb.Children.Add(ta); sb.Begin(this); //Stick2 animation ta.SetValue(Storyboard.TargetNameProperty, "stick2"); Storyboard.SetTargetProperty(ta, new PropertyPath(MarginProperty)); ta.From = new Thickness(86, 0, -93, 0); ta.To = new Thickness(86, 0, 500, 0); ta.Duration = new Duration(TimeSpan.FromSeconds(1)); sb.Children.Add(ta); sb.Begin(this); //Stick3 animation ta.SetValue(Storyboard.TargetNameProperty, "stick3"); Storyboard.SetTargetProperty(ta, new PropertyPath(MarginProperty)); ta.From = new Thickness(91, 0, 127, 0); ta.To = new Thickness(91, 0, 500, 0); ta.Duration = new Duration(TimeSpan.FromSeconds(1)); sb.Children.Add(ta); sb.Begin(this); //Stick4 animation ta.SetValue(Storyboard.TargetNameProperty, "stick4"); Storyboard.SetTargetProperty(ta, new PropertyPath(MarginProperty)); ta.From = new Thickness(94, 0, 296, 0); ta.To = new Thickness(94, 0, 500, 0); ta.Duration = new Duration(TimeSpan.FromSeconds(1)); sb.Children.Add(ta); sb.Begin(this); //Stick5 animation ta.SetValue(Storyboard.TargetNameProperty, "stick5"); Storyboard.SetTargetProperty(ta, new PropertyPath(MarginProperty)); ta.From = new Thickness(328, 0, -113, 0); ta.To = new Thickness(328, 0, 500, 0); ta.Duration = new Duration(TimeSpan.FromSeconds(1)); sb.Children.Add(ta); sb.Begin(this); //Stick6 animation ta.SetValue(Storyboard.TargetNameProperty, "stick6"); Storyboard.SetTargetProperty(ta, new PropertyPath(MarginProperty)); ta.From = new Thickness(47, 0, 74, 0); ta.To = new Thickness(47, 0, 500, 0); ta.Duration = new Duration(TimeSpan.FromSeconds(1)); sb.Children.Add(ta); sb.Begin(this); //Stick7 animation ta.SetValue(Storyboard.TargetNameProperty, "stick7"); Storyboard.SetTargetProperty(ta, new PropertyPath(MarginProperty)); ta.From = new Thickness(298, 0, 1, 0); ta.To = new Thickness(298, 0, 500, 0); ta.Duration = new Duration(TimeSpan.FromSeconds(1)); sb.Children.Add(ta); sb.Begin(this); //Stick8 animation ta.SetValue(Storyboard.TargetNameProperty, "stick8"); Storyboard.SetTargetProperty(ta, new PropertyPath(MarginProperty)); ta.From = new Thickness(300, 0, -113, 0); ta.To = new Thickness(300, 0, 500, 0); ta.Duration = new Duration(TimeSpan.FromSeconds(1)); sb.Children.Add(ta); sb.Begin(this); //Stick 9 ta.SetValue(Storyboard.TargetNameProperty, "stick9"); Storyboard.SetTargetProperty(ta, new PropertyPath(MarginProperty)); ta.From = new Thickness(47, 0, -165, 0); ta.To = new Thickness(47, 0, 500, 0); ta.Duration = new Duration(TimeSpan.FromSeconds(1)); sb.Children.Add(ta); sb.Begin(this); #endregion #region Show the game area DoubleAnimation da = new DoubleAnimation(); da.From = 0; da.To = 1; da.Duration = new Duration(TimeSpan.FromSeconds(2)); Button0.BeginAnimation(OpacityProperty, da); Button1.BeginAnimation(OpacityProperty, da); Button2.BeginAnimation(OpacityProperty, da); Button3.BeginAnimation(OpacityProperty, da); Button4.BeginAnimation(OpacityProperty, da); Button5.BeginAnimation(OpacityProperty, da); Button6.BeginAnimation(OpacityProperty, da); Button7.BeginAnimation(OpacityProperty, da); Button8.BeginAnimation(OpacityProperty, da); #endregion #region disable the play button PlayButton.IsEnabled = false; PlayButton.Background = Brushes.Gray; #endregion }
//stimulates button presses when key is hit *really wanted the buttons to visually depress but this didnt do it private void click_handle(object sender, System.Windows.Input.KeyEventArgs e) { Console.WriteLine("Argument is: " + e.Key.ToString()); switch (e.Key) { case Key.Q: e.Handled = true; Button1.PerformClick(); break; case Key.W: e.Handled = true; Button2.PerformClick(); break; case Key.E: e.Handled = true; Button3.PerformClick(); break; case Key.R: e.Handled = true; Button4.PerformClick(); break; case Key.A: e.Handled = true; Button5.PerformClick(); break; case Key.S: e.Handled = true; Button6.PerformClick(); break; case Key.D: e.Handled = true; Button7.PerformClick(); break; case Key.F: e.Handled = true; Button8.PerformClick(); break; case Key.Y: e.Handled = true; Button9.PerformClick(); break; case Key.U: e.Handled = true; Button10.PerformClick(); break; case Key.I: e.Handled = true; Button11.PerformClick(); break; case Key.O: e.Handled = true; Button12.PerformClick(); break; case Key.H: e.Handled = true; Button13.PerformClick(); break; case Key.J: e.Handled = true; Button14.PerformClick(); break; case Key.K: e.Handled = true; Button15.PerformClick(); break; case Key.L: e.Handled = true; Button16.PerformClick(); break; case Key.LeftShift: e.Handled = true; if (isShift == 0) { Loop(); } else { storeLoop(); } break; } }
public void Sre_SpeechRecognized(object sender, SpeechRecognizedEventArgs e) { string txt = e.Result.Text; float confidence = e.Result.Confidence; if (confidence >= 0.4) { int first = Convert.ToInt32(e.Result.Semantics["first"].Value); //int second = Convert.ToInt32(e.Result.Semantics["second"].Value); //string operation = e.Result.Semantics["operation"].Value.ToString(); switch (first) { case 1: Button1.Dispatcher.Invoke(new Action(() => { Button1.RaiseEvent(new RoutedEventArgs(ButtonBase.ClickEvent)); SolidColorBrush brush = new SolidColorBrush(Color.FromArgb(255, 221, 221, 221)); Button1.Background = brush; ColorAnimation anima = new ColorAnimation(Colors.Blue, new Duration(TimeSpan.FromSeconds(0.5))); anima.AutoReverse = true; brush.BeginAnimation(SolidColorBrush.ColorProperty, anima); })); break; case 2: Button2.Dispatcher.Invoke(new Action(() => { Button2.RaiseEvent(new RoutedEventArgs(ButtonBase.ClickEvent)); SolidColorBrush brush = new SolidColorBrush(Color.FromArgb(255, 221, 221, 221)); Button2.Background = brush; ColorAnimation anima = new ColorAnimation(Colors.Blue, new Duration(TimeSpan.FromSeconds(0.5))); anima.AutoReverse = true; brush.BeginAnimation(SolidColorBrush.ColorProperty, anima); })); break; case 3: Button3.Dispatcher.Invoke(new Action(() => { Button3.RaiseEvent(new RoutedEventArgs(ButtonBase.ClickEvent)); SolidColorBrush brush = new SolidColorBrush(Color.FromArgb(255, 221, 221, 221)); Button3.Background = brush; ColorAnimation anima = new ColorAnimation(Colors.Blue, new Duration(TimeSpan.FromSeconds(0.5))); anima.AutoReverse = true; brush.BeginAnimation(SolidColorBrush.ColorProperty, anima); })); break; case 4: Button4.Dispatcher.Invoke(new Action(() => { Button4.RaiseEvent(new RoutedEventArgs(ButtonBase.ClickEvent)); SolidColorBrush brush = new SolidColorBrush(Color.FromArgb(255, 221, 221, 221)); Button4.Background = brush; ColorAnimation anima = new ColorAnimation(Colors.Blue, new Duration(TimeSpan.FromSeconds(0.5))); anima.AutoReverse = true; brush.BeginAnimation(SolidColorBrush.ColorProperty, anima); })); break; case 5: Button5.Dispatcher.Invoke(new Action(() => { Button5.RaiseEvent(new RoutedEventArgs(ButtonBase.ClickEvent)); SolidColorBrush brush = new SolidColorBrush(Color.FromArgb(255, 221, 221, 221)); Button5.Background = brush; ColorAnimation anima = new ColorAnimation(Colors.Blue, new Duration(TimeSpan.FromSeconds(0.5))); anima.AutoReverse = true; brush.BeginAnimation(SolidColorBrush.ColorProperty, anima); })); break; case 6: Button6.Dispatcher.Invoke(new Action(() => { Button6.RaiseEvent(new RoutedEventArgs(ButtonBase.ClickEvent)); SolidColorBrush brush = new SolidColorBrush(Color.FromArgb(255, 221, 221, 221)); Button6.Background = brush; ColorAnimation anima = new ColorAnimation(Colors.Blue, new Duration(TimeSpan.FromSeconds(0.5))); anima.AutoReverse = true; brush.BeginAnimation(SolidColorBrush.ColorProperty, anima); })); break; case 7: Button7.Dispatcher.Invoke(new Action(() => { Button7.RaiseEvent(new RoutedEventArgs(ButtonBase.ClickEvent)); SolidColorBrush brush = new SolidColorBrush(Color.FromArgb(255, 221, 221, 221)); Button7.Background = brush; ColorAnimation anima = new ColorAnimation(Colors.Blue, new Duration(TimeSpan.FromSeconds(0.5))); anima.AutoReverse = true; brush.BeginAnimation(SolidColorBrush.ColorProperty, anima); })); break; case 8: Button8.Dispatcher.Invoke(new Action(() => { Button8.RaiseEvent(new RoutedEventArgs(ButtonBase.ClickEvent)); SolidColorBrush brush = new SolidColorBrush(Color.FromArgb(255, 221, 221, 221)); Button8.Background = brush; ColorAnimation anima = new ColorAnimation(Colors.Blue, new Duration(TimeSpan.FromSeconds(0.5))); anima.AutoReverse = true; brush.BeginAnimation(SolidColorBrush.ColorProperty, anima); })); break; case 9: Button9.Dispatcher.Invoke(new Action(() => { Button9.RaiseEvent(new RoutedEventArgs(ButtonBase.ClickEvent)); SolidColorBrush brush = new SolidColorBrush(Color.FromArgb(255, 221, 221, 221)); Button9.Background = brush; ColorAnimation anima = new ColorAnimation(Colors.Blue, new Duration(TimeSpan.FromSeconds(0.5))); anima.AutoReverse = true; brush.BeginAnimation(SolidColorBrush.ColorProperty, anima); })); break; case 0: Button0.Dispatcher.Invoke(new Action(() => { Button0.RaiseEvent(new RoutedEventArgs(ButtonBase.ClickEvent)); SolidColorBrush brush = new SolidColorBrush(Color.FromArgb(255, 221, 221, 221)); Button0.Background = brush; ColorAnimation anima = new ColorAnimation(Colors.Blue, new Duration(TimeSpan.FromSeconds(0.5))); anima.AutoReverse = true; brush.BeginAnimation(SolidColorBrush.ColorProperty, anima); })); break; case 10: ButtonRowne.Dispatcher.Invoke(new Action(() => { ButtonRowne.RaiseEvent(new RoutedEventArgs(ButtonBase.ClickEvent)); SolidColorBrush brush = new SolidColorBrush(Color.FromArgb(255, 221, 221, 221)); ButtonRowne.Background = brush; ColorAnimation anima = new ColorAnimation(Colors.Blue, new Duration(TimeSpan.FromSeconds(0.5))); anima.AutoReverse = true; brush.BeginAnimation(SolidColorBrush.ColorProperty, anima); })); break; case 11: ButtonPlus.Dispatcher.Invoke(new Action(() => { ButtonPlus.RaiseEvent(new RoutedEventArgs(ButtonBase.ClickEvent)); SolidColorBrush brush = new SolidColorBrush(Color.FromArgb(255, 221, 221, 221)); ButtonPlus.Background = brush; ColorAnimation anima = new ColorAnimation(Colors.Blue, new Duration(TimeSpan.FromSeconds(0.5))); anima.AutoReverse = true; brush.BeginAnimation(SolidColorBrush.ColorProperty, anima); })); break; case 12: ButtonMinus.Dispatcher.Invoke(new Action(() => { ButtonMinus.RaiseEvent(new RoutedEventArgs(ButtonBase.ClickEvent)); SolidColorBrush brush = new SolidColorBrush(Color.FromArgb(255, 221, 221, 221)); ButtonMinus.Background = brush; ColorAnimation anima = new ColorAnimation(Colors.Blue, new Duration(TimeSpan.FromSeconds(0.5))); anima.AutoReverse = true; brush.BeginAnimation(SolidColorBrush.ColorProperty, anima); })); break; case 13: ButtonRazy.Dispatcher.Invoke(new Action(() => { ButtonRazy.RaiseEvent(new RoutedEventArgs(ButtonBase.ClickEvent)); SolidColorBrush brush = new SolidColorBrush(Color.FromArgb(255, 221, 221, 221)); ButtonRazy.Background = brush; ColorAnimation anima = new ColorAnimation(Colors.Blue, new Duration(TimeSpan.FromSeconds(0.5))); anima.AutoReverse = true; brush.BeginAnimation(SolidColorBrush.ColorProperty, anima); })); break; case 14: ButtonPrzez.Dispatcher.Invoke(new Action(() => { ButtonPrzez.RaiseEvent(new RoutedEventArgs(ButtonBase.ClickEvent)); SolidColorBrush brush = new SolidColorBrush(Color.FromArgb(255, 221, 221, 221)); ButtonPrzez.Background = brush; ColorAnimation anima = new ColorAnimation(Colors.Blue, new Duration(TimeSpan.FromSeconds(0.5))); anima.AutoReverse = true; brush.BeginAnimation(SolidColorBrush.ColorProperty, anima); })); break; case 15: ButtonC.Dispatcher.Invoke(new Action(() => { ButtonC.RaiseEvent(new RoutedEventArgs(ButtonBase.ClickEvent)); SolidColorBrush brush = new SolidColorBrush(Color.FromArgb(255, 221, 221, 221)); ButtonC.Background = brush; ColorAnimation anima = new ColorAnimation(Colors.Blue, new Duration(TimeSpan.FromSeconds(0.5))); anima.AutoReverse = true; brush.BeginAnimation(SolidColorBrush.ColorProperty, anima); })); break; default: break; } //if (operation == "plus") //{ // ButtonPlus.Dispatcher.Invoke(new Action(() => // { // ButtonPlus.RaiseEvent(new RoutedEventArgs(ButtonBase.ClickEvent)); // })); //} //else if (operation == "minus") //{ // ButtonMinus.Dispatcher.Invoke(new Action(() => // { // ButtonMinus.RaiseEvent(new RoutedEventArgs(ButtonBase.ClickEvent)); // })); //} //else if (operation == "razy") //{ // ButtonRazy.Dispatcher.Invoke(new Action(() => // { // ButtonRazy.RaiseEvent(new RoutedEventArgs(ButtonBase.ClickEvent)); // })); //} //else if (operation == "przez") //{ // ButtonPrzez.Dispatcher.Invoke(new Action(() => // { // ButtonPrzez.RaiseEvent(new RoutedEventArgs(ButtonBase.ClickEvent)); // })); //} //switch (second) //{ // case 1: // Button1.Dispatcher.Invoke(new Action(() => // { // Button1.RaiseEvent(new RoutedEventArgs(ButtonBase.ClickEvent)); // })); // break; // case 2: // Button2.Dispatcher.Invoke(new Action(() => // { // Button2.RaiseEvent(new RoutedEventArgs(ButtonBase.ClickEvent)); // })); // break; // case 3: // Button3.Dispatcher.Invoke(new Action(() => // { // Button3.RaiseEvent(new RoutedEventArgs(ButtonBase.ClickEvent)); // })); // break; // case 4: // Button4.Dispatcher.Invoke(new Action(() => // { // Button4.RaiseEvent(new RoutedEventArgs(ButtonBase.ClickEvent)); // })); // break; // case 5: // Button5.Dispatcher.Invoke(new Action(() => // { // Button5.RaiseEvent(new RoutedEventArgs(ButtonBase.ClickEvent)); // })); // break; // case 6: // Button6.Dispatcher.Invoke(new Action(() => // { // Button6.RaiseEvent(new RoutedEventArgs(ButtonBase.ClickEvent)); // })); // break; // case 7: // Button7.Dispatcher.Invoke(new Action(() => // { // Button7.RaiseEvent(new RoutedEventArgs(ButtonBase.ClickEvent)); // })); // break; // case 8: // Button8.Dispatcher.Invoke(new Action(() => // { // Button8.RaiseEvent(new RoutedEventArgs(ButtonBase.ClickEvent)); // })); // break; // case 9: // Button9.Dispatcher.Invoke(new Action(() => // { // Button9.RaiseEvent(new RoutedEventArgs(ButtonBase.ClickEvent)); // })); // break; // case 0: // Button0.Dispatcher.Invoke(new Action(() => // { // Button0.RaiseEvent(new RoutedEventArgs(ButtonBase.ClickEvent)); // })); // break; // default: // break; //} //ButtonRowne.Dispatcher.Invoke(new Action(() => //{ // ButtonRowne.RaiseEvent(new RoutedEventArgs(ButtonBase.ClickEvent)); //})); } else { ss.Speak("Proszę powtórzyć"); } }
void ReleaseDesignerOutlets() { if (Button1 != null) { Button1.Dispose(); Button1 = null; } if (Button2 != null) { Button2.Dispose(); Button2 = null; } if (Button3 != null) { Button3.Dispose(); Button3 = null; } if (Button4 != null) { Button4.Dispose(); Button4 = null; } if (Button5 != null) { Button5.Dispose(); Button5 = null; } if (Button6 != null) { Button6.Dispose(); Button6 = null; } if (Button7 != null) { Button7.Dispose(); Button7 = null; } if (Button8 != null) { Button8.Dispose(); Button8 = null; } if (Button9 != null) { Button9.Dispose(); Button9 = null; } if (ResetButton != null) { ResetButton.Dispose(); ResetButton = null; } if (TitleLabel != null) { TitleLabel.Dispose(); TitleLabel = null; } }
void ReleaseDesignerOutlets() { if (Button0 != null) { Button0.Dispose(); Button0 = null; } if (Button1 != null) { Button1.Dispose(); Button1 = null; } if (Button10 != null) { Button10.Dispose(); Button10 = null; } if (Button11 != null) { Button11.Dispose(); Button11 = null; } if (Button2 != null) { Button2.Dispose(); Button2 = null; } if (Button3 != null) { Button3.Dispose(); Button3 = null; } if (Button4 != null) { Button4.Dispose(); Button4 = null; } if (Button5 != null) { Button5.Dispose(); Button5 = null; } if (Button6 != null) { Button6.Dispose(); Button6 = null; } if (Button7 != null) { Button7.Dispose(); Button7 = null; } if (Button8 != null) { Button8.Dispose(); Button8 = null; } if (Button9 != null) { Button9.Dispose(); Button9 = null; } if (ResultLabel != null) { ResultLabel.Dispose(); ResultLabel = null; } }