Exemplo n.º 1
0
        /// <summary>
        /// Loads the HTML for the named view.
        /// </summary>
        /// <param name="name">The name.</param>
        /// <returns></returns>
        public async Task <string> LoadAsync(string name)
        {
            var value = cache.Read(name);

            if (value == null)
            {
                value = await inner.LoadAsync(name);

                cache.Write(name, value);
            }
            return(value);
        }
Exemplo n.º 2
0
 static string LoadResourceString(string name)
 {
     string value = cache.Read(name);
     if (value == null)
     {
         var assembly = typeof(AssetManager).Assembly;
         using (var sr = new StreamReader(assembly.GetManifestResourceStream(name)))
         {
             value = sr.ReadToEnd();
             cache.Write(name, value);
         }
     }
     return value;
 }