示例#1
0
 public GenerateDataSqlJobCommand(IDataSqlGenerator generator, IFilePlace place, ISqlDialect dialect, TableDataFrame dataFrame, DataFrameRowsExtractor rows, ConnectionPack connpack, SqlFormatProperties formatProps)
 {
     Generator   = generator;
     Place       = place;
     Dialect     = dialect;
     ConnPack    = connpack;
     m_rows      = rows;
     m_dataFrame = dataFrame;
     FormatProps = formatProps;
 }
示例#2
0
 public static Job CreateDataJob(IDataSqlGenerator generator, IFilePlace place, ISqlDialect dialect, TableDataFrame dataFrame, DataFrameRowsExtractor rows, ConnectionPack connpack, SqlFormatProperties formatProps, JobProperties jobProps)
 {
     return(Job.FromCommand(new GenerateDataSqlJobCommand(generator, place, dialect, dataFrame, rows, connpack, formatProps), jobProps));
 }
示例#3
0
        private void RefreshPreview()
        {
            if (!m_initialized)
            {
                return;
            }
            var dial = cbxDialect.SelectedItem as ISqlDialect;

            if (dial == null && m_db != null)
            {
                dial = m_db.Dialect;
            }
            if (dial == null && m_dataFrame != null)
            {
                dial = m_dataFrame.GetDialect();
            }
            if (dial == null && m_objs != null)
            {
                dial = m_objs[0].Dialect;
            }
            if (dial == null)
            {
                dial = GenericDialect.Instance;
            }
            m_previewRows   = tbxRows.Text.SafeIntParse(10);
            m_dialect       = dial;
            m_sqlgen        = lbxGenerator.SelectedItem as ISqlGeneratorCommon;
            m_rowsExtractor = (DataFrameRowsExtractor)lbxRows.SelectedItem;
            m_formatProps   = sqlFormatPropsFrame1.Value;

            if (m_curRun != null)
            {
                return;
            }

            if (m_dialect != null && m_sqlgen != null)
            {
                pictureBox1.BringToFront();
                if (m_objs != null)
                {
                    if (m_db != null)
                    {
                        m_db.Connection.BeginInvoke((Action)DoRefreshPreview, m_invoker.CreateInvokeCallback(RefreshedPreview));
                    }
                    else
                    {
                        m_curRun = DoRefreshPreview;
                        m_curRun.BeginInvoke(m_invoker.CreateInvokeCallback(RefreshedPreview), null);
                        //DoRefreshPreview();
                        //RefreshedPreview(null);
                    }
                }
                if (m_dataFrame != null)
                {
                    if (m_dataFrame.TabularData.Connection != null)
                    {
                        m_dataFrame.TabularData.Connection.BeginInvoke((Action)DoRefreshPreview, m_invoker.CreateInvokeCallback(RefreshedPreview));
                    }
                    else
                    {
                        ThreadPool.BeginInvoke(DoRefreshPreviewFunc, m_invoker.CreateInvokeCallback(RefreshedPreview));
                    }
                }
            }
        }