Esempio n. 1
0
        private void Dispose(bool disposing)
        {
            if (!disposed)
            {
                if (disposing)
                {
                    // Dispose managed resources.
                }

                // There are no unmanaged resources to release, but
                // if we add them, they need to be released here.
                if (xslt2 != null)
                {
                    System.Runtime.InteropServices.Marshal.ReleaseComObject(xslt2);
                    xslt2 = null;
                }

                if (xslt1 != null)
                {
                }

                System.Runtime.InteropServices.Marshal.ReleaseComObject(application);
            }
            application = null;
            disposed    = true;
        }
Esempio n. 2
0
 /// <summary>
 /// Loads Xslt template for transformation
 /// </summary>
 /// <param name="xsltInformation"></param>
 /// <param name="settings"></param>
 public void Create(IXsltInformation xsltInformation, XsltTransformerSettings settings)
 {
     _xsltInformation = xsltInformation;
     application      = new Application();
     if (settings.PreferredVersion == "1.0")
     {
         Version           = "1.0";
         xslt1             = application.XSLT1;
         xslt1.XSLFileName = xsltInformation.SourceFile;
     }
     else
     {
         Version           = "2.0";
         xslt2             = application.XSLT2;
         xslt2.XSLFileName = xsltInformation.SourceFile;
     }
 }