Ejemplo n.º 1
0
        private static void SendObfuscated(string strKeys)
        {
            Debug.Assert(strKeys != null);
            if (strKeys == null)
            {
                throw new ArgumentNullException("strKeys");
            }

            if (strKeys.Length == 0)
            {
                return;
            }

            ClipboardEventChainBlocker cev = new ClipboardEventChainBlocker();
            ClipboardContents          cnt = new ClipboardContents(true);
            Exception excpInner            = null;

            char[] vSpecial = new char[] { '{', '}', '(', ')', '+', '^', '%',
                                           ' ', '\t', '\r', '\n' };

            try
            {
                List <string> vParts = SplitKeySequence(strKeys);
                foreach (string strPart in vParts)
                {
                    if (strPart.Length == 0)
                    {
                        continue;
                    }

                    if (strPart.IndexOfAny(vSpecial) >= 0)
                    {
                        SendKeysWithSpecial(strPart);
                    }
                    else
                    {
                        MixedTransfer(strPart);
                    }
                }
            }
            catch (Exception ex) { excpInner = ex; }

            cnt.SetData();
            cev.Release();

            if (excpInner != null)
            {
                throw excpInner;
            }
        }
Ejemplo n.º 2
0
        private static void Send(ISiEngine siEngine, List <SiEvent> l)
        {
            bool bHasClipOp = l.Exists(SendInputEx.IsClipboardOp);
            ClipboardEventChainBlocker cev = null;
            ClipboardContents          cnt = null;

            if (bHasClipOp)
            {
                cev = new ClipboardEventChainBlocker();
                cnt = new ClipboardContents(true, true);
            }

            try { SendPriv(siEngine, l); }
            finally
            {
                if (bHasClipOp)
                {
                    ClipboardUtil.Clear();
                    cnt.SetData();
                    cev.Dispose();
                }
            }
        }
Ejemplo n.º 3
0
        private static void SendObfuscated(string strKeys, SiStateEx siState)
        {
            if(string.IsNullOrEmpty(strKeys)) return;

            ClipboardEventChainBlocker cev = new ClipboardEventChainBlocker();
            ClipboardContents cnt = new ClipboardContents(true, true);
            Exception excpInner = null;

            char[] vSpecial = new char[]{ '{', '}', '(', ')', '+', '^', '%',
                ' ', '\t', '\r', '\n' };

            try
            {
                List<string> vParts = SplitKeySequence(strKeys);
                foreach(string strPart in vParts)
                {
                    if(string.IsNullOrEmpty(strPart)) continue;

                    if(strPart.IndexOfAny(vSpecial) >= 0)
                        SendKeysWithSpecial(strPart, siState);
                    else MixedTransfer(strPart, siState);
                }
            }
            catch(Exception ex) { excpInner = ex; }

            cnt.SetData();
            cev.Release();

            if(excpInner != null) throw excpInner;
        }
Ejemplo n.º 4
0
        private static void Send(ISiEngine siEngine, List<SiEvent> l)
        {
            bool bHasClipOp = l.Exists(SendInputEx.IsClipboardOp);
            ClipboardEventChainBlocker cev = null;
            ClipboardContents cnt = null;
            if(bHasClipOp)
            {
                cev = new ClipboardEventChainBlocker();
                cnt = new ClipboardContents(true, true);
            }

            try { SendPriv(siEngine, l); }
            finally
            {
                if(bHasClipOp)
                {
                    ClipboardUtil.Clear();
                    cnt.SetData();
                    cev.Release();
                }
            }
        }
Ejemplo n.º 5
0
        private static void SendObfuscated(string strKeys)
        {
            Debug.Assert(strKeys != null);
            if(strKeys == null) throw new ArgumentNullException("strKeys");

            if(strKeys.Length == 0) return;

            ClipboardEventChainBlocker cev = new ClipboardEventChainBlocker();
            ClipboardContents cnt = new ClipboardContents(true);
            Exception excpInner = null;

            char[] vSpecial = new char[]{ '{', '}', '(', ')', '+', '^', '%',
                ' ', '\t', '\r', '\n' };

            try
            {
                List<string> vParts = SplitKeySequence(strKeys);
                foreach(string strPart in vParts)
                {
                    if(strPart.Length == 0) continue;

                    if(strPart.IndexOfAny(vSpecial) >= 0)
                        SendKeysWithSpecial(strPart);
                    else
                        MixedTransfer(strPart);
                }
            }
            catch(Exception ex) { excpInner = ex; }

            cnt.SetData();
            cev.Release();

            if(excpInner != null) throw excpInner;
        }