public override void ViewDidLoad() { base.ViewDidLoad(); NavigationItem.SetRightBarButtonItem(new UIBarButtonItem("Tweet", UIBarButtonItemStyle.Bordered, (sender, e) => ViewModel.ShareGeneralCommand.Execute()), false); #warning Button1 and Button2 need removing from the NIB! Button3.SetImage(UIImage.FromFile("ConfResources/Images/appbar.calendar.png"), UIControlState.Normal); Button4.SetImage(UIImage.FromFile("ConfResources/Images/appbar.people.png"), UIControlState.Normal); Button5.SetImage(UIImage.FromFile("ConfResources/Images/appbar.cow.png"), UIControlState.Normal); this.AddBindings(new Dictionary <object, string>() { { Label1, "{'Text':{'Path':'TextSource','Converter':'Language','ConverterParameter':'ByTime'}}" }, { Label2, "{'Text':{'Path':'TextSource','Converter':'Language','ConverterParameter':'BySpeaker'}}" }, { Label3, "{'Text':{'Path':'TextSource','Converter':'Language','ConverterParameter':'ByTopic'}}" }, { Button3, "{'Title':{'Path':'TextSource','Converter':'Language','ConverterParameter':'Saturday'}}" }, { Button4, "{'Title':{'Path':'TextSource','Converter':'Language','ConverterParameter':'Speakers'}}" }, { Button5, "{'Title':{'Path':'TextSource','Converter':'Language','ConverterParameter':'Topics'}}" }, }); this.AddBindings(new Dictionary <object, string>() { { Button3, "{'TouchDown':{'Path':'ShowSessionsCommand'}}" }, { Button4, "{'TouchDown':{'Path':'ShowSpeakersCommand'}}" }, { Button5, "{'TouchDown':{'Path':'ShowTopicsCommand'}}" }, }); }
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>(); }
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); }
public override void ViewDidLoad() { base.ViewDidLoad(); NavigationItem.SetRightBarButtonItem(new UIBarButtonItem("Tweet", UIBarButtonItemStyle.Bordered, (sender, e) => ViewModel.DoShareGeneral()), false); // Perform any additional setup after loading the view, typically from a nib. Button1.SetImage(UIImage.FromFile("ConfResources/Images/appbar.calendar.png"), UIControlState.Normal); Button2.SetImage(UIImage.FromFile("ConfResources/Images/appbar.calendar.png"), UIControlState.Normal); Button3.SetImage(UIImage.FromFile("ConfResources/Images/appbar.calendar.png"), UIControlState.Normal); Button4.SetImage(UIImage.FromFile("ConfResources/Images/appbar.people.png"), UIControlState.Normal); Button5.SetImage(UIImage.FromFile("ConfResources/Images/appbar.database.png"), UIControlState.Normal); this.AddBindings(new Dictionary <object, string>() { { Label1, "Text TextSource,Converter=Language, ConverterParameter='ByDay'" }, { Label2, "Text TextSource,Converter=Language, ConverterParameter='BySpeaker'" }, { Label3, "Text TextSource,Converter=Language, ConverterParameter='ByTopic'" }, { Button1, "Title TextSource,Converter=Language, ConverterParameter='Thursday'" }, { Button2, "Title TextSource,Converter=Language, ConverterParameter='Friday'" }, { Button3, "Title TextSource,Converter=Language, ConverterParameter='Saturday'" }, { Button4, "Title TextSource,Converter=Language, ConverterParameter='Speakers'" }, { Button5, "Title TextSource,Converter=Language, ConverterParameter='Topics'" }, }); this.AddBindings(new Dictionary <object, string>() { { Button1, "TouchUpInside ShowThursdayCommand" }, { Button2, "TouchUpInside ShowFridayCommand" }, { Button3, "TouchUpInside ShowSaturdayCommand" }, { Button4, "TouchUpInside ShowSpeakersCommand" }, { Button5, "TouchUpInside ShowTopicsCommand" }, }); }
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 Handle5() { if (Solution == null || Position == Solution.Length) { return(false); } Button5.AddInteractionPunch(0.2f); Handle(5); return(false); }
public MainPageViewModel(INavigation navigation) { //Model→ViewModel this.Label1 = model.ObserveProperty(x => x.Name).ToReactiveProperty(); //Button Button1.Subscribe(x => model.NamePlus(x)); Button2.Subscribe(x => model.NamePlus(x)); Button3.Subscribe(x => model.NamePlus(x)); Button4.Subscribe(x => model.NamePlus(x)); Button5.Subscribe(x => model.NamePlus(x)); //Button(ページ遷移) NextPageButton.Subscribe(async _ => await navigation.PushAsync(new Views.NextPageView())); }
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(); } } }
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); }
//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; } }
protected void Page_Load(object sender, EventArgs e) { Button5.Focus(); }
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; }
public IEnumerator ProcessTwitchCommand(string cmd) { if (Solution == null || Position >= Solution.Length) { yield break; } cmd = cmd.ToLowerInvariant(); int cut; if (cmd.StartsWith("submit ")) { cut = 7; } else if (cmd.StartsWith("press ")) { cut = 6; } else { yield return("sendtochaterror Use either 'submit' or 'press' followed by a number sequence."); yield break; } List <int> digits = new List <int>(); char[] strSplit = cmd.Substring(cut).ToCharArray(); foreach (char c in strSplit) { if (!"0123456789 ,".Contains(c)) { yield return("sendtochaterror Invalid character in number sequence: '" + c + "'.\nValid characters are 0-9, space, and comma."); yield break; } int d = GetDigit(c); if (d != -1) { digits.Add(d); } } if (digits.Count == 0) { yield break; } if (digits.Count > (Solution.Length - Position)) { yield return("sendtochaterror Too many digits submitted."); yield break; } int progress = BombInfo.GetSolvedModuleNames().Where(x => !ignoredModules.Contains(x)).Count(); if (progress < Solution.Length) { yield return("Forget Me Not"); yield return("sendtochat DansGame A little early, don't you think?"); Handle(digits[0]); yield break; } yield return("Forget Me Not"); yield return("sendtochat PogChamp Here we go!"); yield return("multiple strikes"); //Needed for fake solve. SolveType solve = pickSolveType(digits.Count, Solution.Length - Position); foreach (int d in digits) { Button5.AddInteractionPunch(0.2f); bool valid = Handle(d); if (!valid) { if (solve == SolveType.REGULAR && BombInfo.GetTime() >= 45 && Random.value > 0.95) { yield return(new WaitForSeconds(2)); yield return("sendtochat Kreygasm We did it reddit!"); yield return(new WaitForSeconds(1)); yield return("sendtochat Kappa Nope, just kidding."); } else { yield return("sendtochat DansGame This isn't correct..."); } yield return("sendtochat Correct digits entered: " + Position); break; } if (Position >= Solution.Length) { yield return("sendtochat Kreygasm We did it reddit!"); break; } if (getMusicToggle(solve, Position, digits.Count, Solution.Length - Position)) { yield return("toggle waiting music"); } yield return(new WaitForSeconds(getDelay(solve, Position, digits.Count, Solution.Length - Position))); } yield return("end multiple strikes"); yield break; }
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; } }
private void ItemBonuses() { if (item >= 1) { Button1.SetActive(true); } if (item >= 5) { Button5.SetActive(true); } if (item >= 10) { Button10.SetActive(true); } if (item >= 20) { Button20.SetActive(true); } if (item >= 30) { Button30.SetActive(true); } if (item >= 50) { Button50.SetActive(true); } if (item >= 75) { Button75.SetActive(true); } if (item >= 100) { Button100.SetActive(true); } if (item >= 115) { Button115.SetActive(true); } if (item >= 145) { Button145.SetActive(true); } if (item >= 150) { Button150.SetActive(true); } if (item >= 180) { Button180.SetActive(true); } if (item >= 200) { Button200.SetActive(true); } if (item == 0) { Button1.SetActive(false); } if (item < 5) { Button5.SetActive(false); } if (item < 10) { Button10.SetActive(false); } if (item < 20) { Button20.SetActive(false); } if (item < 30) { Button30.SetActive(false); } if (item < 50) { Button50.SetActive(false); } if (item < 75) { Button75.SetActive(false); } if (item < 100) { Button100.SetActive(false); } if (item < 115) { Button115.SetActive(false); } if (item < 145) { Button145.SetActive(false); } if (item < 150) { Button150.SetActive(false); } if (item < 180) { Button180.SetActive(false); } if (item < 200) { Button200.SetActive(false); } }
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 (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; } }
protected void LinkButton2_Click(object sender, EventArgs e) { Panel2.Visible = true; Panel1.Visible = false; Button5.Focus(); }
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; } }
/// <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 }
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; } }