private void btnRun_Click(object sender, EventArgs e) { AlgoritmaAgaci aa = null; Baslat baslat = null; bool isDegiskenIzle = false; try { degisken_listesi.clear(); } catch (Exception) { } for (int i = 0; i < sekiller.Count; i++) { if (sekiller[i].GetType() == typeof(Degisken)) { degisken_listesi.SetDegisken(sekiller[i].YapilacakIslem); } if (sekiller[i].GetType() == typeof(Baslat)) { baslat = (Baslat)sekiller[i]; } if (sekiller[i].GetType() == typeof(DegiskenIzle)) { isDegiskenIzle = true; ((DegiskenIzle)sekiller[i]).IlkKontrol = true; } sekiller[i].BorderStyle = BorderStyle.None; } try { try { if (isDegiskenIzle) { dp = new DegiskenPenceresi(); dp.Show(); dp.dgvDegiskenler.Rows.Clear(); dp.dgvDegiskenler.Columns.Clear(); } console = new frmConsole(); console.rtBTemizle(); console.Show(); } catch (Exception) { } new KodOlustur(baslat); aa = new AlgoritmaAgaci(baslat); int hiz = trackBarHiz.Value; thread = new Thread(() => aa.Calistir(hiz, isDegiskenIzle, dp, console)); thread.Start(); } catch (Exception ex) { MessageBox.Show("Programı başlatmak için Başlat eklenmedi.." + ex); } }
public virtual void Initialize(object sender) { { if (IsInitialized) { return; } ConsoleForm = new frmConsole(this); ConsoleForm.Show(); ConsoleForm.Activate(); InitializedBy = (sender as IIdeComponent)?.ParentIDE.Machine ?? sender; IsInitialized = true; ConsoleForm.Text = Title; ConsoleForm.Display.SelectionColor = System.Drawing.Color.White; } }
public virtual void Reinitialize(object sender, bool saveData = true) { if (!(IsInitialized && ConsoleForm != null)) { return; } if (saveData) { string rtfText = ""; Hashtable dataClients = null; List <Color> dataClientsColors = null; if (ConsoleForm != null && !ConsoleForm.IsDisposed) { rtfText = ConsoleForm.GetDisplayRTFtext(); dataClients = ConsoleForm.DataClients; dataClientsColors = ConsoleForm.DataClientsColors; } frmConsole oldConsole = ConsoleForm; ConsoleForm = new frmConsole(this); ConsoleForm.Show(); ConsoleForm.Activate(); InitializedBy = sender is IInputPort ? (sender as IInputPort).ParentIDE.Machine : sender is IOutputPort ? (sender as IOutputPort).ParentIDE.Machine : sender; IsInitialized = true; ConsoleForm.Text = Title; ConsoleForm.Display.Rtf = rtfText; ConsoleForm.DataClients = dataClients; ConsoleForm.DataClientsColors = dataClientsColors; oldConsole?.DisposeAsync(); oldConsole = null; } else { Dispose(); Initialize(sender); } }
private void btnRun_Click(object sender, EventArgs e) { AlgoritmaAgaci aa = null; Baslat baslat = null; bool isDegiskenIzle = false; try { degisken_listesi.clear(); } catch (Exception) { } for (int i = 0; i < sekiller.Count; i++) { if (sekiller[i].GetType() == typeof(Degisken)) { degisken_listesi.SetDegisken(sekiller[i].YapilacakIslem); } if (sekiller[i].GetType() == typeof(Baslat)) { baslat = (Baslat)sekiller[i]; } if (sekiller[i].GetType() ==typeof(DegiskenIzle)) { isDegiskenIzle = true; ((DegiskenIzle)sekiller[i]).IlkKontrol = true; } sekiller[i].BorderStyle = BorderStyle.None; } try { try { if (isDegiskenIzle) { dp = new DegiskenPenceresi(); dp.Show(); dp.dgvDegiskenler.Rows.Clear(); dp.dgvDegiskenler.Columns.Clear(); } console = new frmConsole(); console.rtBTemizle(); console.Show(); } catch (Exception) { } new KodOlustur(baslat); aa = new AlgoritmaAgaci(baslat); int hiz = trackBarHiz.Value; thread = new Thread(() => aa.Calistir(hiz, isDegiskenIzle,dp,console)); thread.Start(); } catch (Exception ex) { MessageBox.Show("Programı başlatmak için Başlat eklenmedi.."+ex); } }