SpecialValueItem.cs 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using CB.Entity;
  6. using CB.Interface;
  7. namespace CB.TrendChart
  8. {
  9. class SpecialValueItem<TEntity> : ChartItemRepository<TEntity>, IChartItem<TEntity> where TEntity : LotteryOpenCode
  10. {
  11. public new int[] _itemIndex;
  12. public override void Init(ChartCssConfigInfo cssConfig, TrendChartItemInfo itemConfig)
  13. {
  14. DefaultInit(cssConfig, itemConfig);
  15. }
  16. #region 未用
  17. public override void MissDataInit(TrendChartData TrendChartCofig, int i)
  18. {
  19. }
  20. public override string GetMissData(MissDataType missDataType)
  21. {
  22. return "";
  23. }
  24. #endregion
  25. public override bool SetItemValue(TEntity entity)
  26. {
  27. if (this._ItemIndex == null)
  28. {
  29. this._ItemIndex = new int[this._itemConfig.ItemCount];
  30. }
  31. _itemIndex = new int[this._itemConfig.ItemCount];
  32. return SetSpecialValue(entity, ref _itemIndex, ref this._ItemIndex);
  33. }
  34. public override bool SetItemValue(TEntity entity, TEntity lastentity)
  35. {
  36. if (this._ItemIndex == null)
  37. {
  38. this._ItemIndex = new int[this._itemConfig.ItemCount];
  39. }
  40. _itemIndex = new int[this._itemConfig.ItemCount];
  41. return SetSpecialValue(entity, ref _itemIndex, ref this._ItemIndex);
  42. }
  43. public override string GetFomartString(string fomart, ChartCssConfigInfo cssConfig = null)
  44. {
  45. var html = GetFomartHTML(fomart, cssConfig);
  46. var sp = new StringBuilder((html.Item1.Length + 40) * this._itemConfig.ItemCount);
  47. switch (this._itemConfig.FuntionType)
  48. {
  49. case ChartItemType.SpecialValue_FCSSQ_ChuHaoPL:
  50. sp.Append(CssValueFunction.SpecialValue_FCSSQ_ChuHaoPL(this._LocalEntity, this._itemConfig, this._cssConfig, this._ItemIndex, html.Item1));
  51. break;
  52. case ChartItemType.SpecialValue_TCDLT_ChuHaoPL:
  53. sp.Append(CssValueFunction.SpecialValue_TCDLT_ChuHaoPL(this._LocalEntity, this._itemConfig, this._cssConfig, this._ItemIndex, html.Item1));
  54. break;
  55. default:
  56. for (int i = 0; i < this._itemConfig.ItemCount; i++)
  57. {
  58. sp.Append(GetHtml(true, html.Item1, "", this._ItemIndex[i].ToString(), i));
  59. }
  60. break;
  61. }
  62. return sp.ToString();
  63. }
  64. }
  65. }