BackManager.cs 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. using Muchinfo.MTPClient.Infrastructure.Interfaces;
  2. using System.Collections.Generic;
  3. namespace Muchinfo.MTPClient.UI.Utilities
  4. {
  5. public class BackManager
  6. {
  7. /// <summary>
  8. /// 执行操作集合,用于后退
  9. /// </summary>
  10. private static List<WindowItem> _backList = new List<WindowItem>();
  11. #region 后退操作
  12. /// <summary>
  13. /// 添加到后退集合
  14. /// </summary>
  15. /// <param name="item">The item.</param>
  16. public static void AddToBackList(WindowItem item)
  17. {
  18. _backList.Insert(0, item);
  19. }
  20. /// <summary>
  21. /// 后退
  22. /// </summary>
  23. public static void BackOff()
  24. {
  25. //粤国际:取消此功能
  26. return;
  27. //if (!_backList.Any()) return;
  28. ////删除当前的
  29. //if (_backList.Count > 1) _backList.RemoveAt(0);
  30. //var item = _backList.FirstOrDefault();
  31. //if (item == null) return;
  32. //_backList.Remove(item);
  33. //switch (item.WindowType)
  34. //{
  35. // case WindowType.QuoteListView:
  36. // var commandItem = item as WindowItemWithCommandType;
  37. // if (commandItem == null) return;
  38. // WindowHelper.OpenQuoteListWindow(commandItem.Title, commandItem.MenuCommandType, commandItem.AdditionalInfo);
  39. // break;
  40. // case WindowType.TikDetails:
  41. // case WindowType.TradeDetails:
  42. // var goods = CacheManager.CacheGoodsBaseInfos.FirstOrDefault(z => z.Id == item.AdditionalInfo);
  43. // if (goods == null) return;
  44. // //var quoteGoods = goods.ToQuoteGoods();
  45. // if (item.WindowType == WindowType.TradeDetails)
  46. // {
  47. // PriceCardHelper.OpenSubPenDetail(goods);
  48. // }
  49. // else
  50. // {
  51. // PriceCardHelper.OpenSubPriceDetail(goods);
  52. // }
  53. // break;
  54. // case WindowType.QuoteChartView:
  55. // var chartItem = item as ChartWindowItem;
  56. // if (chartItem == null) return;
  57. // var arg = new OpenQuoteChartWindowArg(chartItem.Goods, chartItem.CycleType);
  58. // WindowHelper.OpenQuoteChartWindow(arg);
  59. // break;
  60. // case WindowType.NewsView:
  61. // var newsItem = item as NewsWindowItem;
  62. // if (newsItem == null) return;
  63. // WindowHelper.OpenNewsWindow(newsItem.CategoryCode);
  64. // break;
  65. //}
  66. }
  67. #endregion
  68. }
  69. }