public void PerformWork(WorkWithPayload luceneWork) { if (luceneWork.Work is AddLuceneWork) PerformWork((AddLuceneWork) luceneWork.Work, luceneWork.Provider); else if (luceneWork.Work is DeleteLuceneWork) PerformWork((DeleteLuceneWork) luceneWork.Work, luceneWork.Provider); else if (luceneWork.Work is OptimizeLuceneWork) PerformWork((OptimizeLuceneWork) luceneWork.Work, luceneWork.Provider); else if (luceneWork.Work is PurgeAllLuceneWork) PerformWork((PurgeAllLuceneWork) luceneWork.Work, luceneWork.Provider); else throw new AssertionFailure("Unknown work type: " + luceneWork.GetType()); }
public void PerformWork(WorkWithPayload luceneWork) { if (luceneWork.Work is AddLuceneWork) { PerformWork((AddLuceneWork)luceneWork.Work, luceneWork.Provider); } else if (luceneWork.Work is DeleteLuceneWork) { PerformWork((DeleteLuceneWork)luceneWork.Work, luceneWork.Provider); } else if (luceneWork.Work is OptimizeLuceneWork) { PerformWork((OptimizeLuceneWork)luceneWork.Work, luceneWork.Provider); } else if (luceneWork.Work is PurgeAllLuceneWork) { PerformWork((PurgeAllLuceneWork)luceneWork.Work, luceneWork.Provider); } else { throw new AssertionFailure("Unknown work type: " + luceneWork.GetType()); } }
public void PerformWork(WorkWithPayload luceneWork) { switch (luceneWork.Work) { case AddLuceneWork addWork: PerformWork(addWork, luceneWork.Provider); break; case DeleteLuceneWork deleteWork: PerformWork(deleteWork, luceneWork.Provider); break; case OptimizeLuceneWork optimizeWork: PerformWork(optimizeWork, luceneWork.Provider); break; case PurgeAllLuceneWork purgeWork: PerformWork(purgeWork, luceneWork.Provider); break; default: throw new AssertionFailure("Unknown work type: " + luceneWork.GetType()); } }