Пример #1
0
 private static HrefLookup GetHrefLookupConfig(FileInfo fileInfo, HrefLookup result)
 {
     try
     {
         lock (ObjectLock)
         {
             using (var reader = new StreamReader(fileInfo.FullName))
             {
                 var contents = reader.ReadToEnd();
                 if (contents != string.Empty)
                 {
                     result = new HrefLookup(contents);
                 }
             }
         }
     }
     catch (Exception)
     {
         //allow a try on next user
         CacheMemory.ClearMenu();
         CacheMemory.ClearCmsCache();
         result = new HrefLookup();
     }
     return(result);
 }
Пример #2
0
        public IResponseBase Execute(IRequestParameter parameters)
        {
            if (EnvironmentHelper.IsProd())
            {
                //sets Icore middle ware to shutdown on response.
                //regardless of the return value.
                CacheMemory.ClearMenu();
                _core.Context.Response.StatusCode = (int)HttpStatusCode.Unauthorized;
                _core.Context.Response.Close();
            }
            else
            {
                CacheMemory.ClearCmsCache();
            }
            var result = new Response <EmptyRequest> {
                resultset = new EmptyRequest()
            };

            return(result);
        }