/// <summary>
        /// extract base orchestration Module properties - ServiceModel, Core, etc.
        /// This is done at this level instead of the base object due to the fact that we have to pull things out of the base orch at the top level, instead of at the 
        /// <see cref="XmlNode"/> level, which is done from the <c>ServiceDeclaration</c> level on down
        /// </summary>
        private void GetModuleProperties()
        {
            try
            {
#if reader
                _reader.MoveToContent();
                MajorVersion = Convert.ToSByte(_reader.GetAttribute("MajorVersion"));
                MinorVersion = Convert.ToSByte(_reader.GetAttribute("MinorVersion"));
                Core = new Guid(_reader.GetAttribute("Core"));
                ScheduleModel = new Guid(_reader.GetAttribute("ScheduleModel"));

                //"inner" properties (Module)
                _reader.ReadToDescendant("om:Element");

                _oid = new Guid(_reader.GetAttribute("OID"));

                while (_reader.Read())
                {
                    if (!_reader.HasAttributes)
                        break;
                    if (_reader.Name.Equals("om:Property"))
                        GetReaderProperties(_reader.GetAttribute("Name"), _reader.GetAttribute("Value"));
                    else if (_reader.Name.Equals("om:Element"))
                    {
                        if (_reader.GetAttribute("Type").Equals("PortType"))
                            _portTypes.Add(new BtsPortType(_reader.ReadSubtree()));
                        else if (_reader.GetAttribute("Type").Equals("PrintElement"))
                        {
                            //move the reader forward
                            var r = _reader.ReadSubtree();
                            r.Read();
                            r.Close();                            
                        }
                        else if (_reader.GetAttribute("Type").Equals("ServiceDeclaration"))
                            ServiceDeclaration = new BtsServiceDeclaration(_reader.ReadSubtree());
                        else if (_reader.GetAttribute("Type").Equals("MultipartMessageType"))
                            _mmmsgTypes.Add(new BtsMultiPartMessageType(_reader.ReadSubtree()));
                        else if (_reader.GetAttribute("Type").Equals("CorrelationType"))
                            _corrTypes.Add(new BtsCorrelationType(_reader.ReadSubtree()));
                        else if (_reader.GetAttribute("Type").Equals("ServiceLinkType"))
                            _svcLinkTypes.Add(new BtsServiceLinkType(_reader.ReadSubtree()));
                        else if (_reader.GetAttribute("Type").Equals("TargetXMLNamespaceAttribute"))
                            XmlAttribute = new BtsTargetXmlAttribute(_reader.ReadSubtree());
                        else if (_reader.GetAttribute("Type").Equals("MethodMessageType"))
                            _msgTypes.Add(new BtsMethodMessageType(_reader.ReadSubtree()));
                        else
                        {
                            Debug.WriteLine("[BtsOrch.GetModuleProperties] unhandled element " +
                                            _reader.GetAttribute("Type") + " received (needs implementation)");
                            Debugger.Break();
                        }
                    }
                    else
                        continue; //what else could we possibly expect??
                }
#endif
            }
            catch (Exception)
            {
#if DEBUG
                Debugger.Break();
#endif
            }
        }
Esempio n. 2
0
        public BtsServiceDeclaration(XmlReader reader)
            : base(reader)
        {
            while (reader.Read())
            {
                if (!reader.HasAttributes)
                {
                    continue;
                }

                if (reader.Name.Equals("om:Property"))
                {
                    GetReaderProperties(reader.GetAttribute("Name"), reader.GetAttribute("Value"));
                }
                else if (reader.Name.Equals("om:Element"))
                {
                    string attr = reader.GetAttribute("Type");
                    if (attr.Equals("ServiceBody"))
                    {
                        _svcBody = new BtsServiceBody(reader.ReadSubtree());
                    }
                    else if (attr.Equals("PortDeclaration"))
                    {
                        _portDecs.Add(new BtsPortDeclaration(reader.ReadSubtree()));
                    }
                    else if (attr.Equals("CorrelationDeclaration"))
                    {
                        _corrDecs.Add(new BtsCorrelationDeclaration(reader.ReadSubtree()));
                    }
                    else if (attr.Equals("MessageDeclaration"))
                    {
                        _msgDecs.Add(new BtsMessageDeclaration(reader.ReadSubtree()));
                    }
                    else if (attr.Equals("VariableDeclaration"))
                    {
                        _varDecs.Add(new BtsVariableDeclaration(reader.ReadSubtree()));
                    }
                    else if (attr.Equals("LongRunningTransaction"))
                    {
                        _tx = new BtsLongRunningTx(reader.ReadSubtree());
                    }
                    else if (attr.Equals("AtomicTransaction"))
                    {
                        _tx = new BtsAtomicTx(reader.ReadSubtree());
                    }
                    else if (attr.Equals("TransactionAttribute"))
                    {
                        _txAtt = new BtsTransactionAttribute(reader.ReadSubtree());
                    }
                    else if (attr.Equals("Compensation"))
                    {
                        _comp = new BtsCompensation(reader.ReadSubtree());
                    }
                    else if (attr.Equals("ServiceLinkDeclaration"))
                    {
                        _sld = new BtsServiceLinkDeclaration(reader.ReadSubtree());
                    }
                    else if (attr.Equals("TargetXMLNamespaceAttribute"))
                    {
                        _target = new BtsTargetXmlAttribute(reader.ReadSubtree());
                    }
                    else
                    {
                        Debug.WriteLine("[BtsServiceDeclaration.ctor] unhandled element " + reader.GetAttribute("Type") +
                                        "!!!!");
                        Debugger.Break();
                    }
                }
            }
            reader.Close();
        }