예제 #1
0
 private void btnGenerateXSLT_Click(object sender, EventArgs e)
 {
     if (sequenceRecorder1.AutomationEngine != null)
     {
         SaveFileDialog dlg = new SaveFileDialog();
         dlg.Filter = "XSLT Files (*.xslt)|*.xslt";
         if (dlg.ShowDialog() == DialogResult.OK)
         {
             ISequenceTranslator translator = SequenceTranslatorFactory.GetSequenceTranslator(SequenceTranslationType.XSLT);
             string xslt = translator.Translate(sequenceRecorder1.AutomationEngine.Sequence).ToString();
             File.WriteAllText(dlg.FileName, xslt);
             MessageBox.Show("Saved.");
         }
     }
 }
예제 #2
0
 private void zGetXSLT(Sequence sequence)
 {
     if (sequence != null)
     {
         SaveFileDialog dlg = new SaveFileDialog();
         dlg.Filter   = "XSLT Files (*.xslt)|*.xslt";
         dlg.FileName = String.Format("{0}.xslt", sequence.Name);
         if (dlg.ShowDialog() == DialogResult.OK)
         {
             SequenceDetail      sequenceDetail = WebHawkAppContext.AutomationController.GetSequenceDetail(sequence.SequenceId);
             ISequenceTranslator translator     = SequenceTranslatorFactory.GetSequenceTranslator(SequenceTranslationType.XSLT);
             string xslt = translator.Translate(sequenceDetail.SequenceSteps).ToString();
             File.WriteAllText(dlg.FileName, xslt);
             MessageBox.Show(String.Format("XSLT translation of sequence \"{0}\" successfully saved to \"{1}\".", sequence.Name, dlg.FileName),
                             "Saved",
                             MessageBoxButtons.OK,
                             MessageBoxIcon.Information);
         }
     }
 }