EnduringGiftBoxView.cs 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using ET;
  5. using FairyGUI;
  6. using UI.EnduringGiftBox;
  7. using UnityEngine;
  8. namespace GFGGame
  9. {
  10. public class EnduringGiftBoxView : BaseWindow
  11. {
  12. private UI_EnduringGiftBoxUI _ui;
  13. private int _itemId; //道具id,该页面目前只给:体力,金币使用
  14. private int _count; //本次购买次数
  15. private int _buyTimes = 0; //已购次数
  16. private int _type = 0; //0从别的地方跳转过来. 1从点击TOP菜单栏icon跳转过来
  17. private Action _onSuccess;
  18. private int _maxTimes = 0;
  19. private string _message = "";
  20. private List<ShopCfg> _shopCfgList = new List<ShopCfg>();
  21. private GameObject _gameObject1;
  22. private GameObject _gameObject2;
  23. private GameObject _gameObject3;
  24. private GameObject _gameObject4;
  25. private GoWrapper _wrapper1;
  26. private GoWrapper _wrapper2;
  27. private GoWrapper _wrapper3;
  28. private GoWrapper _wrapper4;
  29. protected override void OnInit()
  30. {
  31. base.OnInit();
  32. packageName = UI_EnduringGiftBoxUI.PACKAGE_NAME;
  33. _ui = UI_EnduringGiftBoxUI.Create();
  34. this.viewCom = _ui.target;
  35. this.viewCom.Center();
  36. this.modal = true;
  37. viewAnimationType = EnumViewAnimationType.None;
  38. _ui.m_btnSure.onClick.Add(OnClickBtnSure);
  39. _ui.m_btnCancel.onClick.Add(OnClickBtnCancel);
  40. _ui.m_btnBack.onClick.Add(OnClickBtnCancel);
  41. }
  42. public override void Dispose()
  43. {
  44. SceneController.DestroyObjectFromView(_gameObject1, _wrapper1);
  45. SceneController.DestroyObjectFromView(_gameObject2, _wrapper2);
  46. SceneController.DestroyObjectFromView(_gameObject3, _wrapper3);
  47. SceneController.DestroyObjectFromView(_gameObject4, _wrapper4);
  48. if (_ui != null)
  49. {
  50. _ui.Dispose();
  51. _ui = null;
  52. }
  53. EnduringGiftBoxController.Dispose();
  54. base.Dispose();
  55. }
  56. protected override void OnShown()
  57. {
  58. base.OnShown();
  59. AddEffect();
  60. _ui.m_t1.Play();
  61. _ui.m_t2.Play();
  62. UpdateView();
  63. }
  64. protected override void AddEventListener()
  65. {
  66. base.AddEventListener();
  67. EventAgent.AddEventListener(ConstMessage.CONTINUOUS_REBATE_GIFT_SHOP_BUY, UpDayRebateAndView);
  68. EventAgent.AddEventListener(ConstMessage.CONTINUOUS_REBATE_GIFT, UpdateView);
  69. }
  70. protected override void RemoveEventListener()
  71. {
  72. EventAgent.RemoveEventListener(ConstMessage.CONTINUOUS_REBATE_GIFT_SHOP_BUY, UpDayRebateAndView);
  73. EventAgent.RemoveEventListener(ConstMessage.CONTINUOUS_REBATE_GIFT, UpdateView);
  74. base.RemoveEventListener();
  75. }
  76. private void AddEffect()
  77. {
  78. string resPath3;
  79. if (_itemId == ConstItemID.POWER)
  80. {
  81. resPath3 = ResPathUtil.GetViewEffectPath("ui_Activity", "Activity_people02");
  82. }
  83. else
  84. {
  85. resPath3 = ResPathUtil.GetViewEffectPath("ui_Activity", "Activity_people01");
  86. }
  87. //小人
  88. SceneController.AddObjectToView(null, null, _ui.m_holderBaby, resPath3,
  89. out _gameObject3, out _wrapper3);
  90. //爆发,大泡泡
  91. string resPath1 = ResPathUtil.GetViewEffectPath("ui_Activity", "Activity_baofa");
  92. SceneController.AddObjectToView(null, null, _ui.m_holderPaoMax, resPath1,
  93. out _gameObject1, out _wrapper1);
  94. //持续的小泡泡
  95. string resPath2 = ResPathUtil.GetViewEffectPath("ui_Activity", "Activity_chixu");
  96. SceneController.AddObjectToView(null, null, _ui.m_holderPaoMin, resPath2,
  97. out _gameObject2, out _wrapper2);
  98. //爆发时候的发光
  99. string resPath4 = ResPathUtil.GetViewEffectPath("ui_Activity", "Activity_glow");
  100. SceneController.AddObjectToView(null, null, _ui.m_holderFg, resPath4,
  101. out _gameObject4, out _wrapper4);
  102. }
  103. public void SetParams(int itemId, int count, Action onSuccess, string message = "", int type = 0)
  104. {
  105. _itemId = itemId;
  106. _count = count;
  107. _onSuccess = onSuccess;
  108. _message = message;
  109. _type = type;
  110. }
  111. private void UpdateView()
  112. {
  113. _buyTimes = ItemDataManager.GetItemExchangeTimes(_itemId);
  114. ItemExchangeCfgArray.Instance.GetMoneyIdAndNum(_itemId, _buyTimes, _count, out int costId, out int coustNum,
  115. out int buyNum);
  116. ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(_itemId);
  117. ItemCfg costCfg = ItemCfgArray.Instance.GetCfg(costId);
  118. _ui.m_txtNeed.text = string.Format("是否花费{0}{1} 购买{2}{3}", coustNum, costCfg.name, buyNum, itemCfg.name);
  119. _maxTimes = ItemExchangeCfgArray.Instance.GetCfg(_itemId).maxLimit;
  120. string showTxt = string.Empty;
  121. _shopCfgList.Clear();
  122. //常驻礼包
  123. if (_itemId == ConstItemID.POWER)
  124. {
  125. //体力礼包
  126. _shopCfgList = ShopCfgArray.Instance
  127. .GetCfgsBymenu1Andmenu2(ConstStoreTabId.ENDURING_GIFT_BOX, ConstStoreSubId.ENDURING_GIFT_BOX_POWER)
  128. .OrderBy(a => a.refreshType).ToList();
  129. _ui.m_txtNeed.align = AlignType.Center;
  130. int maxLimit = ItemExchangeCfgArray.Instance.GetCfg(ConstItemID.POWER).maxLimit;
  131. int lastBuyCount = maxLimit - ItemDataManager.GetItemExchangeTimes(ConstItemID.POWER);
  132. showTxt = string.Format("每5分钟回复1点体力\n今日剩余购买次数{0}/{1}次", lastBuyCount, maxLimit);
  133. }
  134. else
  135. {
  136. //金币礼包
  137. _shopCfgList = ShopCfgArray.Instance
  138. .GetCfgsBymenu1Andmenu2(ConstStoreTabId.ENDURING_GIFT_BOX, ConstStoreSubId.ENDURING_GIFT_BOX_GOLD)
  139. .OrderBy(a => a.refreshType).ToList();
  140. _ui.m_txtNeed.align = AlignType.Right;
  141. if (_maxTimes != 0)
  142. {
  143. showTxt = string.Format("今日剩余购买次数{0}/{1}", _maxTimes - _buyTimes, _maxTimes);
  144. }
  145. }
  146. _ui.m_txtNum.text = showTxt;
  147. _ui.m_txtPromptExt.text = string.Format("除了上述购买{0}的途径,我们还提供了更多的优惠礼包选择", itemCfg.name);
  148. _ui.m_list.itemRenderer = ListItemRender;
  149. _ui.m_list.numItems = _shopCfgList.Count;
  150. _ui.m_list.visible = true;
  151. }
  152. private void ListItemRender(int index, GObject obj)
  153. {
  154. ShopCfg shopCfg = _shopCfgList[index];
  155. ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(shopCfg.itemId); //购买的物品-礼包
  156. UI_ComCurSupplyItem item = UI_ComCurSupplyItem.Proxy(obj);
  157. item.target.data = shopCfg;
  158. //返利包
  159. item.m_txtTitle.text = itemCfg.name;
  160. item.m_txtWeekPrompt.visible = false;
  161. item.m_icoWeekPromptTag.visible = false;
  162. if (itemCfg.param2Arr.Length != 0)
  163. {
  164. item.m_txtWeekPrompt.visible = true;
  165. item.m_icoWeekPromptTag.visible = true;
  166. item.m_txtWeekPrompt.text = string.Format("连续{0}天每日获得", itemCfg.param2Arr[0]);
  167. }
  168. int numItems;
  169. var childItemCfg = ItemCfgArray.Instance.GetCfg(shopCfg.itemId);
  170. var remainBuyNum = shopCfg.maxBuyNum - ShopDataManager.Instance.GetGoodsBuyNumById(shopCfg.id);
  171. item.m_comLeftGiftBox.m_loaIcon.url = ResPathUtil.GetIconPath(itemCfg);
  172. item.m_btnBuy.m_txtOldPrice.text = $"{shopCfg.originalPrice}";
  173. item.m_btnBuy.m_loaIcon.visible = false;
  174. string mTxtOldPrice = string.Empty;
  175. if (shopCfg.costType == CostType.ITEM)
  176. {
  177. //货币
  178. ItemCfg costCfg = ItemCfgArray.Instance.GetCfg(shopCfg.costId);
  179. item.m_btnBuy.m_loaIcon.visible = true;
  180. item.m_btnBuy.m_loaIcon.url = ResPathUtil.GetIconPath(costCfg);
  181. }
  182. else if (shopCfg.costType == CostType.RMB)
  183. {
  184. //人民币
  185. mTxtOldPrice = "元";
  186. }
  187. else
  188. {
  189. //免费
  190. mTxtOldPrice = $"免费";
  191. item.m_btnBuy.m_txtOldPrice.text = "";
  192. item.m_btnBuy.m_txtNewPrice.align = AlignType.Left;
  193. item.m_btnBuy.m_txtNewPrice.x = 90;
  194. }
  195. item.m_btnBuy.m_txtNewPrice.text = $"{shopCfg.price + mTxtOldPrice}";
  196. item.m_comLeftGiftBox.target.data = itemCfg;
  197. item.m_comLeftGiftBox.m_loaIcon.onClick.Add(OnListSelectorItemClick);
  198. if (shopCfg.originalPrice != shopCfg.price)
  199. {
  200. var roundedNumStr = NumberUtil.CalculateDiscount(shopCfg.originalPrice, shopCfg.price);
  201. item.m_comLeftGiftBox.m_comDiscount.target.visible = true;
  202. item.m_comLeftGiftBox.m_comDiscount.m_txtDiscountNum.text = $"{roundedNumStr}折"; //之后再计算赋值
  203. }
  204. else
  205. {
  206. item.m_comLeftGiftBox.m_comDiscount.target.visible = false;
  207. }
  208. if (shopCfg.refreshType == RefreshType.DAY) //也可以换成人民币来做条件
  209. {
  210. //日刷
  211. item.m_comLeftGiftBox.m_comGouMaiGetText.target.visible = false;
  212. item.m_txtUrc.text = string.Format("今日剩余{0}/{1}", remainBuyNum, shopCfg.maxBuyNum);
  213. item.m_txtLrc.text = string.Format("可获得{0}会员积分", shopCfg.price * 10);
  214. item.m_txtWeekPrompt.visible = false;
  215. item.m_icoWeekPromptTag.visible = false;
  216. numItems = childItemCfg.itemsArr.Length;
  217. if (remainBuyNum == 0)
  218. {
  219. //已售完
  220. item.m_btnBuy.target.visible = true;
  221. item.m_btnCurReceive.target.visible = false;
  222. item.m_btnBuy.m_bagYellow.visible = false;
  223. item.m_btnBuy.m_bagGrey.visible = true;
  224. }
  225. else
  226. {
  227. //未售完
  228. item.m_btnBuy.target.visible = true;
  229. item.m_btnCurReceive.target.visible = false;
  230. item.m_btnBuy.m_bagYellow.visible = true;
  231. item.m_btnBuy.m_bagGrey.visible = false;
  232. }
  233. }
  234. else
  235. {
  236. //周刷
  237. var weekGiftBoxState = EnduringGiftBoxDataManager.Instance.DayIsRebateGiftBox(shopCfg.itemId);
  238. item.m_comLeftGiftBox.m_comGouMaiGetText.target.visible = true;
  239. var itemArr = itemCfg.itemsArr[0];
  240. ItemCfg getItemCfg = ItemCfgArray.Instance.GetCfg(itemArr[0]); //及时获得的物品,读取第一个显示ICON
  241. item.m_comLeftGiftBox.m_comGouMaiGetText.m_loaIcon.url = ResPathUtil.GetIconPath(getItemCfg);
  242. item.m_comLeftGiftBox.m_comGouMaiGetText.m_txtGetGold.text = itemArr[1].ToString();
  243. item.m_txtUrc.text = string.Format("每周限购{0}/{1}", remainBuyNum, shopCfg.maxBuyNum);
  244. int rebateDay = EnduringGiftBoxDataManager.Instance.GetItemRebateDay(itemCfg.id);
  245. string mTxtLrc = string.Empty;
  246. if (rebateDay != 0)
  247. {
  248. mTxtLrc = string.Format("剩余{0}天", rebateDay);
  249. }
  250. item.m_txtLrc.text = mTxtLrc;
  251. item.m_txtWeekPrompt.visible = true;
  252. item.m_txtWeekPrompt.text =
  253. string.Format("连续{0}天每日获得",
  254. itemCfg.param2Arr[0] + 1); //NumberUtil.GetChiniseNumberText(itemCfg.param2Arr[0])
  255. item.m_icoWeekPromptTag.visible = true;
  256. numItems = childItemCfg.param1Arr.Length;
  257. //是否需要领取
  258. if (weekGiftBoxState)
  259. {
  260. item.m_btnBuy.target.visible = false;
  261. item.m_btnCurReceive.target.visible = true;
  262. item.m_btnCurReceive.m_receive.visible = true;
  263. item.m_btnCurReceive.m_received.visible = false;
  264. item.m_btnCurReceive.m_txtRec.text = "领取";
  265. }
  266. else
  267. {
  268. //是否能购买
  269. if (remainBuyNum == 0)
  270. {
  271. //已经领取
  272. if (EnduringGiftBoxDataManager.Instance.DayRebateItemIds.Contains(shopCfg.itemId))
  273. {
  274. item.m_btnBuy.target.visible = false;
  275. item.m_btnCurReceive.target.visible = true;
  276. item.m_btnCurReceive.m_receive.visible = false;
  277. item.m_btnCurReceive.m_received.visible = true;
  278. item.m_btnCurReceive.m_txtRec.text = "已领取";
  279. }
  280. else
  281. {
  282. item.m_btnCurReceive.target.visible = false;
  283. item.m_btnBuy.target.visible = true;
  284. item.m_btnBuy.m_bagGrey.visible = true;
  285. item.m_btnBuy.m_bagYellow.visible = false;
  286. }
  287. }
  288. else
  289. {
  290. //未售完
  291. item.m_btnBuy.target.visible = true;
  292. item.m_btnBuy.m_bagGrey.visible = false;
  293. item.m_btnBuy.m_bagYellow.visible = true;
  294. item.m_btnCurReceive.target.visible = false;
  295. }
  296. }
  297. }
  298. item.m_icoWeekPromptTag.onClick.Add(RuleController.ShowRuleView);
  299. item.m_icoWeekPromptTag.data = 300013;
  300. //领取按钮点击事件
  301. item.m_btnCurReceive.target.onClick.Add(OnBtnCurReceiveClick);
  302. //购买按钮点击事件
  303. item.m_btnBuy.target.onClick.Add(OnBtnBuyClick);
  304. item.m_list.data = shopCfg;
  305. item.m_list.itemRenderer = ChildListItemRender;
  306. item.m_list.numItems = numItems;
  307. }
  308. //领取按钮点击事件
  309. private void OnBtnCurReceiveClick(EventContext context)
  310. {
  311. GObject sender = context.sender as GObject;
  312. GObject obj = sender.parent;
  313. ShopCfg cfg = obj.data as ShopCfg;
  314. bool isSellOut = EnduringGiftBoxDataManager.Instance.DayIsRebateGiftBox(cfg.itemId);
  315. if (isSellOut)
  316. {
  317. EnduringGiftBoxSProxy.ReqGetGiftBagRebate(cfg.id).Coroutine();
  318. }
  319. else
  320. {
  321. PromptController.Instance.ShowFloatTextPrompt("无法领取");
  322. }
  323. }
  324. //购买按钮点击事件
  325. private void OnBtnBuyClick(EventContext context)
  326. {
  327. GObject sender = context.sender as GObject;
  328. GObject obj = sender.parent;
  329. ShopCfg cfg = obj.data as ShopCfg;
  330. bool isSellOut = cfg.maxBuyNum > 0 &&
  331. cfg.maxBuyNum - ShopDataManager.Instance.GetGoodsBuyNumById(cfg.id) <= 0;
  332. if (isSellOut)
  333. {
  334. PromptController.Instance.ShowFloatTextPrompt("已售罄");
  335. return;
  336. }
  337. if (!ShopDataManager.Instance.GetShopGoodsStateById(cfg.id))
  338. {
  339. PromptController.Instance.ShowFloatTextPrompt(ShopDataManager.Instance.GetShopGoodsStateTips(cfg.id));
  340. return;
  341. }
  342. if (cfg.costType == CostType.FREE)
  343. {
  344. ShopSProxy.ReqShopBuy(cfg.id, 1).Coroutine();
  345. LogServerHelper.SendPlayParticipationLog((int)PlayParticipationEnum.SHANG_CHENG, 2);
  346. }
  347. else
  348. {
  349. ViewManager.Show<ItemExchangeView>(cfg.id);
  350. }
  351. }
  352. private void ChildListItemRender(int index, GObject obj)
  353. {
  354. UI_ComRewardIconItem uiItemChild = UI_ComRewardIconItem.Proxy(obj);
  355. var shopCfg = uiItemChild.target.parent.data as ShopCfg;
  356. var itemCfg = ItemCfgArray.Instance.GetCfg(shopCfg.itemId);
  357. // uiItemChild.m_showRreceives.visible = false;
  358. //var curGiftBoxState = EnduringGiftBoxDataManager.GiftBoxStateDic[shopCfg.id];
  359. int[][] result;
  360. if (shopCfg.refreshType == RefreshType.DAY)
  361. {
  362. result = itemCfg.itemsArr;
  363. uiItemChild.m_bagYellow.visible = false;
  364. uiItemChild.m_bagBlue.visible = true;
  365. uiItemChild.m_bagYellowEx.visible = false;
  366. uiItemChild.m_bagBlueEx.visible = true;
  367. }
  368. else
  369. {
  370. //周刷
  371. result = itemCfg.param1Arr;
  372. uiItemChild.m_bagYellow.visible = true;
  373. uiItemChild.m_bagBlue.visible = false;
  374. uiItemChild.m_bagYellowEx.visible = true;
  375. uiItemChild.m_bagBlueEx.visible = false;
  376. }
  377. // if (curGiftBoxState == EnduringGiftBoxBuyStatus.YesGet)
  378. // {
  379. // uiItemChild.m_showRreceives.visible = true;
  380. // }
  381. // else if (curGiftBoxState == EnduringGiftBoxBuyStatus.NoGet)
  382. // {
  383. // uiItemChild.m_showRreceives.visible = false;
  384. // }
  385. var itemArr = result[index];
  386. var itemCfgChild = ItemCfgArray.Instance.GetCfg(itemArr[0]);
  387. uiItemChild.m_loaIcon.onClick.Add(OnListSelectorItemClick);
  388. uiItemChild.m_loaIcon.url = ResPathUtil.GetIconPath(itemCfgChild);
  389. uiItemChild.m_num.text = itemArr[1].ToString();
  390. uiItemChild.target.data = itemCfgChild;
  391. UI_ComRewardIconItem.ProxyEnd();
  392. }
  393. //弹出物品详细描述框
  394. private void OnListSelectorItemClick(EventContext context)
  395. {
  396. GObject sender = context.sender as GObject;
  397. GObject obj = sender.parent;
  398. ItemCfg itemCfg = obj.data as ItemCfg;
  399. GoodsItemTipsController.ShowItemTips(itemCfg.id);
  400. }
  401. private async void OnClickBtnSure()
  402. {
  403. if (_maxTimes > 0 && (_buyTimes + _count) > _maxTimes)
  404. {
  405. PromptController.Instance.ShowFloatTextPrompt("购买次数不足");
  406. return;
  407. }
  408. ItemExchangeCfgArray.Instance.GetMoneyIdAndNum(_itemId, _buyTimes, _count, out int costId, out int coustNum,
  409. out int buyNum);
  410. Debug.Log(costId + "数量:" + ItemDataManager.GetItemNum(costId));
  411. if (ItemDataManager.GetItemNum(costId) < coustNum)
  412. {
  413. ItemCfg costCfg = ItemCfgArray.Instance.GetCfg(costId);
  414. if (_itemId == ConstItemID.DIAMOND_PURPLE)
  415. {
  416. PromptController.Instance.ShowFloatTextPrompt(string.Format("{0}不足,请前往商城选购", costCfg.name));
  417. }
  418. else
  419. {
  420. AlertUI.Show(costCfg.name + "不足,是否前往购买?").SetLeftButton(true).SetRightButton(true, "确认",
  421. (AlertWindow.AlertCallback)((object data) =>
  422. {
  423. long costNeedCount = coustNum - ItemDataManager.GetItemNum(costId);
  424. BuyItemConteoller.Show(costId, costNeedCount, ConstBuyType.TYPE_ITEM, null, true, true,
  425. GameConst.MAX_COUNT_TO_BUY_DIAMOND_RED);
  426. }));
  427. OnClickBtnCancel();
  428. }
  429. return;
  430. }
  431. bool result = await ItemExchangeSProxy.ItemExchange(_itemId, _count);
  432. if (result)
  433. {
  434. PromptController.Instance.ShowFloatTextPrompt("购买成功", MessageType.SUCCESS);
  435. if (_onSuccess != null)
  436. {
  437. _onSuccess();
  438. }
  439. }
  440. UpdateView();
  441. //判断一下是不是从主要界面进来的
  442. if (_type == 0)
  443. {
  444. this.Hide();
  445. }
  446. }
  447. //购买连续礼包之后,更新数据+更新界面
  448. private void UpDayRebateAndView(EventContext context)
  449. {
  450. ShopCfg shopCfg = context.data as ShopCfg;
  451. var itemCfg = ItemCfgArray.Instance.GetCfg(shopCfg.itemId);
  452. if (itemCfg.itemType == ConstItemType.GIFT_BAG &&
  453. itemCfg.subType == ConstItemSubType.CONTINUOUS_REWARD_GIFT)
  454. {
  455. int dayNum = EnduringGiftBoxDataManager.Instance.GetItemRebateDay(itemCfg.id);
  456. int totalDayNum = dayNum + itemCfg.param2Arr[0];
  457. EnduringGiftBoxDataManager.Instance.UpDayAllRebateItemDic(itemCfg.id, totalDayNum);
  458. EnduringGiftBoxDataManager.Instance.AddDayRebateItemIds(itemCfg.id);
  459. }
  460. UpdateView();
  461. }
  462. protected override void OnHide()
  463. {
  464. this.RemoveEventListener();
  465. Dispose();
  466. base.Hide();
  467. _onSuccess = null;
  468. }
  469. private void OnClickBtnCancel()
  470. {
  471. // Dispose();
  472. this.Hide();
  473. }
  474. }
  475. }