Beispiel #1
0
 /// <summary> Получение формы со стаканом и графиком </summary>
 /// <param name="sec"></param>
 /// <returns></returns>
 public Form_GraphicDepth ShowGraphicDepth(Securities sec)
 {
     Qlog.CatchException(() =>
     {
         var form = ListFormsDepth.FirstOrDefault(f => f.TrElement.Security == sec);
         if (form.IsNull())
         {
             var elTr = this.DataTrading.AddOrFind(sec);
             if (elTr.NotIsNull())
             {
                 form = new Form_GraphicDepth(Trader, elTr, this);
                 ListFormsDepth.Add(form);
             }
             //Инициализация закрытия
             form.FormClosed += (s, e) =>
             {
                 ListFormsDepth.Remove(form);
             };
         }
         if (form.NotIsNull())
         {
             form.Show();
             form.WindowState = FormWindowState.Maximized;
         }
         return(form);
     });
     return(null);
 }
Beispiel #2
0
 /// <summary> Получение формы со стаканом и графиком </summary>
 /// <param name="sec"></param>
 /// <returns></returns>
 private Form_GraphicDepth ShowGraphicDepth(Securities sec)
 {
     try
     {
         var form = ListFormsDepth.FirstOrDefault(f => !f.isClose && f.TrElement.Security == sec);
         if (form == null)
         {
             var elTr = this.DataTrading.Collection.FirstOrDefault(e => e.Security == sec);
             if (elTr == null)
             {
                 elTr = new TElement(sec);
                 this.DataTrading.Add(elTr);
                 elTr.Create();
             }
             form = new Form_GraphicDepth(Trader, elTr, this);
             ListFormsDepth.Add(form);
         }
         if (form != null)
         {
             form.Show();
         }
         return(form);
     }
     catch (Exception ee)
     {
         MessageBox.Show(ee.ToString());
     }
     return(null);
 }