Ejemplo n.º 1
0
        public void OnRemovePageCompleted(string pageId)
        {
            var tocId = WebViewManager.ExtractTocIdFromDivId(pageId);
            var tag   = webView.Tag as JavaObjWrapper <WebViewTag>;

            if (tag.Value.TOCIdList != null)
            {
                tag.Value.TOCIdList.RemoveAll(id => id == tocId);
            }
        }
Ejemplo n.º 2
0
        public void OnScrollLoadPageCompleted(string addedPageId, string removedPagedIdList)
        {
            Android.Util.Log.Debug("dbg", "Added Page: " + addedPageId);
            Android.Util.Log.Debug("dbg", "Removed Page: " + removedPagedIdList);

            var tocId = WebViewManager.ExtractTocIdFromDivId(addedPageId);
            var tag   = webView.Tag as JavaObjWrapper <WebViewTag>;

            if (tag == null)
            {
                return;
            }

            if (tag.Value.TOCIdList != null)
            {
                if (tag.Value.TOCIdList.FindIndex(id => id == tocId) < 0)
                {
                    tag.Value.TOCIdList.Add(tocId);
                }
            }

            if (removedPagedIdList != null && tag.Value.TOCIdList != null)
            {
                var pageIds = removedPagedIdList.Split(new [] { ';' }, StringSplitOptions.RemoveEmptyEntries);
                foreach (var id in pageIds)
                {
                    tocId = WebViewManager.ExtractTocIdFromDivId(id);
                    tag.Value.TOCIdList.Remove(tocId);
                }
            }

            if (onScrollLoadPageCompleted != null)
            {
                onScrollLoadPageCompleted(addedPageId);
            }
        }