예제 #1
0
        public virtual IEnumerable <PostModel> CreatePostModel(IEnumerable <IDOMElement> serializedData)
        {
            IEnumerable <PostModel> result = null;

            if (serializedData.Any())
            {
                result = XMLGuidePostModeCreator.CreatePostModel(serializedData);
            }

            return(result);
        }
예제 #2
0
        public async Task <IEnumerable <PostModel> > GetContent(Uri expectedUri)
        {
            var expectedPage = DefaultPageCount + (_pageOffsetCount * _pageOffsetMultiplier++);

            IEnumerable <PostModel> result = null;

            var denormalizedData = await GetResourceData(new Uri(expectedUri.AbsoluteUri.TrimEnd(new [] { '/' }) + (expectedPage > 1 ? string.Format("index/page{0}", expectedPage) : "/")), HttpMethodEnum.GET, _mainFunGetData);

            var serializedData = Serialize(denormalizedData);

            if (serializedData.Any())
            {
                result = XMLGuidePostModeCreator.CreatePostModel(serializedData);
            }

#if DEBUG
            File.WriteAllText("C:\\mainfun.html", denormalizedData.ToString());
#endif

            return(result);
        }
예제 #3
0
        private IEnumerable <PostModel> SerializeContent(StringBuilder content, bool firstEnter)
        {
#if DEBUG
            File.WriteAllText("C:\\pikabu.html", content.ToString());
#endif

            IEnumerable <PostModel> result = null;

            if (firstEnter)
            {
                var serializedData = Serialize(content);
                if (serializedData.Any())
                {
                    result = XMLGuidePostModeCreator.CreatePostModel(serializedData);
                }
            }
            else
            {
            }

            return(result);
        }