Ejemplo n.º 1
0
        /// <summary>
        /// Called when the web view wants to update the mouse cursor during a drag &amp; drop operation.
        /// </summary>
        /// <param name="browser"></param>
        /// <param name="operation">Describes the allowed operation (none, move, copy, link).</param>
        protected override void UpdateDragCursor(CefBrowser browser, CefDragOperationsMask operation)
        {
            Cursor        cursor;
            CefCursorType cursorType;

            switch (operation)
            {
            case CefDragOperationsMask.None:
                cursor     = CursorInteropHelper.Create(StandardCursorType.No);
                cursorType = CefCursorType.Notallowed;
                break;

            case CefDragOperationsMask.Move:
                cursor     = CursorInteropHelper.Create(StandardCursorType.DragMove);
                cursorType = CefCursorType.Move;
                break;

            case CefDragOperationsMask.Link:
                cursor     = CursorInteropHelper.Create(StandardCursorType.DragLink);
                cursorType = CefCursorType.Alias;
                break;

            default:
                cursor     = CursorInteropHelper.Create(StandardCursorType.DragCopy);
                cursorType = CefCursorType.Copy;
                break;
            }
            WebView.RaiseCefCursorChange(new CursorChangeEventArgs(cursor, cursorType));
        }
Ejemplo n.º 2
0
        /// <inheritdoc />
        protected override bool OnCursorChange(CefBrowser browser, IntPtr cursorHandle, CefCursorType type, CefCursorInfo customCursorInfo)
        {
            var ea = new CursorChangeEventArgs(type != CefCursorType.Custom ? CursorInteropHelper.Create(new SafeFileHandle(cursorHandle, false)) : CustomCursor.Create(ref customCursorInfo), type);

            WebView.RaiseCefCursorChange(ea);
            return(ea.Handled);
        }
Ejemplo n.º 3
0
 protected override void OnCursorChange(CefBrowser browser, IntPtr cursorHandle, CefCursorType type, CefCursorInfo customCursorInfo)
 {
     WebView.RaiseCefCursorChange(
         new CursorChangeEventArgs(type != CefCursorType.Custom ? CursorInteropHelper.Create(cursorHandle) : CustomCursor.Create(ref customCursorInfo), type)
         );
 }