Example #1
0
        protected override bool OnButtonDownOverNonAdorner(Point pointerPosition)
        {
            PropertyToolAction actionToApply = this.GetActionToApply();

            this.UpdateCursor();
            SceneElement elementAtPoint = this.ActiveView.GetElementAtPoint(pointerPosition, (HitTestModifier)null, new InvisibleObjectHitTestModifier(SceneView.SmartInvisiblePanelSelect), (ICollection <BaseFrameworkElement>)null);

            if (elementAtPoint == null || actionToApply == PropertyToolAction.PaintBucket && !elementAtPoint.IsSelectable || (elementAtPoint.ViewObject == null || !PlatformTypes.FrameworkElement.IsAssignableFrom((ITypeId)elementAtPoint.ViewObject.GetIType((ITypeResolver)this.ActiveSceneViewModel.ProjectContext))))
            {
                return(false);
            }
            switch (actionToApply)
            {
            case PropertyToolAction.Eyedropper:
                this.actionString       = PropertyToolBehavior.EyedropperUndoString;
                this.openUndoUnitAction = PropertyToolAction.Eyedropper;
                this.ApplyEyedropper(elementAtPoint);
                break;

            case PropertyToolAction.PaintBucket:
                this.actionString       = PropertyToolBehavior.PaintBucketUndoString;
                this.openUndoUnitAction = PropertyToolAction.PaintBucket;
                this.ApplyPaintBucket(elementAtPoint);
                break;

            default:
                throw new ArgumentException(ExceptionStringTable.PropertyToolBehaviorUnrecognizedAction);
            }
            return(true);
        }
Example #2
0
 public PropertyToolBehavior(ToolBehaviorContext toolContext, PropertyToolAction action)
     : base(toolContext)
 {
     this.action = action;
 }