Esempio n. 1
0
        internal AutotextTrigger(ActionTriggers triggers, Action <AutotextTriggerArgs> action, string text, TAFlags flags, TAPostfix postfixType, string postfixChars) : base(triggers, action, true)
        {
            this.text         = text;
            this.flags        = flags;
            this.postfixType  = postfixType;
            this.postfixChars = postfixChars;

            if (flags == 0 && postfixType == 0 && postfixChars == null)
            {
                _paramsString = text;
            }
            else
            {
                using (new Util.StringBuilder_(out var b)) {
                    b.Append(text);
                    if (flags != 0)
                    {
                        b.Append("  (").Append(flags.ToString()).Append(')');
                    }
                    if (postfixType != 0)
                    {
                        b.Append("  postfixType=").Append(postfixType.ToString());
                    }
                    if (postfixChars != null)
                    {
                        b.Append("  postfixChars=").Append(postfixChars);
                    }
                    _paramsString = b.ToString();
                }
            }
            //AOutput.Write(this);
        }
Esempio n. 2
0
 internal WindowTrigger(ActionTriggers triggers, Action <WindowTriggerArgs> action, TWEvent ev, AWnd.Finder finder, TWFlags flags, TWLater later) : base(triggers, action, false)
 {
     this.ev     = ev;
     this.finder = finder;
     this.flags  = flags;
     this.later  = later;
 }
Esempio n. 3
0
        internal HotkeyTrigger(ActionTriggers triggers, Action <HotkeyTriggerArgs> action, KMod mod, KMod modAny, TKFlags flags, string paramsString) : base(triggers, action, true)
        {
            const KMod csaw = KMod.Ctrl | KMod.Shift | KMod.Alt | KMod.Win;

            modMask       = ~modAny & csaw;
            modMasked     = mod & modMask;
            this.flags    = flags;
            _paramsString = flags == 0 ? paramsString : paramsString + " (" + flags.ToString() + ")";             //AOutput.Write(_paramsString);
        }
Esempio n. 4
0
        internal MouseTrigger(ActionTriggers triggers, Action <MouseTriggerArgs> action, KMod mod, KMod modAny, TMFlags flags, TMScreen screen, string paramsString) : base(triggers, action, true)
        {
            const KMod csaw = KMod.Ctrl | KMod.Shift | KMod.Alt | KMod.Win;

            modMask          = ~modAny & csaw;
            modMasked        = mod & modMask;
            this.flags       = flags;
            this.screenIndex = screen;
            _paramsString    = paramsString;
        }
Esempio n. 5
0
        readonly TriggerFunc[] _funcAfter, _funcBefore; //Triggers.FuncOf. _funcAfter used by all triggers; _funcBefore - like scope.

        internal ActionTrigger(ActionTriggers triggers, Delegate action, bool usesWindowScope)
        {
            this.action   = action;
            this.triggers = triggers;
            var to = triggers.options_;

            options       = to.Current;
            EnabledAlways = to.EnabledAlways;
            if (usesWindowScope)
            {
                scope = triggers.scopes_.Current;
            }
            var tf = triggers.funcs_;

            _funcBefore = _Func(tf.commonBefore, tf.nextBefore); tf.nextBefore = null;
            _funcAfter  = _Func(tf.nextAfter, tf.commonAfter); tf.nextAfter = null;

            TriggerFunc[] _Func(TFunc f1, TFunc f2)
            {
                var f3 = f1 + f2; if (f3 == null)
                {
                    return(null);
                }
                var a1 = f3.GetInvocationList();
                var r1 = new TriggerFunc[a1.Length];

                for (int i = 0; i < a1.Length; i++)
                {
                    var f4 = a1[i] as TFunc;
                    if (!tf.perfDict.TryGetValue(f4, out var fs))
                    {
                        tf.perfDict[f4] = fs = new TriggerFunc {
                            f = f4
                        }
                    }
                    ;
                    r1[i] = fs;
                }
                return(r1);
            }
        }
Esempio n. 6
0
 internal WindowTriggers(ActionTriggers triggers)
 {
     _triggers = triggers;
     _win10    = AVersion.MinWin10;
     _win8     = AVersion.MinWin8;
 }
Esempio n. 7
0
 internal AutotextTrigger(ActionTriggers triggers, Action <AutotextTriggerArgs> action, string text, TAFlags flags, TAPostfix postfixType, string postfixChars, (string, int) source)
Esempio n. 8
0
 internal AutotextTriggers(ActionTriggers triggers)
 {
     _triggers      = triggers;
     _simpleReplace = new TASimpleReplace(this);
 }
Esempio n. 9
0
 internal MouseTriggers(ActionTriggers triggers)
 {
     _triggers = triggers;
 }
Esempio n. 10
0
 internal HotkeyTriggers(ActionTriggers triggers)
 {
     _triggers = triggers;
 }