当前位置: 首页>>代码示例>>C#>>正文


C# KeyValuePair.DisplayInShowForm方法代码示例

本文整理汇总了C#中KeyValuePair.DisplayInShowForm方法的典型用法代码示例。如果您正苦于以下问题:C# KeyValuePair.DisplayInShowForm方法的具体用法?C# KeyValuePair.DisplayInShowForm怎么用?C# KeyValuePair.DisplayInShowForm使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在KeyValuePair的用法示例。


在下文中一共展示了KeyValuePair.DisplayInShowForm方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ShowPortfolioPnlProgression

    public void ShowPortfolioPnlProgression()
    {
      var pnl = new ConstructGen<double>(Positions.Select(x=>x.Security).ToArray());

      var flp = new System.Windows.Forms.FlowLayoutPanel();

      var listOfInfraBoxes = new List<Infragistics.Win.Misc.UltraGroupBox>();

      for (int i = 0; i < pnl.ArrayLength; ++i)
      {
        var posPnl = Positions[i].GeneratePnlSinceFix();

        for (int d = 0; d < posPnl.Length; ++d)
        {
          pnl.SetValue(posPnl.Dates[d], i, posPnl.Data[d].Close);
        }

        {
          Infragistics.Win.Misc.UltraGroupBox box = new Infragistics.Win.Misc.UltraGroupBox();
          box.Text = string.Format("{0} {1}", Positions[i].Security, Positions[i].Pnl.ToString("###0.0#;(###0.0#);-"));
          box.Tag = Positions[i].Pnl;
          box.Size = new System.Drawing.Size(250, 250);

          var chart = new SI.Controls.BarDataPointChart();
          chart.SetYAxisFormat("##0.0#");
          chart.Dock = System.Windows.Forms.DockStyle.Fill;
          chart.Create(posPnl);
          box.Controls.Add(chart);
          listOfInfraBoxes.Add(box);
        }
      }

      Infragistics.Win.Misc.UltraGroupBox[] boxArr = listOfInfraBoxes.OrderByDescending(x => (double)x.Tag).ToArray();

      {
        double max = 0d;
        foreach (Infragistics.Win.Misc.UltraGroupBox box in boxArr)
        {
          max = Math.Max(max, ((SI.Controls.BarDataPointChart)box.Controls[0]).YAxisAbsoluteMax);
        }

        foreach (Infragistics.Win.Misc.UltraGroupBox box in boxArr)
        {
          ((SI.Controls.BarDataPointChart)box.Controls[0]).SetMaxMinYAxisRange(max);
        }
      }

      foreach (Infragistics.Win.Misc.UltraGroupBox box in boxArr)
      {
        flp.Controls.Add(box);
      }


      pnl.SortKeys();

      for (int i = 0; i < pnl.ArrayLength; ++i)
      {
        DatedDataCollectionGen<double> col = pnl.GetColumnValuesAsDDC(i);
        double last = col.Data[0];

        for (int j = 1; j < col.Length; ++j)
        {
          double val = col.Data[j];

          if (val == 0d)
          {
            if (last != 0d)
            {
              pnl.SetValue(col.Dates[j], i, last);
            }
          }
          else
            last = val;
        }
      }

      DatedDataCollectionGen<double> total = pnl.SumRows();

      KeyValuePair<string, System.Windows.Forms.Control>[] cons = new KeyValuePair<string, System.Windows.Forms.Control>[3];

      var stack = new Controls.SimpleStackedColumnChart();

      stack.Create<string, string>(
        pnl.Dates.Select(x => x.ToString("HH:mm")).ToArray(),
        Positions.Select(x => x.Security).ToArray(),
        pnl.ToArray());
      cons[0] = new KeyValuePair<string, System.Windows.Forms.Control>("position attributed", stack);


      //stack.DisplayInShowForm(string.Format("{0} pnl progression, position attributed", this.Name));

      var lcdd = new SI.Controls.LineChartDataDisplay();
      lcdd.AddSeries(total.Dates, total.Data, Name, 40, "#0.0#");
      lcdd.SetXAxisFormat("HH:mm");
      //lcdd.DisplayInShowForm(string.Format("{0} total pnl progression", m_p.DisplayName));
      cons[1] = new KeyValuePair<string, Control>("total", lcdd);

      cons[2] = new KeyValuePair<string, Control>("comp", flp);

      cons.DisplayInShowForm(string.Format("{0} pnl progression", Name));
//.........这里部分代码省略.........
开发者ID:heimanhon,项目名称:researchwork,代码行数:101,代码来源:LivePortfolio.cs


注:本文中的KeyValuePair.DisplayInShowForm方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。