コード例 #1
0
 /// <summary>
 /// Writes image to the clipboard.
 /// </summary>
 /// <param name="image"></param>
 /// <param name="type"></param>
 public void writeImage(NativeImage image, string type = null)
 {
     if (type == null)
     {
         API.Apply("writeImage", image);
     }
     else
     {
         API.Apply("writeImage", image, type);
     }
 }
コード例 #2
0
        /// <summary>
        /// Captures a snapshot of the page within rect.
        /// </summary>
        /// <param name="callback"></param>
        public void capturePage(Action <NativeImage> callback)
        {
            if (callback == null)
            {
                return;
            }
            string       eventName = "_capturePage";
            CallbackItem item      = null;

            item = API.CreateCallbackItem(eventName, (object[] args) => {
                API.RemoveCallbackItem(eventName, item);
                NativeImage image = API.CreateObject <NativeImage>(args[0]);
                callback?.Invoke(image);
            });
            API.Apply("capturePage", item);
        }
コード例 #3
0
        /// <summary>
        /// Fetches a path's associated icon.
        /// </summary>
        /// <param name="path"></param>
        /// <param name="options"></param>
        /// <param name="callback"></param>
        public void getFileIcon(string path, FileIconOptions options, Action <Error, NativeImage> callback)
        {
            if (callback == null)
            {
                return;
            }
            string       eventName = "_getFileIcon";
            CallbackItem item      = null;

            item = API.CreateCallbackItem(eventName, (object[] args) => {
                API.RemoveCallbackItem(eventName, item);
                Error error       = API.CreateObject <Error>(args[0]);
                NativeImage image = API.CreateObject <NativeImage>(args[1]);
                callback?.Invoke(error, image);
            });
            API.Apply("getFileIcon", path, options, item);
        }
コード例 #4
0
 /// <summary>
 /// Creates a new tray icon associated with the image.
 /// </summary>
 /// <param name="image"></param>
 public Tray Create(NativeImage image)
 {
     return(API.ApplyConstructor <Tray>(image));
 }
コード例 #5
0
 /// <summary>
 /// *macOS*
 /// Sets the image associated with this tray icon when pressed on macOS.
 /// </summary>
 /// <param name="image"></param>
 public void setPressedImage(NativeImage image)
 {
     API.Apply("setPressedImage", image);
 }
コード例 #6
0
 /// <summary>
 /// *macOS*
 /// Sets the image associated with this dock icon.
 /// </summary>
 /// <param name="image"></param>
 public void setIcon(NativeImage image)
 {
     API.Apply("setIcon", image);
 }
コード例 #7
0
 /// <summary>
 /// *Windows Linux*
 /// Changes window icon.
 /// </summary>
 /// <param name="icon"></param>
 public void setIcon(NativeImage icon)
 {
     API.Apply("setIcon", icon);
 }
コード例 #8
0
 /// <summary>
 /// *Windows*
 /// Sets a 16 x 16 pixel overlay onto the current taskbar icon,
 /// usually used to convey some sort of application status or to passively notify the user.
 /// </summary>
 /// <param name="overlay">
 /// the icon to display on the bottom right corner of the taskbar icon.
 /// If this parameter is null, the overlay is cleared
 /// </param>
 /// <param name="description">
 /// a description that will be provided to Accessibility screen readers
 /// </param>
 public void setOverlayIcon(NativeImage overlay, string description)
 {
     API.Apply("setOverlayIcon", overlay, description);
 }