public void Paste(MapNode target, bool clearPainter = true)
        {
            Debug.Assert(target != null, "Copy/Paste format: Target node is null");

            formatSource.CopyFormatTo(target);

            if (Status == FormatPainterStatus.SingleApply && clearPainter)
            {
                Clear();
            }

            if (StateChanged != null)
            {
                StateChanged(this);
            }
        }
Exemple #2
0
        /// <summary>
        /// Create a new style using the refNode (internal copy of given refNode is created)
        /// </summary>
        /// <param name="title"></param>
        /// <param name="styleSource">Changing refNode afterwards will not affect the created style.</param>
        /// <param name="custom"></param>
        public NodeStyle(string title, MapNode styleSource, bool custom = true)
        {
            Title  = title;
            Custom = custom;

            RefNode      = MapNode.CreateIsolatedNode(NodePosition.Right);
            RefNode.Text = "Sample";

            styleSource.CopyFormatTo(RefNode);

            Image = new StyleImageGenerator(RefNode).GenerateImage();
        }