Exemplo n.º 1
0
        IEnumerable <InterfaceBuilderData> CreateBuilderData()
        {
            var interfaceBuilderData = new InterfaceBuilderData(typeof(ASPxHtmlEditor))
            {
                Act = info => {
                    if (new[] { typeof(DevExpress.Web.ASPxUploadControl.ValidationSettings), typeof(DevExpress.Web.ASPxUploadControl.ValidationSettings) }
                        .Any(type => type.IsAssignableFrom(info.PropertyType)))
                    {
                        return(true);
                    }
                    info.RemoveInvalidTypeConverterAttributes("ASPxClasses.Design");
                    return(info.DXFilter(BaseHtmlEditorControlTypes(), typeof(object)));
                }
            };

//            interfaceBuilderData.ReferenceTypes.Add(typeof(CursorConverter));
            yield return(interfaceBuilderData);

            yield return(new InterfaceBuilderData(typeof(HtmlEditorToolbar))
            {
                Act = info => info.DXFilter()
            });

            yield return(new InterfaceBuilderData(typeof(HtmlEditorToolbarItem))
            {
                Act = info => {
                    var dxFilter = info.DXFilter(new[] { typeof(ToolbarItemImageProperties) }, typeof(object));
                    return dxFilter;
                }
            });

            yield return(new InterfaceBuilderData(typeof(HtmlEditorShortcut))
            {
                Act = info => info.DXFilter()
            });

            yield return(new InterfaceBuilderData(typeof(HtmlEditorCustomDialog))
            {
                Act = info => {
                    if (info.Name == "Name")
                    {
                        info.AddAttribute(new BrowsableAttribute(false));
                    }
                    return info.DXFilter();
                }
            });

            yield return(new InterfaceBuilderData(typeof(ToolbarCustomDialogButton))
            {
                Act = info => {
                    if (info.Name == "Name" || info.Name == "CommandName")
                    {
                        info.AddAttribute(new BrowsableAttribute(false));
                        info.AddAttribute(new BrowsableAttribute(false));
                    }
                    return info.DXFilter();
                }
            });
        }
        public void ExtendModelInterfaces(ModelInterfaceExtenders extenders) {
            var interfaceBuilder = new InterfaceBuilder(extenders);
            var componentType = typeof(DXMenuItem);
            var builderData = new InterfaceBuilderData(componentType) {
                Act = info => info.Name != "Id" && info.DXFilter()
            };
            var assembly = interfaceBuilder.Build(new List<InterfaceBuilderData> { builderData },GetPath(componentType.Name));

            interfaceBuilder.ExtendInteface<IModelSchedulerPopupMenuItem, DXMenuItem>(assembly);
        }
