private bool indexExist() { EventLogFile log = new EventLogFile(); if (log.VerifyLog("indexLog")) { if (log.EntryCount > 0) { if (!log.ReadLastEntry().Equals("deleted")) { return(true); } else { return(false); } } else { return(false); } } else { return(false); } }
public bool verfiyIndex() { try { EventLogFile log = new EventLogFile(); //log.DeleteLog(); //log.RemoveSource(); if (!indexExist()) { if (!log.VerifyLog("indexLog")) { log.CreateLog(); } return(true); } else { string message = "There was Another Indexing Operation performed Before. Do you want to Delete current Index files and perform a new indexing Operation?"; string caption = "Index Files Exist"; MessageBoxButtons buttons = MessageBoxButtons.YesNo; DialogResult result; result = MessageBox.Show(message, caption, buttons, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1, MessageBoxOptions.ServiceNotification); if (result == DialogResult.Yes) { if (Directory.Exists(oldIndexDirPath())) { Directory.Delete(oldIndexDirPath(), true); } return(true); } return(false); } } catch (Exception ee) { MessageBox.Show(ee.Message); return(false); } }