Пример #1
0
        protected virtual void getDBShare(AbstractHandler handler)
        {
            var dbName             = getObject(PluginShareHelper.DBPluginKey, PluginShareHelper.DBPlugin_DBCurrentDBName) as string;
            var dbType             = getObject(PluginShareHelper.DBPluginKey, PluginShareHelper.DBPlugin_DBCurrentDBType) as string;
            var dbConnectionString = getObject(PluginShareHelper.DBPluginKey, PluginShareHelper.DBPlugin_DBCurrentDBConnectionString) as string;
            var dsTable            = getObject(PluginShareHelper.DBPluginKey, PluginShareHelper.DBPlugin_DBCurrentDBAllTable) as DataSet;
            var dsTableColumn      = getObject(PluginShareHelper.DBPluginKey, PluginShareHelper.DBPlugin_DBCurrentDBAllTablesColumns) as DataSet;
            var dsTablePrimaryKey  = getObject(PluginShareHelper.DBPluginKey, PluginShareHelper.DBPlugin_DBCurrentDBTablesPrimaryKeys) as DataSet;

            var dBtable         = getObject(PluginShareHelper.DBPluginKey, PluginShareHelper.DBPlugin_DBtable) as string;
            var dBtablesColumns = getObject(PluginShareHelper.DBPluginKey, PluginShareHelper.DBPlugin_DBtablesColumns) as string;

            var dBviews             = getObject(PluginShareHelper.DBPluginKey, PluginShareHelper.DBPlugin_DBviews) as string;
            var dBtablesPrimaryKeys = getObject(PluginShareHelper.DBPluginKey, PluginShareHelper.DBPlugin_DBtablesPrimaryKeys) as string;
            var tsslMessage         = getObject(PluginShareHelper.DBPluginKey, PluginShareHelper.DBPlugin_tsslMessage) as ToolStripStatusLabel;
            var tspbLoadDBProgress  = getObject(PluginShareHelper.DBPluginKey, PluginShareHelper.DBPlugin_tspbLoadDBProgress) as ToolStripProgressBar;
            var originalEncoding    = getObject(PluginShareHelper.DBPluginKey, PluginShareHelper.DBPlugin_OriginalEncoding) as string;
            var targetEncoding      = getObject(PluginShareHelper.DBPluginKey, PluginShareHelper.DBPlugin_TargetEncoding) as string;

            handler.tsiGen              = _tsiGen;
            handler.DBtable             = dBtable;
            handler.DBtablesColumns     = dBtablesColumns;
            handler.DBviews             = dBviews;
            handler.DBtablesPrimaryKeys = dBtablesPrimaryKeys;
            handler.dbName              = dbName;
            handler.dbType              = dbType;
            handler.dbConnectionString  = dbConnectionString;
            handler.tsslMessage         = tsslMessage;
            handler.tspbLoadDBProgress  = tspbLoadDBProgress;
            handler.MainContextMenu     = _dbContextMenuStrip;
            handler.Panel             = Application.Panel;
            handler.dsTable           = dsTable;
            handler.dsTableColumn     = dsTableColumn;
            handler.dsTablePrimaryKey = dsTablePrimaryKey;
            handler.PluginName        = PluginName + "(V" + Version + ")";
            if (!string.IsNullOrEmpty(originalEncoding) && !string.IsNullOrEmpty(targetEncoding))
            {
                handler.OriginalEncoding = Encoding.GetEncoding(originalEncoding);
                handler.TargetEncoding   = Encoding.GetEncoding(targetEncoding);
            }
        }
Пример #2
0
 public virtual void process(DataRow[] drTable, AbstractHandler handler)
 {
     getDBShare(handler);
     handler.process(drTable, handler.dsTableColumn, handler.dsTablePrimaryKey);
 }