예제 #1
0
        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);
        }
예제 #2
0
        protected virtual void OnAtmlFileSaved(string fileName, byte[] content, AtmlFileType atmlFileType)
        {
            FileSavedHandler handler = AtmlFileSaved;

            if (handler != null)
            {
                handler(this, fileName, content, atmlFileType);
            }
        }
예제 #3
0
        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();
     }
 }
예제 #5
0
        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();
     }
 }
예제 #8
0
 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);
            }
        }
예제 #10
0
        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);
            }
        }
예제 #11
0
 private void CurrentTestProgramSetOnAtmlFileSaved( object sender, string fileName, byte[] content,
     AtmlFileType atmlFileType)
 {
     OnAtmlFileSaved( sender, fileName, content, atmlFileType );
 }
예제 #12
0
 protected virtual void OnAtmlFileSaved( object sender, string fileName, byte[] content,
     AtmlFileType atmlFileType)
 {
     FileSavedHandler handler = AtmlFileSaved;
     if (handler != null) handler( sender, fileName, content, atmlFileType );
 }
예제 #13
0
 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 );
 }
예제 #14
0
 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();
     }
 }
예제 #16
0
 private void CurrentTestProgramSetOnAtmlFileSaved(object sender, string fileName, byte[] content,
                                                   AtmlFileType atmlFileType)
 {
     OnAtmlFileSaved(sender, fileName, content, atmlFileType);
 }
예제 #17
0
 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;
 }
예제 #18
0
 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 );
     }
 }
예제 #19
0
 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 );
 }