Source/ColorPickerItem/ColorPickerDropDown.cs

(开头部分) 26KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Text;
using System.Collections;
using System.Drawing;
using System.ComponentModel;
using System.Windows.Forms;

namespace DevComponents.DotNetBar
{
    /// <summary>
    /// Represents the color picker drop down button.
    /// </summary>
    [DefaultEvent("SelectedColorChanged")]
    public class ColorPickerDropDown : ButtonItem
    {
        #region Events
        /// <summary>
        /// Occurs when color is chosen from drop-down color picker or from Custom Colors dialog box. Selected color can be accessed through SelectedColor property.
        /// </summary>
        [Description("Occurs when color is chosen from drop-down color picker or from Custom Colors dialog box.")]
        public event EventHandler SelectedColorChanged;

        /// <summary>
        /// Occurs when mouse is moving over the colors presented by the color picker. You can use it to preview the color before it is selected.
        /// </summary>
        [Description("Occurs when mouse is moving over the colors presented by the color picker")]
        public event ColorPreviewEventHandler ColorPreview;

        /// <summary>
        /// Occurs before color picker dialog is shown. Data property of the event arguments will hold the reference to the Form about to be shown.
        /// </summary>
        public event CancelObjectValueEventHandler BeforeColorDialog;
        #endregion

        #region Private Variables
        private bool m_ColorsInitialized = false;
        private bool m_DisplayThemeColors = true;
        private bool m_DisplayStandardColors = true;
        private bool m_DisplayMoreColors = true;
        
        private bool m_Localized = false;
        private string m_ThemeColorsLabel = "Theme Colors";
        private string m_StandardColorsLabel = "Standard Colors";
        private string m_MoreColorsLabel = "&More Colors...";
        private Color m_SelectedColor = System.Drawing.Color.Empty;
        private Rectangle m_SelectedColorRectangle = Rectangle.Empty;
        private bool m_SelectedImageCreated = false;
        #endregion

        #region Constructor
        /// <summary>
		/// Creates new instance of ButtonItem.
		/// </summary>
		public ColorPickerDropDown():this("","") {}
		/// <summary>
		/// Creates new instance of ButtonItem and assigns the name to it.
		/// </summary>
		/// <param name="sItemName">Item name.</param>
		public ColorPickerDropDown(string sItemName):this(sItemName,"") {}
		/// <summary>
后面还有 602 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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