public override void ViewDidLoad() { base.ViewDidLoad(); SaveButton.TouchUpInside += (sender, e) => { currentTask.Name = TitleText.Text; currentTask.Notes = NotesText.Text; currentTask.Done = DoneSwitch.On; Delegate.SaveTask(currentTask); }; DeleteButton.TouchUpInside += (sender, e) => { Delegate.DeleteTask(currentTask); }; if (UIDevice.CurrentDevice.CheckSystemVersion(7, 0)) { // requires iOS 7 SpeakButton.TouchUpInside += (sender, e) => { Speak(TitleText.Text + ". " + NotesText.Text); }; // InitPitchAndVolume (); } else { SpeakButton.SetTitleColor(UIColor.Gray, UIControlState.Disabled); SpeakButton.Enabled = false; } }
public override void ViewDidLoad() { base.ViewDidLoad(); SaveButton.TouchUpInside += (sender, e) => { currentTodoItem.Name = TitleText.Text; currentTodoItem.Notes = NotesText.Text; currentTodoItem.Done = DoneSwitch.On; AppDelegate.Current.TaskMgr.SaveTask(currentTodoItem); NavigationController.PopViewControllerAnimated(true); }; DeleteButton.TouchUpInside += (sender, e) => { AppDelegate.Current.TaskMgr.DeleteTask(currentTodoItem); NavigationController.PopViewControllerAnimated(true); }; if (UIDevice.CurrentDevice.CheckSystemVersion(7, 0)) { // requires iOS 7 SpeakButton.TouchUpInside += (sender, e) => { Speak(TitleText.Text + ". " + NotesText.Text); }; } else { SpeakButton.SetTitleColor(UIColor.Gray, UIControlState.Disabled); SpeakButton.Enabled = false; } }
private void OnClickListener(GameObject gob) { SpeakButton btnid = (SpeakButton)UIEventListener.Get(gob).parameter; var gserver = App.GetRServer <BlackJackGameServer>(); switch (btnid) { case SpeakButton.BuyInsurance: gserver.SendRequest(GameRequestType.Insurance); break; case SpeakButton.Double: gserver.SendRequest(GameRequestType.AddRate); break; case SpeakButton.Hit: gserver.SendRequest(GameRequestType.Hit); break; case SpeakButton.Stand: gserver.SendRequest(GameRequestType.Stand); break; default: YxDebug.LogError("No this button in you enum!!"); break; } }
public override void ViewDidLoad() { base.ViewDidLoad(); SaveButton.TouchUpInside += async(sender, e) => { currentTodoItem.Name = TitleText.Text; currentTodoItem.Notes = NotesText.Text; currentTodoItem.Done = DoneSwitch.On; // PUSH currentTodoItem.DeviceToken = AppDelegate.Current.DeviceToken ?? ""; //HACK: AppDelegate.Current.TaskMgr.SaveTask(currentTodoItem); //AppDelegate.Current.TaskMgr.SaveTask(currentTodoItem); await AppDelegate.Current.TaskMgr.SaveTaskAsync(currentTodoItem); // VALIDATION // try // { // await AppDelegate.Current.TaskMgr.SaveTodoItemAsync(currentTodoItem); // } // catch (MobileServiceInvalidOperationException ioe) // { // if (ioe.Response.StatusCode == System.Net.HttpStatusCode.BadRequest) { // // configured in portal // CreateAndShowDialog (ioe.Message, "Invalid"); // } else { // // another error that we are not expecting // CreateAndShowDialog (ioe.Response.Content.ToString (), "Error"); // } // } NavigationController.PopViewControllerAnimated(true); }; DeleteButton.TouchUpInside += async(sender, e) => { //HACK: AppDelegate.Current.TaskMgr.DeleteTask(currentTodoItem); //AppDelegate.Current.TaskMgr.DeleteTask(currentTodoItem); await AppDelegate.Current.TaskMgr.DeleteTaskAsync(currentTodoItem); NavigationController.PopViewControllerAnimated(true); }; // SPEECH if (UIDevice.CurrentDevice.CheckSystemVersion(7, 0)) { // requires iOS 7 SpeakButton.TouchUpInside += (sender, e) => { Speak(TitleText.Text + ". " + NotesText.Text); }; } else { SpeakButton.SetTitleColor(UIColor.Gray, UIControlState.Disabled); SpeakButton.Enabled = false; } }
protected void OnClickListener(GameObject gob) { SpeakButton btnid = (SpeakButton)UIEventListener.Get(gob).parameter; var selfPanel = App.GetGameData <FillpitGameData>().GetPlayer <PlayerPanel>(); switch (btnid) { case SpeakButton.BetBtn: Tools.GobShowOnlyOne(Pages, "AddBetBtns"); break; case SpeakButton.KickBtn: Tools.GobShowOnlyOne(Pages, "AddBetBtns"); break; case SpeakButton.FoldBtn: var selftype = selfPanel.PlayerType; switch (selftype) { case 1: case 6: App.GetRServer <FillpitGameServer>().SendRequest(GameRequestType.Fold, null); break; case 4: case 7: case 10: App.GetRServer <FillpitGameServer>().SendRequest(GameRequestType.NotKick, null); break; } break; case SpeakButton.FollowBtn: Dictionary <string, object> data = new Dictionary <string, object>() { { "gold", App.GetGameData <FillpitGameData>().LastBetValue } }; App.GetRServer <FillpitGameServer>().SendRequest(GameRequestType.Bet, data); break; case SpeakButton.NotKickBtn: App.GetRServer <FillpitGameServer>().SendRequest(GameRequestType.NotKick, null); break; case SpeakButton.BackKickBtn: Tools.GobShowOnlyOne(Pages, "AddBetBtns"); selfPanel.PlayerType = 4; break; case SpeakButton.CancelBetBtn: Tools.GobShowOnlyOne(Pages, _prePageName); break; } }
protected void OnClickListener(GameObject gob) { SpeakButton btnid = (SpeakButton)UIEventListener.Get(gob).parameter; switch (btnid) { case SpeakButton.KaiPaiBtn: Dictionary <string, object> data = new Dictionary <string, object>() { { "gold", _maxBet * 2 }, { "seat", App.GameData.SelfSeat } }; App.GetGameManager <DuifenGameManager>().SendRequest(GameRequestType.KaiPai, data); break; case SpeakButton.FoldBtn: FoldGame(); break; case SpeakButton.FollowBtn: FollowBet(); break; case SpeakButton.AutoFollow: IsAutoFollow = !IsAutoFollow; RefreshAutoFollowBtn(gob); break; case SpeakButton.QiLiBtn: data = new Dictionary <string, object>() { { "gold", 0 }, { "seat", App.GameData.SelfSeat } }; App.GetGameManager <DuifenGameManager>().SendRequest(GameRequestType.QiLi, data); _couldFold = true; break; case SpeakButton.AddBtn: RefreshBetBtnsEnable(); SetItemActive(Pages, "AddBetBtns", true); break; } }
void ReleaseDesignerOutlets() { if (TitleText != null) { TitleText.Dispose(); TitleText = null; } if (NotesText != null) { NotesText.Dispose(); NotesText = null; } if (DoneSwitch != null) { DoneSwitch.Dispose(); DoneSwitch = null; } if (DeleteButton != null) { DeleteButton.Dispose(); DeleteButton = null; } if (SaveButton != null) { SaveButton.Dispose(); SaveButton = null; } if (SpeakButton != null) { SpeakButton.Dispose(); SpeakButton = null; } }
protected void OnClickListener(GameObject gob) { SpeakButton btnid = (SpeakButton)UIEventListener.Get(gob).parameter; switch (btnid) { case SpeakButton.CheckBtn: OnClickCheckBtn(); break; case SpeakButton.FinishBtn: OnClickFinishBtn(); break; case SpeakButton.ZuPaiBtn: OnClickZuPaiBtn(); break; } }
protected void OnClickListener(GameObject gob) { SpeakButton btnid = (SpeakButton)UIEventListener.Get(gob).parameter; Dictionary <string, object> data; switch (btnid) { case SpeakButton.AddBet_Btn: Tools.GobShowOnlyOne(Pages, "AddBet"); InitAdd(AllowMin, AllowMax); break; case SpeakButton.Call_Btn: { data = new Dictionary <string, object>() { { "gold", (int)(MaxBetNum - App.GameData.GetPlayer <PlayerPanel>().BetMoney) } }; App.GetRServer <TexasGameServer>().SendRequest(GameRequestType.Bet, data); ShowNothing(); } break; case SpeakButton.Fold_Btn: App.GetRServer <TexasGameServer>().SendRequest(GameRequestType.Fold, null); ShowNothing(); break; case SpeakButton.SeePoker_Btn: data = new Dictionary <string, object>() { { "gold", 0 } }; App.GetRServer <TexasGameServer>().SendRequest(GameRequestType.Bet, data); ShowNothing(); break; case SpeakButton.EnterAddBet_Btn: data = new Dictionary <string, object>() { { "gold", (int)(AddBetNum - App.GameData.GetPlayer <PlayerPanel>().BetMoney) } }; App.GetRServer <TexasGameServer>().SendRequest(GameRequestType.Bet, data); ShowNothing(); break; case SpeakButton.HalfPool_Btn: data = new Dictionary <string, object>() { { "gold", (int)(PoolNum >> 1) } }; App.GetRServer <TexasGameServer>().SendRequest(GameRequestType.Bet, data); ShowNothing(); break; case SpeakButton.TwoThirdsPool_Btn: data = new Dictionary <string, object>() { { "gold", (int)(PoolNum * (2f / 3f)) } }; App.GetRServer <TexasGameServer>().SendRequest(GameRequestType.Bet, data); ShowNothing(); break; case SpeakButton.AllPool_Btn: data = new Dictionary <string, object>() { { "gold", (int)PoolNum } }; App.GetRServer <TexasGameServer>().SendRequest(GameRequestType.Bet, data); ShowNothing(); break; case SpeakButton.Allin_Btn: data = new Dictionary <string, object>() { { "gold", (int)App.GameData.GetPlayer <PlayerPanel>().RoomCoin } }; App.GetRServer <TexasGameServer>().SendRequest(GameRequestType.Bet, data); ShowOver(); break; case SpeakButton.SeePokerOrFold_Toggle: IsAutoSeeOrFold = !IsAutoSeeOrFold; break; case SpeakButton.Call_Toggle: IsAutoCall = !IsAutoCall; break; case SpeakButton.CloseAdd_Btn: Tools.GobShowOnlyOne(Pages, "Speak"); break; } }
protected void OnClickListener(GameObject gob) { SpeakButton btnid = (SpeakButton)UIEventListener.Get(gob).parameter; Dictionary <string, object> data; var mgr = App.GetGameManager <GangWuGameManager>(); var gdata = App.GetGameData <GangwuGameData>(); var self = gdata.GetPlayer <PlayerPanel>(); switch (btnid) { case SpeakButton.AddBet_Btn: GameObject page = Tools.GobShowOnlyOne(Pages, "AddBet"); int addBet = MaxBetNum - self.BetMoney; AddBetSum = addBet; AdvanceBet(addBet); //通知服务器,开启预加注 mgr.BetMgr.RefreshAddBetBtns(); Transform btn = page.transform.FindChild("Allin_Btn"); var selfCoin = self.Coin; bool couldAllin = gdata.CardCount > 3 && selfCoin > 0; Tools.SetBtnCouldClick(btn.gameObject, couldAllin && selfCoin > 0); break; case SpeakButton.Call_Btn: data = new Dictionary <string, object>() { { "gold", MaxBetNum - self.BetMoney } }; App.GetRServer <GangWuGameServer>().SendRequest(GameRequestType.Bet, data); break; case SpeakButton.Fold_Btn: App.GetRServer <GangWuGameServer>().SendRequest(GameRequestType.Fold, null); break; case SpeakButton.SeePoker_Btn: data = new Dictionary <string, object>() { { "gold", 0 } }; App.GetRServer <GangWuGameServer>().SendRequest(GameRequestType.Bet, data); break; case SpeakButton.Allin_Btn: int leastRoomGold = gdata.LeastRoomGold; int betGold = leastRoomGold + gdata.LeastGoldPanel.BetMoney - self.BetMoney; if (betGold < 0) { YxDebug.Log("==== Allin Gold less than zero , please check !! ===="); return; } data = new Dictionary <string, object>() { { "gold", betGold } }; App.GetRServer <GangWuGameServer>().SendRequest(GameRequestType.Bet, data); break; case SpeakButton.SeePokerOrFold_Toggle: IsAutoSeeOrFold = !IsAutoSeeOrFold; break; case SpeakButton.Call_Toggle: IsAutoCall = !IsAutoCall; break; case SpeakButton.CloseAdd_Btn: Tools.GobShowOnlyOne(Pages, "Speak"); break; case SpeakButton.BackBet_Btn: int back = _betRemenber.Pop(); AddBetSum -= back; mgr.BetMgr.RefreshAddBetBtns(); break; case SpeakButton.GoBet_Btn: data = new Dictionary <string, object>() { { "gold", AddBetSum } }; App.GetRServer <GangWuGameServer>().SendRequest(GameRequestType.Bet, data); break; case SpeakButton.Cancel_Btn: AdvanceBet(-1); AddBetSum = 0; Tools.GobShowOnlyOne(Pages, "Speak"); break; default: throw new ArgumentOutOfRangeException(); } }