Esempio n. 1
0
        /// <summary>
        /// Event to call Alert window
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void helpToolStripButton_Click(object sender, EventArgs e)
        {
            string         name        = Guid.NewGuid().ToString();
            frmAlertWindow AlertWindow = new frmAlertWindow();

            AlertWindow.MdiParent = this;
            AlertWindow.Name      = name;
            AddContextMenuTabControlItem(name, AlertWindow);
            AlertWindow.Show();
        }
Esempio n. 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;
                }
            }
        }