/// <summary> /// Sets the color of the given editor. /// </summary> /// <param name="control">The <see cref="IColorEditor"/> to update.</param> /// <param name="sender">The <see cref="IColorEditor"/> triggering the update.</param> protected virtual void SetColor(IColorEditor control, IColorEditor sender) { if (control != null && control != sender) { control.Color = sender.Color; } }
/// <summary> /// Synchronizes linked components with the specified <see cref="IColorEditor"/>. /// </summary> /// <param name="sender">The <see cref="IColorEditor"/> triggering the update.</param> protected virtual void Synchronize(IColorEditor sender) { if (!LockUpdates) { try { LockUpdates = true; SetColor(ColorWheel, sender); SetColor(ColorEditor, sender); } finally { LockUpdates = false; } } }
/// <summary> /// Synchronizes linked components with the specified <see cref="IColorEditor"/>. /// </summary> /// <param name="sender">The <see cref="IColorEditor"/> triggering the update.</param> protected virtual void Synchronize(IColorEditor sender) { if (!this.LockUpdates) { try { this.LockUpdates = true; this.SetColor(this.ColorGrid, sender); this.SetColor(this.ColorWheel, sender); this.SetColor(this.ScreenColorPicker, sender); this.SetColor(this.ColorEditor, sender); this.SetColor(this.LightnessColorSlider, sender); } finally { this.LockUpdates = false; } } }
/// <summary> /// Sets the color of the given editor. /// </summary> /// <param name="control">The <see cref="IColorEditor"/> to update.</param> /// <param name="sender">The <see cref="IColorEditor"/> triggering the update.</param> protected virtual void SetColor(IColorEditor control, IColorEditor sender) { if (control != null && control != sender) control.Color = sender.Color; }
/// <summary> /// Binds events for the specified editor. /// </summary> /// <param name="control">The <see cref="IColorEditor"/> to bind to.</param> protected virtual void BindEvents(IColorEditor control) { control.ColorChanged += this.ColorChangedHandler; }
/// <summary> /// Binds events for the specified editor. /// </summary> /// <param name="control">The <see cref="IColorEditor"/> to bind to.</param> protected virtual void BindEvents(IColorEditor control) { control.ColorChanged += ColorChangedHandler; }