コード例 #1
0
        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);
        }
コード例 #2
0
 protected override void SetUp()
 {
     typesCache      = NewMock <ITypesCache>();
     typeFinder      = NewMock <ITypeFinder>();
     dataTypeFactory = NewMock <IDataTypeFactory>();
     finder          = new TypeInAssemblyFinder(GetType().Assembly, typesCache, dataTypeFactory);
 }
コード例 #3
0
 protected override void SetUp()
 {
     typesCache = NewMock<ITypesCache>();
     typeFinder = NewMock<ITypeFinder>();
     dataTypeFactory = NewMock<IDataTypeFactory>();
     finder = new TypeInAssemblyFinder(GetType().Assembly, typesCache, dataTypeFactory);
 }
コード例 #4
0
 public TypeInReferencedAssemblyFinder(Assembly seedAssembly, ITypesCache typesCache, ITypeFinder typeFinder,
     IDataTypeFactory dataTypeFactory)
 {
     this.seedAssembly = seedAssembly;
     this.typesCache = typesCache;
     this.typeFinder = typeFinder;
     this.dataTypeFactory = dataTypeFactory;
 }
コード例 #5
0
 public TypeInReferencedAssemblyFinder(Assembly seedAssembly, ITypesCache typesCache, ITypeFinder typeFinder,
                                       IDataTypeFactory dataTypeFactory)
 {
     this.seedAssembly    = seedAssembly;
     this.typesCache      = typesCache;
     this.typeFinder      = typeFinder;
     this.dataTypeFactory = dataTypeFactory;
 }
コード例 #6
0
 protected override void SetUp()
 {
     seedAssembly    = GetType().Assembly;
     typeFinder      = NewMock <ITypeFinder>();
     typesCache      = NewMock <ITypesCache>();
     dataTypeFactory = NewMock <IDataTypeFactory>();
     dataType        = NewMock <IDataType>();
 }
コード例 #7
0
ファイル: Validator.cs プロジェクト: zhangjianqi/OPC-UA-OOI
 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"));
     }
 }
コード例 #8
0
 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"));
     }
 }
コード例 #9
0
        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);
        }
コード例 #10
0
        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);
        }
コード例 #11
0
 public GenericTypeFinder(ITypesCache typesCache, ITypeFinder typeFinder, IDataTypeFactory dataTypeFactory)
 {
     this.typesCache = typesCache;
     this.typeFinder = typeFinder;
     this.dataTypeFactory = dataTypeFactory;
 }
コード例 #12
0
 protected override void SetUp()
 {
     dataTypeFactory = NewMock<IDataTypeFactory>();
     finder = new CachedTypesFinder(dataTypeFactory);
 }
コード例 #13
0
 public CachedTypesFinder(IDataTypeFactory dataTypeFactory)
 {
     this.dataTypeFactory = dataTypeFactory;
 }
コード例 #14
0
 private static void Update(IDataTypeFactory nodeDesign, UADataType nodeSet, UAModelContext modelContext, Action <TraceMessage> traceEvent)
 {
     nodeSet.Definition.GetParameters(nodeDesign.NewDefinition(), modelContext, traceEvent);
 }
コード例 #15
0
 protected override void SetUp()
 {
     dataTypeFactory = NewMock <IDataTypeFactory>();
     finder          = new CachedTypesFinder(dataTypeFactory);
 }
コード例 #16
0
 protected override void SetUp()
 {
     seedAssembly = GetType().Assembly;
     typeFinder = NewMock<ITypeFinder>();
     typesCache = NewMock<ITypesCache>();
     dataTypeFactory = NewMock<IDataTypeFactory>();
     dataType = NewMock<IDataType>();
 }
コード例 #17
0
 public GenericTypeFinder(ITypesCache typesCache, ITypeFinder typeFinder, IDataTypeFactory dataTypeFactory)
 {
     this.typesCache      = typesCache;
     this.typeFinder      = typeFinder;
     this.dataTypeFactory = dataTypeFactory;
 }
コード例 #18
0
        public void InformationModelIExportDataTypeFactoryFactoryTestMethod2()
        {
            IDataTypeFactory _new = m_FactoryBase.AddNodeFactory <IDataTypeFactory>();

            Assert.IsNotNull(_new);
        }
コード例 #19
0
 public EntityTemplate(EntityDomain entity, IDataTypeFactory dataTypeFactory)
     : this(entity, dataTypeFactory, null)
 {
 }
コード例 #20
0
 public CachedTypesFinder(IDataTypeFactory dataTypeFactory)
 {
     this.dataTypeFactory = dataTypeFactory;
 }
コード例 #21
0
        public ValueComparer(IDataTypeFactory dataTypeFactory)
        {
            Guard.AgainstNull(dataTypeFactory, nameof(dataTypeFactory));

            _dataTypeFactory = dataTypeFactory;
        }