public void Close()
 {
     if (ErrorWriter == null)
         return;
     bool haveMutex = ErrorWriter.GetFileAccessMutex(1000);
     if (!haveMutex)
         SystemServices.LogMessage("ErrorLogger", "Close - Cannot acquire mutex", LogEntryType.ErrorMessage);
     ErrorWriter.CloseFile();
     if (haveMutex)
         ErrorWriter.ReleaseFileAccessMutex();
     ErrorWriter = null;
 }
 private void Open()
 {
     ErrorWriter = new XmlFileWriter("errors", ManagerType + "_" + ManagerDesc + "_Err", Directory);
     ErrorWriter.AutoDateVersion = true;
     ErrorWriter.AutoNumberVersion = true;
 }