private void SaveChartParamters(frmCharts chart) { var zoomList = chart.zoomList; SQLiteDBOperation.DeleteZoomList(chart.Name); if (zoomList != null && zoomList.Count > 0) { foreach (var item in zoomList) { SQLiteDBOperation.SaveZoomList(item, chart.Name); } } var annotations = chart.annotationList; SQLiteDBOperation.DeleteAnnotation(chart.Name); if (annotations != null && annotations.Count > 0) { foreach (var item in chart.annotationList) { SQLiteDBOperation.SaveAnnotation(item, chart.Name); } } SQLiteDBOperation.DeleteFormToolState(chart.Name); var toolState = new FormState(); toolState.FormUniqueName = chart.Name; toolState.LockState = chart.isLocked == true ? 1 : 0; toolState.VisibleState = chart.panelVisible == true ? 1 : 0; toolState.TimeFrame = chart.candleTimeFrame; SQLiteDBOperation.SaveFormToolState(toolState); }
private void ToolStripMenuItem_Click(object sender, EventArgs e) { ToolStripMenuItem toolStripMenuItem = sender as ToolStripMenuItem; string nameStrip = toolStripMenuItem.Name; string name = Guid.NewGuid().ToString(); var arrayStrip = nameStrip.Split('.'); if (arrayStrip.Count() > 1) { string symbol = arrayStrip[1]; if (arrayStrip[0].ToLower() == "bitfinex") { symbol = "t" + symbol; } frmCharts chart = new frmCharts(this, arrayStrip[0], symbol); chart.MdiParent = this; chart.Name = name; AddContextMenuTabControlItem(name, chart); chart.Show(); } }
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; } } }