Source/AdvTree/Drawing/Shape.cs

(完整代码) 1KB

using System;
using System.Text;
using System.Drawing;
using System.ComponentModel;

namespace DevComponents.WinForms.Drawing
{
    /// <summary>
    /// Defines a visual shape.
    /// </summary>
    internal abstract class Shape
    {
        #region Internal Implementation
        /// <summary>
        /// Renders shape on canvas.
        /// </summary>
        /// <param name="g">Target graphics to render shape on.</param>
        /// <param name="bounds">Shape bounds.</param>
        public abstract void Paint(Graphics g, Rectangle bounds);

        private Shape _Content = null;
        /// <summary>
        /// Gets or sets the single piece of content inside of the shape.
        /// </summary>
        [DefaultValue(null)]
        public Shape Content
        {
            get { return _Content; }
            set { _Content = value; }
        }

        private bool _ClipToBounds = false;
        /// <summary>
        /// Gets or sets whether to clip the Content of this shape. Default value is false.
        /// </summary>
        [DefaultValue(false)]
        public bool ClipToBounds
        {
            get { return _ClipToBounds; }
            set
            {
                _ClipToBounds = value;
            }
        }
        
        #endregion
    }
}

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。