Exemplo n.º 3
0
        IEnumerable <InterfaceBuilderData> CreateBuilderData()
        {
            var interfaceBuilderData = new InterfaceBuilderData(typeof(RichEditControl))
            {
                Act = info => info.Name != "Undo" && info.DXFilter()
            };

            interfaceBuilderData.ReferenceTypes.AddRange(new[] { typeof(CriteriaOperator), typeof(DocumentCapability) });
            yield return(interfaceBuilderData);
        }
        public void ExtendModelInterfaces(ModelInterfaceExtenders extenders){
            extenders.Add<IModelSchedulerPopupMenuItem, IModelSchedulerPopupMenuItemEx>();
            var interfaceBuilder = new InterfaceBuilder(extenders);
            var builderData = new InterfaceBuilderData(typeof(SchedulerMenuItem)){Act = info =>{
                if (info.Name == "Id")
                    return false;
                return info.DXFilter();
            }
            };
            var assembly = interfaceBuilder.Build(new List<InterfaceBuilderData> { builderData }, GetPath(typeof(SchedulerMenuItem).Name));

            interfaceBuilder.ExtendInteface<IModelSchedulerPopupMenuItem,SchedulerMenuItem>(assembly);
        }
        public void ExtendModelInterfaces(ModelInterfaceExtenders extenders)
        {
            var interfaceBuilder = new InterfaceBuilder(extenders);
            var componentType    = typeof(DXMenuItem);
            var builderData      = new InterfaceBuilderData(componentType)
            {
                Act = info => info.Name != "Id" && info.DXFilter()
            };
            var assembly = interfaceBuilder.Build(new List <InterfaceBuilderData> {
                builderData
            }, GetPath(componentType.Name));

            interfaceBuilder.ExtendInteface <IModelSchedulerPopupMenuItem, DXMenuItem>(assembly);
        }
        IEnumerable<InterfaceBuilderData> CreateBuilderData() {
            var interfaceBuilderData = new InterfaceBuilderData(typeof (ASPxHtmlEditor)){
                Act = info => {
                    if (new[] { typeof(UploadControlValidationSettings), typeof(UploadControlValidationSettings) }
                            .Any(type => type.IsAssignableFrom(info.PropertyType))) {
                        return true;
                    }
                    if (info.Name=="UploadImageFolder")
                        info.AddAttribute(new DefaultValueAttribute("~/Images"));
                    info.RemoveInvalidTypeConverterAttributes("ASPxClasses.Design");
                    return info.DXFilter(BaseHtmlEditorControlTypes(), typeof (object));
                }
            };
//            interfaceBuilderData.ReferenceTypes.Add(typeof(CursorConverter));
            yield return interfaceBuilderData;
            yield return new InterfaceBuilderData(typeof(HtmlEditorToolbar)){
                Act = info => info.DXFilter()
            };
            yield return new InterfaceBuilderData(typeof(HtmlEditorToolbarItem)){
                Act = info => {
                    var dxFilter = info.DXFilter(new[]{typeof (ToolbarItemImageProperties)}, typeof (object));
                    return dxFilter;
                }
            };
            yield return new InterfaceBuilderData(typeof(HtmlEditorShortcut)){
                Act = info => info.DXFilter()
            };
            yield return new InterfaceBuilderData(typeof(HtmlEditorCustomDialog)){
                Act = info => {
                    if (info.Name == "Name")
                        info.AddAttribute(new BrowsableAttribute(false));
                    return info.DXFilter();
                }
            };
            yield return new InterfaceBuilderData(typeof(ToolbarCustomDialogButton)) {
                Act = info => {
                    if (info.Name == "Name" || info.Name == "CommandName") {
                        info.AddAttribute(new BrowsableAttribute(false));
                        info.AddAttribute(new BrowsableAttribute(false));
                    }
                    return info.DXFilter();
                }
            };
        }
        protected override IEnumerable <InterfaceBuilderData> CreateBuilderData()
        {
            var interfaceBuilderData = new InterfaceBuilderData(typeof(RichEditControl))
            {
                Act = info => {
                    if (info.PropertyType == typeof(RichEditRulerVisibility))
                    {
                        info.AddAttribute(new DefaultValueAttribute(RichEditRulerVisibility.Hidden));
                    }
                    else if (info.PropertyType == typeof(RichEditViewType))
                    {
                        info.AddAttribute(new DefaultValueAttribute(RichEditViewType.Simple));
                    }
                    return(info.Name != "Undo" && info.DXFilter());
                }
            };

            interfaceBuilderData.ReferenceTypes.AddRange(new[] { typeof(CriteriaOperator), typeof(DocumentCapability) });
            yield return(interfaceBuilderData);
        }
        public void ExtendModelInterfaces(ModelInterfaceExtenders extenders)
        {
            extenders.Add <IModelSchedulerPopupMenuItem, IModelSchedulerPopupMenuItemEx>();
            var interfaceBuilder = new InterfaceBuilder(extenders);
            var builderData      = new InterfaceBuilderData(typeof(SchedulerMenuItem))
            {
                Act = info => {
                    if (info.Name == "Id")
                    {
                        return(false);
                    }
                    return(info.DXFilter());
                }
            };
            var assembly = interfaceBuilder.Build(new List <InterfaceBuilderData> {
                builderData
            }, GetPath(typeof(SchedulerMenuItem).Name));

            interfaceBuilder.ExtendInteface <IModelSchedulerPopupMenuItem, SchedulerMenuItem>(assembly);
        }