Пример #1
0
 public static void Sleep(Helper_Profile.Profile.Button.TimeInterval TimeInterval)
 {
     Sleep_Millisecond(TimeInterval.Millisecond);
     Sleep_Second(TimeInterval.Second);
     Sleep_Minute(TimeInterval.Minute);
     Sleep_Hour(TimeInterval.Hour);
 }
Пример #2
0
        private void CreateProfileButtons(Helper_Profile.Profile.Button[] ProfileButtons)
        {
            CreateButtonsLayoutPanel(ProfileButtons);

            ProfileWinFormButtons = new Button[ProfileButtons.Length];

            int AddedButtonCount = 0;
            int AddingCol = 0;
            int AddingRow = 0;

            for (int i = 0; i < ProfileButtons.Length; i++)
            {
                ProfileWinFormButtons[i] = new Button();
                ProfileWinFormButtons[i].Dock = DockStyle.Fill;
                ProfileWinFormButtons[i].Text = ProfileButtons[i].ButtonName;
                ProfileWinFormButtons[i].Tag = ProfileButtons[i];
                ProfileWinFormButtons[i].Click += new System.EventHandler(this.ProfileWinFormButton_Click);
                ProfileWinFormButtons[i].UseVisualStyleBackColor = true;

                ButtonsLayoutPanel.Controls.Add(this.ProfileWinFormButtons[i], AddingCol, AddingRow);
                AddedButtonCount++;
                AddingCol++;

                if (AddingCol > ButtonsLayoutPanel.ColumnCount - 1)
                {
                    AddingCol = 0;
                    AddingRow++;
                }
            }
        }
Пример #3
0
        private void CreateButtonsLayoutPanel(Helper_Profile.Profile.Button[] ProfileButtons)
        {
            int ButtonsLayoutPanelLines = ProfileButtons.Length % Setting_Global.MaxButtonCountPerLine == 0
                           ? ProfileButtons.Length / Setting_Global.MaxButtonCountPerLine
                           : ProfileButtons.Length / Setting_Global.MaxButtonCountPerLine + 1;

            if (ProfileButtons.Length < Setting_Global.MaxButtonCountPerLine)
            {
                ButtonsLayoutPanel.ColumnCount = ProfileButtons.Length;
                ButtonsLayoutPanel.RowCount = 1;
            }
            else
            {
                ButtonsLayoutPanel.ColumnCount = Setting_Global.MaxButtonCountPerLine;
                ButtonsLayoutPanel.RowCount = ButtonsLayoutPanelLines;
            }

            ButtonsLayoutPanel.ColumnStyles.Clear();
            Single ColPercent = 100 / ButtonsLayoutPanel.ColumnCount;

            for (int i = 0; i < ButtonsLayoutPanel.ColumnCount; i++)
            {
                ButtonsLayoutPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, ColPercent));
            }

            ButtonsLayoutPanel.RowStyles.Clear();
            Single RowPercent = 100 / ButtonsLayoutPanel.RowCount;

            for (int i = 0; i < ButtonsLayoutPanel.RowCount; i++)
            {
                ButtonsLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Percent, RowPercent));
            }
        }
Пример #4
0
        private static void SendKeys(IntPtr hWnd, string KeysQuery, int Repeat, Helper_Profile.Profile.Button.TimeInterval RepeatInterval)
        {
            int RepeatCount = 0;

            while (Repeat == 0 || RepeatCount < Repeat)
            {
                string[] KeyArray = GetKeyArray(KeysQuery);

                foreach (string Key in KeyArray)
                {
                    string[] KeyQueryArgu = Key.Split(new char[] { ',' });

                    PressKeyOption PressKeyOption = PressKeyOption.KeyDownUp;

                    if (KeyQueryArgu.Length == 2)
                    {
                        switch (KeyQueryArgu[1])
                        {
                            case "D":
                                PressKeyOption = PressKeyOption.KeyDown;
                                break;
                            case "DU":
                                PressKeyOption = PressKeyOption.KeyDownUp;
                                break;
                            default:
                                break;
                        }

                        SendKey(hWnd, GetVK(KeyQueryArgu[0]), PressKeyOption);
                    }
                    else
                    {
                        SendKey(hWnd, GetVK(Key), PressKeyOption);
                    }
                }

                if (Repeat != 0)
                    RepeatCount++;

                if (Repeat != 1)
                    Helper_Timer.Sleep(RepeatInterval);
            }
        }