Exemplo n.º 1
0
        public static DocSets GetDocSets(string culture, string docPath)
        {
            DocSets result          = null;
            int     firstSlashIndex = docPath.IndexOf("/");

            if (firstSlashIndex < 0)
            {
                return(null);
            }
            string productCategory    = docPath.Substring(0, firstSlashIndex);
            string docPathTrimProduct = docPath.Substring(firstSlashIndex + 1);

            result = GetCachedDocSets(culture, productCategory);
            if (result == null)
            {
                string docSetFilePath = productCategory + "/DocSets.xml";
                string docSetContent  = BlobManager.ReadContent(blobConnectString, docBlobContainer, culture, docSetFilePath);

                if (docSetContent != null)
                {
                    result = XmlReader.GetOject <DocSets>(docSetContent);
                    if (result != null)
                    {
                        CacheDocSets(culture, productCategory, result);
                    }
                }
            }
            return(result);
        }
Exemplo n.º 2
0
        public static void ClearDocSetsCache(string culture, string productCategory)
        {
            string  key    = culture + "_" + productCategory;
            DocSets result = null;

            docSetsDic.TryRemove(key, out result);
        }
Exemplo n.º 3
0
        private static void CacheDocSets(string culture, string productCategory, DocSets docSets)
        {
            string key = culture + "_" + productCategory;

            if (!docSetsDic.ContainsKey(key))
            {
                docSetsDic.TryAdd(key, docSets);
            }
        }