//protected virtual void CreateHeaderWebDataPageManager_v1(XElement xe)
        //{
        //    _headerDataPageManager = new WebDataPageManager<THeaderData>();

        //    _headerDataPageManager.WebLoadDataManager = new WebLoadDataManager<IEnumDataPages<THeaderData>>();
        //    UrlCache urlCache = UrlCache.Create(xe);
        //    if (urlCache != null)
        //    {
        //        urlCache.GetUrlSubDirectory = GetHeaderPageCacheUrlSubDirectory;
        //        _headerDataPageManager.WebLoadDataManager.UrlCache = urlCache;
        //    }

        //    _headerDataPageManager.WebLoadDataManager.InitLoadFromWeb = InitLoadFromWeb;
        //    _headerDataPageManager.WebLoadDataManager.GetHttpRequestParameters = GetHttpRequestParameters;
        //    _headerDataPageManager.WebLoadDataManager.GetData = GetHeaderPageData;
        //    _headerDataPageManager.GetKeyFromHttpRequest = GetHeaderKey;

        //    _headerDataPageManager.DocumentStore = MongoDocumentStore<IEnumDataPages<THeaderData>>.Create(xe);
        //    if (_headerDataPageManager.DocumentStore != null)
        //        _headerDataPageManager.DocumentStore.NominalType = _headerPageNominalType;

        //    _headerDataPageManager.GetHttpRequestPageFunction = GetHttpRequestPage;
        //}

        protected virtual void CreateDetailWebDataManager(XElement xe)
        {
            _detailDataManager = new WebDataManager_v4 <TDetailData>();
            //_detailDataManager.Version = xe.zXPathValue("Version").zTryParseAs(1);

            UrlCache urlCache = UrlCache.Create(xe);

            if (urlCache != null)
            {
                urlCache.GetUrlSubDirectory = GetDetailCacheUrlSubDirectory;
            }

            _detailDataManager.WebLoadDataManager = new WebLoadDataManager_v2 <TDetailData>();
            _detailDataManager.WebLoadDataManager.TraceException  = true;
            _detailDataManager.WebLoadDataManager.UrlCache        = urlCache;
            _detailDataManager.WebLoadDataManager.InitLoadFromWeb = InitLoadFromWeb;
            _detailDataManager.WebLoadDataManager.GetData         = GetDetailData;
            SetHttpRequestParameters(_detailDataManager.WebLoadDataManager.RequestParameters);

            _detailDataManager.GetKeyFromHttpRequest = GetDetailKey;
            //_detailDataManager.LoadImages = LoadDetailImages;

            //if (_detailDataManager.Version < 3)
            //{
            //    _detailDataManager.DocumentStore = MongoDocumentStore<TDetailData>.Create(xe);
            //}
            //else
            //{
            _detailDataManager.DataStore = MongoDataStore.Create(xe);
            MongoDataSerializer <TDetailData> dataSerializer = new MongoDataSerializer <TDetailData>();

            dataSerializer.ItemName           = xe.zXPathValue("MongoDocumentItemName");
            _detailDataManager.DataSerializer = dataSerializer;
            //}

            UrlCache imageUrlCache = UrlCache.Create(xe.zXPathElement("Image"));

            //if (imageUrlCache != null)
            //{
            //    //imageUrlCache.GetUrlSubDirectory = GetDetailImageCacheUrlSubDirectory;
            //    //_detailDataManager.WebImageCacheManager = new WebImageCacheManager_v2(imageUrlCache);

            //    //_detailDataManager.WebImageCacheManager = new WebImageCacheManager_v3(imageUrlCache);
            //    //_detailDataManager.WebImageCacheManager.TraceException = true;
            //    //_detailDataManager.GetImageSubDirectory = GetDetailImageCacheUrlSubDirectory;
            //}

            _detailDataManager.WebLoadImageManager = new WebLoadImageManager_v2 <TDetailData>();
            if (imageUrlCache != null)
            {
                _detailDataManager.WebLoadImageManager.WebImageCacheManager = new WebImageCacheManager_v3(imageUrlCache);
                _detailDataManager.WebLoadImageManager.WebImageCacheManager.TraceException = true;
                //_detailDataManager.WebLoadImageManager.GetImageSubDirectory = GetDetailImageCacheUrlSubDirectory;
                _detailDataManager.GetImageSubDirectory = GetDetailImageCacheUrlSubDirectory;
            }
        }
        protected virtual void CreateHeaderWebDataPageManager(XElement xe)
        {
            _headerDataPageManager = new WebDataPageManager_v4 <THeaderData>();

            UrlCache urlCache = UrlCache.Create(xe);

            if (urlCache != null)
            {
                urlCache.GetUrlSubDirectory = GetHeaderPageCacheUrlSubDirectory;
            }
            //Trace.WriteLine($"WebHeaderDetailMongoManagerBase_v2<THeaderData, TDetailData>.CreateHeaderWebDataPageManager() : {(urlCache != null ? "urlCache created" : "no urlCache")}");

            _headerDataPageManager.WebLoadDataManager = new WebLoadDataManager_v2 <IEnumDataPages <THeaderData> >();
            _headerDataPageManager.WebLoadDataManager.TraceException  = true;
            _headerDataPageManager.WebLoadDataManager.UrlCache        = urlCache;
            _headerDataPageManager.WebLoadDataManager.InitLoadFromWeb = InitLoadFromWeb;
            _headerDataPageManager.WebLoadDataManager.GetData         = GetHeaderPageData;
            //_headerDataPageManager.WebLoadDataManager.GetHttpRequestParameters = GetHttpRequestParameters;
            SetHttpRequestParameters(_headerDataPageManager.WebLoadDataManager.RequestParameters);
            _headerDataPageManager.GetKeyFromHttpRequest = GetHeaderKey;

            //_headerDataPageManager.DocumentStore = MongoDocumentStore<IEnumDataPages<THeaderData>>.Create(xe);
            //if (_headerDataPageManager.DocumentStore != null)
            //    _headerDataPageManager.DocumentStore.NominalType = _headerPageNominalType;

            _headerDataPageManager.DataStore = MongoDataStore.Create(xe);
            MongoDataSerializer <IEnumDataPages <THeaderData> > dataSerializer = new MongoDataSerializer <IEnumDataPages <THeaderData> >();

            dataSerializer.ItemName               = xe.zXPathValue("MongoDocumentItemName");
            dataSerializer.NominalType            = _headerPageNominalType;
            _headerDataPageManager.DataSerializer = dataSerializer;

            UrlCache imageUrlCache = UrlCache.Create(xe.zXPathElement("Image"));

            _headerDataPageManager.WebLoadImageManager = new WebLoadImageManager_v2 <IEnumDataPages <THeaderData> >();
            if (imageUrlCache != null)
            {
                _headerDataPageManager.WebLoadImageManager.WebImageCacheManager = new WebImageCacheManager_v3(imageUrlCache);
                _headerDataPageManager.WebLoadImageManager.WebImageCacheManager.TraceException = true;
                //_headerDataPageManager.WebLoadImageManager.GetImageSubDirectory = GetHeaderImageCacheUrlSubDirectory;
                _headerDataPageManager.GetImageSubDirectory = GetHeaderImageCacheUrlSubDirectory;
            }

            _headerDataPageManager.GetHttpRequestPageFunction = GetHttpRequestPage;
        }