Exemple #1
0
        }     // End Sub TestClipboard

        public override async Task SetClipboardContentsAsync(string text)
        {
            Tmds.DBus.ObjectPath objectPath = new Tmds.DBus.ObjectPath("/klipper");
            string service = "org.kde.klipper";

            using (Tmds.DBus.Connection connection = new Tmds.DBus.Connection(Tmds.DBus.Address.Session))
            {
                await connection.ConnectAsync();

                Klipper.DBus.IKlipper klipper = connection.CreateProxy <Klipper.DBus.IKlipper>(service, objectPath);
                await klipper.setClipboardContentsAsync(text);
            } // End using connection
        }     // End Task SetClipboardContentsAsync
Exemple #2
0
        public void SetText(string value)
        {
            Tmds.DBus.ObjectPath objectPath = new Tmds.DBus.ObjectPath("/klipper");
            string service = "org.kde.klipper";

            using (Tmds.DBus.Connection connection = new Tmds.DBus.Connection(Tmds.DBus.Address.Session))
            {
                connection.ConnectAsync().Wait();

                Klipper.DBus.IKlipper klipper = connection.CreateProxy <Klipper.DBus.IKlipper>(service, objectPath);
                klipper.setClipboardContentsAsync(value).Wait();
            }
        }
Exemple #3
0
        }     // End Task SetClipboardContentsAsync

        public override async Task <string> GetClipboardContentAsync()
        {
            string clipboardContents = null;

            Tmds.DBus.ObjectPath objectPath = new Tmds.DBus.ObjectPath("/klipper");
            string service = "org.kde.klipper";

            using (Tmds.DBus.Connection connection = new Tmds.DBus.Connection(Tmds.DBus.Address.Session))
            {
                await connection.ConnectAsync();

                Klipper.DBus.IKlipper klipper = connection.CreateProxy <Klipper.DBus.IKlipper>(service, objectPath);

                clipboardContents = await klipper.getClipboardContentsAsync();
            }     // End Using connection

            return(clipboardContents);
        } // End Task GetClipboardContentsAsync
Exemple #4
0
        public string GetText()
        {
            string clipboardContents = null;

            Tmds.DBus.ObjectPath objectPath = new Tmds.DBus.ObjectPath("/klipper");
            string service = "org.kde.klipper";

            using (Tmds.DBus.Connection connection = new Tmds.DBus.Connection(Tmds.DBus.Address.Session))
            {
                connection.ConnectAsync().Wait();

                Klipper.DBus.IKlipper klipper = connection.CreateProxy <Klipper.DBus.IKlipper>(service, objectPath);

                clipboardContents = klipper.getClipboardContentsAsync().Result;
            } // End Using connection

            return(clipboardContents);
        }