コード例 #1
0
        /// <summary>
        /// Displays Change Pause dialog and 
        /// returns WaitMacroCommand object with specified pause or null.
        /// </summary>
        public static WaitMacroCommand PromptUser(int pause)
        {
            WaitMacroCommand cmd = null;

            using (ChangePauseDialog dlg = new ChangePauseDialog()) {
                dlg.Pause = pause;
                if (dlg.ShowDialog() == DialogResult.OK) {
                    cmd = new WaitMacroCommand();
                    cmd.Pause = dlg.Pause;
                }
            }

            return cmd;
        }
コード例 #2
0
ファイル: WaitMacroCommand.cs プロジェクト: byterj/phoenix
        /// <summary>
        /// Displays Change Pause dialog and
        /// returns WaitMacroCommand object with specified pause or null.
        /// </summary>
        public static WaitMacroCommand PromptUser(int pause)
        {
            WaitMacroCommand cmd = null;

            using (ChangePauseDialog dlg = new ChangePauseDialog()) {
                dlg.Pause = pause;
                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    cmd       = new WaitMacroCommand();
                    cmd.Pause = dlg.Pause;
                }
            }

            return(cmd);
        }
コード例 #3
0
ファイル: MacroCommandList.cs プロジェクト: byterj/phoenix
        void insertWaitMenu_Click(object sender, EventArgs e)
        {
            if (commandList != null)
            {
                lock (commandList.SyncRoot) {
                    for (int i = table.SelectedIndicies.Length - 1; i >= 0; i--)
                    {
                        WaitMacroCommand cmd = WaitMacroCommand.PromptUser(500);

                        if (cmd != null)
                        {
                            Macro.Insert(table.SelectedIndicies[i], cmd);
                        }
                    }
                }
            }
        }
コード例 #4
0
        public void InsertCommand(int index, IMacroCommand command)
        {
            lock (commands.SyncRoot) {
                if (index >= 0)
                {
                    // Insert item
                    commands.Insert(index++, command);

                    if (pause > 0 && command.CommandType == MacroCommandType.Active)
                    {
                        IMacroCommand waitCmd = new WaitMacroCommand(pause);

                        if (index >= 0)
                        {
                            commands.Insert(index, waitCmd);
                        }
                        else
                        {
                            commands.Add(waitCmd);
                        }
                    }
                }
                else
                {
                    // Add item
                    if (pendingPause && pause > 0)
                    {
                        IMacroCommand waitCmd = new WaitMacroCommand(pause);
                        commands.Add(waitCmd);
                        pendingPause = false;
                    }

                    commands.Add(command);

                    if (command.CommandType == MacroCommandType.Active)
                    {
                        pendingPause = true;
                    }
                }
            }
        }
コード例 #5
0
ファイル: MacroRecorder.cs プロジェクト: greeduomacro/phoenix
        public void InsertCommand(int index, IMacroCommand command)
        {
            lock (commands.SyncRoot) {
                if (index >= 0) {
                    // Insert item
                    commands.Insert(index++, command);

                    if (pause > 0 && command.CommandType == MacroCommandType.Active) {
                        IMacroCommand waitCmd = new WaitMacroCommand(pause);

                        if (index >= 0)
                            commands.Insert(index, waitCmd);
                        else
                            commands.Add(waitCmd);
                    }
                }
                else {
                    // Add item
                    if (pendingPause && pause > 0) {
                        IMacroCommand waitCmd = new WaitMacroCommand(pause);
                        commands.Add(waitCmd);
                        pendingPause = false;
                    }

                    commands.Add(command);

                    if (command.CommandType == MacroCommandType.Active)
                        pendingPause = true;
                }
            }
        }