コード例 #1
0
        //private string GetCommand()
        //{
        //    bool ctrl, alt, win;
        //    Keys key;

        //    ctrl = GetAsyncKeyState(Keys.ControlKey);
        //    alt = GetAsyncKeyState(Keys.Alt);
        //    win = GetAsyncKeyState(Keys.LWin) || GetAsyncKeyState(Keys.RWin);

        //    var query = from KeyCommand commandObject in commandList
        //                where GetAsyncKeyState(commandObject.Key) &&
        //                    (!commandObject.CTRLMask || ctrl) &&
        //                    (!commandObject.ALTMask || alt) &&
        //                    (!commandObject.WINMask || win)
        //                select commandObject.ExecString;

        //    string commands = string.Join("[TAB]", query.ToArray());

        //    return commands;
        //}
        //private void SendKeys()
        //{
        //    string[] formattedCommand = GetFormattedCommad(GetCommand());
        //    foreach (string command in formattedCommand)
        //        System.Windows.Forms.SendKeys.Send(command);
        //}

        //private string[] GetFormattedCommad(string command)
        //{
        //    List<string> commandList = new List<string>();
        //    string[] splitCommands = command.Split(new string[] { "¿" }, StringSplitOptions.None);
        //    int counter = 0;
        //    foreach (string cmd in splitCommands)
        //    {
        //        if (counter % 2 == 1)
        //            commandList.Add(GetMaskString(cmd));
        //        else
        //            commandList.Add(cmd);
        //        counter++;
        //    }
        //    return commandList.ToArray();
        //}

        //private string GetMaskString(string mask)
        //{
        //    string maskString = "";
        //    switch (mask)
        //    {
        //        case "TAB":
        //            maskString = "{TAB}";
        //            break;
        //        case "ENTER":
        //            maskString = "{ENTER}";
        //            break;
        //    }
        //    return maskString;
        //}

        #endregion

        private bool PredicateDelegate(Hotkey emp)
        {
            return(true);
        }