Exemple #1
0
        private void Extend_Predefined_ViewItem(PredefinedMap predefinedMap, string mapPropertyName,
                                                bool checkListViewColumns = false)
        {
            using (var module = predefinedMap.Extend()){
                var connectableObservable = TypeMappingService.MappedTypes.Replay();
                connectableObservable.Connect();
                using (var application =
                           DefaultModelMapperModule($"{nameof(Extend_Predefined_PropertyEditorControls)}-{predefinedMap}",
                                                    predefinedMap.Platform(), module).Application){
                    var typeToMap = predefinedMap.TypeToMap();

                    var modelNode = application.Model.GetNodeByPath(MMDetailViewTestItemNodePath);
                    modelNode.GetNode(mapPropertyName).ShouldNotBeNull();
                    if (checkListViewColumns)
                    {
                        modelNode = application.Model.GetNodeByPath(MMListViewTestItemNodePath);
                        modelNode.GetNode(mapPropertyName).ShouldNotBeNull();
                    }

                    var typeInfo = XafTypesInfo.Instance.FindTypeInfo(typeof(IModelModelMap)).Descendants
                                   .FirstOrDefault(info => info.Name.EndsWith(typeToMap.Name));
                    typeInfo.ShouldNotBeNull();
                    typeInfo.Name.ShouldBe(typeToMap.ModelTypeName());

                    var defaultContext =
                        ((IModelApplicationModelMapper)application.Model).ModelMapper.MapperContexts.GetNode(
                            ModelMapperContextNodeGenerator.Default);
                    defaultContext.ShouldNotBeNull();
                    var modelMapper = defaultContext.GetNode(predefinedMap.DisplayName());
                    modelMapper.ShouldNotBeNull();
                }
            }
        }
Exemple #2
0
 public void Extend_Predefined_PropertyEditorControls(PredefinedMap predefinedMap)
 {
     InitializeMapperService($"{nameof(Extend_Predefined_PropertyEditorControls)}{predefinedMap}", predefinedMap.Platform());
     Extend_Predefined_ViewItem(predefinedMap, ViewItemService.PropertyEditorControlMapName);
 }
Exemple #3
0
 public void Extend_PredefinedRepositoryItems(PredefinedMap predefinedMap)
 {
     InitializeMapperService($"{nameof(Extend_PredefinedRepositoryItems)}{predefinedMap}", predefinedMap.Platform());
     Extend_Predefined_ViewItem(predefinedMap, ViewItemService.RepositoryItemsMapName, true);
 }