public void ConfigureDrawing(AbstractDrawing drawing, Action refresh) { Keyframe keyframe = metadata.HitKeyframe; IDecorable decorable = drawing as IDecorable; if (keyframe == null || drawing == null || decorable == null) { return; } HistoryMementoModifyDrawing memento = new HistoryMementoModifyDrawing(metadata, keyframe.Id, drawing.Id, drawing.Name, SerializationFilter.Style); FormConfigureDrawing2 fcd = new FormConfigureDrawing2(decorable, refresh); FormsHelper.Locate(fcd); fcd.ShowDialog(); if (fcd.DialogResult == DialogResult.OK) { memento.UpdateCommandName(drawing.Name); metadata.HistoryStack.PushNewCommand(memento); } fcd.Dispose(); }
//-------------------------------------------------------------------------------------------------- public override void Remove() { if (_Owner != null) { _Owner.RemoveComponent(this); Owner = null; } base.Remove(); }
/// <summary> /// Get the precision cursor to use while manipulating the object. /// </summary> public Cursor GetManipulationCursor(AbstractDrawing drawing) { IDecorable decorable = drawing as IDecorable; if (decorable == null) { return(GetCursorPrecision(null, false)); } return(GetCursorPrecision(decorable.DrawingStyle, false)); }
//-------------------------------------------------------------------------------------------------- protected override void OwnerChanged(IDecorable oldOwner, IDecorable newOwner) { base.OwnerChanged(oldOwner, newOwner); if (newOwner != null) { } else { // InvalidateVisual(); } }
private void mnuConfigureDrawing_Click(object sender, EventArgs e) { IDecorable drawing = metadataManipulator.HitDrawing as IDecorable; if (drawing == null || drawing.DrawingStyle == null || drawing.DrawingStyle.Elements.Count == 0) { return; } metadataManipulator.ConfigureDrawing(metadataManipulator.HitDrawing, Refresh); Refresh(); }
public FormConfigureDrawing2(IDecorable drawing, Action invalidator) { this.drawing = drawing; this.oldName = drawing.Name; this.style = drawing.DrawingStyle; this.style.ReadValue(); this.style.Memorize(); this.invalidator = invalidator; InitializeComponent(); LocalizeForm(); SetupForm(); }
//-------------------------------------------------------------------------------------------------- protected override void OwnerChanged(IDecorable oldOwner, IDecorable newOwner) { base.OwnerChanged(oldOwner, newOwner); if (oldOwner is Body oldBody) { oldBody.RemoveDependent(this); } if (newOwner is Body newBody) { newBody.AddDependent(this); } }
public GoldFoilDecorator(IDecorable decorablee) : base(decorablee) { }
public DecorableDecorator(IDecorable decorablee) { _decorablee = decorablee; }
//-------------------------------------------------------------------------------------------------- protected virtual void OwnerChanged(IDecorable oldOwner, IDecorable newOwner) { }