示例#1
0
        private void Ll2_Click(object sender, EventArgs e)
        {
            FormCondition frm = (Condition2 != null ? new FormCondition(Condition2, m_macro) : new FormCondition(m_macro));

            if (frm.ShowDialog() == DialogResult.OK)
            {
                Condition2 = frm.Condition;
                m_ll2.Text = ((sender as Condition) != null ? (sender as Condition).GetText() : "Bedingung");
                OnConditionChanged(this, new ConditionChangedArgs());
            }
        }
示例#2
0
        private void Ll1_Click(object sender, EventArgs e)
        {
            FormCondition frm = new FormCondition(m_macro);

            if (frm.ShowDialog() == DialogResult.OK)
            {
                Condition1 = frm.Condition;
                Condition1.OnConditionChanged += Condition1_OnConditionChanged;
                m_ll1.Text = (Condition1 != null ? Condition1.GetText() : "Bedingung");
                OnConditionChanged(this, new ConditionChangedArgs());
            }
        }
示例#3
0
        private void Ll1_Click(object sender, EventArgs e)
        {
            FormCondition frm = (m_condition != null ? new FormCondition(m_condition, m_macro) : new FormCondition(m_macro));

            if (frm.ShowDialog() == DialogResult.OK)
            {
                m_condition = frm.Condition;
                m_condition.OnConditionChanged += M_condition_OnConditionChanged;
                m_llCondition.Text              = (m_condition != null ? m_condition.GetText() : "Bedingung");

                if (OnConditionChanged != null)
                {
                    OnConditionChanged(this, new ConditionChangedArgs());
                }
            }
        }
示例#4
0
        private void tsmiNewCondition_Click(object sender, EventArgs e)
        {
            Macro m = Macro.GetMacroByChild(tvMakros.SelectedNode);

            FormCondition frm = new FormCondition(m);

            if (frm.ShowDialog() == DialogResult.OK)
            {
                if (m_selectedNode.Name == "conditions")
                {
                    m_selectedNode.Nodes.Insert(0, new ConditionNode(frm.Condition));
                }
                else
                {
                    m_selectedNode.Parent.Nodes.Insert(m_selectedNode.Index + 1, new ConditionNode(frm.Condition));
                }
            }
        }
示例#5
0
        private void tvMakros_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e)
        {
            tvMakros.SelectedNode = e.Node;

            if (e.Button == MouseButtons.Left)
            {
                if (e.Node.GetType() == typeof(CommandWait))
                {
                    CommandWait c = (CommandWait)tvMakros.SelectedNode;

                    FormCommandWait frm = new FormCommandWait(c.Duration);
                    if (frm.ShowDialog() == DialogResult.OK)
                    {
                        c.Duration = frm.WaitDuration;
                    }
                }
                else if (e.Node.GetType() == typeof(ActivatorShortcut))
                {
                    ActivatorShortcut     a   = (ActivatorShortcut)e.Node;
                    FormActivatorShortcut frm = new FormActivatorShortcut(a.Shortcut, a.LoopexEcution);
                    if (frm.ShowDialog() == DialogResult.OK)
                    {
                        a.Shortcut.Keys = frm.Shortcut.Keys;
                        a.Shortcut      = a.Shortcut;
                        a.LoopexEcution = frm.LoopExecution;
                    }
                }
                else if (e.Node.GetType() == typeof(ActivatorTime))
                {
                    ActivatorTime     a   = (ActivatorTime)e.Node;
                    FormActivatorTime frm = new FormActivatorTime(a.TriggerTime, a.TriggerInterval);
                    if (frm.ShowDialog() == DialogResult.OK)
                    {
                        a.TriggerTime     = frm.TriggerTime;
                        a.TriggerInterval = frm.TriggerInterval;
                    }
                }
                else if (e.Node.GetType() == typeof(CommandInput))
                {
                    Macro            m   = Macro.GetMacroByChild(m_selectedNode);
                    FormCommandInput frm = new FormCommandInput((CommandInput)e.Node, m);
                    if (frm.ShowDialog() == DialogResult.OK)
                    {
                        e.Node.Parent.Nodes.Insert(e.Node.Index, frm.CommandInput);
                        e.Node.Remove();
                    }
                }
                else if (e.Node.GetType() == typeof(ConditionNode))
                {
                    Macro         m  = Macro.GetMacroByChild(tvMakros.SelectedNode);
                    ConditionNode cn = (ConditionNode)e.Node;

                    FormCondition frm = null;
                    if (cn.Condition != null)
                    {
                        frm = new FormCondition(cn.Condition, m);
                    }
                    else
                    {
                        frm = new FormCondition(m);
                    }

                    if (frm.ShowDialog() == DialogResult.OK)
                    {
                        cn.Condition = frm.Condition;
                    }
                }
                else if (e.Node.GetType() == typeof(CommandSetVariable))
                {
                    CommandSetVariable c = (CommandSetVariable)m_selectedNode;
                    Macro m = Macro.GetMacroByChild(c);
                    FormCommandSetVariable frm = new FormCommandSetVariable((c.Variable != null ? c.Variable.Name : ""), c.Output, m);
                    if (frm.ShowDialog() == DialogResult.OK)
                    {
                        c.Variable = frm.Variable;
                        c.Output   = frm.Output;
                    }
                }
                else if (e.Node.GetType() == typeof(CommandReplayMakro))
                {
                    CommandReplayMakro     c   = (CommandReplayMakro)m_selectedNode;
                    FormCommandReplayMacro frm = new FormCommandReplayMacro(c.MacroName);
                    if (frm.ShowDialog() == DialogResult.OK)
                    {
                        c.MacroName = frm.MacroName;
                    }
                }
                else if (e.Node.GetType() == typeof(CommandWriteFile))
                {
                    Macro                m   = Macro.GetMacroByChild(m_selectedNode);
                    CommandWriteFile     c   = (CommandWriteFile)m_selectedNode;
                    FormCommandWriteFile frm = new FormCommandWriteFile(c.FileName, c.FileText, c.AppendFile, m);
                    if (frm.ShowDialog() == DialogResult.OK)
                    {
                        c.FileName   = frm.FileName;
                        c.FileText   = frm.Text;
                        c.AppendFile = frm.AppendFile;
                    }
                }
            }
        }