Exemple #1
0
        /// <summary>
        /// Возвращает описание контрола Image
        /// </summary>
        private ControlTypeDescription GetSampleImageDescription()
        {
            var standardCssClass = PropertyFactory.GetStandardCssClassProperty();

            standardCssClass.DefaultValue = "sample-image";

            var bindingProperty = PropertyFactory.GetBindingProperty();

            bindingProperty.GetBindingLoader = () => new CustomBindingLoader(Constants.SampleImage.Slider, Constants.SampleImage.SliderConverter);

            var sampleImage = new ControlTypeDescription(Constants.SampleImage.ClassName)
            {
                DisplayName             = Resources.ControlTypes_SampleImage,
                ControlGroupDisplayName = Resources.ControlGroup_Samples,
                PropertyDescriptions    =
                {
                    standardCssClass,
                    PropertyFactory.GetNameProperty(),
                    PropertyFactory.GetVisibilityProperty(),
                    PropertyFactory.GetCustomCssClassesProperty(),
                    PropertyFactory.Create(Constants.SampleImage.ImageHeight),
                    PropertyFactory.Create(Constants.SampleImage.ImageWidth),
                    PropertyFactory.Create(Constants.SampleImage.Slider),
                    PropertyFactory.Create(Constants.SampleImage.Description),
                    PropertyFactory.Create(UrlPropertyDesignerExtension.Extension.Constants.CommonProperties.UrlAddress),
                    bindingProperty,
                    PropertyFactory.GetClickEvent(),
                    PropertyFactory.GetMouseOverEvent(),
                    PropertyFactory.GetMouseOutEvent(),
                }
            };

            return(sampleImage);
        }
        /// <summary>
        /// Возвращает описание контрола SampleTextBox
        /// </summary>
        private ControlTypeDescription GetSampleTextBoxDescription()
        {
            var standardCssClass = PropertyFactory.GetStandardCssClassProperty();

            standardCssClass.DefaultValue = "sample-textbox";

            var sampleTextBox = new ControlTypeDescription(Constants.SampleTextBox.ClassName)
            {
                DisplayName             = Resources.ControlTypes_SampleTextBox,
                ControlGroupDisplayName = Resources.ControlGroup_Samples,
                PropertyDescriptions    =
                {
                    standardCssClass,
                    PropertyFactory.GetNameProperty(),
                    PropertyFactory.GetVisibilityProperty(),
                    PropertyFactory.GetCustomCssClassesProperty(),
                    PropertyFactory.GetTipProperty(),
                    PropertyFactory.GetLabelTextProperty(),
                    PropertyFactory.GetTabStopProperty(),
                    PropertyFactory.GetDefaultProperty(),
                    PropertyFactory.Create(Constants.CommonProperties.UrlAddress),
                    PropertyFactory.GetClickEvent(),
                    PropertyFactory.GetMouseOverEvent(),
                    PropertyFactory.GetMouseOutEvent(),
                    PropertyFactory.GetFocusEvent(),
                    PropertyFactory.GetBlurEvent(),
                    PropertyFactory.GetDataChangedEvent(),
                    PropertyFactory.CreateEvent("ImageClick",                     "ControlTypes_ImageClickEventProperty"),
                },
                GetAllowedOperations = AllowedOperationsStorage.GetAllowedOperations(Constants.AllowedOperations.AllowCreateInEditLayoutsOnly)
            };

            PropertyFactory.AddSimpleBinding(sampleTextBox, editOperation: true);
            return(sampleTextBox);
        }