public void RemoveATMLDocument(string documentName, AtmlFileType atmlDocNo) { documentName = AddDocumentSuffix(documentName, atmlDocNo); string folder = Path.Combine(TestSetDirectory.FullName, "atml"); string fullFileName = Path.Combine(folder, documentName); FileManager.DeleteFile(fullFileName); }
protected virtual void OnAtmlFileSaved(string fileName, byte[] content, AtmlFileType atmlFileType) { FileSavedHandler handler = AtmlFileSaved; if (handler != null) { handler(this, fileName, content, atmlFileType); } }
public static void RemoveATMLDocument(string documentName, AtmlFileType atmlType) { TestProgramSet currenTestProgramSet = Instance.CurrentTestProgramSet; if (currenTestProgramSet != null) { currenTestProgramSet.RemoveATMLDocument(documentName, atmlType); } ATMLNavigator.Instance.RemoveAtmlFile(documentName); }
private void ATMLTranslatorOutputWindow_AtmlFileSaved(object sender, string fileName, byte[] content, AtmlFileType atmlFileType) { if (atmlFileType == AtmlFileType.AtmlTypeTestDescription) { atmlPreviewPanel.Text = Encoding.UTF8.GetString(content); atmlPreviewPanel.InitForXML(); SetControlStates(); } }
public static void SaveATMLDocument(string documentName, AtmlFileType atmlType, byte[] contentBytes, bool forceOverWrite = false) { TestProgramSet currenTestProgramSet = Instance.CurrentTestProgramSet; if (currenTestProgramSet != null) { currenTestProgramSet.SaveATMLDocument(documentName, atmlType, contentBytes, forceOverWrite); } }
private void ATMLReaderOutputWindow_AtmlFileSaved( object sender, string fileName, byte[] content, AtmlFileType atmlFileType) { if (atmlFileType == AtmlFileType.AtmlTypeTestConfiguration) { atmlPreviewPanel.Text = Encoding.UTF8.GetString( content ); atmlPreviewPanel.InitForXML(); } }
private void ATMLReaderOutputWindow_AtmlFileSaved(object sender, string fileName, byte[] content, AtmlFileType atmlFileType) { if (atmlFileType == AtmlFileType.AtmlTypeTestConfiguration) { atmlPreviewPanel.Text = Encoding.UTF8.GetString(content); atmlPreviewPanel.InitForXML(); } }
private static string AddDocumentSuffix(string documentName, AtmlFileType atmlDocNo) { if (!documentName.Contains("1671")) { documentName = documentName + ".1671." + (int)atmlDocNo; } if (!documentName.ToLower().EndsWith(".xml")) { documentName = documentName + ".xml"; } return(documentName); }
protected virtual void OnAtmlObjectNameChanged(string oldName, string newName, string uuid, AtmlFileType fileType) { AtmlNameChangedEventHandler handler = AtmlObjectNameChanged; var args = new AtmlNameChangedEventArgs(); args.OldName = oldName; args.NewName = newName; args.AtmlFileType = fileType; args.Uuid = uuid; if (handler != null) { handler(this, args); } }
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); } }
private void CurrentTestProgramSetOnAtmlFileSaved( object sender, string fileName, byte[] content, AtmlFileType atmlFileType) { OnAtmlFileSaved( sender, fileName, content, atmlFileType ); }
protected virtual void OnAtmlFileSaved( object sender, string fileName, byte[] content, AtmlFileType atmlFileType) { FileSavedHandler handler = AtmlFileSaved; if (handler != null) handler( sender, fileName, content, atmlFileType ); }
public static void SaveATMLDocument( string documentName, AtmlFileType atmlType, byte[] contentBytes, bool forceOverWrite = false) { TestProgramSet currenTestProgramSet = Instance.CurrentTestProgramSet; if (currenTestProgramSet != null) currenTestProgramSet.SaveATMLDocument( documentName, atmlType, contentBytes, forceOverWrite ); }
public static void RemoveATMLDocument( string documentName, AtmlFileType atmlType ) { TestProgramSet currenTestProgramSet = Instance.CurrentTestProgramSet; if (currenTestProgramSet != null) currenTestProgramSet.RemoveATMLDocument( documentName, atmlType ); ATMLNavigator.Instance.RemoveAtmlFile( documentName ); }
private void ATMLTranslatorOutputWindow_AtmlFileSaved( object sender, string fileName, byte[] content, AtmlFileType atmlFileType) { if (atmlFileType == AtmlFileType.AtmlTypeTestDescription) { atmlPreviewPanel.Text = Encoding.UTF8.GetString( content ); atmlPreviewPanel.InitForXML(); SetControlStates(); } }
private void CurrentTestProgramSetOnAtmlFileSaved(object sender, string fileName, byte[] content, AtmlFileType atmlFileType) { OnAtmlFileSaved(sender, fileName, content, atmlFileType); }
private static string AddDocumentSuffix( string documentName, AtmlFileType atmlDocNo ) { if (!documentName.Contains( "1671" )) documentName = documentName + ".1671." + (int) atmlDocNo; if (!documentName.ToLower().EndsWith( ".xml" )) documentName = documentName + ".xml"; return documentName; }
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 ); } }
public void RemoveATMLDocument( string documentName, AtmlFileType atmlDocNo ) { documentName = AddDocumentSuffix( documentName, atmlDocNo ); string folder = Path.Combine( TestSetDirectory.FullName, "atml" ); string fullFileName = Path.Combine( folder, documentName ); FileManager.DeleteFile( fullFileName ); }