ATML1671Allocator.allocator.ATMLAllocator.LoadXML C# (CSharp) Метод

LoadXML() публичный Метод

public LoadXML ( string xmlDocument ) : void
xmlDocument string
Результат void
        public void LoadXML( string xmlDocument )
        {
            try
            {
                _xmlDocument = xmlDocument;
                XNamespace ad = "urn:IEEE-1671.1:2009:TestDescription";
                _document = XDocument.Load( new StringReader( _xmlDocument ) );

                _testDescription = TestDescription.Deserialize( _xmlDocument );

                _sources.AddRange( _document.Descendants( ad + "Source" ) );
                _sensors.AddRange( _document.Descendants( ad + "Sensor" ) );
                _monitors.AddRange( _document.Descendants( ad + "Monitor" ) );

                foreach (SignalRequirementsSignalRequirement signalRequirement in _testDescription.SignalRequirements)
                {
                    _requiredSignals.Add( signalRequirement.TsfClass );
                }

                foreach (ActionType action in _testDescription.DetailedTestInformation.Actions)
                {
                    var operations = action.Behavior.Item as Operations1;
                    if (operations != null)
                    {
                        foreach (OperationType operation in operations.Operation)
                        {
                            var setup = operation as OperationSetup;
                            if (setup != null)
                            {
                                var source = setup.Item as OperationSetupSource;
                                if (source != null)
                                {
                                    LogManager.SourceTrace(ATMLAllocator.SOURCE, HttpUtility.HtmlEncode(source.Any.InnerXml.Trim()));
                                    XElement signal = XElement.Parse( source.Any.InnerXml.Trim() );
                                    LogManager.SourceTrace(ATMLAllocator.SOURCE, "{0}:{1}", signal.GetPrefixOfNamespace(signal.Name.Namespace),
                                                      signal.Name.NamespaceName );
                                }
                            }
                        }
                    }
                }
                OnTestDescriptionChanged( _testDescription );
            }
            catch (Exception e)
            {
                LogManager.SourceError(ATMLAllocator.SOURCE, e);
            }
        }