예제 #1
0
        public void Start(Control sourceControl, Effects.Effects effects, Point location, IPreview preview)
        {
            if (IsDisposed)
            {
                return;
            }

            if (!IsHandleCreated)
            {
                CreateHandle();
            }

            _effects = effects;

            SourceControl = sourceControl ?? throw new ArgumentNullException(nameof(sourceControl));

            IsDragging = true;
            Location   = location;

            Preview                  = preview;
            UpdatablePreview         = preview as IUpdatablePreview;
            PreviewOpacityController = preview as IPreviewOpacityController;

            if (UpdatablePreview is object)
            {
                UpdatablePreview.Updated += OnUpdatablePreviewUpdated;
                UpdatablePreview?.Start();
            }

            InvalidatePreview();

            _effects.StartEffect.Start(new IEffect.Arguments(this, SourceControl, null));
        }
예제 #2
0
        public void Start(Control sourceControl, Effects.Effects effects, IPreview preview, Point cursorOffset)
        {
            if (preview is null)
            {
                return;
            }

            CursorOffset = cursorOffset;

            var mousePosition   = Control.MousePosition;
            var previewPosition = new Point(mousePosition.X - cursorOffset.X, mousePosition.Y - cursorOffset.Y);

            if (_previewForm?.IsDisposed ?? false)
            {
                _previewForm = null;
            }

            IsDragging = true;

            PreviewForm.Start(sourceControl, effects, previewPosition, preview);
        }
예제 #3
0
 public EffectService(IBattleUnit battleUnit, Effects.Effects effects)
 {
     Effects    = effects;
     BattleUnit = battleUnit;
 }