public InteractiveBrokersServer()
        {
            InteractiveBrokersServerRealization realization = new InteractiveBrokersServerRealization();

            ServerRealization = realization;

            CreateParameterString("Host", "127.0.0.1");
            CreateParameterInt("Port", 7497);
            CreateParameterButton("Show securities");
            ((ServerParameterButton)ServerParameters[2]).UserClickButton
                += () =>
                {
                realization.ShowSecuritySubscribleUi();
                };
        }
        public IbContractStorageUi(List <SecurityIb> secToSubscrible, InteractiveBrokersServerRealization server)
        {
            InitializeComponent();
            SecToSubscrible = secToSubscrible;
            _server         = server;

            _grid            = DataGridFactory.GetDataGridView(DataGridViewSelectionMode.FullRowSelect, DataGridViewAutoSizeRowsMode.None);
            _grid.ScrollBars = ScrollBars.Vertical;

            DataGridViewTextBoxCell cell0 = new DataGridViewTextBoxCell();

            cell0.Style = _grid.DefaultCellStyle;

            DataGridViewColumn column0 = new DataGridViewColumn();

            column0.CellTemplate = cell0;
            column0.HeaderText   = OsLocalization.Market.Label42;
            column0.ReadOnly     = false;
            column0.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            // column0.Width = 150;

            _grid.Columns.Add(column0);

            DataGridViewColumn column = new DataGridViewColumn();

            column.CellTemplate = cell0;
            column.HeaderText   = OsLocalization.Market.Label43;
            column.ReadOnly     = false;
            column.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            // column.Width = 150;
            _grid.Columns.Add(column);

            DataGridViewColumn column1 = new DataGridViewColumn();

            column1.CellTemplate = cell0;
            column1.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            column1.ReadOnly     = false;
            // column1.Width = 150;
            column1.HeaderText = OsLocalization.Market.Label44;
            _grid.Columns.Add(column1);

            DataGridViewColumn column3 = new DataGridViewColumn();

            column3.CellTemplate = cell0;
            column3.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            column3.ReadOnly     = false;
            // column1.Width = 150;
            column3.HeaderText = OsLocalization.Market.Label45;
            _grid.Columns.Add(column3);

            DataGridViewColumn column4 = new DataGridViewColumn();

            column4.CellTemplate = cell0;
            column4.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            column4.ReadOnly     = false;
            column4.HeaderText   = OsLocalization.Market.Label46;
            _grid.Columns.Add(column4);

            DataGridViewColumn column6 = new DataGridViewColumn();

            column6.CellTemplate = cell0;
            column6.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            column6.ReadOnly     = false;
            column6.HeaderText   = OsLocalization.Market.Label61;
            _grid.Columns.Add(column6);

            DataGridViewColumn column5 = new DataGridViewColumn();

            column5.CellTemplate = cell0;
            column5.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            column5.ReadOnly     = false;
            column5.HeaderText   = OsLocalization.Market.Label60;
            _grid.Columns.Add(column5);

            _grid.Rows.Add(null, null);

            Host.Child = _grid;
            LoadSecOnTable();

            Closing                += IbContractStorageUi_Closing;
            _grid.Click            += _grid_Click;
            _grid.CellValueChanged += _grid_CellValueChanged;
        }