public static void GetConfirmation(Confirm confirmFunction, ConfirmationType _type, Menu.MenuManager.MenuState _state) { ConfirmationWindow.confirmFunction = confirmFunction; _returnState = _state; if(_type.Equals(ConfirmationType.ApplyChanges)) _label.text = "Apply Changes?"; else _label.text = "Are you sure?"; _win.enabled = true; _yes.Select(); }
public object Any(Confirm request) { var signature = this.Request.Headers.GetValues("Signature"); if (signature != null) { if (auth.AuthResult(signature[0].ToString(), this.Request.RawUrl)) { string Result = ""; // I = Verify GIN,P=Putway,T=Goods Transfer,V=Verify GRN,K=Picking GIN if (request.ConfirmType == "I") { Result = ConfirmLogic.VerifyGIN(request.AsnNo, request.UserID); } if (request.ConfirmType == "P") { Result = ConfirmLogic.Putway(request.AsnNo, request.UserID); } if (request.ConfirmType == "T") { Result = ConfirmLogic.GoodsTransfer(request.AsnNo, request.UserID); } if (request.ConfirmType == "V") { Result = ConfirmLogic.VerifyGRNNew(request.AsnNo, request.UserID); } if (request.ConfirmType == "K") { Result = ConfirmLogic.PickingGIN(request.AsnNo, request.UserID); } return new ConfirmResponse { strResult = Result }; } } return new AuthFaildResponse { strResult = "No Authentication." }; }
public ResetPassword() { InitializeComponent(); Confirm.Select(); // керування фокусом }
public bool Do(IProgress <int> informer) { var fileinfos = db.SelectFileInfos(); long fileinfoLen = fileinfos.Count * 2; long fileinfoIdx = fileinfoLen; if (fileinfoLen == 0) { return(true); } var userChangedfileList = new List <string>(); var userLockedfileList = new List <string>(); // ハッシュ値を使用してファイル変更されていないか確認 foreach (var fileinfo in fileinfos) { --fileinfoIdx; try { string nowHash = Util.MakeHash(fileinfo.FilePath); string storeHash = fileinfo.ReplacedFileHash; if (nowHash != storeHash) { userChangedfileList.Add(fileinfo.FilePath); } } catch (FileNotFoundException) { userChangedfileList.Add(fileinfo.FilePath); } catch (IOException) { userLockedfileList.Add(fileinfo.FilePath); } informer.Report((int)(Int32.MaxValue * fileinfoIdx / fileinfoLen)); } // もし、書込みができないファイルがある場合はエラーとする if (userLockedfileList.Count != 0) { informer.Report(Int32.MaxValue); if (Error != null) { Error.Invoke(userLockedfileList); } return(false); } // 変更がある場合は、確認の割り込みを行う if (userChangedfileList.Count != 0) { if (Confirm != null) { var rtnVal = Confirm.Invoke(userChangedfileList); if (!rtnVal) { // キャンセル informer.Report(Int32.MaxValue); return(false); } } } // 置換開始 foreach (var fileinfo in fileinfos) { --fileinfoIdx; do { try { db.Select(fileinfo); break; } catch (IOException) { // ユーザさんが処理中にロックをかけた if (InformUserInterrupt != null) { InformUserInterrupt.Invoke(fileinfo.FilePath); } } } while (true); informer.Report((int)(Int32.MaxValue * fileinfoIdx / fileinfoLen)); } return(true); }
public void ClientCaching(Confirm confirm) => Call("CLIENT".SubCommand("CACHING").InputRaw(confirm), rt => rt.ThrowOrValue());
public bool Yes(string Question) => Confirm.Yes(Question);
// Use this for initialization void Awake () { Self = this; Cancel.onClick.AddListener(CloseUI); CloseUI(); }
public ActionResult Downvote([Bind(Include = "ReviewID, DownVote")] Review review, Confirm Confirm) { Review ReviewToChange = db.Reviews.Find(review.ReviewID); if (Confirm.ToString() == "Yes") { ReviewToChange.DownVote = ReviewToChange.DownVote + 1; db.Entry(ReviewToChange).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Approved")); } return(RedirectToAction("Approved")); }
public override void Construct() { Font = "font8"; PayLabel = AddChild(new Widget { AutoLayout = AutoLayout.DockTop, MinimumSize = new Point(0, 24) }); AgeLabel = AddChild(new Widget() { AutoLayout = AutoLayout.DockTop, MinimumSize = new Point(0, 24) }); var columns = AddChild(new Gui.Widgets.Columns { AutoLayout = AutoLayout.DockTop, MinimumSize = new Point(0, 100), ColumnCount = 3 }); var left = columns.AddChild(new Gui.Widget()); var right = columns.AddChild(new Gui.Widget()); var evenMoreRight = columns.AddChild(new Gui.Widget()); #region Stats var statParent = left.AddChild(new Gui.Widgets.Columns { AutoLayout = AutoLayout.DockTop, MinimumSize = new Point(0, 60), TriggerOnChildClick = true, OnClick = (sender, args) => { var employeeInfo = sender.FindParentOfType <OverviewPanel>(); if (employeeInfo != null && employeeInfo.Employee != null) { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.Append("MODIFIERS: CHA CON DEX INT SIZ STR WIS \n"); // Todo: Need to align columns. Current method only works for monospaced fonts. foreach (var modifier in employeeInfo.Employee.Creature.Stats.EnumerateStatAdjustments()) { stringBuilder.Append(SetLength(modifier.Name, 9)); stringBuilder.Append(": "); stringBuilder.Append(FormatNumber(modifier.Charisma)); stringBuilder.Append(" "); stringBuilder.Append(FormatNumber(modifier.Constitution)); stringBuilder.Append(" "); stringBuilder.Append(FormatNumber(modifier.Dexterity)); stringBuilder.Append(" "); stringBuilder.Append(FormatNumber(modifier.Intelligence)); stringBuilder.Append(" "); stringBuilder.Append(FormatNumber(modifier.Size)); stringBuilder.Append(" "); stringBuilder.Append(FormatNumber(modifier.Strength)); stringBuilder.Append(" "); stringBuilder.Append(FormatNumber(modifier.Wisdom)); stringBuilder.Append("\n"); } Confirm popup = new Confirm() { CancelText = "", Text = stringBuilder.ToString() }; sender.Root.ShowMinorPopup(popup); } } }); var statsLeft = statParent.AddChild(new Widget()); var statsRight = statParent.AddChild(new Widget()); StatDexterity = statsLeft.AddChild(new Widget { AutoLayout = AutoLayout.DockTop, MinimumSize = new Point(0, 16), Tooltip = "Dexterity (affects dwarf speed)" }); StatStrength = statsLeft.AddChild(new Widget { AutoLayout = AutoLayout.DockTop, MinimumSize = new Point(0, 16), Tooltip = "Strength (affects dwarf attack power)" }); StatWisdom = statsLeft.AddChild(new Widget { AutoLayout = AutoLayout.DockTop, MinimumSize = new Point(0, 16), Tooltip = "Wisdom (affects temprement and spell resistance)" }); StatCharisma = statsLeft.AddChild(new Widget { AutoLayout = AutoLayout.DockTop, MinimumSize = new Point(0, 16), Tooltip = "Charisma (affects ability to make friends)" }); StatConstitution = statsRight.AddChild(new Widget { AutoLayout = AutoLayout.DockTop, MinimumSize = new Point(0, 16), Tooltip = "Constitution (affects dwarf health and damage resistance)" }); StatIntelligence = statsRight.AddChild(new Widget { AutoLayout = AutoLayout.DockTop, MinimumSize = new Point(0, 16), Tooltip = "Intelligence (affects crafting/farming)" }); StatSize = statsRight.AddChild(new Widget { AutoLayout = AutoLayout.DockTop, MinimumSize = new Point(0, 16), Tooltip = "Size" }); #endregion #region status bars Hunger = CreateStatusBar(right, "Hunger", "Starving", "Hungry", "Peckish", "Okay"); Energy = CreateStatusBar(right, "Energy", "Exhausted", "Tired", "Okay", "Energetic"); Happiness = CreateStatusBar(right, "Happiness", "Miserable", "Unhappy", "So So", "Happy", "Euphoric"); Health = CreateStatusBar(evenMoreRight, "Health", "Near Death", "Critical", "Hurt", "Uncomfortable", "Fine", "Perfect"); Boredom = CreateStatusBar(evenMoreRight, "Boredom", "Desperate", "Overworked", "Bored", "Meh", "Fine", "Excited"); #endregion Thoughts = AddChild(new Widget { AutoLayout = AutoLayout.DockTop, MinimumSize = new Point(0, 24) }); var bottomBar = AddChild(new Widget { Transparent = true, AutoLayout = AutoLayout.DockBottom, MinimumSize = new Point(0, 32) }); base.Construct(); }
public PlayerPauseUI() { PlayerPauseUI.localization = Localization.read("/Player/PlayerPause.dat"); if (PlayerPauseUI.icons != null) { PlayerPauseUI.icons.unload(); PlayerPauseUI.icons = null; } PlayerPauseUI.icons = Bundles.getBundle("/Bundles/Textures/Player/Icons/PlayerPause/PlayerPause.unity3d"); PlayerPauseUI.container = new Sleek(); PlayerPauseUI.container.positionScale_Y = 1f; PlayerPauseUI.container.positionOffset_X = 10; PlayerPauseUI.container.positionOffset_Y = 10; PlayerPauseUI.container.sizeOffset_X = -20; PlayerPauseUI.container.sizeOffset_Y = -20; PlayerPauseUI.container.sizeScale_X = 1f; PlayerPauseUI.container.sizeScale_Y = 1f; PlayerUI.container.add(PlayerPauseUI.container); PlayerPauseUI.active = false; PlayerPauseUI.returnButton = new SleekButtonIcon((Texture2D)PlayerPauseUI.icons.load("Return")); PlayerPauseUI.returnButton.positionOffset_X = -100; PlayerPauseUI.returnButton.positionOffset_Y = -205; PlayerPauseUI.returnButton.positionScale_X = 0.5f; PlayerPauseUI.returnButton.positionScale_Y = 0.5f; PlayerPauseUI.returnButton.sizeOffset_X = 200; PlayerPauseUI.returnButton.sizeOffset_Y = 50; PlayerPauseUI.returnButton.text = PlayerPauseUI.localization.format("Return_Button_Text"); PlayerPauseUI.returnButton.tooltip = PlayerPauseUI.localization.format("Return_Button_Tooltip"); PlayerPauseUI.returnButton.iconImage.backgroundTint = ESleekTint.FOREGROUND; SleekButton sleekButton = PlayerPauseUI.returnButton; if (PlayerPauseUI.< > f__mg$cache0 == null) { PlayerPauseUI.< > f__mg$cache0 = new ClickedButton(PlayerPauseUI.onClickedReturnButton); } sleekButton.onClickedButton = PlayerPauseUI.< > f__mg$cache0; PlayerPauseUI.returnButton.fontSize = 14; PlayerPauseUI.container.add(PlayerPauseUI.returnButton); PlayerPauseUI.optionsButton = new SleekButtonIcon((Texture2D)PlayerPauseUI.icons.load("Options")); PlayerPauseUI.optionsButton.positionOffset_X = -100; PlayerPauseUI.optionsButton.positionOffset_Y = -145; PlayerPauseUI.optionsButton.positionScale_X = 0.5f; PlayerPauseUI.optionsButton.positionScale_Y = 0.5f; PlayerPauseUI.optionsButton.sizeOffset_X = 200; PlayerPauseUI.optionsButton.sizeOffset_Y = 50; PlayerPauseUI.optionsButton.text = PlayerPauseUI.localization.format("Options_Button_Text"); PlayerPauseUI.optionsButton.tooltip = PlayerPauseUI.localization.format("Options_Button_Tooltip"); SleekButton sleekButton2 = PlayerPauseUI.optionsButton; if (PlayerPauseUI.< > f__mg$cache1 == null) { PlayerPauseUI.< > f__mg$cache1 = new ClickedButton(PlayerPauseUI.onClickedOptionsButton); } sleekButton2.onClickedButton = PlayerPauseUI.< > f__mg$cache1; PlayerPauseUI.optionsButton.iconImage.backgroundTint = ESleekTint.FOREGROUND; PlayerPauseUI.optionsButton.fontSize = 14; PlayerPauseUI.container.add(PlayerPauseUI.optionsButton); PlayerPauseUI.displayButton = new SleekButtonIcon((Texture2D)PlayerPauseUI.icons.load("Display")); PlayerPauseUI.displayButton.positionOffset_X = -100; PlayerPauseUI.displayButton.positionOffset_Y = -85; PlayerPauseUI.displayButton.positionScale_X = 0.5f; PlayerPauseUI.displayButton.positionScale_Y = 0.5f; PlayerPauseUI.displayButton.sizeOffset_X = 200; PlayerPauseUI.displayButton.sizeOffset_Y = 50; PlayerPauseUI.displayButton.text = PlayerPauseUI.localization.format("Display_Button_Text"); PlayerPauseUI.displayButton.tooltip = PlayerPauseUI.localization.format("Display_Button_Tooltip"); PlayerPauseUI.displayButton.iconImage.backgroundTint = ESleekTint.FOREGROUND; SleekButton sleekButton3 = PlayerPauseUI.displayButton; if (PlayerPauseUI.< > f__mg$cache2 == null) { PlayerPauseUI.< > f__mg$cache2 = new ClickedButton(PlayerPauseUI.onClickedDisplayButton); } sleekButton3.onClickedButton = PlayerPauseUI.< > f__mg$cache2; PlayerPauseUI.displayButton.fontSize = 14; PlayerPauseUI.container.add(PlayerPauseUI.displayButton); PlayerPauseUI.graphicsButton = new SleekButtonIcon((Texture2D)PlayerPauseUI.icons.load("Graphics")); PlayerPauseUI.graphicsButton.positionOffset_X = -100; PlayerPauseUI.graphicsButton.positionOffset_Y = -25; PlayerPauseUI.graphicsButton.positionScale_X = 0.5f; PlayerPauseUI.graphicsButton.positionScale_Y = 0.5f; PlayerPauseUI.graphicsButton.sizeOffset_X = 200; PlayerPauseUI.graphicsButton.sizeOffset_Y = 50; PlayerPauseUI.graphicsButton.text = PlayerPauseUI.localization.format("Graphics_Button_Text"); PlayerPauseUI.graphicsButton.tooltip = PlayerPauseUI.localization.format("Graphics_Button_Tooltip"); PlayerPauseUI.graphicsButton.iconImage.backgroundTint = ESleekTint.FOREGROUND; SleekButton sleekButton4 = PlayerPauseUI.graphicsButton; if (PlayerPauseUI.< > f__mg$cache3 == null) { PlayerPauseUI.< > f__mg$cache3 = new ClickedButton(PlayerPauseUI.onClickedGraphicsButton); } sleekButton4.onClickedButton = PlayerPauseUI.< > f__mg$cache3; PlayerPauseUI.graphicsButton.fontSize = 14; PlayerPauseUI.container.add(PlayerPauseUI.graphicsButton); PlayerPauseUI.controlsButton = new SleekButtonIcon((Texture2D)PlayerPauseUI.icons.load("Controls")); PlayerPauseUI.controlsButton.positionOffset_X = -100; PlayerPauseUI.controlsButton.positionOffset_Y = 35; PlayerPauseUI.controlsButton.positionScale_X = 0.5f; PlayerPauseUI.controlsButton.positionScale_Y = 0.5f; PlayerPauseUI.controlsButton.sizeOffset_X = 200; PlayerPauseUI.controlsButton.sizeOffset_Y = 50; PlayerPauseUI.controlsButton.text = PlayerPauseUI.localization.format("Controls_Button_Text"); PlayerPauseUI.controlsButton.tooltip = PlayerPauseUI.localization.format("Controls_Button_Tooltip"); PlayerPauseUI.controlsButton.iconImage.backgroundTint = ESleekTint.FOREGROUND; SleekButton sleekButton5 = PlayerPauseUI.controlsButton; if (PlayerPauseUI.< > f__mg$cache4 == null) { PlayerPauseUI.< > f__mg$cache4 = new ClickedButton(PlayerPauseUI.onClickedControlsButton); } sleekButton5.onClickedButton = PlayerPauseUI.< > f__mg$cache4; PlayerPauseUI.controlsButton.fontSize = 14; PlayerPauseUI.container.add(PlayerPauseUI.controlsButton); PlayerPauseUI.exitButton = new SleekButtonIcon((Texture2D)PlayerPauseUI.icons.load("Exit")); PlayerPauseUI.exitButton.positionOffset_X = -100; PlayerPauseUI.exitButton.positionOffset_Y = 155; PlayerPauseUI.exitButton.positionScale_X = 0.5f; PlayerPauseUI.exitButton.positionScale_Y = 0.5f; PlayerPauseUI.exitButton.sizeOffset_X = 200; PlayerPauseUI.exitButton.sizeOffset_Y = 50; PlayerPauseUI.exitButton.text = PlayerPauseUI.localization.format("Exit_Button_Text"); PlayerPauseUI.exitButton.tooltip = PlayerPauseUI.localization.format("Exit_Button_Tooltip"); PlayerPauseUI.exitButton.iconImage.backgroundTint = ESleekTint.FOREGROUND; SleekButton sleekButton6 = PlayerPauseUI.exitButton; if (PlayerPauseUI.< > f__mg$cache5 == null) { PlayerPauseUI.< > f__mg$cache5 = new ClickedButton(PlayerPauseUI.onClickedExitButton); } sleekButton6.onClickedButton = PlayerPauseUI.< > f__mg$cache5; PlayerPauseUI.exitButton.fontSize = 14; PlayerPauseUI.container.add(PlayerPauseUI.exitButton); PlayerPauseUI.suicideButton = new SleekButtonIconConfirm((Texture2D)PlayerPauseUI.icons.load("Suicide"), PlayerPauseUI.localization.format("Suicide_Button_Confirm"), PlayerPauseUI.localization.format("Suicide_Button_Confirm_Tooltip"), PlayerPauseUI.localization.format("Suicide_Button_Deny"), PlayerPauseUI.localization.format("Suicide_Button_Deny_Tooltip")); PlayerPauseUI.suicideButton.positionOffset_X = -100; PlayerPauseUI.suicideButton.positionOffset_Y = 95; PlayerPauseUI.suicideButton.positionScale_X = 0.5f; PlayerPauseUI.suicideButton.positionScale_Y = 0.5f; PlayerPauseUI.suicideButton.sizeOffset_X = 200; PlayerPauseUI.suicideButton.sizeOffset_Y = 50; PlayerPauseUI.suicideButton.text = PlayerPauseUI.localization.format("Suicide_Button_Text"); PlayerPauseUI.suicideButton.tooltip = PlayerPauseUI.localization.format("Suicide_Button_Tooltip"); PlayerPauseUI.suicideButton.iconImage.backgroundTint = ESleekTint.FOREGROUND; SleekButtonIconConfirm sleekButtonIconConfirm = PlayerPauseUI.suicideButton; if (PlayerPauseUI.< > f__mg$cache6 == null) { PlayerPauseUI.< > f__mg$cache6 = new Confirm(PlayerPauseUI.onClickedSuicideButton); } sleekButtonIconConfirm.onConfirmed = PlayerPauseUI.< > f__mg$cache6; PlayerPauseUI.suicideButton.fontSize = 14; PlayerPauseUI.container.add(PlayerPauseUI.suicideButton); PlayerPauseUI.spyBox = new SleekBox(); PlayerPauseUI.spyBox.positionOffset_Y = -310; PlayerPauseUI.spyBox.positionScale_X = 0.5f; PlayerPauseUI.spyBox.positionScale_Y = 0.5f; PlayerPauseUI.spyBox.sizeOffset_X = 660; PlayerPauseUI.spyBox.sizeOffset_Y = 500; PlayerPauseUI.container.add(PlayerPauseUI.spyBox); PlayerPauseUI.spyBox.isVisible = false; PlayerPauseUI.spyImage = new SleekImageTexture(); PlayerPauseUI.spyImage.positionOffset_X = 10; PlayerPauseUI.spyImage.positionOffset_Y = 10; PlayerPauseUI.spyImage.sizeOffset_X = 640; PlayerPauseUI.spyImage.sizeOffset_Y = 480; PlayerPauseUI.spyBox.add(PlayerPauseUI.spyImage); PlayerPauseUI.spyRefreshButton = new SleekButton(); PlayerPauseUI.spyRefreshButton.positionOffset_X = -205; PlayerPauseUI.spyRefreshButton.positionOffset_Y = 10; PlayerPauseUI.spyRefreshButton.positionScale_X = 0.5f; PlayerPauseUI.spyRefreshButton.positionScale_Y = 1f; PlayerPauseUI.spyRefreshButton.sizeOffset_X = 200; PlayerPauseUI.spyRefreshButton.sizeOffset_Y = 50; PlayerPauseUI.spyRefreshButton.text = PlayerPauseUI.localization.format("Spy_Refresh_Button_Text"); PlayerPauseUI.spyRefreshButton.tooltip = PlayerPauseUI.localization.format("Spy_Refresh_Button_Tooltip"); SleekButton sleekButton7 = PlayerPauseUI.spyRefreshButton; if (PlayerPauseUI.< > f__mg$cache7 == null) { PlayerPauseUI.< > f__mg$cache7 = new ClickedButton(PlayerPauseUI.onClickedSpyRefreshButton); } sleekButton7.onClickedButton = PlayerPauseUI.< > f__mg$cache7; PlayerPauseUI.spyRefreshButton.fontSize = 14; PlayerPauseUI.spyBox.add(PlayerPauseUI.spyRefreshButton); PlayerPauseUI.spySlayButton = new SleekButton(); PlayerPauseUI.spySlayButton.positionOffset_X = 5; PlayerPauseUI.spySlayButton.positionOffset_Y = 10; PlayerPauseUI.spySlayButton.positionScale_X = 0.5f; PlayerPauseUI.spySlayButton.positionScale_Y = 1f; PlayerPauseUI.spySlayButton.sizeOffset_X = 200; PlayerPauseUI.spySlayButton.sizeOffset_Y = 50; PlayerPauseUI.spySlayButton.text = PlayerPauseUI.localization.format("Spy_Slay_Button_Text"); PlayerPauseUI.spySlayButton.tooltip = PlayerPauseUI.localization.format("Spy_Slay_Button_Tooltip"); SleekButton sleekButton8 = PlayerPauseUI.spySlayButton; if (PlayerPauseUI.< > f__mg$cache8 == null) { PlayerPauseUI.< > f__mg$cache8 = new ClickedButton(PlayerPauseUI.onClickedSpySlayButton); } sleekButton8.onClickedButton = PlayerPauseUI.< > f__mg$cache8; PlayerPauseUI.spySlayButton.fontSize = 14; PlayerPauseUI.spyBox.add(PlayerPauseUI.spySlayButton); PlayerPauseUI.serverBox = new SleekBox(); PlayerPauseUI.serverBox.positionOffset_Y = -50; PlayerPauseUI.serverBox.positionScale_Y = 1f; PlayerPauseUI.serverBox.sizeOffset_X = -5; PlayerPauseUI.serverBox.sizeOffset_Y = 50; PlayerPauseUI.serverBox.sizeScale_X = 0.75f; PlayerPauseUI.serverBox.fontSize = 14; PlayerPauseUI.container.add(PlayerPauseUI.serverBox); PlayerPauseUI.favoriteButton = new SleekButtonIcon(null); PlayerPauseUI.favoriteButton.positionScale_X = 0.75f; PlayerPauseUI.favoriteButton.positionOffset_Y = -50; PlayerPauseUI.favoriteButton.positionOffset_X = 5; PlayerPauseUI.favoriteButton.positionScale_Y = 1f; PlayerPauseUI.favoriteButton.sizeOffset_X = -5; PlayerPauseUI.favoriteButton.sizeOffset_Y = 50; PlayerPauseUI.favoriteButton.sizeScale_X = 0.25f; PlayerPauseUI.favoriteButton.tooltip = PlayerPauseUI.localization.format("Favorite_Button_Tooltip"); PlayerPauseUI.favoriteButton.fontSize = 14; SleekButton sleekButton9 = PlayerPauseUI.favoriteButton; if (PlayerPauseUI.< > f__mg$cache9 == null) { PlayerPauseUI.< > f__mg$cache9 = new ClickedButton(PlayerPauseUI.onClickedFavoriteButton); } sleekButton9.onClickedButton = PlayerPauseUI.< > f__mg$cache9; PlayerPauseUI.container.add(PlayerPauseUI.favoriteButton); if (Provider.isServer) { PlayerPauseUI.favoriteButton.isVisible = false; PlayerPauseUI.serverBox.sizeScale_X = 1f; } new MenuConfigurationOptionsUI(); new MenuConfigurationDisplayUI(); new MenuConfigurationGraphicsUI(); new MenuConfigurationControlsUI(); PlayerPauseUI.updateFavorite(); if (PlayerPauseUI.< > f__mg$cacheA == null) { PlayerPauseUI.< > f__mg$cacheA = new PlayerSpyReady(PlayerPauseUI.onSpyReady); } Player.onSpyReady = PlayerPauseUI.< > f__mg$cacheA; }
public void ConfirmIntegerObjectsAreEqualTests() { bool ok = Confirm.Equal(1, 1); }
public void ConfirmStringObjectsAreEqualTests() { bool ok = Confirm.Equal("1", "1"); ok = Confirm.Equal(null, null); }
public void ConfirmGreaterTest() { Confirm.IsGreater(4, 1); Confirm.IsGreater(2.0, 1.9); }
public void ConfirmIsFalseThrowsEqualExceptionIfValueIsNotFalse() { Confirm.IsFalse(true); }
public void ConfirmIsTrueThrowsEqualExceptionIfValueIsNotTrue() { Confirm.IsTrue(false); }
public void ConfirmIsFalse() { Confirm.IsFalse(false); }
public async Task <AccountResult> Confirm(Confirm entity) => await _accountService.Confirm(entity);
public ActionResult Upvote([Bind(Include = "ReviewID, UpVote")] Review review, Confirm Confirm) { Review ReviewToChange = db.Reviews.Find(review.ReviewID); if (Confirm.ToString() == "Yes") { ReviewToChange.UpVote = ReviewToChange.UpVote + 1; db.Entry(ReviewToChange).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Approved")); } // ViewBag.Upvote = "You have successfully upvote this review"; return(RedirectToAction("Approved")); }
/// <summary> /// 删除表格选中行(FineUI v6.0更新:必须加上延迟,否则弹出框会阻止事件向上传播,导致不能选中单元格!!) /// </summary> /// <param name="grid1"></param> /// <returns></returns> protected string GetDeleteScript(Grid grid1) { string confirmScript = Confirm.GetShowReference("删除选中行?", String.Empty, MessageBoxIcon.Question, grid1.GetDeleteSelectedRowsReference(), String.Empty); return(String.Format("F.defer(function(){{{0}}},100);", confirmScript)); }
private async Task <bool> SubmitImpl(string param) { Buy.Model.Symbol = SymbolInformation.Symbol; Buy.Model.Side = TradeSide.Buy; Buy.Model.Kind = OrderKind.Buy; Buy.Model.Type = IsMarketBuy ? OrderType.MARKET : OrderType.LIMIT; StopLoss.Model.Symbol = SymbolInformation.Symbol; StopLoss.Model.Side = TradeSide.Sell; StopLoss.Model.Kind = OrderKind.StopLoss; StopLoss.Model.Type = IsLimitStop ? OrderType.STOP_LIMIT : OrderType.MARKET; StopLoss.Quantity = Buy.Quantity; Debug.Assert(Buy.Model.Quantity >= SymbolInformation.MinQuantity); Debug.Assert((Buy.Model.Price * Buy.Model.Quantity) >= SymbolInformation.MinNotional); Debug.Assert((StopLoss.Model.Price * StopLoss.Model.Quantity) >= SymbolInformation.MinNotional); foreach (var tp in TakeProfit) { tp.Model.Symbol = SymbolInformation.Symbol; tp.Model.Side = TradeSide.Sell; tp.Model.Kind = OrderKind.TakeProfit; tp.Model.Type = OrderType.MARKET; if (tp.QuantityPercent > 0.01) { tp.Quantity = SymbolInformation.ClampQuantity(Buy.Quantity * (decimal)tp.QuantityPercent); Debug.Assert(tp.Quantity >= SymbolInformation.MinQuantity); Debug.Assert(tp.Total >= SymbolInformation.MinNotional); } else { tp.Quantity = 0m; } } var tpQuantityTotal = TakeProfit.Sum(tp => tp.Quantity); var tpQuantityPercent = TakeProfit.Sum(tp => tp.QuantityPercent); if (tpQuantityPercent > 0.98) { tpQuantityPercent = 1.00; } var tpValidQuantity = SymbolInformation.ClampQuantity(Buy.Quantity * (decimal)tpQuantityPercent); var tpQuantityLeft = tpValidQuantity - tpQuantityTotal; while (tpQuantityLeft >= SymbolInformation.StepSize) { foreach (var tp in TakeProfit.Where(x => x.QuantityPercent >= 0.01)) { if (tpQuantityLeft >= SymbolInformation.StepSize) { tp.Quantity += SymbolInformation.StepSize; tpQuantityLeft -= SymbolInformation.StepSize; } } tpQuantityLeft = Buy.Quantity - TakeProfit.Sum(tp => tp.Quantity); } Debug.Assert(Buy.Quantity >= TakeProfit.Sum(tp => tp.Quantity)); if (tpQuantityLeft > 0m) { //System.Windows.MessageBox.Show($"Остаток: {tpQuantityLeft} {SymbolInformation.BaseAsset}"); var ok = await Confirm.Handle($"Остаток: {tpQuantityLeft} {SymbolInformation.BaseAsset}"); if (!ok) { return(false); } } Model.Jobs.Add(Buy.Model); foreach (var tp in TakeProfitCollection) { // NOTE: if SL is TRAILING by STEPS, // then create new object with corresponding price // for every TP. Model.Jobs.Add(StopLoss.Model); Model.Jobs.Add(tp.Model); } Model.Created = DateTime.Now; Model.Updated = DateTime.Now; Model.Events.Add(Model.Created, "Task created."); SerializeModel(Model); return(true); }
public MainWindow() : base(0, 0, Console.WindowWidth, Console.WindowHeight, null) { var oneBtn = new Button(2, 2, "Button One", "oneBtn", this) { Action = delegate() { new Alert("You Clicked Button One", this, ConsoleColor.White); } }; var twoBtn = new Button(4, 2, "Button Two", "twoBtn", this) { Action = delegate() { new Alert("You Clicked Button Two", this, ConsoleColor.White); } }; var threeBtn = new Button(6, 2, "Long Alert", "threeoBtn", this) { Action = delegate() { new Alert("A web browser (commonly referred to as a browser) is a software application for retrieving, presenting and traversing information resources on the World Wide", this, ConsoleColor.White); } }; var displayAlertBtn = new Button(2, 20, "Display Alert", "displayAlertBtn", this) { Action = delegate() { new Alert("This is an Alert!", this, ConsoleColor.White); } }; var displayConfirmBtn = new Button(4, 20, "Display Confirm", "displayConfirmBtn", this) { Action = delegate() { var cf = new Confirm("This is a Confirm!", this, ConsoleColor.White); if (cf.ShowDialog() == ConsoleDraw.DialogResult.OK) { } } }; var exitBtn = new Button(6, 20, "Exit", "exitBtn", this) { Action = delegate() { ExitWindow(); } }; var displaySettingBtn = new Button(2, 40, "Display Settings", "displaySettingsBtn", this) { Action = delegate() { new SettingsWindow(this); } }; var displaySaveBtn = new Button(4, 40, "Display Save Menu", "displaySaveMenuBtn", this) { Action = delegate() { new SaveMenu("Untitled.txt", Directory.GetCurrentDirectory(), "Test Data", this); } }; var displayLoadBtn = new Button(6, 40, "Display Load Menu", "displayLoadMenuBtn", this) { Action = delegate() { new LoadMenu(Directory.GetCurrentDirectory(), new Dictionary <string, string>() { { "txt", "Text Document" }, { "*", "All Files" } }, this); } }; var oneCheckBox = new CheckBox(10, 2, "oneCheckBox", this); var oneCheckBoxLabel = new Label("Check Box One", 10, 6, "oneCheckBoxLabel", this); var twoCheckBox = new CheckBox(12, 2, "twoCheckBox", this) { Checked = true }; var twoCheckBoxLabel = new Label("Check Box Two", 12, 6, "twoCheckBoxLabel", this); var threeCheckBox = new CheckBox(14, 2, "threeCheckBox", this); var threeCheckBoxLabel = new Label("Check Box Three", 14, 6, "threeCheckBoxLabel", this); var groupOneLabel = new Label("Radio Button Group One", 9, 25, "oneCheckBoxLabel", this); var oneRadioBtnGroupOne = new RadioButton(10, 25, "oneRadioBtnGroupOne", "groupOne", this) { Checked = true }; var oneRadioBtnGroupOneLabel = new Label("Radio Button One", 10, 29, "oneCheckBoxLabel", this); var twoRadioBtnGroupOne = new RadioButton(12, 25, "twoRadioBtnGroupOne", "groupOne", this); var twoRadioBtnGroupOneLabel = new Label("Radio Button Two", 12, 29, "oneCheckBoxLabel", this); var threeRadioBtnGroupOne = new RadioButton(14, 25, "threeRadioBtnGroupOne", "groupOne", this); var threeRadioBtnGroupOneLabel = new Label("Radio Button Three", 14, 29, "oneCheckBoxLabel", this); var groupTwoLabel = new Label("Radio Button Group Two", 9, 50, "oneCheckBoxLabel", this); var oneRadioBtnGroupTwo = new RadioButton(10, 50, "oneRadioBtnGroupTwo", "groupTwo", this) { Checked = true }; var twoRadioBtnGroupTwo = new RadioButton(12, 50, "twoRadioBtnGroupTwo", "groupTwo", this); var threeRadioBtnGroupTwo = new RadioButton(14, 50, "threeRadioBtnGroupTwo", "groupTwo", this); var textAreaLabel = new Label("Text Area", 16, 2, "textAreaLabel", this); var textArea = new TextArea(17, 2, 60, 6, "txtArea", this); textArea.BackgroundColour = ConsoleColor.DarkGray; var txtBoxLabel = new Label("Text Box", 24, 2, "txtBoxLabel", this); var txtBox = new TextBox(24, 11, "txtBox", this); var fileSelect = new FileBrowser(26, 2, 40, 10, Directory.GetCurrentDirectory(), "fileSelect", this, true); var progressBar = new ProgressBar(10, 39, 2, 3, 70, "progressBar", this); var progressBarLabel = new Label("10%", 39, 73, "oneCheckBoxLabel", this); var progressBarDownBtn = new Button(37, 2, "Progress Down", "displaySettingsBtn", this) { Action = delegate() { progressBar.PercentageComplete--; progressBarLabel.SetText(String.Format("{0}%", progressBar.PercentageComplete).PadRight(4)); } }; var progressBarUpBtn = new Button(37, 18, "Progress Up", "displaySettingsBtn", this) { Action = delegate() { progressBar.PercentageComplete++; progressBarLabel.SetText(String.Format("{0}%", progressBar.PercentageComplete).PadRight(4)); } }; Inputs.Add(oneBtn); Inputs.Add(twoBtn); Inputs.Add(threeBtn); Inputs.Add(oneCheckBox); Inputs.Add(oneCheckBoxLabel); Inputs.Add(twoCheckBox); Inputs.Add(twoCheckBoxLabel); Inputs.Add(threeCheckBox); Inputs.Add(threeCheckBoxLabel); Inputs.Add(displayAlertBtn); Inputs.Add(displayConfirmBtn); Inputs.Add(exitBtn); Inputs.Add(groupOneLabel); Inputs.Add(oneRadioBtnGroupOne); Inputs.Add(oneRadioBtnGroupOneLabel); Inputs.Add(twoRadioBtnGroupOne); Inputs.Add(twoRadioBtnGroupOneLabel); Inputs.Add(threeRadioBtnGroupOne); Inputs.Add(threeRadioBtnGroupOneLabel); Inputs.Add(displaySettingBtn); Inputs.Add(displaySaveBtn); Inputs.Add(displayLoadBtn); Inputs.Add(groupTwoLabel); Inputs.Add(oneRadioBtnGroupTwo); Inputs.Add(twoRadioBtnGroupTwo); Inputs.Add(threeRadioBtnGroupTwo); Inputs.Add(textAreaLabel); Inputs.Add(textArea); Inputs.Add(txtBoxLabel); Inputs.Add(txtBox); Inputs.Add(fileSelect); Inputs.Add(progressBarDownBtn); Inputs.Add(progressBarUpBtn); Inputs.Add(progressBar); Inputs.Add(progressBarLabel); List <string> opts = new List <string>() { "hello", "world" }; var cb = new Dropdown(0, 0, opts, "cb", this); cb.DropdownItems = new List <DropdownItem>(opts.Select(_ => new DropdownItem(_, 10, "2", this)).ToArray()); Inputs.Add(cb); CurrentlySelected = oneBtn; Draw(); MainLoop(); }
private async void GetInitialData() { try { UserDialogs.Instance.ShowLoading("Obteniendo comandos a controlar...", MaskType.Black); if (!await ApiIsOnline()) { UserDialogs.Instance.HideLoading(); Toast.ShowError(AlertMessages.Error); return; } else { if (!await GetTokenSuccess()) { UserDialogs.Instance.HideLoading(); Toast.ShowError(AlertMessages.Error); return; } else { ControlSchedulesExecutionQueryValues QueryValues = new ControlSchedulesExecutionQueryValues() { IdLog = this.LogItem.IdLog }; Response resultCommandsToControlGet = await ApiSrv.GetControlSchedulesExecution(TokenGet.Key, QueryValues); if (!resultCommandsToControlGet.IsSuccess) { UserDialogs.Instance.HideLoading(); Toast.ShowError(AlertMessages.Error); return; } else { ControlSchedulesExecutions = JsonConvert.DeserializeObject <List <ControlSchedulesExecution> >(Crypto.DecodeString(resultCommandsToControlGet.Data)); CommandsToControlItems = new ObservableCollection <CommandsToControl>(); foreach (ControlSchedulesExecution controlSchedulesExecution in ControlSchedulesExecutions) { CommandsToControlItems.Add(new CommandsToControl() { IdStatus = controlSchedulesExecution.IdStatus, InstanceNumber = controlSchedulesExecution.InstanceNumber, Lot = controlSchedulesExecution.Lot, Command = controlSchedulesExecution.Command, StartDate = (controlSchedulesExecution.StartDate != null) ? (DateTime)controlSchedulesExecution.StartDate : new DateTime(), EndDate = (controlSchedulesExecution.EndDate != null) ? (DateTime)controlSchedulesExecution.EndDate : new DateTime(), TimeFrom = (controlSchedulesExecution.TimeFrom != null) ? (DateTime)controlSchedulesExecution.TimeFrom : new DateTime(), TimeUntil = (controlSchedulesExecution.TimeUntil != null) ? (DateTime)controlSchedulesExecution.TimeUntil : new DateTime(), OutOfSchedule = controlSchedulesExecution.OutOfSchedule, CriticalBusiness = controlSchedulesExecution.CriticalBusiness, StartDateString = (controlSchedulesExecution.StartDate != null) ? ((DateTime)controlSchedulesExecution.StartDate).ToString(DateTimeFormatString.LatinDate) : "", EndDateString = (controlSchedulesExecution.EndDate != null) ? ((DateTime)controlSchedulesExecution.EndDate).ToString(DateTimeFormatString.LatinDate) : "", TimeFromString = (controlSchedulesExecution.TimeFrom != null) ? ((DateTime)controlSchedulesExecution.TimeFrom).ToString(DateTimeFormatString.Time24Hour) : "", TimeUntilString = (controlSchedulesExecution.TimeUntil != null) ? ((DateTime)controlSchedulesExecution.TimeUntil).ToString(DateTimeFormatString.Time24Hour) : "", StatusColorEE = GetStatusColor.ByIdStatus(controlSchedulesExecution.IdStatus.Trim()), StatusColorEC = (controlSchedulesExecution.OutOfSchedule != null) ? StatusColor.Red : StatusColor.White, }); } UserDialogs.Instance.HideLoading(); if (CommandsToControlItems.Count == 0) { bool result = await Confirm.Show(string.Format("No hay comandos a controlar para la bitácora: {0}, desea cerrar la vista?", this.LogItem.NameLog)); if (result) { Application.Current.MainPage.Navigation.PopAsync(); } } } } } } catch (Exception ex) { UserDialogs.Instance.HideLoading(); Toast.ShowError(AlertMessages.Error); } }
public void MethodManager_GetTestsInTestClass_Will_Find_Test_Tear_Down_Method_On_For_Every_Test() { IList <TestMethod> tests = manager.GetTestsInTestClass(typeof(MethodManagerTest), TestType.All, null); Confirm.IsTrue(tests.All(t => t.TestTearDown != null)); }
public string FailureBox(string Caption) => $"{Confirm.Failure(Caption)}";
// Token: 0x060036F5 RID: 14069 RVA: 0x0017B8D8 File Offset: 0x00179CD8 public MenuPlaySingleplayerUI() { MenuPlaySingleplayerUI.localization = Localization.read("/Menu/Play/MenuPlaySingleplayer.dat"); Bundle bundle = Bundles.getBundle("/Bundles/Textures/Menu/Icons/Play/MenuPlaySingleplayer/MenuPlaySingleplayer.unity3d"); MenuPlaySingleplayerUI.container = new Sleek(); MenuPlaySingleplayerUI.container.positionOffset_X = 10; MenuPlaySingleplayerUI.container.positionOffset_Y = 10; MenuPlaySingleplayerUI.container.positionScale_Y = 1f; MenuPlaySingleplayerUI.container.sizeOffset_X = -20; MenuPlaySingleplayerUI.container.sizeOffset_Y = -20; MenuPlaySingleplayerUI.container.sizeScale_X = 1f; MenuPlaySingleplayerUI.container.sizeScale_Y = 1f; MenuUI.container.add(MenuPlaySingleplayerUI.container); MenuPlaySingleplayerUI.active = false; MenuPlaySingleplayerUI.previewBox = new SleekBox(); MenuPlaySingleplayerUI.previewBox.positionOffset_X = -450; MenuPlaySingleplayerUI.previewBox.positionOffset_Y = 100; MenuPlaySingleplayerUI.previewBox.positionScale_X = 0.5f; MenuPlaySingleplayerUI.previewBox.sizeOffset_X = 355; MenuPlaySingleplayerUI.previewBox.sizeOffset_Y = 180; MenuPlaySingleplayerUI.container.add(MenuPlaySingleplayerUI.previewBox); MenuPlaySingleplayerUI.previewImage = new SleekImageTexture(); MenuPlaySingleplayerUI.previewImage.positionOffset_X = 10; MenuPlaySingleplayerUI.previewImage.positionOffset_Y = 10; MenuPlaySingleplayerUI.previewImage.sizeOffset_X = -20; MenuPlaySingleplayerUI.previewImage.sizeOffset_Y = -20; MenuPlaySingleplayerUI.previewImage.sizeScale_X = 1f; MenuPlaySingleplayerUI.previewImage.sizeScale_Y = 1f; MenuPlaySingleplayerUI.previewImage.shouldDestroyTexture = true; MenuPlaySingleplayerUI.previewBox.add(MenuPlaySingleplayerUI.previewImage); MenuPlaySingleplayerUI.levelScrollBox = new SleekScrollBox(); MenuPlaySingleplayerUI.levelScrollBox.positionOffset_X = -240; MenuPlaySingleplayerUI.levelScrollBox.positionOffset_Y = 340; MenuPlaySingleplayerUI.levelScrollBox.positionScale_X = 0.5f; MenuPlaySingleplayerUI.levelScrollBox.sizeOffset_X = 430; MenuPlaySingleplayerUI.levelScrollBox.sizeOffset_Y = -440; MenuPlaySingleplayerUI.levelScrollBox.sizeScale_Y = 1f; MenuPlaySingleplayerUI.levelScrollBox.area = new Rect(0f, 0f, 5f, 0f); MenuPlaySingleplayerUI.container.add(MenuPlaySingleplayerUI.levelScrollBox); MenuPlaySingleplayerUI.officalMapsButton = new SleekButton(); MenuPlaySingleplayerUI.officalMapsButton.positionOffset_X = -240; MenuPlaySingleplayerUI.officalMapsButton.positionOffset_Y = 290; MenuPlaySingleplayerUI.officalMapsButton.positionScale_X = 0.5f; MenuPlaySingleplayerUI.officalMapsButton.sizeOffset_X = 100; MenuPlaySingleplayerUI.officalMapsButton.sizeOffset_Y = 50; MenuPlaySingleplayerUI.officalMapsButton.text = MenuPlaySingleplayerUI.localization.format("Maps_Official"); MenuPlaySingleplayerUI.officalMapsButton.tooltip = MenuPlaySingleplayerUI.localization.format("Maps_Official_Tooltip"); SleekButton sleekButton = MenuPlaySingleplayerUI.officalMapsButton; if (MenuPlaySingleplayerUI.< > f__mg$cache1 == null) { MenuPlaySingleplayerUI.< > f__mg$cache1 = new ClickedButton(MenuPlaySingleplayerUI.onClickedOfficialMapsButton); } sleekButton.onClickedButton = MenuPlaySingleplayerUI.< > f__mg$cache1; MenuPlaySingleplayerUI.officalMapsButton.fontSize = 14; MenuPlaySingleplayerUI.container.add(MenuPlaySingleplayerUI.officalMapsButton); if (Provider.statusData.Maps.Official != EMapStatus.NONE) { SleekNew sleek = new SleekNew(Provider.statusData.Maps.Official == EMapStatus.UPDATED); MenuPlaySingleplayerUI.officalMapsButton.add(sleek); } MenuPlaySingleplayerUI.curatedMapsButton = new SleekButton(); MenuPlaySingleplayerUI.curatedMapsButton.positionOffset_X = -140; MenuPlaySingleplayerUI.curatedMapsButton.positionOffset_Y = 290; MenuPlaySingleplayerUI.curatedMapsButton.positionScale_X = 0.5f; MenuPlaySingleplayerUI.curatedMapsButton.sizeOffset_X = 100; MenuPlaySingleplayerUI.curatedMapsButton.sizeOffset_Y = 50; MenuPlaySingleplayerUI.curatedMapsButton.text = MenuPlaySingleplayerUI.localization.format("Maps_Curated"); MenuPlaySingleplayerUI.curatedMapsButton.tooltip = MenuPlaySingleplayerUI.localization.format("Maps_Curated_Tooltip"); SleekButton sleekButton2 = MenuPlaySingleplayerUI.curatedMapsButton; if (MenuPlaySingleplayerUI.< > f__mg$cache2 == null) { MenuPlaySingleplayerUI.< > f__mg$cache2 = new ClickedButton(MenuPlaySingleplayerUI.onClickedCuratedMapsButton); } sleekButton2.onClickedButton = MenuPlaySingleplayerUI.< > f__mg$cache2; MenuPlaySingleplayerUI.curatedMapsButton.fontSize = 14; MenuPlaySingleplayerUI.container.add(MenuPlaySingleplayerUI.curatedMapsButton); if (Provider.statusData.Maps.Curated != EMapStatus.NONE) { SleekNew sleek2 = new SleekNew(Provider.statusData.Maps.Curated == EMapStatus.UPDATED); MenuPlaySingleplayerUI.curatedMapsButton.add(sleek2); } MenuPlaySingleplayerUI.workshopMapsButton = new SleekButton(); MenuPlaySingleplayerUI.workshopMapsButton.positionOffset_X = -40; MenuPlaySingleplayerUI.workshopMapsButton.positionOffset_Y = 290; MenuPlaySingleplayerUI.workshopMapsButton.positionScale_X = 0.5f; MenuPlaySingleplayerUI.workshopMapsButton.sizeOffset_X = 100; MenuPlaySingleplayerUI.workshopMapsButton.sizeOffset_Y = 50; MenuPlaySingleplayerUI.workshopMapsButton.text = MenuPlaySingleplayerUI.localization.format("Maps_Workshop"); MenuPlaySingleplayerUI.workshopMapsButton.tooltip = MenuPlaySingleplayerUI.localization.format("Maps_Workshop_Tooltip"); SleekButton sleekButton3 = MenuPlaySingleplayerUI.workshopMapsButton; if (MenuPlaySingleplayerUI.< > f__mg$cache3 == null) { MenuPlaySingleplayerUI.< > f__mg$cache3 = new ClickedButton(MenuPlaySingleplayerUI.onClickedWorkshopMapsButton); } sleekButton3.onClickedButton = MenuPlaySingleplayerUI.< > f__mg$cache3; MenuPlaySingleplayerUI.workshopMapsButton.fontSize = 14; MenuPlaySingleplayerUI.container.add(MenuPlaySingleplayerUI.workshopMapsButton); MenuPlaySingleplayerUI.miscMapsButton = new SleekButton(); MenuPlaySingleplayerUI.miscMapsButton.positionOffset_X = 60; MenuPlaySingleplayerUI.miscMapsButton.positionOffset_Y = 290; MenuPlaySingleplayerUI.miscMapsButton.positionScale_X = 0.5f; MenuPlaySingleplayerUI.miscMapsButton.sizeOffset_X = 100; MenuPlaySingleplayerUI.miscMapsButton.sizeOffset_Y = 50; MenuPlaySingleplayerUI.miscMapsButton.text = MenuPlaySingleplayerUI.localization.format("Maps_Misc"); MenuPlaySingleplayerUI.miscMapsButton.tooltip = MenuPlaySingleplayerUI.localization.format("Maps_Misc_Tooltip"); SleekButton sleekButton4 = MenuPlaySingleplayerUI.miscMapsButton; if (MenuPlaySingleplayerUI.< > f__mg$cache4 == null) { MenuPlaySingleplayerUI.< > f__mg$cache4 = new ClickedButton(MenuPlaySingleplayerUI.onClickedMiscMapsButton); } sleekButton4.onClickedButton = MenuPlaySingleplayerUI.< > f__mg$cache4; MenuPlaySingleplayerUI.miscMapsButton.fontSize = 14; MenuPlaySingleplayerUI.container.add(MenuPlaySingleplayerUI.miscMapsButton); if (Provider.statusData.Maps.Misc != EMapStatus.NONE) { SleekNew sleek3 = new SleekNew(Provider.statusData.Maps.Misc == EMapStatus.UPDATED); MenuPlaySingleplayerUI.miscMapsButton.add(sleek3); } MenuPlaySingleplayerUI.selectedBox = new SleekBox(); MenuPlaySingleplayerUI.selectedBox.positionOffset_X = -85; MenuPlaySingleplayerUI.selectedBox.positionOffset_Y = 100; MenuPlaySingleplayerUI.selectedBox.positionScale_X = 0.5f; MenuPlaySingleplayerUI.selectedBox.sizeOffset_X = 275; MenuPlaySingleplayerUI.selectedBox.sizeOffset_Y = 30; MenuPlaySingleplayerUI.container.add(MenuPlaySingleplayerUI.selectedBox); MenuPlaySingleplayerUI.descriptionBox = new SleekBox(); MenuPlaySingleplayerUI.descriptionBox.positionOffset_X = -85; MenuPlaySingleplayerUI.descriptionBox.positionOffset_Y = 140; MenuPlaySingleplayerUI.descriptionBox.positionScale_X = 0.5f; MenuPlaySingleplayerUI.descriptionBox.sizeOffset_X = 275; MenuPlaySingleplayerUI.descriptionBox.sizeOffset_Y = 140; MenuPlaySingleplayerUI.descriptionBox.fontAlignment = TextAnchor.UpperCenter; MenuPlaySingleplayerUI.container.add(MenuPlaySingleplayerUI.descriptionBox); MenuPlaySingleplayerUI.creditsBox = new SleekBox(); MenuPlaySingleplayerUI.creditsBox.positionOffset_X = 200; MenuPlaySingleplayerUI.creditsBox.positionOffset_Y = 100; MenuPlaySingleplayerUI.creditsBox.positionScale_X = 0.5f; MenuPlaySingleplayerUI.creditsBox.sizeOffset_X = 250; MenuPlaySingleplayerUI.creditsBox.foregroundTint = ESleekTint.NONE; MenuPlaySingleplayerUI.container.add(MenuPlaySingleplayerUI.creditsBox); MenuPlaySingleplayerUI.creditsBox.isVisible = false; MenuPlaySingleplayerUI.timedBox = new SleekBox(); MenuPlaySingleplayerUI.timedBox.isRich = true; MenuPlaySingleplayerUI.timedBox.positionOffset_X = 200; MenuPlaySingleplayerUI.timedBox.positionOffset_Y = 100; MenuPlaySingleplayerUI.timedBox.positionScale_X = 0.5f; MenuPlaySingleplayerUI.timedBox.sizeOffset_X = 250; MenuPlaySingleplayerUI.timedBox.sizeOffset_Y = 70; MenuPlaySingleplayerUI.timedBox.foregroundTint = ESleekTint.NONE; MenuPlaySingleplayerUI.container.add(MenuPlaySingleplayerUI.timedBox); MenuPlaySingleplayerUI.timedBox.isVisible = false; MenuPlaySingleplayerUI.itemButton = new SleekButton(); MenuPlaySingleplayerUI.itemButton.isRich = true; MenuPlaySingleplayerUI.itemButton.positionOffset_X = 200; MenuPlaySingleplayerUI.itemButton.positionOffset_Y = 100; MenuPlaySingleplayerUI.itemButton.positionScale_X = 0.5f; MenuPlaySingleplayerUI.itemButton.sizeOffset_X = 250; MenuPlaySingleplayerUI.itemButton.sizeOffset_Y = 100; MenuPlaySingleplayerUI.itemButton.foregroundTint = ESleekTint.NONE; SleekButton sleekButton5 = MenuPlaySingleplayerUI.itemButton; if (MenuPlaySingleplayerUI.< > f__mg$cache5 == null) { MenuPlaySingleplayerUI.< > f__mg$cache5 = new ClickedButton(MenuPlaySingleplayerUI.onClickedCreditsButton); } sleekButton5.onClickedButton = MenuPlaySingleplayerUI.< > f__mg$cache5; MenuPlaySingleplayerUI.container.add(MenuPlaySingleplayerUI.itemButton); MenuPlaySingleplayerUI.itemButton.isVisible = false; MenuPlaySingleplayerUI.feedbackButton = new SleekButton(); MenuPlaySingleplayerUI.feedbackButton.positionOffset_X = 200; MenuPlaySingleplayerUI.feedbackButton.positionOffset_Y = 100; MenuPlaySingleplayerUI.feedbackButton.positionScale_X = 0.5f; MenuPlaySingleplayerUI.feedbackButton.sizeOffset_X = 250; MenuPlaySingleplayerUI.feedbackButton.sizeOffset_Y = 30; MenuPlaySingleplayerUI.feedbackButton.text = MenuPlaySingleplayerUI.localization.format("Feedback_Button"); MenuPlaySingleplayerUI.feedbackButton.tooltip = MenuPlaySingleplayerUI.localization.format("Feedback_Button_Tooltip"); SleekButton sleekButton6 = MenuPlaySingleplayerUI.feedbackButton; if (MenuPlaySingleplayerUI.< > f__mg$cache6 == null) { MenuPlaySingleplayerUI.< > f__mg$cache6 = new ClickedButton(MenuPlaySingleplayerUI.onClickedFeedbackButton); } sleekButton6.onClickedButton = MenuPlaySingleplayerUI.< > f__mg$cache6; MenuPlaySingleplayerUI.container.add(MenuPlaySingleplayerUI.feedbackButton); MenuPlaySingleplayerUI.feedbackButton.isVisible = false; MenuPlaySingleplayerUI.playButton = new SleekButtonIcon((Texture2D)bundle.load("Play")); MenuPlaySingleplayerUI.playButton.positionOffset_X = -450; MenuPlaySingleplayerUI.playButton.positionOffset_Y = 290; MenuPlaySingleplayerUI.playButton.positionScale_X = 0.5f; MenuPlaySingleplayerUI.playButton.sizeOffset_X = 200; MenuPlaySingleplayerUI.playButton.sizeOffset_Y = 30; MenuPlaySingleplayerUI.playButton.text = MenuPlaySingleplayerUI.localization.format("Play_Button"); MenuPlaySingleplayerUI.playButton.tooltip = MenuPlaySingleplayerUI.localization.format("Play_Button_Tooltip"); MenuPlaySingleplayerUI.playButton.iconImage.backgroundTint = ESleekTint.FOREGROUND; SleekButton sleekButton7 = MenuPlaySingleplayerUI.playButton; if (MenuPlaySingleplayerUI.< > f__mg$cache7 == null) { MenuPlaySingleplayerUI.< > f__mg$cache7 = new ClickedButton(MenuPlaySingleplayerUI.onClickedPlayButton); } sleekButton7.onClickedButton = MenuPlaySingleplayerUI.< > f__mg$cache7; MenuPlaySingleplayerUI.container.add(MenuPlaySingleplayerUI.playButton); MenuPlaySingleplayerUI.modeButtonState = new SleekButtonState(new GUIContent[] { new GUIContent(MenuPlaySingleplayerUI.localization.format("Easy_Button"), (Texture)bundle.load("Easy")), new GUIContent(MenuPlaySingleplayerUI.localization.format("Normal_Button"), (Texture)bundle.load("Normal")), new GUIContent(MenuPlaySingleplayerUI.localization.format("Hard_Button"), (Texture)bundle.load("Hard")) }); MenuPlaySingleplayerUI.modeButtonState.positionOffset_X = -450; MenuPlaySingleplayerUI.modeButtonState.positionOffset_Y = 330; MenuPlaySingleplayerUI.modeButtonState.positionScale_X = 0.5f; MenuPlaySingleplayerUI.modeButtonState.sizeOffset_X = 200; MenuPlaySingleplayerUI.modeButtonState.sizeOffset_Y = 30; MenuPlaySingleplayerUI.modeButtonState.state = (int)PlaySettings.singleplayerMode; SleekButtonState sleekButtonState = MenuPlaySingleplayerUI.modeButtonState; if (MenuPlaySingleplayerUI.< > f__mg$cache8 == null) { MenuPlaySingleplayerUI.< > f__mg$cache8 = new SwappedState(MenuPlaySingleplayerUI.onSwappedModeState); } sleekButtonState.onSwappedState = MenuPlaySingleplayerUI.< > f__mg$cache8; MenuPlaySingleplayerUI.container.add(MenuPlaySingleplayerUI.modeButtonState); MenuPlaySingleplayerUI.configButton = new SleekButton(); MenuPlaySingleplayerUI.configButton.positionOffset_X = -450; MenuPlaySingleplayerUI.configButton.positionOffset_Y = 370; MenuPlaySingleplayerUI.configButton.positionScale_X = 0.5f; MenuPlaySingleplayerUI.configButton.sizeOffset_X = 200; MenuPlaySingleplayerUI.configButton.sizeOffset_Y = 30; MenuPlaySingleplayerUI.configButton.text = MenuPlaySingleplayerUI.localization.format("Config_Button"); MenuPlaySingleplayerUI.configButton.tooltip = MenuPlaySingleplayerUI.localization.format("Config_Button_Tooltip"); SleekButton sleekButton8 = MenuPlaySingleplayerUI.configButton; if (MenuPlaySingleplayerUI.< > f__mg$cache9 == null) { MenuPlaySingleplayerUI.< > f__mg$cache9 = new ClickedButton(MenuPlaySingleplayerUI.onClickedConfigButton); } sleekButton8.onClickedButton = MenuPlaySingleplayerUI.< > f__mg$cache9; MenuPlaySingleplayerUI.container.add(MenuPlaySingleplayerUI.configButton); MenuPlaySingleplayerUI.cheatsToggle = new SleekToggle(); MenuPlaySingleplayerUI.cheatsToggle.positionOffset_X = -450; MenuPlaySingleplayerUI.cheatsToggle.positionOffset_Y = 410; MenuPlaySingleplayerUI.cheatsToggle.positionScale_X = 0.5f; MenuPlaySingleplayerUI.cheatsToggle.sizeOffset_X = 40; MenuPlaySingleplayerUI.cheatsToggle.sizeOffset_Y = 40; MenuPlaySingleplayerUI.cheatsToggle.addLabel(MenuPlaySingleplayerUI.localization.format("Cheats_Label"), ESleekSide.RIGHT); MenuPlaySingleplayerUI.cheatsToggle.state = PlaySettings.singleplayerCheats; SleekToggle sleekToggle = MenuPlaySingleplayerUI.cheatsToggle; if (MenuPlaySingleplayerUI.< > f__mg$cacheA == null) { MenuPlaySingleplayerUI.< > f__mg$cacheA = new Toggled(MenuPlaySingleplayerUI.onToggledCheatsToggle); } sleekToggle.onToggled = MenuPlaySingleplayerUI.< > f__mg$cacheA; MenuPlaySingleplayerUI.container.add(MenuPlaySingleplayerUI.cheatsToggle); MenuPlaySingleplayerUI.resetButton = new SleekButtonIconConfirm(null, MenuPlaySingleplayerUI.localization.format("Reset_Button_Confirm"), MenuPlaySingleplayerUI.localization.format("Reset_Button_Confirm_Tooltip"), MenuPlaySingleplayerUI.localization.format("Reset_Button_Deny"), MenuPlaySingleplayerUI.localization.format("Reset_Button_Deny_Tooltip")); MenuPlaySingleplayerUI.resetButton.positionOffset_X = -450; MenuPlaySingleplayerUI.resetButton.positionOffset_Y = 470; MenuPlaySingleplayerUI.resetButton.positionScale_X = 0.5f; MenuPlaySingleplayerUI.resetButton.sizeOffset_X = 200; MenuPlaySingleplayerUI.resetButton.sizeOffset_Y = 30; MenuPlaySingleplayerUI.resetButton.text = MenuPlaySingleplayerUI.localization.format("Reset_Button"); MenuPlaySingleplayerUI.resetButton.tooltip = MenuPlaySingleplayerUI.localization.format("Reset_Button_Tooltip"); SleekButtonIconConfirm sleekButtonIconConfirm = MenuPlaySingleplayerUI.resetButton; if (MenuPlaySingleplayerUI.< > f__mg$cacheB == null) { MenuPlaySingleplayerUI.< > f__mg$cacheB = new Confirm(MenuPlaySingleplayerUI.onClickedResetButton); } sleekButtonIconConfirm.onConfirmed = MenuPlaySingleplayerUI.< > f__mg$cacheB; MenuPlaySingleplayerUI.container.add(MenuPlaySingleplayerUI.resetButton); bundle.unload(); MenuPlaySingleplayerUI.refreshLevels(); Delegate onLevelsRefreshed = Level.onLevelsRefreshed; if (MenuPlaySingleplayerUI.< > f__mg$cacheC == null) { MenuPlaySingleplayerUI.< > f__mg$cacheC = new LevelsRefreshed(MenuPlaySingleplayerUI.onLevelsRefreshed); } Level.onLevelsRefreshed = (LevelsRefreshed)Delegate.Combine(onLevelsRefreshed, MenuPlaySingleplayerUI.< > f__mg$cacheC); MenuPlaySingleplayerUI.backButton = new SleekButtonIcon((Texture2D)MenuDashboardUI.icons.load("Exit")); MenuPlaySingleplayerUI.backButton.positionOffset_Y = -50; MenuPlaySingleplayerUI.backButton.positionScale_Y = 1f; MenuPlaySingleplayerUI.backButton.sizeOffset_X = 200; MenuPlaySingleplayerUI.backButton.sizeOffset_Y = 50; MenuPlaySingleplayerUI.backButton.text = MenuDashboardUI.localization.format("BackButtonText"); MenuPlaySingleplayerUI.backButton.tooltip = MenuDashboardUI.localization.format("BackButtonTooltip"); SleekButton sleekButton9 = MenuPlaySingleplayerUI.backButton; if (MenuPlaySingleplayerUI.< > f__mg$cacheD == null) { MenuPlaySingleplayerUI.< > f__mg$cacheD = new ClickedButton(MenuPlaySingleplayerUI.onClickedBackButton); } sleekButton9.onClickedButton = MenuPlaySingleplayerUI.< > f__mg$cacheD; MenuPlaySingleplayerUI.backButton.fontSize = 14; MenuPlaySingleplayerUI.backButton.iconImage.backgroundTint = ESleekTint.FOREGROUND; MenuPlaySingleplayerUI.container.add(MenuPlaySingleplayerUI.backButton); new MenuPlayConfigUI(); }
// 删除选中行的脚本 private string GetDeleteScript() { return(Confirm.GetShowReference("删除选中行?", String.Empty, MessageBoxIcon.Question, Grid1.GetDeleteSelectedRowsReference(), String.Empty)); }
public ActionResult Cancellation([Bind(Include = "OrderID, CancelStatus")] Order order, Confirm Confirm) { Order orderToChange = db.Orders.Find(order.OrderID); List <OrderDetail> ods = orderToChange.OrderDetails; foreach (OrderDetail od in ods) { if (DateTime.Today.AddHours(1) > od.Showing.StartTime) { ViewBag.ErrorCancellation = "You can't cancel this order. Because at least one of your showing starts within an hour"; return(View("Error")); } } int numoforder = order.OrderDetails.Count(); if (Confirm == Confirm.Yes && orderToChange.PaymentMethod == PaymentMethod.PopcornPoints.ToString()) { orderToChange.CancelStatus = CancelStatus.Yes; String UserID = User.Identity.GetUserId(); AppUser AppUser = db.Users.Find(UserID); Int32 popcornBalance = AppUser.PopcornPoints; orderToChange.AppUser.PopcornPoints = orderToChange.AppUser.PopcornPoints + orderToChange.OrderDetails.Count() * 100; db.Entry(orderToChange).State = EntityState.Modified; db.SaveChanges(); String emailSubject = "Cancellation"; String emailBody = "Your order " + orderToChange.OrderNumber.ToString() + " is cancelled."; SendEmail(orderToChange.AppUser.Email, emailSubject, emailBody); return(RedirectToAction("Index")); } else if (Confirm == Confirm.Yes && orderToChange.PaymentMethod == PaymentMethod.CreditCard.ToString()) { orderToChange.CancelStatus = CancelStatus.Yes; String UserID = User.Identity.GetUserId(); AppUser AppUser = db.Users.Find(UserID); //Int32 popcornBalance = AppUser.PopcornPoints; //orderToChange.AppUser.PopcornPoints = orderToChange.AppUser.PopcornPoints + orderToChange.OrderDetails.Count() * 100; db.Entry(orderToChange).State = EntityState.Modified; db.SaveChanges(); String emailSubject = "Cancellation"; String emailBody = "Your order " + orderToChange.OrderNumber.ToString() + " is cancelled."; SendEmail(orderToChange.AppUser.Email, emailSubject, emailBody); return(RedirectToAction("Index")); } else { orderToChange.CancelStatus = CancelStatus.No; db.Entry(orderToChange).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } }
/// <summary> /// 下载模板按钮 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnDownLoad_Click(object sender, EventArgs e) { PageContext.RegisterStartupScript(Confirm.GetShowReference("确定下载导入模板吗?", String.Empty, MessageBoxIcon.Question, PageManager1.GetCustomEventReference(false, "Confirm_OK"), PageManager1.GetCustomEventReference("Confirm_Cancel"))); }
public ActionResult CheckOut([Bind(Include = "OrderID, CheckOutStatus, PaymentMethod")] Order order, Confirm Confirm) { Order orderToChange = db.Orders.Find(order.OrderID); if (Confirm == Confirm.Yes) { orderToChange.PaymentMethod = PaymentMethod.CreditCard.ToString(); orderToChange.CheckOutStatus = true; Int32 Price = Decimal.ToInt32(orderToChange.TotalBeforeTax); orderToChange.AppUser.PopcornPoints = orderToChange.AppUser.PopcornPoints + Price; db.Entry(orderToChange).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Summary", new { id = order.OrderID })); } else { orderToChange.CheckOutStatus = false; db.Entry(orderToChange).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); if (Visible) { RegisterClientScripts(); _isClientScriptRegistered = true; } confirm = (Confirm)Page.LoadControl(Confirm.Location); confirm.Title = Resource.ConfirmRemoveCommentTitle; confirm.SelectTitle = ConfirmRemoveCommentMessage; confirm.SelectJSCallback = JavaScriptRemoveCommentFunctionName; Controls.Add(confirm); }
public ActionResult Popcorn([Bind(Include = "OrderID, CheckOutStatus, PaymentMethod")] Order order, Confirm Confirm) { Order orderToChange = db.Orders.Find(order.OrderID); if (Confirm == Confirm.Yes) { orderToChange.CheckOutStatus = true; orderToChange.PaymentMethod = PaymentMethod.PopcornPoints.ToString(); String UserID = User.Identity.GetUserId(); Int32 quantity = orderToChange.OrderDetails.Count(); AppUser AppUser = db.Users.Find(UserID); Int32 popcornBalance = AppUser.PopcornPoints; if (quantity * 100 < popcornBalance) { orderToChange.AppUser.PopcornPoints = orderToChange.AppUser.PopcornPoints - quantity * 100; db.Entry(orderToChange).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("SummaryForPop", new { id = order.OrderID })); } else { ViewBag.Error = "Insufficient Popcorn Points"; return(View("Error")); } } else { orderToChange.CheckOutStatus = false; db.Entry(orderToChange).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } }
public ActionResult Cancellation([Bind(Include = "ShowingID, CancelStatus")] Showing Showing, Confirm Confirm) { Showing showingToChange = db.Showings.Find(Showing.ShowingID); List <OrderDetail> ods = showingToChange.OrderDetails; if (Confirm == Confirm.Yes) { showingToChange.ShowingCancelStatus = ShowingCancelStatus.Yes; db.Entry(showingToChange).State = EntityState.Modified; db.SaveChanges(); foreach (OrderDetail od in ods) { if (od.Order.PaymentMethod == PaymentMethod.PopcornPoints.ToString()) { AppUser AppUser = db.Users.Find(od.Order.AppUser.Id); Int32 popcornBalance = AppUser.PopcornPoints; AppUser.PopcornPoints = AppUser.PopcornPoints + 100; String emailSubject = "Cancellation"; String emailBody = "Your ticket " + showingToChange.MovieAndDate + " is cancelled."; SendEmail(AppUser.Email, emailSubject, emailBody); return(RedirectToAction("Index")); } else { AppUser AppUser = db.Users.Find(od.Order.AppUser.Id); //Int32 popcornBalance = AppUser.PopcornPoints; //AppUser.PopcornPoints = AppUser.PopcornPoints + 100; String emailSubject = "Cancellation"; String emailBody = "Your ticket " + showingToChange.MovieAndDate + " is cancelled."; SendEmail(AppUser.Email, emailSubject, emailBody); return(RedirectToAction("Index")); } } } showingToChange.ShowingCancelStatus = ShowingCancelStatus.No; db.Entry(showingToChange).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); }
private void ThrowsEqualityException() { Confirm.Equal("1", "8"); }