Example #1
0
        /// <summary>
        /// 公開マイリスト一覧を取得する
        /// </summary>
        public Session<Response<Mylist.Mylist[]>> DownloadPublicMylistList()
        {
            var session = new Session<Response<Mylist.Mylist[]>>();
            var accessorList = new List<Func<byte[], APIs.IAccesser>>();

            if (!htmlMylistCache.IsAvailab)
                accessorList.Add(
                    (data) =>
                    {
                        var accesser = new APIs.user_mylist_page_html.Accesser();
                        accesser.Setting(
                            context.CookieContainer,
                            target.ID);

                        return accesser;
                    });

            session.SetAccessers(
                accessorList.ToArray(),
                (data) =>
                {
                    var parser = new APIs.user_mylist_page_html.Parser();

                    if (data != null)
                        htmlMylistCache.Value = parser.Parse(data);

                    return Converter.PublicMylistListResponse(context, parser.Parse(htmlMylistCache));
                });

            return session;
        }
Example #2
0
        /// <summary>
        /// 公開マイリスト一覧を取得する
        /// </summary>
        public Session <Response <Mylist.Mylist[]> > DownloadPublicMylistList()
        {
            return(new Session <Response <Mylist.Mylist[]> >((flow) =>
            {
                var parser = new APIs.user_mylist_page_html.Parser();

                if (!htmlMylistCache.IsAvailab)
                {
                    var accessor = new APIs.user_mylist_page_html.Accessor();
                    accessor.Setting(
                        context.CookieContainer,
                        target.ID);
                    flow.Return(accessor);

                    htmlMylistCache.Value = parser.Parse(flow.GetResult());
                }

                return Converter.PublicMylistListResponse(context, parser.Parse(htmlMylistCache));
            }));
        }