コード例 #1
0
        public unsafe Task SetTextAsync(string text)
        {
            _native.Clear();

            if (text != null)
            {
                _native.SetText(NSPasteboardTypeString, text);
            }

            return(Task.CompletedTask);
        }
コード例 #2
0
        public Task SetTextAsync(string text)
        {
            _native.Clear();

            if (text != null)
            {
                using (var buffer = new Utf8Buffer(text))
                {
                    _native.SetText(NSPasteboardTypeString, buffer.DangerousGetHandle());
                }
            }

            return(Task.CompletedTask);
        }
コード例 #3
0
        public Task SetTextAsync(string text)
        {
            _native.Clear();

            if (text != null)
            {
                _native.SetText(text);
            }

            return(Task.CompletedTask);
        }