private void UpdateDataData(bool sendEvent) { ushort i = m_start; while (i < m_end) { String data = ""; for (byte j = 0; j < m_displayLenght; j++) { byte b = GameBoy.Ram.ReadByteAt((ushort)(i + j)); data += String.Format("{0:x2} ", b); } object[] row = { false, m_name, String.Format("{0:x4}",i), String.Format("{0:x2}",GameBoy.Ram.ReadByteAt(i)), data, m_displayLenght, true, i }; this.LoadDataRow(row, false); i += m_displayLenght; } this.AcceptChanges(); if (sendEvent) { TableEventArgs e = new TableEventArgs(); if (m_tableChanged != null) { m_tableChanged(this, e); } } }
protected override void CreateDataTab(object sender, TableEventArgs e) { if (!DataTabPages.Contains(e.Label)) { var tab = CreateBitmexDataTabPage(e.Table, e.Label); Invoke((System.Action) delegate { DataTabPages.Add(tab); if (tab == SelectedTab) { tab.Renew(); } }); } else { var tab = DataTabPages.Map[e.Label]; BeginInvoke((System.Action) delegate { if (tab == SelectedTab) { tab.Renew(); } }); } }
void tableDesigner1_TableBecomesActive(TableEventArgs e) { if (TableActive != null) { TableActive(tableDesigner1, e); } }
protected virtual void OnTableSelected(TableEventArgs args) { if (TableSelected != null) { TableSelected(this, args); } }
public void RQS_NewSession(object sender, TableEventArgs e) { // событие NewSession приходит в случае изменения номера сессии на сервере АЛОР-Трейд // номер сесии меняется в случает планового(новый торговый день) или внепланового рестарта сервера АЛОР-Трейд listView1.Items.Clear(); if (trans_slot != null) { string msg; timer1.Tick -= new EventHandler(timer1_Tick); trans_slot.CloseConnection(out msg); AddEvent(trans_slot.SlotID, msg); timer1.Stop(); } data_slot.rqs.evhLogLine -= new TableEventHandler(RQS_LogLine); data_slot.rqs.evhSynchronized -= new TableEventHandler(RQS_Synchronized); data_slot.rqs.evhNewSession -= new TableEventHandler(RQS_NewSession); data_slot.rqs.evhUpdateAllTableViews -= new TableListEventHandler(RQS_UpdateAllTableViews); // Если флаг AutoNewSession установлен, то коннектимся к серверу if (cbAutoNewSession.Checked) { AddEvent("Primer", "Start AutoNewSession"); Connect(); } }
// handler of SelectedEvent event private void GetEmployee(object sender, TableEventArgs e) { MessageBox.Show("Begin Edit emp = " + e.inc.ToString()); TabContentOfRowForEdit content = new TabContentOfRowForEdit(); TabPage page; int inc = e.inc; if (inc != -1) { DataRow row = ds.Tables[0].Rows[inc]; // business object employee = new OrdinaryEmployee(inc, row[1].ToString(), System.Convert.ToDecimal(row[2])); // View page = new TabPage("Edit");; } else {// marker new row is inc == -1 employee = new OrdinaryEmployee(inc, "no name", 0); // View page = new TabPage("New");; } content.textBox1.Text = employee.Name; content.textBox2.Text = employee.Salary.ToString(); // = System.Convert.ToDecimal(textBox2.Text); content.employee = employee; //page.linkPage = e.linkPage; content.tabControl = tabControl1; content.Dock = DockStyle.Fill; content.EndEditEvent += new EventHandler <RowEventArgs>(UpdateEmployeeTable); page.Controls.Add(content); page.Controls.SetChildIndex(content, 0); // from http://forum.vingrad.ru/forum/topic-215354.html tabControl1.TabPages.Add(page); tabControl1.SelectedIndex = tabControl1.TabPages.Count - 1; }
public void RQS_Synchronized(object sender, TableEventArgs e) { Slot slot = null; if (e.RequestSocket != null) { slot = e.RequestSocket.slot; } AddEvent(slot.SlotID, "Synchronized"); // Заказываем OrderBook, обращаться к данным будем в обрабочике событий RQS_UpdateAllTableViews через DataView OrderBook OrderBook_Si = data_slot.GetOrderbook(SecBoard_Si, SecCode_Si); OrderBook_Ri = data_slot.GetOrderbook(SecBoard_Ri, SecCode_Ri); Orders = data_slot.GetTable("ORDERS"); // получаем BROKERREF и ACCOUNT, они будут нужны постановки заявки BROKERREF = slot.BrokerRef; ACCOUNT = slot.TrdAccID; //Определяем тип сервера АЛОР-Трейд (если ФОРТС то будем использовать MoveOrder, если ММВБ то AddOrder и DeleteOrder) SERVERTYPE = slot.ServerType; // По событию Synchronized коннектим trans_slot Thread.Sleep(1000); // Ждем 1000 мс так как второй коннект сервер не примет раньше чем через 1000 мс string msg; trans_slot.OpenConnection(out msg); AddEvent(trans_slot.SlotID, msg); timer1.Start(); }
void mdxrReader_ZacatekTabulky(object sender, TableEventArgs ev) { mxwWriter.WriteStartElement(mtrTransformace.Tabulky.Tabulka); if (mtrTransformace.Tabulky.CislovatElementy) { mxwWriter.WriteAttributeString("n", ev.Sequence.ToString()); } }
protected virtual void OnTableClick(object sender, TableEventArgs e) { OnTableClickEventHandler handler = TableClick; if (handler != null) { handler(sender, e); } }
private void ButtonSetTable_Click(object sender, EventArgs e) { string id = IDTextBox.Text; string status = comboBoxStatus.Text; TableEventArgs args = new TableEventArgs(id, status); tableCheck(this, args); this.Dispose(); }
public void RQS_LogLine(object sender, TableEventArgs e) { Slot slot = null; if (e.RequestSocket != null) { slot = e.RequestSocket.slot; } AddEvent(slot.SlotID, e.Message); }
// Handler ChangeView event private void ChangeTable(object sender, TableEventArgs e) { try { objConnect.UpdateDatabase(ds); MessageBox.Show("Database updated"); } catch (Exception err) { MessageBox.Show(err.Message); } }
protected override void UpdateDataTab(object sender, TableEventArgs e) { if (DataTabPages.ContainsKey(e.Label)) { var tab = DataTabPages.Map[e.Label]; var tradeTab = DataTabPages.Map["trade"]; BeginInvoke((System.Action) delegate { var selected = SelectedTab; if (tab == selected || tab == tradeTab) { tab.Renew(); } }); } }
void doDeleteTableEvent(object sender, TableEventArgs arg) { if (view == null) return; if (view.InvokeRequired) { view.Invoke( new TableStateChangerEventHandler(view.DeleteTable), new object[] { sender, arg.ThisTable }); } else { view.DeleteTable(sender, arg.ThisTable); } }
private static void Print(TableEventArgs args) { Console.Clear(); for (int i = 0; i < args.TableC.Length; i++) { if (args.TableC[i].IsUse) { Console.ForegroundColor = ConsoleColor.Green; } else { Console.ForegroundColor = ConsoleColor.White; } Console.WriteLine("Fork № {0} IsUse = {1}", i, args.TableC[i].IsUse); } }
public void Prepare(object sender, TableEventArgs e) { switch (e.Label) { case "order": if (string.IsNullOrEmpty(OrderTable)) { OrderTable = e.Table; } break; case "margin": if (string.IsNullOrEmpty(MarginTable)) { MarginTable = e.Table; } break; case "position": if (string.IsNullOrEmpty(PositionTable)) { PositionTable = e.Table; } break; case "execution": if (string.IsNullOrEmpty(ExecutionTable)) { ExecutionTable = e.Table; } break; case "orderBookL2": if (string.IsNullOrEmpty(OrderBookTable)) { OrderBookTable = e.Table; } break; } }
private static void Show(object sender, TableEventArgs args) { bool print = false; if (_table == null) { _table = args.TableC; Print(args); } for (int i = 0; i < args.TableC.Length; i++) { if (_table[i].IsUse != args.TableC[i].IsUse) { print = true; break; } } if (print) { Print(args); } }
private void navigatorControl_TableSelect(object sender, TableEventArgs args) { OnTableSelected(args); }
protected virtual void OnTableSelected(TableEventArgs args) { TableSelected?.Invoke(this, args); }
void mdxrReader_KonecTabulky(object sender, TableEventArgs ev) { mxwWriter.WriteEndElement(); }
public void HandleTable(object sender, TableEventArgs e) { Console.WriteLine("{0}{1} got a table", this.FirstName, this.LastName); }
private void rqs_evhNeedNewPassword(object sender, TableEventArgs e) { (Application.OpenForms[0] as Form1).AddEvent(e.RequestSocket.slot.SlotID, "Need to change your password"); }
private void Tables_TableAdded(object sender, TableEventArgs e) { e.Table.RowAdded += Table_Changed; e.Table.ValueChanged += Table_Changed; e.Table.RowRemoved += Table_Changed; }
protected abstract void UpdateDataTab(object sender, TableEventArgs e);
private void rqs_evhLogLine(object sender, TableEventArgs e) { (Application.OpenForms[0] as Form1).AddEvent(e.RequestSocket.slot.SlotID, e.Message); }
private void rqs_evhServiceLoggedIn(object sender, TableEventArgs e) { (Application.OpenForms[0] as Form1).AddEvent("EVENT", "LoggedIn"); }
private void rqs_evhNewSession(object sender, TableEventArgs e) { (Application.OpenForms[0] as Form1).AddEvent("EVENT", "New session required"); System.Threading.ThreadPool.QueueUserWorkItem(reconnectSlotAsync, e); }
// invoke event private void TMForm_ButtonClicked(object sender, TableEventArgs e) { tableIDTextBox.Text = e.TableID; TableStatusTextBox.Text = e.TableStatus; }
private void DnfTableSelected(object sender, TableEventArgs args) { _selectedTable = args.Table; _pf.SelectedObject = args.Table; }
private void mdxrReader_ZacatekTabulky(object sender, TableEventArgs ev) { ZpracovatZnakovyStylJakoJevNaKonciUseku(); //throw new NotImplementedException(); }
protected virtual void OnTableChanged(TableEventArgs e) => TableChanged?.Invoke(this, e);