Пример #1
0
 private void btnExecute_Click(object sender, EventArgs e)
 {
     if (String.IsNullOrEmpty(txtXmlFileName.Text) || String.IsNullOrEmpty(txtXslFileName.Text))
     {
         MessageBox.Show("You must choose XML and XSL(T) files before continue!", "Stop", MessageBoxButtons.OK,
             MessageBoxIcon.Stop);
     }
     else
     {
         try
         {
             using (var transformer = new XslTransformer())
             {
                 transformer.Initialize(txtXslFileName.Text);
                 txtOutput.Text = transformer.GenerateString(openXml.OpenFile());                        
             }
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
 }
Пример #2
0
 private void btnExecute_Click(object sender, EventArgs e)
 {
     if (String.IsNullOrEmpty(txtXmlFileName.Text) || String.IsNullOrEmpty(txtXslFileName.Text))
     {
         MessageBox.Show("You must choose XML and XSL(T) files before continue!", "Stop", MessageBoxButtons.OK,
                         MessageBoxIcon.Stop);
     }
     else
     {
         try
         {
             using (var transformer = new XslTransformer())
             {
                 transformer.Initialize(txtXslFileName.Text);
                 txtOutput.Text = transformer.GenerateString(openXml.OpenFile());
             }
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
 }