示例#1
0
 private void ListBoundWatch_DoubleClick(object sender, EventArgs e)
 {
     foreach (Form item in Application.OpenForms)
     {
         if (item.Visible)
         {
             if (item.Tag != null)
             {
                 if (((TagWatcher)item.Tag).Name == _Bnb.Bound.Base.Name)
                 {
                     item.Focus();
                     return;
                 }
             }
         }
     }
     if (See == SeeHistory.WithHistory)
     {
         BoundWatchCntrlFrm bwf1 = new BoundWatchCntrlFrm(_Bnb, SeeHistory.NoHistrory);
         bwf1.StartPosition = FormStartPosition.WindowsDefaultLocation;
         //bwf1.Tag = Program.ShowedForms.Last();//$"{_Bnb.Bound.Base.Ticker}";
         //bwf1.Location = new Point(Program.mf.Location.X + Program.mf.Size.Width + 211 * Program.ShowedForms.Last().Index, Program.mf.Location.Y + 10 * Program.ShowedForms.Last().Index);
         bwf1.Show();
         BoundWatchCntrlFrm bwf = new BoundWatchCntrlFrm(_Bnb, SeeHistory.History);
         bwf.StartPosition = FormStartPosition.Manual;
         bwf.Location      = new Point(bwf1.Location.X + bwf1.Width + 10, bwf1.Location.Y);
         //bwf.Tag = Program.ShowedForms.Last();//$"{_Bnb.Bound.Base.Ticker}";
         bwf.Show();
     }
     else
     {
         BoundWatchCntrlFrm bwf1 = new BoundWatchCntrlFrm(_Bnb, See);
         bwf1.StartPosition = FormStartPosition.WindowsDefaultLocation;
         //bwf1.Location = new Point(Program.mf.Location.X + Program.mf.Size.Width + 211 * Program.ShowedForms.Last().Index, Program.mf.Location.Y + 10 * Program.ShowedForms.Last().Index);
         //bwf1.Tag = Program.ShowedForms.Last();//$"{_Bnb.Bound.Base.Ticker}";
         bwf1.Show();
     }
 }
示例#2
0
        private void worst_ptofit_btn_Click(object sender, EventArgs e)
        {
            if (Selected_portfail.BoundsList.Count > 0)
            {
                Bound_Conclav bc;
                switch (SeeHistory)
                {
                case SeeHistory.NoHistrory:
                    var a = Selected_portfail.Bounds_Now.Min();
                    bc = Selected_portfail.BoundsList.Where(t => t.Bound_now == a).Single();
                    break;

                case SeeHistory.History:
                    var b = Selected_portfail.Bounds_Sold.Min();
                    bc = Selected_portfail.BoundsList.Where(t => t.Bound_sold == b).Single();
                    break;

                case SeeHistory.WithHistory:
                default:
                    var c = Selected_portfail.Bounds_Now.Min();
                    var d = Selected_portfail.Bounds_Sold.Min();
                    if (c.Profit_perc < d.Profit_perc)
                    {
                        bc = Selected_portfail.BoundsList.Where(t => t.Bound_now == c).Single();
                    }
                    else
                    {
                        bc = Selected_portfail.BoundsList.Where(t => t.Bound_sold == d).Single();
                    }
                    break;
                }
                BoundWatchCntrlFrm bwf_worst = new BoundWatchCntrlFrm(bc, SeeHistory);
                Program.ShowedForms.Add(new TagWatcher(bc.Bound.Base.Name, SeeHistory));
                //bwf_worst.Tag = Program.ShowedForms.Last();//$"{bc.Bound.Base.Ticker}";
                bwf_worst.Show();
            }
        }