Esempio n. 1
0
        private static MylistGroupDetail ParseMylistGroupDetailXml(string xml)
        {
            var serializer = new XmlSerializer(typeof(MylistGroupResponse));

            MylistGroupResponse response = null;

            using (var stream = new StringReader(xml))
            {
                response = (MylistGroupResponse)serializer.Deserialize(stream);
            }

            return(response.Mylistgroup);
        }
Esempio n. 2
0
        /// <summary>マイリストグループを取得するストリームを取得する、現在は自分のマイリストグループのみ、ユーザー指定は無視される</summary>
        public Streams <MylistGroupResponse> OpenMylistGroupDownloadStreams()
        {
            var streamDataList         = new List <StreamData>();
            MylistGroupResponse result = null;

            streamDataList.Add(
                new StreamData()
            {
                StreamType  = StreamType.Read,
                GetStream   = () => context.Client.OpenDownloadStream(ApiUrls.GetMylistGroup),
                SetReadData = (data) =>
                {
                    var serialize = new DataContractJsonSerializer(typeof(Serial.GetMylistGroup.Contract));
                    result        = converter.ConvertMylistGroupResponse((Serial.GetMylistGroup.Contract)serialize.ReadObject(new MemoryStream(data)));
                },
            });

            return(new Streams <MylistGroupResponse>(
                       streamDataList.ToArray(),
                       () => result));
        }