コード例 #1
0
ファイル: frmConfigXml.cs プロジェクト: eyedia/idpe
        private void BindData()
        {
            string strfeedMechanism = DataSource.Keys.GetKeyValue(IdpeKeyTypes.XmlFeedMechanism);

            if (string.IsNullOrEmpty(strfeedMechanism))
            {
                return;
            }

            XmlFeedMechanism feedMechanism = (XmlFeedMechanism)Enum.Parse(typeof(XmlFeedMechanism), strfeedMechanism, true);

            if (feedMechanism == XmlFeedMechanism.Xslt)
            {
                radXslt.Checked = true;
                rtbXslt.Text    = DataSource.Keys.GetKeyValue(IdpeKeyTypes.Xslt);
                SyntaxHighLighter.HighLight(rtbXslt, _blueKeyWords, _redKeyWords);
            }
            else if (feedMechanism == XmlFeedMechanism.CSharpCode)
            {
                radCSharpCode.Checked  = true;
                cSharpExpression1.Code = DataSource.Keys.GetKeyValue(IdpeKeyTypes.CSharpCodeGenerateTable);
            }
            else if (feedMechanism == XmlFeedMechanism.Custom)
            {
                radCustomInterface.Checked = true;
                txtInterfaceName.Text      = DataSource.Keys.GetKeyValue(IdpeKeyTypes.FileInterfaceName);
            }
        }
コード例 #2
0
ファイル: frmConfigXml.cs プロジェクト: eyedia/idpe
        private void btnNew_Click(object sender, EventArgs e)
        {
            if (radXslt.Checked)
            {
                rtbXslt.Text  = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" + Environment.NewLine;
                rtbXslt.Text += "<xsl:stylesheet version=\"1.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\" xmlns:msxsl=\"urn:schemas-microsoft-com:xslt\" exclude-result-prefixes=\"msxsl\">" + Environment.NewLine;
                rtbXslt.Text += "  <xsl:output method=\"text\" indent=\"yes\"/>" + Environment.NewLine;

                rtbXslt.Text += "  <xsl:template match=\"Interchange\">" + Environment.NewLine;
                rtbXslt.Text += "  <xsl:apply-templates select=\"XPATH1\"/>" + Environment.NewLine;
                rtbXslt.Text += "  <xsl:apply-templates select=\"XPATH2\"/>" + Environment.NewLine;


                rtbXslt.Text += Environment.NewLine;

                rtbXslt.Text += "    <xsl:template match=\"XPATH1\">" + Environment.NewLine;
                rtbXslt.Text += "      ..." + Environment.NewLine;
                rtbXslt.Text += "      ..." + Environment.NewLine;
                rtbXslt.Text += "    </xsl:template>" + Environment.NewLine;

                rtbXslt.Text += "    <xsl:template match=\"XPATH2\">" + Environment.NewLine;
                rtbXslt.Text += "      ..." + Environment.NewLine;
                rtbXslt.Text += "      ..." + Environment.NewLine;
                rtbXslt.Text += "    </xsl:template>" + Environment.NewLine;
                rtbXslt.Text += "</xsl:stylesheet>" + Environment.NewLine;
                SyntaxHighLighter.HighLight(rtbXslt, _blueKeyWords, _redKeyWords);
            }
            else
            {
                cSharpExpression1.Code = "";
            }
        }
