/// <summary> /// Initialises the service description. /// </summary> protected override void Initialise() { base.Initialise(); msvVersion = new SpecVersionDescription(this); maActions = new ActionsDescription(this); msvStateVariables = new StateVariablesDescription(this); }
/// <summary> /// Uses an XML node for this description. /// </summary> /// <param name="reader">The XML reader to use the node from.</param> /// <param name="lastNodeName">The last node name.</param> /// <returns>True if the node was processed false otherwise.</returns> protected override bool UseNode(XmlTextReader reader, string lastNodeName) { if (SpecVersionDescription.IsStartNodeFor(reader)) { msvSpecVersion = new SpecVersionDescription(this, reader); return(true); } else if (DeviceDescription.IsStartNodeFor(reader)) { mdDevice = new DeviceDescription(this, reader); return(true); } return(false); }
/// <summary> /// Gets the root description for a reader. /// </summary> /// <param name="documentURL">The URL for this root description.</param> /// <param name="reader">The XML reader to get the root description from.</param> public RootDescription(string documentURL, XmlTextReader reader) : base(null) { msvSpecVersion = new SpecVersionDescription(this); mdDevice = new DeviceDescription(this); msDocumentURL = documentURL; if (IsStartNodeFor(reader)) { msSchema = reader.GetAttribute("xmlns") ?? String.Empty; ProcessReader(reader); } else throw new InvalidOperationException( string.Format( "The node {0} is not a valid node for {1}", reader.Name, this.GetType().Name)); }
/// <summary> /// Gets the root description for a reader. /// </summary> /// <param name="documentURL">The URL for this root description.</param> /// <param name="reader">The XML reader to get the root description from.</param> public RootDescription(string documentURL, XmlTextReader reader) : base(null) { msvSpecVersion = new SpecVersionDescription(this); mdDevice = new DeviceDescription(this); msDocumentURL = documentURL; if (IsStartNodeFor(reader)) { msSchema = reader.GetAttribute("xmlns") ?? String.Empty; ProcessReader(reader); } else { throw new InvalidOperationException( string.Format( "The node {0} is not a valid node for {1}", reader.Name, this.GetType().Name)); } }
/// <summary> /// Uses an XML node for this description. /// </summary> /// <param name="reader">The XML reader to use the node from.</param> /// <param name="lastNodeName">The last node name.</param> /// <returns>True if the node was processed false otherwise.</returns> protected override bool UseNode(XmlTextReader reader, string lastNodeName) { if (SpecVersionDescription.IsStartNodeFor(reader)) { msvVersion = new SpecVersionDescription(this, reader); return(true); } else if (ActionsDescription.IsStartNodeFor(reader)) { maActions.AddItemsFrom(reader); return(true); } else if (StateVariablesDescription.IsStartNodeFor(reader)) { msvStateVariables.AddItemsFrom(reader); return(true); } return(false); }
/// <summary> /// Uses an XML node for this description. /// </summary> /// <param name="reader">The XML reader to use the node from.</param> /// <param name="lastNodeName">The last node name.</param> /// <returns>True if the node was processed false otherwise.</returns> protected override bool UseNode(XmlTextReader reader, string lastNodeName) { if (SpecVersionDescription.IsStartNodeFor(reader)) { msvVersion = new SpecVersionDescription(this, reader); return true; } else if (ActionsDescription.IsStartNodeFor(reader)) { maActions.AddItemsFrom(reader); return true; } else if (StateVariablesDescription.IsStartNodeFor(reader)) { msvStateVariables.AddItemsFrom(reader); return true; } return false; }
/// <summary> /// Uses an XML node for this description. /// </summary> /// <param name="reader">The XML reader to use the node from.</param> /// <param name="lastNodeName">The last node name.</param> /// <returns>True if the node was processed false otherwise.</returns> protected override bool UseNode(XmlTextReader reader, string lastNodeName) { if (SpecVersionDescription.IsStartNodeFor(reader)) { msvSpecVersion = new SpecVersionDescription(this, reader); return true; } else if (DeviceDescription.IsStartNodeFor(reader)) { mdDevice = new DeviceDescription(this, reader); return true; } return false; }