Bloom.Book.ImageUpdater.UpdateAllHtmlDataAttributesForAllImgElements C# (CSharp) Method

UpdateAllHtmlDataAttributesForAllImgElements() public static method

We mirror several metadata tags in the html for quick access by the UI. This method makes sure they are all up to date.
public static UpdateAllHtmlDataAttributesForAllImgElements ( string folderPath, HtmlDom dom, IProgress progress ) : void
folderPath string
dom HtmlDom
progress IProgress
return void
        public static void UpdateAllHtmlDataAttributesForAllImgElements(string folderPath, HtmlDom dom, IProgress progress)
        {
            //Update the html attributes which echo some of it, and is used by javascript to overlay displays related to
            //whether the info is there or missing or whatever.

            var imgElements = HtmlDom.SelectChildImgAndBackgroundImageElements(dom.RawDom.DocumentElement);
            int completed = 0;
            foreach (XmlElement img in imgElements)
            {
                progress.ProgressIndicator.PercentCompleted = (int)(100.0 * (float)completed / (float)imgElements.Count);
                UpdateImgMetdataAttributesToMatchImage(folderPath, img, progress);
                completed++;
            }
        }