BlisterUI.Input.KeyboardEventDispatcher.SetToClipboard C# (CSharp) Method

SetToClipboard() public static method

public static SetToClipboard ( string s ) : void
s string
return void
        public static void SetToClipboard(string s)
        {
            clipboard = s;
            Thread thread = new Thread(DoCopyThread);
            thread.SetApartmentState(ApartmentState.STA);
            thread.Start();
            thread.Join();
        }

Usage Example

Example #1
0
        public void OnControl(object s, CharacterEventArgs args)
        {
            switch (args.Character)
            {
            case ControlCharacters.CtrlV:
                string c = KeyboardEventDispatcher.GetNewClipboard();
                Insert(c);
                return;

            case ControlCharacters.CtrlC:
                if (text.Length > 0)
                {
                    KeyboardEventDispatcher.SetToClipboard(Text);
                }
                return;
            }
        }