//Staff role choose button private void Staff_role_button_Click(object sender, EventArgs e) { SlideTimer.Start(); sliding_panel.BringToFront(); Role = "STAFF"; //RoleTimer.Start(); }
//Sliding Panel private void SlideTimer_Tick(object sender, EventArgs s) { //open the panel if (IsHidden) { sliding_panel.Width += 20; if (sliding_panel.Width >= LoginPanelWidth) { SlideTimer.Stop(); IsHidden = false; } this.Refresh(); } //hide the panel else { sliding_panel.Width -= 20; if (sliding_panel.Width <= 0) { SlideTimer.Stop(); IsHidden = true; } this.Refresh(); } }
//Trainer role choose button private void Trainer_role_button_Click(object sender, EventArgs e) { SlideTimer.Start(); sliding_panel.BringToFront(); Role = "TRAINER"; //RoleTimer.Start(); }
//Admin role choose button private void Admin_role_button_Click(object sender, EventArgs e) { SlideTimer.Start(); sliding_panel.BringToFront(); Role = "ADMIN"; //RoleTimer.Start(); }
private void SlideMenuBtn_Click(object sender, EventArgs e) { var button = allSliderPanels.First(b => b.Value.Equals(sender)); orderSliderPanels.Add(new Tuple <Panel, Button>(button.Key, button.Value)); SlideTimer.Start(); }
private void SlideTimer_Tick(object sender, EventArgs e) { //нажатые кнопки раскрытия панелей добавляются в очередь, чтобы открываться в строгом порядке if (orderSliderPanels.Count == 1) // вторая нажатая кнопка не раскроется, пока из очереди не удалится первая { orderSliderPanels.Last().Item1.Height += TimerValue; orderSliderPanels.Last().Item2.Image = Resources.Collapse_Arrow_20px; if (orderSliderPanels.Last().Item1.Size == orderSliderPanels.Last().Item1.MaximumSize) { SlideTimer.Stop(); } } else { orderSliderPanels.First().Item1.Height -= TimerValue; orderSliderPanels.First().Item2.Image = Resources.Expand_Arrow_20px; if (orderSliderPanels.First().Item1.Size == orderSliderPanels.First().Item1.MinimumSize) { orderSliderPanels.RemoveAll(item => item.Item1.Equals(orderSliderPanels.First().Item1)); // убираем все вхождения, чтобы кнопка не открывалась снова if (orderSliderPanels.Count == 0) { SlideTimer.Stop(); } } } }
//Back button private void Back_button_Click(object sender, EventArgs e) { SlideTimer.Start(); Role = ""; Username_TB.Text = "Username"; Password_TB.Text = "Password"; Username_TB.ForeColor = SystemColors.InactiveCaption; Password_TB.UseSystemPasswordChar = false; Password_TB.ForeColor = SystemColors.InactiveCaption; }
void Setup() { try { SlideInterval = int.Parse(ConfigurationManager.AppSettings["SlideInterval"]); DetectorInterval = int.Parse(ConfigurationManager.AppSettings["DetectorInterval"]); TimerDetector.Interval = DetectorInterval; SlideTimer.Interval = SlideInterval; if (ImagePath == null) { ImagePath = new List <string>(); } if (ImageCounter == null) { ImageCounter = new Dictionary <int, int>(); } var mapFile = ConfigurationManager.AppSettings["MappingFile"]; if (File.Exists(mapFile)) { var AllLines = File.ReadAllLines(mapFile); foreach (var line in AllLines) { var path = line.Split(',')[1]; if (!Directory.Exists(path)) { Directory.CreateDirectory(path); Directory.CreateDirectory(path + "\\Male"); Directory.CreateDirectory(path + "\\Female"); } ImagePath.Add(path); } } if (Datas == null) { Datas = new List <DetectionResult>(); } _frame = new Mat(); detector = new DetectAgeGender(); _capture = new VideoCapture(); _capture.ImageGrabbed += _capture_ImageGrabbed; _capture.Start(); TimerDetector.Start(); SlideTimer.Start(); } catch (NullReferenceException excpt) { MessageBox.Show(excpt.Message); } }
private void SlideTimer_Tick(object sender, EventArgs e) { if (isHidenSlider) { SlideMenu.Width += 25; if (SlideMenu.Width >= mSliderWidth) { SlideTimer.Stop(); isHidenSlider = false; this.Refresh(); } } else { SlideMenu.Width -= 25; if (SlideMenu.Width <= 0) { SlideTimer.Stop(); isHidenSlider = true; this.Refresh(); } } }
private void Login_Load(object sender, EventArgs e) { pictureBox1.Visible = true; SlideTimer.Start(); timer.Start(); }
private void PictureBox1_Click(object sender, EventArgs e) { SlideTimer.Start(); }