public void SaveATMLDocument( string documentName, AtmlFileType atmlDocNo, byte[] contentBytes,
bool forceOverWrite)
{
documentName = AddDocumentSuffix( documentName, atmlDocNo );
string folder = TestSetDirectory + @"\atml\";
string fullFileName = Path.Combine( folder, documentName );
bool ok2Save = true;
if (!forceOverWrite && File.Exists( fullFileName ))
{
ok2Save = DialogResult.Yes ==
MessageBox.Show(
string.Format( "File name {0} already exists. Are you sure you want to overwrite it?",
documentName ),
@"O V E R W R I T E F I L E ", MessageBoxButtons.YesNo, MessageBoxIcon.Question );
}
if (ok2Save)
{
File.WriteAllBytes( fullFileName, contentBytes );
LogManager.Debug( "File {0} has been written to {1}", documentName, folder );
OnAtmlFileSaved( documentName, contentBytes, atmlDocNo );
}
}