示例#1
0
        private AdferoVideoOutputList ListVideoOutputsForArticle(int articleId, int offset, int limit, string[] properties, string[] fields)
        {
            string uri = this.GetUri(articleId, "articleId", "xml", properties, fields, offset, limit);

            uri = string.Format("http://{0}:{1}@{2}", this.credentials.PublicKey, this.credentials.SecretKey, uri.Replace("http://", string.Empty));
            string xml = AdferoArticles.AdferoHelpers.GetXmlFromUri(uri);

            AdferoVideoOutputList videoOutputs = this.ListVideoOutputsFromXmlString(xml);

            videoOutputs.Limit  = limit;
            videoOutputs.Offset = offset;

            return(videoOutputs);
        }
示例#2
0
        private AdferoVideoOutputList ListVideoOutputsFromXmlString(string xml)
        {
            XmlDocument doc = new XmlDocument();

            doc.LoadXml(xml);
            int totalCount = int.Parse(doc.SelectSingleNode("//videoOutputs").Attributes["totalCount"].Value);
            AdferoVideoOutputList videoOutputs = new AdferoVideoOutputList();

            videoOutputs.TotalCount = totalCount;

            foreach (XmlNode n in doc.SelectNodes("//videoOutputs/videoOutput"))
            {
                foreach (XmlNode na in n.SelectNodes("id"))
                {
                    AdferoVideoOutputListItem videoOutput = new AdferoVideoOutputListItem();
                    videoOutput.Id = int.Parse(na.InnerText);
                    videoOutputs.Items.Add(videoOutput);
                }
            }

            return(videoOutputs);
        }
        private AdferoVideoOutputList ListVideoOutputsFromXmlString(string xml)
        {
            XmlDocument doc = new XmlDocument();
            doc.LoadXml(xml);
            int totalCount = int.Parse(doc.SelectSingleNode("//videoOutputs").Attributes["totalCount"].Value);
            AdferoVideoOutputList videoOutputs = new AdferoVideoOutputList();
            videoOutputs.TotalCount = totalCount;

            foreach (XmlNode n in doc.SelectNodes("//videoOutputs/videoOutput"))
            {
                foreach (XmlNode na in n.SelectNodes("id"))
                {
                    AdferoVideoOutputListItem videoOutput = new AdferoVideoOutputListItem();
                    videoOutput.Id = int.Parse(na.InnerText);
                    videoOutputs.Items.Add(videoOutput);
                }
            }

            return videoOutputs;
        }