自定义控件开发--默认编辑器

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.UI.Design;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Design;
using System.Drawing.Design;
using System.Windows.Forms;
using System.Web.UI.WebControls;
using System.Windows.Forms.Design;
using System.Drawing;

namespace MyTestProj
{
    
public class EditorControl : WebControl
    {
        
string strTxtEditor;
        [Category(
"编辑器")]
        [Description(
"下拉多行文本编辑器")]
        [Editor(
"System.ComponentModel.Design.MultilineStringEditor,System.Design"typeof(UITypeEditor))]
        
public string TxtEditor
        {
            
get
            {
                
return strTxtEditor;
            }
            
set
            {
                strTxtEditor 
= value;
            }
        }
        Color cColorEditor;
        [Category(
"编辑器")]
        [Description(
"颜色编辑器")]
        [Editor(
"System.ComponentModel.Design.ColorEditor,System.Design",
        
typeof(UITypeEditor))]
        
public Color ColorEditor
        {
            
get
            {
                
return cColorEditor;
            }
            
set
            {
                cColorEditor 
= value;
            }
        }
        
string strFileName;
        [Category(
"编辑器")]
        [Description(
"文件选择编辑器")]
        [Editor(
typeof(FileNameEditor), typeof(UITypeEditor))]
        
public string FileName
        {
            
get
            {
                
return strFileName;
            }
            
set
            {
                strFileName 
= value;
            }
        }
        
string strFolderNameEditor;
        [Category(
"编辑器")]
        [Description(
"目录选择编辑器")]
        [Editor(
typeof(FolderNameEditor), typeof(UITypeEditor))]
        
public string FolderNameEditor
        {
            
get
            {
                
return strFolderNameEditor;
            }
            
set
            {
                strFolderNameEditor 
= value;
            }
        }
        
string strConnectionStringEditor;
        [Category(
"编辑器")]
        [Description(
"连接字符串编辑器")]
        [Editor(
typeof(System.Web.UI.Design.ConnectionStringEditor),
        
typeof(UITypeEditor))]
        
public string ConnectionStringEditor
        {
            
get
            {
                
return strConnectionStringEditor;
            }
            
set
            {
                strConnectionStringEditor 
= value;
            }
        }
        
string strExpressionsCollectionEditor;
        [Category(
"编辑器")]
        [Description(
"编辑表达式绑定集合的编辑器")]
        [Editor(
typeof(System.Web.UI.Design.ExpressionsCollectionEditor),
        
typeof(UITypeEditor))]
        
public string ExpressionsCollectionEditor
        {
            
get
            {
                
return strExpressionsCollectionEditor;
            }
            
set
            {
                strExpressionsCollectionEditor 
= value;
            }
        }
        
string strUserControlFileEditor;
        [Category(
"编辑器")]
        [Description(
"用户控件(ascx)对话框编辑器")]
        [Editor(
typeof(System.Web.UI.Design.UserControlFileEditor),
        
typeof(UITypeEditor))]
        
public string UserControlFileEditor
        {
            
get
            {
                
return strUserControlFileEditor;
            }
            
set
            {
                strUserControlFileEditor 
= value;
            }
        }
    }
}

posted on 2009-11-16 21:13  博览潇湘  阅读(662)  评论(0)    收藏  举报

导航