Base class for drag feedback implementations.
Inheritance: IDisposable
Esempio n. 1
0
 private void ClearDragFeedback()
 {
     if (_dragFeedback != null)
     {
         _dragFeedback.Dispose();
         _dragFeedback = null;
     }
 }
Esempio n. 2
0
        private void ResolveDragFeedback()
        {
            ClearDragFeedback();

            // Start with the provided value
            PaletteDragFeedback dragFeedback = _stateCommon.GetDragDropFeedback();

            // Should never be 'inherit'
            if (dragFeedback == PaletteDragFeedback.Inherit)
            {
                dragFeedback = PaletteDragFeedback.Rounded;
            }

            // Check if the rounded style is possible
            if (dragFeedback == PaletteDragFeedback.Rounded)
            {
                // Rounded feedback uses a per-pixel alpha blending and so we need to be on a machine that supports
                // more than 256 colors and also allows the layered windows feature. If not then revert to sqaures
                if ((OSFeature.Feature.GetVersionPresent(OSFeature.LayeredWindows) == null) || (CommonHelper.ColorDepth() <= 8))
                {
                    dragFeedback = PaletteDragFeedback.Square;
                }
            }

            switch (dragFeedback)
            {
            case PaletteDragFeedback.Rounded:
            case PaletteDragFeedback.Square:
                _dragFeedback = new DragFeedbackDocking(dragFeedback);
                break;

            default:
                _dragFeedback = new DragFeedbackSolid();
                break;
            }
        }