Esempio n. 1
0
        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();
        }
Esempio n. 2
0
        //--------------------------------------------------------------------------------------------------

        public override void Remove()
        {
            if (_Owner != null)
            {
                _Owner.RemoveComponent(this);
                Owner = null;
            }
            base.Remove();
        }
Esempio n. 3
0
        /// <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));
        }
Esempio n. 4
0
        //--------------------------------------------------------------------------------------------------

        protected override void OwnerChanged(IDecorable oldOwner, IDecorable newOwner)
        {
            base.OwnerChanged(oldOwner, newOwner);

            if (newOwner != null)
            {
            }
            else
            {
//            InvalidateVisual();
            }
        }
Esempio n. 5
0
        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();
        }
Esempio n. 6
0
        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);
            }
        }
Esempio n. 8
0
 public GoldFoilDecorator(IDecorable decorablee) : base(decorablee)
 {
 }
Esempio n. 9
0
 public DecorableDecorator(IDecorable decorablee)
 {
     _decorablee = decorablee;
 }
Esempio n. 10
0
        //--------------------------------------------------------------------------------------------------

        protected virtual void OwnerChanged(IDecorable oldOwner, IDecorable newOwner)
        {
        }