public EntityTemplate(EntityDomain entity, IDataTypeFactory dataTypeFactory, EntityTemplate parent) { Name = entity.Name; DataType = CreateDataTypeName(parent?.DataType, entity.Name); Parent = parent; foreach (var attribute in entity.Attributes) { var dataType = dataTypeFactory.MakeValueDataType(attribute.DataType, attribute.AllowNull); if (attribute.IsIdentifier) { IdenfierDataType = dataType; IdenfierGuid = dataType.DataType == EnumDataTypes.Identifier; } else { _attributesTemplate.Add(new AttributeTemplate(attribute, dataType)); } } foreach (var element in entity.Elements) { var dataTypeParameter = CreateDataTypeName(DataType, element.Entity.Name); var dataType = dataTypeFactory.MakeGenericDataType(element.DataType, dataTypeParameter); var entityElement = new EntityTemplate(element.Entity, dataTypeFactory, this); var elementTemplate = new ElementTemplate(entityElement, dataType); _elementsTemplate.Add(elementTemplate); AddReference(elementTemplate); } Attributes = new CollectionTemplate <AttributeTemplate>(_attributesTemplate); Elements = new CollectionTemplate <ElementTemplate>(_elementsTemplate); References = new CollectionTemplate <ElementTemplate>(_referencesTemplate); }
protected override void SetUp() { typesCache = NewMock <ITypesCache>(); typeFinder = NewMock <ITypeFinder>(); dataTypeFactory = NewMock <IDataTypeFactory>(); finder = new TypeInAssemblyFinder(GetType().Assembly, typesCache, dataTypeFactory); }
protected override void SetUp() { typesCache = NewMock<ITypesCache>(); typeFinder = NewMock<ITypeFinder>(); dataTypeFactory = NewMock<IDataTypeFactory>(); finder = new TypeInAssemblyFinder(GetType().Assembly, typesCache, dataTypeFactory); }
public TypeInReferencedAssemblyFinder(Assembly seedAssembly, ITypesCache typesCache, ITypeFinder typeFinder, IDataTypeFactory dataTypeFactory) { this.seedAssembly = seedAssembly; this.typesCache = typesCache; this.typeFinder = typeFinder; this.dataTypeFactory = dataTypeFactory; }
protected override void SetUp() { seedAssembly = GetType().Assembly; typeFinder = NewMock <ITypeFinder>(); typesCache = NewMock <ITypesCache>(); dataTypeFactory = NewMock <IDataTypeFactory>(); dataType = NewMock <IDataType>(); }
private void Update(IDataTypeFactory nodeDesign, UADataType nodeSet) { nodeSet.Definition.GetParameters(nodeDesign.NewDefinition(), AS, Log.TraceEvent); nodeDesign.DataTypePurpose = nodeSet.Purpose.ConvertToDataTypePurpose(); if (nodeSet.Purpose != XML.DataTypePurpose.Normal) { Log.TraceEvent(TraceMessage.DiagnosticTraceMessage($"DataTypePurpose value {nodeSet.Purpose } is not supported by the tool")); } }
private static void Update(IDataTypeFactory nodeDesign, UADataType nodeSet, IUAModelContext modelContext, Action <TraceMessage> traceEvent) { nodeSet.Definition.GetParameters(nodeDesign.NewDefinition(), modelContext, traceEvent); nodeDesign.DataTypePurpose = nodeSet.Purpose.ConvertToDataTypePurpose(); if (nodeSet.Purpose != XML.DataTypePurpose.Normal) { traceEvent(TraceMessage.DiagnosticTraceMessage($"DataTypePurpose value {nodeSet.Purpose } is not supported by the tool")); } }
public DefaultTypeFinder(Assembly seedAssembly, IDataTypeFactory dataTypeFactory) { var typeFinderConduit = new TypeFinderConduit(); var typesCache = new CachedTypesFinder(dataTypeFactory); ITypeFinder genericTypeFinder = new GenericTypeFinder(typesCache, typeFinderConduit, dataTypeFactory); ITypeFinder typeInAssemblyFinder = new TypeInAssemblyFinder(seedAssembly, typesCache, dataTypeFactory); ITypeFinder typeInReferencedAssemblyFinder = new TypeInReferencedAssemblyFinder(seedAssembly, typesCache, typeFinder, dataTypeFactory); typeFinder = new TypeFinder(typesCache, genericTypeFinder, typeInAssemblyFinder, typeInReferencedAssemblyFinder); typeFinderConduit.SetTarget(typeFinder); }
public GenericTypeFinder(ITypesCache typesCache, ITypeFinder typeFinder, IDataTypeFactory dataTypeFactory) { this.typesCache = typesCache; this.typeFinder = typeFinder; this.dataTypeFactory = dataTypeFactory; }
protected override void SetUp() { dataTypeFactory = NewMock<IDataTypeFactory>(); finder = new CachedTypesFinder(dataTypeFactory); }
public CachedTypesFinder(IDataTypeFactory dataTypeFactory) { this.dataTypeFactory = dataTypeFactory; }
private static void Update(IDataTypeFactory nodeDesign, UADataType nodeSet, UAModelContext modelContext, Action <TraceMessage> traceEvent) { nodeSet.Definition.GetParameters(nodeDesign.NewDefinition(), modelContext, traceEvent); }
protected override void SetUp() { dataTypeFactory = NewMock <IDataTypeFactory>(); finder = new CachedTypesFinder(dataTypeFactory); }
protected override void SetUp() { seedAssembly = GetType().Assembly; typeFinder = NewMock<ITypeFinder>(); typesCache = NewMock<ITypesCache>(); dataTypeFactory = NewMock<IDataTypeFactory>(); dataType = NewMock<IDataType>(); }
public void InformationModelIExportDataTypeFactoryFactoryTestMethod2() { IDataTypeFactory _new = m_FactoryBase.AddNodeFactory <IDataTypeFactory>(); Assert.IsNotNull(_new); }
public EntityTemplate(EntityDomain entity, IDataTypeFactory dataTypeFactory) : this(entity, dataTypeFactory, null) { }
public ValueComparer(IDataTypeFactory dataTypeFactory) { Guard.AgainstNull(dataTypeFactory, nameof(dataTypeFactory)); _dataTypeFactory = dataTypeFactory; }