public SignalModelLibrary( Stream inputStream )
{
var xmlDocument = new XmlDocument();
var sr = new StreamReader( inputStream );
_xmlContent = sr.ReadToEnd();
if (String.IsNullOrEmpty( _xmlContent ))
throw new Exception( "Empty Input Document" );
_xmlContent = _xmlContent.Trim();
xmlDocument.LoadXml( _xmlContent );
_tsfLibrary = TSFLibrary.Deserialize( _xmlContent );
foreach (TSFType tsfType in _tsfLibrary.TSF)
{
string defaultSchema;
string modelXml;
string interfaceSchema = getInterface( xmlDocument, tsfType.name, out defaultSchema, out modelXml );
if (string.IsNullOrEmpty( defaultSchema ))
if (xmlDocument.DocumentElement != null && xmlDocument.DocumentElement.Attributes[XMLNS] != null)
defaultSchema = xmlDocument.DocumentElement.Attributes[XMLNS].Value;
var model = new SignalModel(
tsfType,
_tsfLibrary.targetNamespace,
defaultSchema,
interfaceSchema,
modelXml,
xmlDocument );
SetSignalModel( tsfType.name, model );
}
}