colorhlseditor.cs

来自「Fireball.CodeEditor is an source code ed」· CS 代码 · 共 55 行

CS
55
字号
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing.Design;
using System.ComponentModel;
using System.Windows.Forms.Design;
using System.Windows.Forms;

namespace Fireball.Drawing.Design
{
    public class ColorHLSEditor:UITypeEditor
    {
        

        private ColorHlsUI _colorUI;

        public ColorHLSEditor()
        {
        }

        public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            if (provider != null)
            {
                IWindowsFormsEditorService winFormsService = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
                if (winFormsService == null)
                {
                    return value;
                }
                if (this._colorUI == null)
                {
                    this._colorUI = new ColorHlsUI(this);
                }
                this._colorUI.Start(winFormsService, value);
                winFormsService.DropDownControl(this._colorUI);
                value = this._colorUI.Value;
                this._colorUI.End();
            }
            return value;
        }
        public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context)
        {
            return UITypeEditorEditStyle.DropDown;
        }
        public override bool IsDropDownResizable
        {
            get
            {
                return false;
            }
        }

    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?