/// <summary> /// Saves the attributes from the stream. /// </summary> /// <param name="context">The context for the system being accessed.</param> /// <param name="encoder">The encoder wrapping the stream to write.</param> public override void Save(ISystemContext context, XmlEncoder encoder) { base.Save(context, encoder); encoder.PushNamespace(Namespaces.OpcUaXsd); if (m_dataTypeDefinition != null) { encoder.WriteExtensionObject("DataTypeDefinition", m_dataTypeDefinition); } encoder.PopNamespace(); }
public void EncodeExampleTestMethod() { //define an instance of our class object, defined above. simpleClass mySimpleClassInstance1 = new simpleClass("String", int.MaxValue, DateTime.Now); //define an object that will encapsulate/extend our simple instance above ExtensionObject extendedSimpleClassInstance = new ExtensionObject(mySimpleClassInstance1); //TODO EncodeExampleUnitTest - fix Inconclusive #41 //encode our class object into the stream Assert.Inconclusive("XmlEncoder must be initialized see UANodeSet.CreateDecoder"); using (XmlEncoder uaEncoderInstance = new XmlEncoder(null)) uaEncoderInstance.WriteExtensionObject("Extended1", extendedSimpleClassInstance); }