コード例 #3
0
ファイル: frmConfigXml.cs プロジェクト: eyedia/idpe
 private void btnImport_Click(object sender, EventArgs e)
 {
     if (radXslt.Checked)
     {
         openFileDialog.Filter = "XSLT files|*.xslt|All files|*.*";
         if (openFileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
         {
             using (StreamReader sr = new StreamReader(openFileDialog.FileName))
             {
                 rtbXslt.Text = sr.ReadToEnd();
                 sr.Close();
                 SyntaxHighLighter.HighLight(rtbXslt, _blueKeyWords, _redKeyWords);
             }
         }
     }
     else
     {
         openFileDialog.Filter = "C# files|*.cs|All files|*.*";
         if (openFileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
         {
             using (StreamReader sr = new StreamReader(openFileDialog.FileName))
             {
                 cSharpExpression1.Code = sr.ReadToEnd();
                 sr.Close();
             }
         }
     }
 }
コード例 #4
0
 private void txtUsing_TextChanged(object sender, EventArgs e)
 {
     btnCompile.Enabled = true;
     SyntaxHighLighter.HighLight(txtUsing);
     if (SourceCodeChanged != null)
     {
         SourceCodeChanged(this, e);
     }
     CSharpCodeInformation.AdditionalUsingNamespace = txtUsing.Text;
 }
コード例 #5
0
 private void txtHelperMethods_TextChanged(object sender, EventArgs e)
 {
     btnCompile.Enabled = true;
     SyntaxHighLighter.HighLight(txtHelperMethods);
     if (SourceCodeChanged != null)
     {
         SourceCodeChanged(this, e);
     }
     CSharpCodeInformation.HelperMethods = txtHelperMethods.Text;
 }
コード例 #6
0
        private void txtEditor_TextChanged(object sender, EventArgs e)
        {
            btnCompile.Enabled = true;
            SyntaxHighLighter.HighLight(txtEditor);
            if (SourceCodeChanged != null)
            {
                SourceCodeChanged(this, e);
            }

            CSharpCodeInformation.Code = txtEditor.Text;
        }
コード例 #7
0
ファイル: frmConfigEDI.cs プロジェクト: eyedia/idpe
        private void btnLoadSamples_Click(object sender, EventArgs e)
        {
            frmConfigEDIExtension ediSamples = new frmConfigEDIExtension(this.Icon);

            if (ediSamples.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                txtSampleFile.Text = ediSamples.EDIFileName;
                rtbXslt.Text       = ediSamples.Xslt;
                SyntaxHighLighter.HighLight(rtbXslt, _blueKeyWords, _redKeyWords);
            }
        }
コード例 #8
0
ファイル: frmConfigXml.cs プロジェクト: eyedia/idpe
        private void btnSamples_Click(object sender, EventArgs e)
        {
            frmConfigXmlExtension configXmlExt = new frmConfigXmlExtension(this.Icon);

            if (configXmlExt.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                txtSampleFile.Text = configXmlExt.SampleInformation.XmlFileName;
                if (configXmlExt.XsltSelected)
                {
                    radXslt.Checked = true;
                    rtbXslt.Text    = configXmlExt.SampleInformation.Xslt;
                    SyntaxHighLighter.HighLight(rtbXslt, _blueKeyWords, _redKeyWords);
                }
                else
                {
                    radCSharpCode.Checked  = true;
                    cSharpExpression1.Code = configXmlExt.CSharpCode;
                }
            }
        }
コード例 #9
0
ファイル: frmConfigEDI.cs プロジェクト: eyedia/idpe
        private void BindData()
        {
            Manager        manager = new Manager();
            IdpeDataSource ds      = manager.GetDataSourceDetails(DataSourceId);

            if ((ds.Delimiter != null) &&
                (ds.Delimiter.ToLower() == "\t"))
            {
                cmbDelmiter.Text = "Tab";
            }
            else
            {
                cmbDelmiter.Text = ds.Delimiter;
            }

            List <IdpeKey> keys = manager.GetKeys(DataSourceId);

            rtbXslt.Text = keys.GetKeyValue(IdpeKeyTypes.EDIX12Xslt);
            SyntaxHighLighter.HighLight(rtbXslt, _blueKeyWords, _redKeyWords);

            string strHeader = keys.GetKeyValue(IdpeKeyTypes.IsFirstRowHeader);

            if (!string.IsNullOrEmpty(strHeader))
            {
                bool boolVal = false;
                bool.TryParse(strHeader, out boolVal);
                chkFileHasHeader.Checked = boolVal;
            }
            chkRenameHeaders.Enabled = chkFileHasHeader.Checked;

            string strRenCol = keys.GetKeyValue(IdpeKeyTypes.RenameColumnHeader);

            if (!string.IsNullOrEmpty(strRenCol))
            {
                bool boolVal = false;
                bool.TryParse(strRenCol, out boolVal);
                chkRenameHeaders.Checked = boolVal;
            }
        }
コード例 #10
0
ファイル: frmConfigXml.cs プロジェクト: eyedia/idpe
 private void timerIdle_Tick(object sender, EventArgs e)
 {
     SyntaxHighLighter.HighLight(rtbXslt, _blueKeyWords, _redKeyWords);
 }