Exemplo n.º 1
0
        private void TransformOutput()
        {
            try
            {
                if (string.IsNullOrEmpty(rTxtMetaData.Text) == false)
                {
                    XmlDocument xml_doc = new XmlDocument();
                    XmlDocument xsl_doc = new XmlDocument();

                    xml_doc.Load(filePath);
                    xsl_doc.InnerXml = rTxtMetaData.Text;
                    XML2XMLTransformer xmlGen = new XML2XMLTransformer(xsl_doc);
                    rTxtOutput.Text = xmlGen.Transform(xml_doc);
                }
                Trace("Transform success.", 2);
            }
            catch (Exception e)
            {
                Trace(string.Format("Transform error : \n{0}", e.StackTrace), 5);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Handles the Paint event of the pnlMapper control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.Windows.Forms.PaintEventArgs"/> instance containing the event data.</param>
        /// Created by SMK at  2:18 AM on 25/11/11 
        private void pnlMapper_Paint(object sender, PaintEventArgs e)
        {
            var grp = e.Graphics;

            grp.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
            tvLinkedSrc.Draw(grp);
            tvLinkedDes.Draw(grp);
            linkTrees.Draw(grp);

            if (isMappingChanged)
            {
                isMappingChanged = false;
                rTxtMetaData.Text = BuildXSL();

                if (string.IsNullOrEmpty(rTxtMetaData.Text) == false)
                {
                    XmlDocument xml_doc = new XmlDocument();
                    XmlDocument xsl_doc = new XmlDocument();

                    xml_doc.Load(filePath);
                    xsl_doc.InnerXml = rTxtMetaData.Text;
                    XML2XMLTransformer xmlGen = new XML2XMLTransformer(xsl_doc);
                    rTxtOutput.Text = xmlGen.Transform(xml_doc);
                }
            }
        }