/// <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); }
/// <summary> /// Возвращает описание контрола SampleCheckBox /// </summary> private ControlTypeDescription GetSampleCheckBoxDescription() { var standardCssClass = PropertyFactory.GetStandardCssClassProperty(); // Получаем свойство StandardCssClass standardCssClass.DefaultValue = "sample-checkbox"; // Изменяем значение по умолчанию var dataFieldProperty = PropertyFactory.GetDataFieldProperty(); dataFieldProperty.Editor = typeof(BooleanMetadataEditor); // Создаем описание контрола, который будет доступен по имени PartnerCheckBox var partnerCheckBox = new ControlTypeDescription(Constants.SampleCheckBox.ClassName) { DisplayName = Resources.ControlTypes_SampleCheckBox, // Отображаемое наименование контрола в окне конструктора разметок ControlGroupDisplayName = Resources.ControlGroup_Samples, // Название группы в конструкторе разметок PropertyDescriptions = // Содержит перечень свойств, которыми обладает контрол { PropertyFactory.GetNameProperty(), // Наименование экземпляра контрола PropertyFactory.GetTipProperty(), // Текст подсказки при наведении на контрол PropertyFactory.GetLabelTextProperty(), // Текст метки PropertyFactory.GetVisibilityProperty(), // Видимость контрола PropertyFactory.GetCustomCssClassesProperty(), // Пользовательские css классы PropertyFactory.GetTabStopProperty(), // Переход по tab standardCssClass, // Базовый css класс контрола PropertyFactory.GetDisabledProperty(), // Редактирование контрола // Блок свойств Binding PropertyFactory.GetDataSourceProperty(), // Источник данных (отображается только в конструкторе) dataFieldProperty, // Поле данных (отображается только в конструкторе) PropertyFactory.GetBindingProperty(), // Свойство binding (не отображается в конструкторе) PropertyFactory.GetEditOperationProperty(), // Режим редактирования (отображается только в конструкторе) PropertyFactory.Create(Constants.SampleCheckBox.DefaultValue), // Свойство DefaultValue (было добавлено ранее этим расширением) PropertyFactory.CreateEvent(Constants.SampleCheckBox.EventChecked, "ControlTypes_EventCheckedProperty"), // Событие EventChecked, отображаемое наименование свойства содержится в файле ресурсов по ключу ControlTypes_EventCheckedProperty PropertyFactory.CreateEvent(Constants.SampleCheckBox.EventUnchecked, "ControlTypes_EventUncheckedProperty") // Событие EventUnchecked }, // GetAllowedOperations = AllowedOperationsStorage.GetAllowedOperations(Constants.AllowedOperations.AllowCreateInEditLayoutsOnly) // Указывает, что контрол доступен только в разметках редактирования }; return(partnerCheckBox); }