Exemplo n.º 1
0
        public static List <ServiceTO> ReadSiblings(XmlReader reader)
        {
            List <ServiceTO> list = new List <ServiceTO>();

            /*
             * true if a matching descendant element is found; otherwise false.
             * If a matching child element is not found, the XmlReader is positioned
             * on the end tag (NodeType is XmlNodeType.EndElement) of the element.
             * If the XmlReader is not positioned on an element when ReadToDescendant
             * was called, this method returns false and the position of the XmlReader
             * is not changed.
             */
            bool found = reader.ReadToDescendant(ServiceTO.SERVICE);

            if (found)
            {
                do
                {
                    ServiceTO service = new ServiceTO(new List <PropTO>());
                    service.setProps(PropTO.ReadSiblings(reader));
                    list.Add(service);
                } while (reader.ReadToNextSibling(ServiceTO.SERVICE));
            }

            return(list);
        }
Exemplo n.º 2
0
 public void addService(ServiceTO serviceTO)
 {
     if (this.serviceTOs == null)
     {
         this.serviceTOs = new List <ServiceTO>();
     }
     this.serviceTOs.Add(serviceTO);
 }
Exemplo n.º 3
0
        public ServiceTO(ServiceTO service)
        {
            this.propTOs = new List <PropTO>();
            if (service == null)
            {
                return;
            }

            PropTO pp = service.getProp(PropTO.KEY_TASKTYPE);

            if (pp != null)
            {
                addProp(pp);
            }

            pp = service.getProp(PropTO.KEY_TASK);
            if (pp != null)
            {
                addProp(pp);
            }

            pp = service.getProp(PropTO.KEY_RESULTENCODING);
            if (pp != null)
            {
                addProp(pp);
            }

            pp = service.getProp(PropTO.KEY_RESULTMIME);
            if (pp != null)
            {
                addProp(pp);
            }

            List <PropTO> pc = service.getProps();

            foreach (PropTO p in pc)
            {
                if (p.GetKey().StartsWith(PropTO.KEY_BOUNCE))
                {
                    this.propTOs.Add(p);
                }
            }
        }
Exemplo n.º 4
0
        public static ServiceTO parse(string xml)
        {
            ServiceTO service = org.xmlBlaster.util.Serialization.DeserializeStr <ServiceTO>(xml);

            return(service);
        }
Exemplo n.º 5
0
 public void ReadXml(XmlReader reader)
 {
     //reader.ReadToFollowing(SERVICES);
     this.serviceTOs = ServiceTO.ReadSiblings(reader);
 }
Exemplo n.º 6
0
 public ServiceListTO(ServiceTO serviceTO)
 {
     addService(serviceTO);
 }