예제 #1
0
파일: PageParser.cs 프로젝트: aocsa/CInca
        public static void NullBytes(LOContent content)
        {
            foreach (var slide in content.lopage.loslide)
            {
                

                if (slide.image_bytes != null)
                {
                    slide.image_bytes = null;

                }

                if (slide.loitemize != null)
                {
                    foreach (var itemize in slide.loitemize.loitem)
                    {
                        if (itemize.image_bytes != null)
                        {
                           

                            itemize.image_bytes = null;
                        }
                    }
                }
            }
        
        }
예제 #2
0
파일: PageParser.cs 프로젝트: aocsa/CInca
        async public static Task DownloadSetBytes(LOContent content)
        {

           await  ProcessSlides(content);
         
        
        
        }
예제 #3
0
파일: PageParser.cs 프로젝트: aocsa/CInca
        async private static Task ProcessSlides(LOContent content)
        {

            CacheService cache = CacheService.Init(SessionService.GetCredentialFileName(), Constants.PreferencesFileName, Constants.LocalDbName);

            

            foreach (var slide in content.lopage.loslide)
            {
                


                bool isUrl = Uri.IsWellFormedUriString(slide.loimage,UriKind.Absolute);

                if (slide.loimage != null && isUrl)
                {
                     var bytesAndPath = await cache.tryGetResource(slide.loimage);


                    //Replace Cloud url with local url
                     //slide.loimage = cachePrefix+bytesAndPath.Item2;

                     slide.image_bytes = bytesAndPath.Item1;


                }

                if (slide.loitemize != null)
                {

                    foreach (var itemize in slide.loitemize.loitem)
                    {
                        if (itemize.loimage != null)
                        {
                            var bytesAndPath = await cache.tryGetResource(itemize.loimage);

                            //Replace Cloud url with local url
                            //itemize.loimage = cachePrefix + bytesAndPath.Item2;

                            itemize.image_bytes = bytesAndPath.Item1;
                        }
                    }

                }

            }
        }