// #endregion #region private DBConnectionstrings metadata_dbconnectionstrings(); private DBConnectionstrings metadata_dbconnectionstrings( ) { //#region int _paramCount = ...; //int _paramCount = 0; //for (int d = 0; d < metadata_.MetadataExtendedCollection[0].DBs.DBCollection.Count; d++) // for (int c = 0; c < metadata_.MetadataExtendedCollection[0].DBs.DBCollection[d].DBConnections.DBConnectionCollection.Count; c++) // if (metadata_.MetadataExtendedCollection[0].DBs.DBCollection[d].DBConnections.DBConnectionCollection[c].generateSQL) // _paramCount++; //#endregion //DBSimpleConnectionstring[] _output = new DBSimpleConnectionstring[_paramCount]; //_paramCount = 0; //for (int d = 0; d < metadata_.MetadataExtendedCollection[0].DBs.DBCollection.Count; d++) { // for (int c = 0; c < metadata_.MetadataExtendedCollection[0].DBs.DBCollection[d].DBConnections.DBConnectionCollection.Count; c++) { // if (metadata_.MetadataExtendedCollection[0].DBs.DBCollection[d].DBConnections.DBConnectionCollection[c].generateSQL) { // _output[_paramCount] = new DBSimpleConnectionstring( // (DBServerTypes)Enum.Parse( // typeof(DBServerTypes), // metadata_.MetadataExtendedCollection[0].DBs.DBCollection[d].DBServerType // ), // metadata_.MetadataExtendedCollection[0].DBs.DBCollection[d].DBConnections.DBConnectionCollection[c].Connectionstring // ); // _paramCount++; // } // } //} //return _output; DBConnectionstrings _output = new DBConnectionstrings(); for (int d = 0; d < metadata_.MetadataExtendedCollection[0].DBs.DBCollection.Count; d++) { for (int c = 0; c < metadata_.MetadataExtendedCollection[0].DBs.DBCollection[d].DBConnections.DBConnectionCollection.Count; c++) { if (metadata_.MetadataExtendedCollection[0].DBs.DBCollection[d].DBConnections.DBConnectionCollection[c].generateSQL) { _output.Add( (DBServerTypes)Enum.Parse( typeof(DBServerTypes), metadata_.MetadataExtendedCollection[0].DBs.DBCollection[d].DBServerType ), metadata_.MetadataExtendedCollection[0].DBs.DBCollection[d].DBConnections.DBConnectionCollection[c].Connectionstring ); } } } return(_output); }
// #region public void Build(cGenerator.dBuild notifyBase_in); public void Build(cGenerator.dBuild notifyBase_in) { #region string _outputDir = ...; string _outputDir = System.IO.Directory.GetParent( Path.GetDirectoryName(filename_) ).FullName; #endregion #region string _metadata0 = ...; string _metadata0 = string.Format( // "{0}{1}OGen-metadatas{1}MD0_{2}-{3}.OGen-metadata.xml", "{0}{1}OGen-metadatas{1}MD0_{2}.OGen-metadata.xml", /*00*/ _outputDir, /*01*/ Path.DirectorySeparatorChar, /*02*/ metadata_.ApplicationName // , /*03*/ metadata_.Default_DBServerType.ToString() ); #endregion if (notifyBase_in != null) { notifyBase_in("generating...", true); } metadata_.SaveState_toFile(_metadata0); DBConnectionstrings _dbconnectionstrings = new DBConnectionstrings(); for (int _dbservertype = 0; _dbservertype < metadata_.DBs.Count; _dbservertype++) { for (int _con = 0; _con < metadata_.DBs[_dbservertype].Connections.Count; _con++) { if (metadata_.DBs[_dbservertype].Connections[_con].GenerateSQL) { _dbconnectionstrings.Add( metadata_.DBs[_dbservertype].DBServerType, metadata_.DBs[_dbservertype].Connections[_con].Connectionstring ); } } } new cGenerator( #if !NET_1_1 System.Configuration.ConfigurationManager.AppSettings #else System.Configuration.ConfigurationSettings.AppSettings #endif ["Templates"], _dbconnectionstrings, _outputDir, new MetaFile( filename_, cDBMetadata.ROOT ) ).Build( notifyBase_in, metadata_ ); if (notifyBase_in != null) { notifyBase_in("...finished", true); } }