Source/ComboItemsEditor.cs

(开头部分) 3KB

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

using System;
using System.ComponentModel.Design;
using System.Drawing.Design;
using System.ComponentModel;
using System.Windows.Forms.ComponentModel;
using System.Windows.Forms.Design;
using System.Drawing;

namespace DevComponents.Editors
{
	/// <summary>
	/// Summary description for ComboItemsEditor.
	/// </summary>
	public class ComboItemsEditor:CollectionEditor
	{
		public ComboItemsEditor(Type type):base(type)
		{
		}
		protected override Type CreateCollectionItemType()
		{
			return typeof(ComboItem);
		}
        protected override object CreateInstance(Type itemType)
        {
            object o = base.CreateInstance(itemType);
            ComboItem ci = o as ComboItem;
            if (ci != null)
            {
                if (ci.Site != null && ci.Site.Name != "")
                    ci.Text = ci.Site.Name;
                else
                    ci.Text = "comboItem";
            }
            return o;
        }
	}

	public class ImageIndexEditor:UITypeEditor
	{
		//private System.Windows.Forms.Design.IWindowsFormsEditorService m_EditorService=null;
		//private UITypeEditor m_ImageEditor;
		private System.Windows.Forms.ImageList m_ImageList=null;
		public ImageIndexEditor():base()
		{
			//m_ImageEditor= System.ComponentModel.TypeDescriptor.GetEditor(typeof(System.Drawing.Image),typeof(UITypeEditor)) as ImageEditor;
		}
		
		public override bool GetPaintValueSupported(ITypeDescriptorContext context)
		{
			return true;
		}

		public override void PaintValue(PaintValueEventArgs e)
		{
			try
			{
				if(e==null || e.Value==null)
					return;
				int iIndex=(int)e.Value;
				System.Drawing.Image img=this.GetImage(e.Context,iIndex);
后面还有 50 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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