zoukankan      html  css  js  c++  java
  • propertyGrid实现选项(原创)

    Draw Dorp-Down propertyGrid

    [TypeConverter(typeof(backgroundRepeatConverter)),
                DescriptionAttribute(
    "description"),
                CategoryAttribute(
    "行为")]
                
    public string backgroundRepeat
                
    {
                    
    get
                    
    {
                            
    if(e.style.backgroundRepeat==null)return "";
                            
    return e.style.backgroundRepeat;
                    
                    }

                    
    set
                    
    {
                        e.style.backgroundRepeat
    =value;
                    }

                }


    public class backgroundRepeatConverter: StringConverter
            
    {  
                
    public override StandardValuesCollection
                    GetStandardValues(ITypeDescriptorContext context) 
                
    {
                    
    return new StandardValuesCollection(new string[]{"repeat"
                                                                        
    "repeat-x"
                                                                        
    "repeat-y",
                    
    "no-repeat"}
    );
                }

                
    public override bool GetStandardValuesSupported(
                    ITypeDescriptorContext context) 
                
    {
                    
    return true;
                }

                
    public override bool GetStandardValuesExclusive(
                    ITypeDescriptorContext context) 
                
    {
                    
    return true;
                }

            }
     
  • 相关阅读:
    Python 生成器
    Python 装饰器
    Go语言【第十四篇】:Go语言基础总结
    Go语言【第十三篇】:Go语言递归函数
    Go语言【第十二篇】:Go数据结构之:切片(Slice)、范围(Range)、集合(Map)
    Go语言【第十一篇】:Go数据结构之:结构体
    Java入门之:对象和类
    Alpha阶段第2周/共2周 Scrum立会报告+燃尽图 04
    Alpha阶段第2周/共2周 Scrum立会报告+燃尽图 03
    Alpha阶段第2周/共2周 Scrum立会报告+燃尽图 02
  • 原文地址:https://www.cnblogs.com/alice/p/189034.html
Copyright © 2011-2022 走看看