コード例 #1
0
 //Staff role choose button
 private void Staff_role_button_Click(object sender, EventArgs e)
 {
     SlideTimer.Start();
     sliding_panel.BringToFront();
     Role = "STAFF";
     //RoleTimer.Start();
 }
コード例 #2
0
 //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();
     }
 }
コード例 #3
0
 //Trainer role choose button
 private void Trainer_role_button_Click(object sender, EventArgs e)
 {
     SlideTimer.Start();
     sliding_panel.BringToFront();
     Role = "TRAINER";
     //RoleTimer.Start();
 }
コード例 #4
0
 //Admin role choose button
 private void Admin_role_button_Click(object sender, EventArgs e)
 {
     SlideTimer.Start();
     sliding_panel.BringToFront();
     Role = "ADMIN";
     //RoleTimer.Start();
 }
コード例 #5
0
        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();
        }
コード例 #6
0
        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();
                    }
                }
            }
        }
コード例 #7
0
 //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;
 }
コード例 #8
0
        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);
            }
        }
コード例 #9
0
ファイル: LoginedWindow.cs プロジェクト: Zelosin/MailClient
 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();
         }
     }
 }
コード例 #10
0
ファイル: Login.cs プロジェクト: EngrKhurramShahzad/BMS
 private void Login_Load(object sender, EventArgs e)
 {
     pictureBox1.Visible = true;
     SlideTimer.Start();
     timer.Start();
 }
コード例 #11
0
ファイル: LoginedWindow.cs プロジェクト: Zelosin/MailClient
 private void PictureBox1_Click(object sender, EventArgs e)
 {
     SlideTimer.Start();
 }