Пример #1
0
        public void OpenMetaEntityList()
        {
            var entityValidator = EntityService.GetEntityValidator(MetaMetaEntity);

            Panels.Add(EntityListPanelViewModel.Create(MetaDataService.GetMetaEntities, OpenMetaEntityCreation,
                                                       OpenMetaEntityEdition, DeleteMetaEntities, entityValidator));
            SetFocusOnSelectedPanel();
        }
Пример #2
0
        public void OpenRegularExpressionList()
        {
            var entityValidator = EntityService.GetEntityValidator(MetaRegularExpression);

            Panels.Add(EntityListPanelViewModel.Create(MetaDataService.GetRegularExpressions,
                                                       OpenRegularExpressionCreation, OpenRegularExpressionEdition, DeleteRegularExpression, entityValidator));
            SetFocusOnSelectedPanel();
        }
        public void Initialize(IMetaEntity metaEntity)
        {
            var metaMetaEntity = EntityService.GetMetaEntity(nameof(IMetaEntity));

            EntityValidator = EntityService.GetEntityValidator(metaMetaEntity);
            var metaMetaField      = EntityService.GetMetaEntity(nameof(IMetaField));
            var metaFieldValidator = EntityService.GetEntityValidator(metaMetaField);

            if (metaEntity == null)
            {
                metaEntity = MetaDataService.InitializeMetaEntity(metaMetaEntity);
            }
            else
            {
                metaEntity = EntityService.GetMetaEntity(metaEntity.Id);
            }
            Caption = EntityValidator.MetaEntity.Label;
            Entity  = metaEntity;
            MetaFieldListPanelViewModel = EntityListPanelViewModel.Create(RefreshMetaFields, null, OpenMetaFieldEdition,
                                                                          DeleteMetaField, metaFieldValidator);

            MetaBooleanMetaField         = EntityService.GetMetaEntity(nameof(IBooleanMetaField));
            CreateBooleanMetaFieldLabel  = string.Format(MdManagerLabels.CreateEntityLabel, MetaBooleanMetaField.Label);
            MetaIntegerMetaField         = EntityService.GetMetaEntity(nameof(IIntegerMetaField));
            CreateIntegerMetaFieldLabel  = string.Format(MdManagerLabels.CreateEntityLabel, MetaIntegerMetaField.Label);
            MetaDecimalMetaField         = EntityService.GetMetaEntity(nameof(IDecimalMetaField));
            CreateDecimalMetaFieldLabel  = string.Format(MdManagerLabels.CreateEntityLabel, MetaDecimalMetaField.Label);
            MetaDateTimeMetaField        = EntityService.GetMetaEntity(nameof(IDateTimeMetaField));
            CreateDateTimeMetaFieldLabel =
                string.Format(MdManagerLabels.CreateEntityLabel, MetaDateTimeMetaField.Label);
            MetaStringMetaField        = EntityService.GetMetaEntity(nameof(IStringMetaField));
            CreateStringMetaFieldLabel = string.Format(MdManagerLabels.CreateEntityLabel, MetaStringMetaField.Label);
            MetaEntityMetaField        = EntityService.GetMetaEntity(nameof(IEntityMetaField));
            CreateEntityMetaFieldLabel = string.Format(MdManagerLabels.CreateEntityLabel, MetaEntityMetaField.Label);

            InitializeFieldValidators(metaEntity);
        }