Пример #1
0
        private AdferoVideoOutput GetVideoOutputFromXmlString(string xml)
        {
            AdferoVideoOutput videoOutput = new AdferoVideoOutput();
            XmlDocument       doc         = new XmlDocument();

            doc.LoadXml(xml);

            foreach (XmlNode n in doc.SelectNodes("//videoOutput/node()"))
            {
                switch (n.Name)
                {
                case "id":
                    videoOutput.Id = int.Parse(n.InnerText);
                    break;

                case "type":
                    videoOutput.Type = n.InnerText;
                    break;

                case "width":
                    videoOutput.Width = int.Parse(n.InnerText);
                    break;

                case "height":
                    videoOutput.Height = int.Parse(n.InnerText);
                    break;

                case "path":
                    videoOutput.Path = n.InnerText;
                    break;

                default:
                    break;
                }
            }

            return(videoOutput);
        }
        private AdferoVideoOutput GetVideoOutputFromXmlString(string xml)
        {
            AdferoVideoOutput videoOutput = new AdferoVideoOutput();
            XmlDocument doc = new XmlDocument();
            doc.LoadXml(xml);

            foreach (XmlNode n in doc.SelectNodes("//videoOutput/node()"))
            {
                switch (n.Name)
                {
                    case "id":
                        videoOutput.Id = int.Parse(n.InnerText);
                        break;

                    case "type":
                        videoOutput.Type = n.InnerText;
                        break;

                    case "width":
                        videoOutput.Width = int.Parse(n.InnerText);
                        break;

                    case "height":
                        videoOutput.Height = int.Parse(n.InnerText);
                        break;

                    case "path":
                        videoOutput.Path = n.InnerText;
                        break;

                    default:
                        break;
                }
            }

            return videoOutput;
        }