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)); }
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); }
public EffectService(IBattleUnit battleUnit, Effects.Effects effects) { Effects = effects; BattleUnit = battleUnit; }