Exemplo n.º 1
0
        public void ReadUADefinedTypesTestMethod()
        {
            UANodeSet _standard = UANodeSet.ReadUADefinedTypes();

            Assert.IsNotNull(_standard);
            Assert.IsNull(_standard.NamespaceUris);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="AddressSpaceContext" /> class.
        /// </summary>
        /// <param name="traceEvent">Encapsulates an action to trace the progress and validation issues.</param>
        /// <exception cref="System.ArgumentNullException">traceEvent - cannot be null.</exception>
        public AddressSpaceContext(Action <TraceMessage> traceEvent)
        {
            m_TraceEvent     = traceEvent ?? throw new ArgumentNullException("traceEvent");
            m_NamespaceTable = new NamespaceTable();
            m_TraceEvent(TraceMessage.DiagnosticTraceMessage("Entering AddressSpaceContext creator - starting creation the OPC UA Address Space."));
            UANodeSet _standard = UANodeSet.ReadUADefinedTypes();

            m_TraceEvent(TraceMessage.DiagnosticTraceMessage("Address Space - the OPC UA defined has been uploaded."));
            ImportNodeSet(_standard);
            m_TraceEvent(TraceMessage.DiagnosticTraceMessage("Address Space - has bee created successfully."));
        }
Exemplo n.º 3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="AddressSpaceContext" /> class.
        /// </summary>
        /// <param name="traceEvent">Encapsulates an action to trace the progress and validation issues.</param>
        /// <exception cref="System.ArgumentNullException">traceEvent - cannot be null.</exception>
        public AddressSpaceContext(Action <TraceMessage> traceEvent)
        {
            if (traceEvent == null)
            {
                throw new ArgumentNullException("traceEvent");
            }
            m_NamespaceTable = new NamespaceTable(traceEvent);
            m_TraceEvent     = x => { };
            traceEvent(TraceMessage.DiagnosticTraceMessage("Entering AddressSpaceContext creator - starting address space validation."));
            UANodeSet _standard = UANodeSet.ReadUADefinedTypes();

            Debug.Assert(_standard != null);
            traceEvent(TraceMessage.DiagnosticTraceMessage("AddressSpaceContext - uploading the OPC UA defined types."));
            ImportNodeSet(_standard);
            m_TraceEvent = traceEvent;
            m_TraceEvent(TraceMessage.DiagnosticTraceMessage("AddressSpaceContext - has bee created successfully."));
        }