コード例 #1
0
ファイル: SyncCore.cs プロジェクト: ciker/WPYoudaonNote
        private async void InternalDownloadImage(string notePath, HtmlNode imgNode)
        {
            var imgUrl       = imgNode.Attributes["src"].Value;
            var imgUrlSplits = imgUrl.Split('/');
            var fileName     = imgUrlSplits[imgUrlSplits.Length - 1];

            ImageEntity image;
            var         savePath = !ImageDao.ImageExists(fileName, out image)
                ? downloadAndSaveImageToLocal(notePath, imgNode, imgUrl, fileName)
                : image.ImgLocalSavePath;

            // Replace the image's src attribute to local path.
            imgNode.Attributes["src"].Value = savePath;
        }