private void btnBack_Click(object sender, EventArgs e) { demback--; if (demnext >= Next.Count) { Next.Add(Back[demback]); } else { Next[demnext] = Back[demback]; } if (Back[demback - 1] == 0 || Back[demback - 1] == 3 || Back[demback - 1] == 6) { if (Back[demback - 1] == 0) { treeView1.SelectedNode = treeView1.Nodes[0]; if (demback >= Back.Count) { Back.Add(0); demback++; } else { Back[demback] = 0; demback++; } ShowDefault(); } if (Back[demback - 1] == 6) { treeView1.SelectedNode = treeView1.Nodes[2]; } } else if (Back[demback - 1] == 1 || Back[demback - 1] == 2) { treeView1.SelectedNode = treeView1.Nodes[0].Nodes[Back[demback - 1] - 1]; } else { treeView1.SelectedNode = treeView1.Nodes[1].Nodes[Back[demback - 1] - 4]; } demnext++; demback--; ShowButon(); }
private void Introduce_Click(object sender, EventArgs e) { treeView1.SelectedNode = treeView1.Nodes[0]; if (def == 0) { return; } def = 0; if (demback >= Back.Count) { Back.Add(0); demback++; } else { Back[demback] = 0; demback++; } demnext = 0; ShowButon(); ShowDefault(); }
public FirewallForm() { InitializeComponent(); timer1.Start(); treeView1.ExpandAll(); Profile = "1"; State = "1"; Action = "1"; Lang = 0; Tiengviet.Checked = true; if (demback >= Back.Count) { Back.Add(0); demback++; } else { Back[demback] = 0; demback++; } treeView1.SelectedNode = treeView1.Nodes[0]; ShowDefault(); ShowTiengViet(); }
//add handle that has transition to this state public void AddBack(Handle h) { Back.Add(h); }
} //save changes //Add and remove methods for Next and Back elements protected virtual void AddBack(SMElementEditor e) { Back.Add(e); }
public void LoadData() { switch (treeView1.SelectedNode.Name) { case "Web": { if (demback >= Back.Count) { Back.Add(6); demback++; } else { Back[demback] = 6; demback++; } ShowWebsiteRule(); ShowButon(); break; } //case "User": // { // if (demback >= Back.Count) // { // Back.Add(0); // demback++; // } // else // { // Back[demback] = 0; // demback++; // } // ShowUser(); // ShowButon(); // break; // } //case "Default": // { // if (demback >= Back.Count) // { // Back.Add(3); // demback++; // } // else // { // Back[demback] = 3; // demback++; // } // ShowDefault(); // ShowButon(); // break; // } case "InboundUser": { if (demback >= Back.Count) { Back.Add(1); demback++; } else { Back[demback] = 1; demback++; } ShowInboundUser(); ShowButon(); break; } case "OutboundUser": { if (demback >= Back.Count) { Back.Add(2); demback++; } else { Back[demback] = 2; demback++; } ShowOutboundUser(); ShowButon(); break; } case "InboundDefault": { if (demback >= Back.Count) { Back.Add(4); demback++; } else { Back[demback] = 4; demback++; } ShowInboundDefault(); ShowButon(); break; } case "OutboundDefault": { if (demback >= Back.Count) { Back.Add(5); demback++; } else { Back[demback] = 5; demback++; } ShowOutboundDefault(); ShowButon(); break; } } }
public void Show(int i) { switch (i) { case 0: { ShowInboundUser(); if (demback >= Back.Count) { Back.Add(1); demback++; } else { Back[demback] = 1; demback++; } break; } case 1: { ShowOutboundUser(); if (demback >= Back.Count) { Back.Add(2); demback++; } else { Back[demback] = 2; demback++; } break; } case 2: { ShowInboundDefault(); if (demback >= Back.Count) { Back.Add(4); demback++; } else { Back[demback] = 4; demback++; } break; } case 3: { ShowOutboundDefault(); if (demback >= Back.Count) { Back.Add(5); demback++; } else { Back[demback] = 5; demback++; } break; } case 4: { ShowWebsiteRule(); if (demback >= Back.Count) { Back.Add(6); demback++; } else { Back[demback] = 6; demback++; } break; } } demnext = 0; ShowButon(); }