public Control Wrap(ISessionDto obj) { var dto = obj as MasterDto; var control = new ModbusControl { Text = dto.Name, Dock = DockStyle.Fill, }; control.ToUI(dto); return(control); }
private void AddSession(SessionSettings session) { var tabPage = new TabPage { Text = session.Name }; var ModbusControl = new ModbusControl { Dock = DockStyle.Fill }; tabPage.Controls.Add(ModbusControl); tabControl.TabPages.Add(tabPage); ModbusControl.ToUI(session); tabControl.SelectedTab = tabPage; }