internal DdeSettingsResult(DdeTable table, Exception error, bool isCritical) { if (table == null) throw new ArgumentNullException("table"); if (error == null) throw new ArgumentNullException("error"); Table = table; Error = error; IsCritical = isCritical; }
/// <summary> /// Проверить, открыто ли окно таблицы. /// </summary> /// <param name="table">Таблица, для которой необходимо проверить наличие открытого окна.</param> /// <returns><see langword="true"/>, если окно открыто, иначе, <see langword="false"/>.</returns> public bool IsTableOpened(DdeTable table) { if (table == null) throw new ArgumentNullException(nameof(table)); ThrowIfQuotesTable(new[] { table }); return IsTableOpened(table.Caption); }
/// <summary> /// Запущен ли экспорт DDE для переданой таблицы. /// </summary> /// <param name="table">Таблица, для которой необходимо узнать, запущен ли экспорт.</param> /// <returns><see langword="true"/>, если экспорт запущен, иначе, <see langword="false"/>.</returns> public bool IsDdeStarted(DdeTable table) { if (table == null) throw new ArgumentNullException(nameof(table)); return _activeDdeExport.Contains(DdeExportTypes.ByDdeTable, table); }
private SystemWindow OpenEditWindow(DdeTable table) { if (table == null) throw new ArgumentNullException(nameof(table)); var window = GetTableWindow(table.Caption); return OpenEditWindow(window); }
private IEnumerable<DdeSettingsResult> GetTableSettings(DdeTable table, SystemWindow window) { if (table == null) throw new ArgumentNullException("table"); if (window == null) throw new ArgumentNullException("window"); var editWnd = OpenEditWindow(window); var results = new List<DdeSettingsResult>(); try { if (table == Adapter.SecuritiesTable) { var ctrl = editWnd.AllChildWindows.First(e => e.DialogID == 10442); if (ctrl.CheckState == CheckState.Checked) { ctrl.CheckState = CheckState.Unchecked; ctrl.Parent.Command(ctrl); //Thread.Sleep(_wmDelay); } } int columnsCtrlId; if (table == Adapter.SecuritiesTable) columnsCtrlId = 10411; else if (table == Adapter.SecuritiesChangeTable) columnsCtrlId = 10511; else if (table == Adapter.OrdersTable) columnsCtrlId = 11806; else if (table == Adapter.StopOrdersTable) columnsCtrlId = 31257; else if (table == Adapter.TradesTable) columnsCtrlId = 30303; else if (table == Adapter.MyTradesTable) columnsCtrlId = 11709; else if (table == Adapter.EquityPortfoliosTable) columnsCtrlId = 17903; else if (table == Adapter.DerivativePortfoliosTable) columnsCtrlId = 30857; else if (table == Adapter.EquityPositionsTable) columnsCtrlId = 12707; else if (table == Adapter.DerivativePositionsTable) columnsCtrlId = 30909; else if (table == Adapter.QuotesTable) columnsCtrlId = 12405; else throw new InvalidOperationException(LocalizedStrings.Str1825); var columnsCtrl = editWnd.AllChildWindows.First(e => e.DialogID == columnsCtrlId); var content = (ListContent)columnsCtrl.Content; if (content.Count < table.Columns.Count) throw new InvalidOperationException(LocalizedStrings.Str1826Params.Put(table.Caption, table.Columns.Count)); for (var i = 0; i < table.Columns.Count; i++) { var expectedColumn = table.Columns[i]; var columnTitle = content[i]; if (columnTitle == expectedColumn.Name) continue; // http://stocksharp.com/forum/default.aspx?g=posts&t=447 if (expectedColumn == DdeSecurityColumns.Status && columnTitle.CompareIgnoreCase("статус торговли инструментом")) continue; var realColumn = table.Columns[columnTitle]; var nonCritical = realColumn != null && realColumn.DataType == expectedColumn.DataType; var message = nonCritical ? LocalizedStrings.Str1827Params : LocalizedStrings.Str1828Params; var tableCaption = table.Caption; if (table == Adapter.QuotesTable) tableCaption = window.Title; results.Add(new DdeSettingsResult(table, new InvalidOperationException( message.Put(tableCaption, i, expectedColumn.Name, columnTitle)), nonCritical)); } } catch (Exception ex) { results.Add(new DdeSettingsResult(table, ex, true)); } if (editWnd != null) CloseEditWindow(editWnd, false); return results; }
/// <summary> /// Открыть таблицу Quik. /// </summary> /// <param name="table">Таблица, для которой необходимо открыть Quik таблицу.</param> public void OpenTable(DdeTable table) { if (table == null) throw new ArgumentNullException(nameof(table)); ThrowIfQuotesTable(new[] { table }); throw new NotImplementedException(); }