public override void DoWork() { try { string str = CachingProvider.Instance().PurgeCache(); ScheduleHistoryItem.Succeeded = true; //REQUIRED ScheduleHistoryItem.AddLogNote(str); } catch (Exception exc) //REQUIRED { ScheduleHistoryItem.Succeeded = false; //REQUIRED ScheduleHistoryItem.AddLogNote(string.Format("Purging cache task failed: {0}.", exc.ToString())); //notification that we have errored Errored(ref exc); //REQUIRED //log the exception Exceptions.Exceptions.LogException(exc); //OPTIONAL } }
// dynamically create provider private static void CreateProvider() { objProvider = (CachingProvider)Reflection.CreateObjectNotCached( "caching" ); }
// dynamically create provider private static void CreateProvider() { objProvider = (CachingProvider)Reflection.CreateObjectNotCached("caching"); }