partial void ButtonRestart_TouchUpInside(UIButton sender) { LabelWinner.Text = ""; //ButtonOne.TitleLabel.Text = ""; ButtonOne.Enabled = true; ButtonOne.SetTitle("", UIControlState.Normal); string btnOne = ButtonOne.Title(UIControlState.Normal); // ButtonTwo.TitleLabel.Text = ""; ButtonTwo.Enabled = true; ButtonTwo.SetTitle("", UIControlState.Normal); string btnTwo = ButtonTwo.Title(UIControlState.Normal); // ButtonTwo.SetTitle("", UIControlState.Normal); // ButtonThree.TitleLabel.Text = ""; ButtonThree.Enabled = true; ButtonThree.SetTitle("", UIControlState.Normal); string btnThree = ButtonThree.Title(UIControlState.Normal); // ButtonThree.SetTitle("", UIControlState.Normal); // ButtonFour.TitleLabel.Text = ""; ButtonFour.Enabled = true; ButtonFour.SetTitle("", UIControlState.Normal); string btnFour = ButtonFour.Title(UIControlState.Normal); // ButtonFour.SetTitle("", UIControlState.Normal); // ButtonFive.TitleLabel.Text = ""; ButtonFive.SetTitle("", UIControlState.Normal); ButtonFive.Enabled = true; string btnFive = ButtonFive.Title(UIControlState.Normal); // ButtonSix.TitleLabel.Text = ""; ButtonSix.Enabled = true; ButtonSix.SetTitle("", UIControlState.Normal); string btnSix = ButtonSix.Title(UIControlState.Normal); // ButtonSeven.TitleLabel.Text = ""; ButtonSeven.Enabled = true; ButtonSeven.SetTitle("", UIControlState.Normal); string btnSeven = ButtonSeven.Title(UIControlState.Normal); // ButtonEight.TitleLabel.Text = ""; ButtonEight.Enabled = true; ButtonEight.SetTitle("", UIControlState.Normal); string btnEight = ButtonEight.Title(UIControlState.Normal); // ButtonNine.TitleLabel.Text = ""; ButtonNine.Enabled = true; ButtonNine.SetTitle("", UIControlState.Normal); string btnNine = ButtonNine.Title(UIControlState.Normal); counter = 0; }
public FolderBrowser() { _ = applyTemplateSubject.SelectMany(a => ButtonOne.ToClicks()) .Select(a => OpenDialog(string.Empty, string.Empty)) .Where(output => output.result ?? false) .ObserveOnDispatcher() .Select(output => output.path) .Subscribe(textChanges.OnNext); }
public FileBrowser() { _ = applyTemplateSubject.Select(a => ButtonOne.ToClicks()) .SelectMany(a => a) .CombineLatest(filterChanges.StartWith(Filter).DistinctUntilChanged(), extensionChanges.StartWith(Extension).DistinctUntilChanged(), (a, b, c) => OpenDialog(b, c)) .Where(output => output.result ?? false) .ObserveOnDispatcher() .Select(output => output.path) .Subscribe(textChanges.OnNext); }
public override void ViewDidLoad() { base.ViewDidLoad(); ButtonOne.SetTitle("", UIControlState.Normal); ButtonTwo.SetTitle("", UIControlState.Normal); ButtonThree.SetTitle("", UIControlState.Normal); ButtonFour.SetTitle("", UIControlState.Normal); ButtonFive.SetTitle("", UIControlState.Normal); ButtonSix.SetTitle("", UIControlState.Normal); ButtonSeven.SetTitle("", UIControlState.Normal); ButtonEight.SetTitle("", UIControlState.Normal); ButtonNine.SetTitle("", UIControlState.Normal); LabelWinner.Text = ""; // Perform any additional setup after loading the view, typically from a nib. }
// Creates a button showing the choice text Button CreateChoiceView(string text, int choices) { if (choices == 1) { ButtonTwo.SetActive(false); ButtonOne.gameObject.SetActive(true); // Gets the text from the button prefab Button choice = ButtonOne.GetComponentInChildren <Button>(); // Make the button expand to fit the text // HorizontalLayoutGroup layoutGroup = ButtonOne.GetComponent<HorizontalLayoutGroup>(); //layoutGroup.childForceExpandHeight = false; return(ButtonOne); } else if (choices == 2) { ButtonOne.gameObject.SetActive(false); ButtonTwo.SetActive(true); Button[] choice = ButtonTwo.GetComponentsInChildren <Button>(); Debug.Log(choice[0] + " " + choice[1]); // Gets the text from the button prefab for (int i = 0; i < 2; i++) { Transform buttonChild = choice[i].gameObject.transform.GetChild(0); TextMeshProUGUI choiceText = buttonChild.GetComponent <TextMeshProUGUI>(); choiceText.text = text; // Make the button expand to fit the text //HorizontalLayoutGroup layoutGroup = choice[i].GetComponent<HorizontalLayoutGroup>(); //layoutGroup.childForceExpandHeight = false; return(choice[i]); } } return(null); }
partial void ButtonOne_TouchUpInside(UIButton sender) { if (counter == 0) { ButtonOne.SetTitle("X", UIControlState.Normal); ButtonOne.SetTitleColor(UIColor.Black, UIControlState.Normal); LabelTurn.Text = "Turn X"; counter++; } else if (counter == 1) { ButtonOne.SetTitle("O", UIControlState.Normal); ButtonOne.SetTitleColor(UIColor.Black, UIControlState.Normal); LabelTurn.Text = "Turn O"; counter--; } ButtonOne.Enabled = false; checkit(); }
void ReleaseDesignerOutlets() { if (ViewLabel != null) { ViewLabel.Dispose(); ViewLabel = null; } if (ButtonZero != null) { ButtonZero.Dispose(); ButtonZero = null; } if (ButtonOne != null) { ButtonOne.Dispose(); ButtonOne = null; } if (ButtonTwo != null) { ButtonTwo.Dispose(); ButtonTwo = null; } if (ButtonThree != null) { ButtonThree.Dispose(); ButtonThree = null; } if (ButtonFour != null) { ButtonFour.Dispose(); ButtonFour = null; } if (ButtonFive != null) { ButtonFive.Dispose(); ButtonFive = null; } if (ButtonSix != null) { ButtonSix.Dispose(); ButtonSix = null; } if (ButtonSeven != null) { ButtonSeven.Dispose(); ButtonSeven = null; } if (ButtonEight != null) { ButtonEight.Dispose(); ButtonEight = null; } if (ButtonNine != null) { ButtonNine.Dispose(); ButtonNine = null; } if (ButtonPlus != null) { ButtonPlus.Dispose(); ButtonPlus = null; } if (ButtonMinus != null) { ButtonMinus.Dispose(); ButtonMinus = null; } if (ButtonMultiply != null) { ButtonMultiply.Dispose(); ButtonMultiply = null; } if (ButtonDivide != null) { ButtonDivide.Dispose(); ButtonDivide = null; } if (ButtonEquals != null) { ButtonEquals.Dispose(); ButtonEquals = null; } if (ButtonClear != null) { ButtonClear.Dispose(); ButtonClear = null; } }
void ReleaseDesignerOutlets() { if (ButtonEight != null) { ButtonEight.Dispose(); ButtonEight = null; } if (ButtonFive != null) { ButtonFive.Dispose(); ButtonFive = null; } if (ButtonFour != null) { ButtonFour.Dispose(); ButtonFour = null; } if (ButtonNine != null) { ButtonNine.Dispose(); ButtonNine = null; } if (ButtonOne != null) { ButtonOne.Dispose(); ButtonOne = null; } if (ButtonRestart != null) { ButtonRestart.Dispose(); ButtonRestart = null; } if (ButtonSeven != null) { ButtonSeven.Dispose(); ButtonSeven = null; } if (ButtonSix != null) { ButtonSix.Dispose(); ButtonSix = null; } if (ButtonThree != null) { ButtonThree.Dispose(); ButtonThree = null; } if (ButtonTwo != null) { ButtonTwo.Dispose(); ButtonTwo = null; } if (LabelTurn != null) { LabelTurn.Dispose(); LabelTurn = null; } if (LabelWinner != null) { LabelWinner.Dispose(); LabelWinner = null; } }
public void checkit() { //Check if tie if (!ButtonOne.Title(UIControlState.Normal).Equals("") && !ButtonTwo.Title(UIControlState.Normal).Equals("") && !ButtonThree.Title(UIControlState.Normal).Equals("") && !ButtonFour.Title(UIControlState.Normal).Equals("") && !ButtonFive.Title(UIControlState.Normal).Equals("") && !ButtonSix.Title(UIControlState.Normal).Equals("") && !ButtonSeven.Title(UIControlState.Normal).Equals("") && !ButtonEight.Title(UIControlState.Normal).Equals("") && !ButtonNine.Title(UIControlState.Normal).Equals("")) { LabelWinner.Text = "Tie"; } //Check diagonal for X if (!ButtonOne.Title(UIControlState.Normal).Equals("") || !ButtonFive.Title(UIControlState.Normal).Equals("") || !ButtonNine.Title(UIControlState.Normal).Equals("")) { if (ButtonOne.Title(UIControlState.Normal).Equals("X") && ButtonFive.Title(UIControlState.Normal).Equals("X") && ButtonNine.Title(UIControlState.Normal).Equals("X")) { LabelWinner.Text = "Player X wins"; ButtonOne.Enabled = false; ButtonTwo.Enabled = false; ButtonThree.Enabled = false; ButtonFour.Enabled = false; ButtonFive.Enabled = false; ButtonSix.Enabled = false; ButtonSeven.Enabled = false; ButtonEight.Enabled = false; ButtonNine.Enabled = false; } } if (!ButtonThree.Title(UIControlState.Normal).Equals("") || !ButtonFive.Title(UIControlState.Normal).Equals("") || !ButtonSeven.Title(UIControlState.Normal).Equals("")) { if (ButtonThree.Title(UIControlState.Normal).Equals("X") && ButtonFive.Title(UIControlState.Normal).Equals("X") && ButtonSeven.Title(UIControlState.Normal).Equals("X")) { LabelWinner.Text = "Player X wins"; ButtonOne.Enabled = false; ButtonTwo.Enabled = false; ButtonThree.Enabled = false; ButtonFour.Enabled = false; ButtonFive.Enabled = false; ButtonSix.Enabled = false; ButtonSeven.Enabled = false; ButtonEight.Enabled = false; ButtonNine.Enabled = false; } } //Check rows for X if (!ButtonOne.Title(UIControlState.Normal).Equals("") || !ButtonTwo.Title(UIControlState.Normal).Equals("") || !ButtonThree.Title(UIControlState.Normal).Equals("")) { if (ButtonOne.Title(UIControlState.Normal).Equals("X") && ButtonTwo.Title(UIControlState.Normal).Equals("X") && ButtonThree.Title(UIControlState.Normal).Equals("X")) { LabelWinner.Text = "Player X wins"; ButtonOne.Enabled = false; ButtonTwo.Enabled = false; ButtonThree.Enabled = false; ButtonFour.Enabled = false; ButtonFive.Enabled = false; ButtonSix.Enabled = false; ButtonSeven.Enabled = false; ButtonEight.Enabled = false; ButtonNine.Enabled = false; } } if (!ButtonFour.Title(UIControlState.Normal).Equals("") || !ButtonFive.Title(UIControlState.Normal).Equals("") || !ButtonSix.Title(UIControlState.Normal).Equals("")) { if (ButtonFour.Title(UIControlState.Normal).Equals("X") && ButtonFive.Title(UIControlState.Normal).Equals("X") && ButtonSix.Title(UIControlState.Normal).Equals("X")) { LabelWinner.Text = "Player X wins"; ButtonOne.Enabled = false; ButtonTwo.Enabled = false; ButtonThree.Enabled = false; ButtonFour.Enabled = false; ButtonFive.Enabled = false; ButtonSix.Enabled = false; ButtonSeven.Enabled = false; ButtonEight.Enabled = false; ButtonNine.Enabled = false; } } if (!ButtonSeven.Title(UIControlState.Normal).Equals("") || !ButtonEight.Title(UIControlState.Normal).Equals("") || !ButtonNine.Title(UIControlState.Normal).Equals("")) { if (ButtonSeven.Title(UIControlState.Normal).Equals("X") && ButtonEight.Title(UIControlState.Normal).Equals("X") && ButtonNine.Title(UIControlState.Normal).Equals("X")) { LabelWinner.Text = "Player X wins"; ButtonOne.Enabled = false; ButtonTwo.Enabled = false; ButtonThree.Enabled = false; ButtonFour.Enabled = false; ButtonFive.Enabled = false; ButtonSix.Enabled = false; ButtonSeven.Enabled = false; ButtonEight.Enabled = false; ButtonNine.Enabled = false; } } //Check columns for X if (!ButtonOne.Title(UIControlState.Normal).Equals("") || !ButtonFour.Title(UIControlState.Normal).Equals("") || !ButtonSeven.Title(UIControlState.Normal).Equals("")) { if (ButtonOne.Title(UIControlState.Normal).Equals("X") && ButtonFour.Title(UIControlState.Normal).Equals("X") && ButtonSeven.Title(UIControlState.Normal).Equals("X")) { LabelWinner.Text = "Player X wins"; ButtonOne.Enabled = false; ButtonTwo.Enabled = false; ButtonThree.Enabled = false; ButtonFour.Enabled = false; ButtonFive.Enabled = false; ButtonSix.Enabled = false; ButtonSeven.Enabled = false; ButtonEight.Enabled = false; ButtonNine.Enabled = false; } } if (!ButtonTwo.Title(UIControlState.Normal).Equals("") || !ButtonFive.Title(UIControlState.Normal).Equals("") || !ButtonEight.Title(UIControlState.Normal).Equals("")) { if (ButtonTwo.Title(UIControlState.Normal).Equals("X") && ButtonFive.Title(UIControlState.Normal).Equals("X") && ButtonEight.Title(UIControlState.Normal).Equals("X")) { LabelWinner.Text = "Player X wins"; ButtonOne.Enabled = false; ButtonTwo.Enabled = false; ButtonThree.Enabled = false; ButtonFour.Enabled = false; ButtonFive.Enabled = false; ButtonSix.Enabled = false; ButtonSeven.Enabled = false; ButtonEight.Enabled = false; ButtonNine.Enabled = false; } } if (!ButtonThree.Title(UIControlState.Normal).Equals("") || !ButtonSix.Title(UIControlState.Normal).Equals("") || !ButtonNine.Title(UIControlState.Normal).Equals("")) { if (ButtonThree.Title(UIControlState.Normal).Equals("X") && ButtonSix.Title(UIControlState.Normal).Equals("X") && ButtonNine.Title(UIControlState.Normal).Equals("X")) { LabelWinner.Text = "Player X wins"; ButtonOne.Enabled = false; ButtonTwo.Enabled = false; ButtonThree.Enabled = false; ButtonFour.Enabled = false; ButtonFive.Enabled = false; ButtonSix.Enabled = false; ButtonSeven.Enabled = false; ButtonEight.Enabled = false; ButtonNine.Enabled = false; } } //Check diagonal for O if (!ButtonOne.Title(UIControlState.Normal).Equals("") || !ButtonFive.Title(UIControlState.Normal).Equals("") || !ButtonNine.Title(UIControlState.Normal).Equals("")) { if (ButtonOne.Title(UIControlState.Normal).Equals("O") && ButtonFive.Title(UIControlState.Normal).Equals("O") && ButtonNine.Title(UIControlState.Normal).Equals("O")) { LabelWinner.Text = "Player O wins"; ButtonOne.Enabled = false; ButtonTwo.Enabled = false; ButtonThree.Enabled = false; ButtonFour.Enabled = false; ButtonFive.Enabled = false; ButtonSix.Enabled = false; ButtonSeven.Enabled = false; ButtonEight.Enabled = false; ButtonNine.Enabled = false; } } if (!ButtonThree.Title(UIControlState.Normal).Equals("") || !ButtonFive.Title(UIControlState.Normal).Equals("") || !ButtonSeven.Title(UIControlState.Normal).Equals("")) { if (ButtonThree.Title(UIControlState.Normal).Equals("O") && ButtonFive.Title(UIControlState.Normal).Equals("O") && ButtonSeven.Title(UIControlState.Normal).Equals("O")) { LabelWinner.Text = "Player O wins"; ButtonOne.Enabled = false; ButtonTwo.Enabled = false; ButtonThree.Enabled = false; ButtonFour.Enabled = false; ButtonFive.Enabled = false; ButtonSix.Enabled = false; ButtonSeven.Enabled = false; ButtonEight.Enabled = false; ButtonNine.Enabled = false; } } //Check rows for O if (!ButtonOne.Title(UIControlState.Normal).Equals("") || !ButtonTwo.Title(UIControlState.Normal).Equals("") || !ButtonThree.Title(UIControlState.Normal).Equals("")) { if (ButtonOne.Title(UIControlState.Normal).Equals("O") && ButtonTwo.Title(UIControlState.Normal).Equals("O") && ButtonThree.Title(UIControlState.Normal).Equals("O")) { LabelWinner.Text = "Player O wins"; ButtonOne.Enabled = false; ButtonTwo.Enabled = false; ButtonThree.Enabled = false; ButtonFour.Enabled = false; ButtonFive.Enabled = false; ButtonSix.Enabled = false; ButtonSeven.Enabled = false; ButtonEight.Enabled = false; ButtonNine.Enabled = false; } } if (!ButtonFour.Title(UIControlState.Normal).Equals("") || !ButtonFive.Title(UIControlState.Normal).Equals("") || !ButtonSix.Title(UIControlState.Normal).Equals("")) { if (ButtonFour.Title(UIControlState.Normal).Equals("O") && ButtonFive.Title(UIControlState.Normal).Equals("O") && ButtonSix.Title(UIControlState.Normal).Equals("O")) { LabelWinner.Text = "Player O wins"; ButtonOne.Enabled = false; ButtonTwo.Enabled = false; ButtonThree.Enabled = false; ButtonFour.Enabled = false; ButtonFive.Enabled = false; ButtonSix.Enabled = false; ButtonSeven.Enabled = false; ButtonEight.Enabled = false; ButtonNine.Enabled = false; } } if (!ButtonSeven.Title(UIControlState.Normal).Equals("") || !ButtonEight.Title(UIControlState.Normal).Equals("") || !ButtonNine.Title(UIControlState.Normal).Equals("")) { if (ButtonSeven.Title(UIControlState.Normal).Equals("O") && ButtonEight.Title(UIControlState.Normal).Equals("O") && ButtonNine.Title(UIControlState.Normal).Equals("O")) { LabelWinner.Text = "Player O wins"; ButtonOne.Enabled = false; ButtonTwo.Enabled = false; ButtonThree.Enabled = false; ButtonFour.Enabled = false; ButtonFive.Enabled = false; ButtonSix.Enabled = false; ButtonSeven.Enabled = false; ButtonEight.Enabled = false; ButtonNine.Enabled = false; } } //Check columns for O if (!ButtonOne.Title(UIControlState.Normal).Equals("") || !ButtonFour.Title(UIControlState.Normal).Equals("") || !ButtonSeven.Title(UIControlState.Normal).Equals("")) { if (ButtonOne.Title(UIControlState.Normal).Equals("O") && ButtonFour.Title(UIControlState.Normal).Equals("O") && ButtonSeven.Title(UIControlState.Normal).Equals("O")) { LabelWinner.Text = "Player O wins"; ButtonOne.Enabled = false; ButtonTwo.Enabled = false; ButtonThree.Enabled = false; ButtonFour.Enabled = false; ButtonFive.Enabled = false; ButtonSix.Enabled = false; ButtonSeven.Enabled = false; ButtonEight.Enabled = false; ButtonNine.Enabled = false; } } if (!ButtonTwo.Title(UIControlState.Normal).Equals("") || !ButtonFive.Title(UIControlState.Normal).Equals("") || !ButtonEight.Title(UIControlState.Normal).Equals("")) { if (ButtonTwo.Title(UIControlState.Normal).Equals("O") && ButtonFive.Title(UIControlState.Normal).Equals("O") && ButtonEight.Title(UIControlState.Normal).Equals("O")) { LabelWinner.Text = "Player O wins"; ButtonOne.Enabled = false; ButtonTwo.Enabled = false; ButtonThree.Enabled = false; ButtonFour.Enabled = false; ButtonFive.Enabled = false; ButtonSix.Enabled = false; ButtonSeven.Enabled = false; ButtonEight.Enabled = false; ButtonNine.Enabled = false; } } if (!ButtonThree.Title(UIControlState.Normal).Equals("") || !ButtonSix.Title(UIControlState.Normal).Equals("") || !ButtonNine.Title(UIControlState.Normal).Equals("")) { if (ButtonThree.Title(UIControlState.Normal).Equals("O") && ButtonSix.Title(UIControlState.Normal).Equals("O") && ButtonNine.Title(UIControlState.Normal).Equals("O")) { LabelWinner.Text = "Player O wins"; ButtonOne.Enabled = false; ButtonTwo.Enabled = false; ButtonThree.Enabled = false; ButtonFour.Enabled = false; ButtonFive.Enabled = false; ButtonSix.Enabled = false; ButtonSeven.Enabled = false; ButtonEight.Enabled = false; ButtonNine.Enabled = false; } } }