示例#1
0
        private void marketWatchToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var frm = new frmPopup();

            frm.ShowDialog();
            if (string.IsNullOrEmpty(frm.WorkspaceName))
            {
                return;
            }
            else
            {
                this.Invoke((Action) delegate()
                {
                    var name = Guid.NewGuid().ToString();
                    frmMarketWatchWin watch = new frmMarketWatchWin();
                    watch.MdiParent         = this;
                    watch.Name = name;
                    watch.Text = frm.WorkspaceName;
                    AddContextMenuTabControlItem(name, watch);
                    watch.Show();
                });
            }
        }
示例#2
0
        private int currentWorkspaceId = 0;//Mantain record of selected workspace
        private void ReteriveWindowLocations(int workSpaceId)
        {
            currentWorkspaceId = workSpaceId;
            var result = SQLiteDBOperation.ReteriveFormLocation(workSpaceId);

            foreach (var item in result)
            {
                switch (item.formName)
                {
                case "frmMarketWatch":
                    this.Invoke((Action) delegate()
                    {
                        frmMarketWatchWin marketWatch = new frmMarketWatchWin();
                        OpenWindows(marketWatch, item);
                    });
                    break;     /* optional */

                case "frmMarketWatchWin":
                    this.Invoke((Action) delegate()
                    {
                        frmMarketWatchWin WatchWindow = new frmMarketWatchWin();
                        OpenWindows(WatchWindow, item);
                    });
                    break;     /* optional */

                case "frmCharts":
                    string title  = item.formTitle;
                    string broker = string.Empty;
                    string symbol = string.Empty;
                    if (!string.IsNullOrEmpty(title))
                    {
                        broker = title.Split('.')[0];
                        symbol = title.Split('.')[1];
                        if (broker.ToLower() == Broker.BitFinex.ToString().ToLower())
                        {
                            symbol = "t" + symbol;
                        }
                    }
                    frmCharts charts = new frmCharts(this, broker, symbol);
                    OpenWindows(charts, item);
                    break;

                case "frmOrders":
                    frmOrders orders = new frmOrders();
                    OpenWindows(orders, item);
                    break;

                case "frmPositions":
                    frmPositions positions = new frmPositions();
                    OpenWindows(positions, item);
                    break;

                case "frmClosedPosition":
                    frmClosedPosition closedPosition = new frmClosedPosition();
                    OpenWindows(closedPosition, item);
                    break;

                case "frmAlertWindow":
                    frmAlertWindow alertWindow = new frmAlertWindow();
                    OpenWindows(alertWindow, item);
                    break;

                case "frmTransaction":
                    frmTransaction transaction = new frmTransaction();
                    OpenWindows(transaction, item);
                    break;

                default:     /* Optional */

                    break;
                }
            }
        }