Merge pull request #1777 from alexrp/sgen-separation
authorAlex Rønne Petersen <alex@alexrp.com>
Thu, 7 May 2015 20:48:30 +0000 (22:48 +0200)
committerAlex Rønne Petersen <alex@alexrp.com>
Thu, 7 May 2015 20:48:30 +0000 (22:48 +0200)
[sgen] Move bridge debugging code out of the independent SGen code

467 files changed:
configure.ac
external/referencesource
mcs/build/tests.make
mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/AssemblyResolver.cs
mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds.cs
mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds70.cs
mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/TdsColumnType.cs
mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/TdsComm.cs
mcs/class/Mono.Data.Tds/Mono.Data.Tds/TdsMetaParameter.cs
mcs/class/System.Data/.gitignore
mcs/class/System.Data/Mono.Data.SqlExpressions/.gitignore [deleted file]
mcs/class/System.Data/Mono.Data.SqlExpressions/Aggregation.cs [deleted file]
mcs/class/System.Data/Mono.Data.SqlExpressions/ArithmeticExpressions.cs [deleted file]
mcs/class/System.Data/Mono.Data.SqlExpressions/BooleanExpressions.cs [deleted file]
mcs/class/System.Data/Mono.Data.SqlExpressions/ChangeLog [deleted file]
mcs/class/System.Data/Mono.Data.SqlExpressions/ColumnReference.cs [deleted file]
mcs/class/System.Data/Mono.Data.SqlExpressions/Comparison.cs [deleted file]
mcs/class/System.Data/Mono.Data.SqlExpressions/Expressions.cs [deleted file]
mcs/class/System.Data/Mono.Data.SqlExpressions/Functions.cs [deleted file]
mcs/class/System.Data/Mono.Data.SqlExpressions/In.cs [deleted file]
mcs/class/System.Data/Mono.Data.SqlExpressions/Like.cs [deleted file]
mcs/class/System.Data/Mono.Data.SqlExpressions/Literal.cs [deleted file]
mcs/class/System.Data/Mono.Data.SqlExpressions/Numeric.cs [deleted file]
mcs/class/System.Data/Mono.Data.SqlExpressions/Parser.jay [deleted file]
mcs/class/System.Data/Mono.Data.SqlExpressions/StringFunctions.cs [deleted file]
mcs/class/System.Data/Mono.Data.SqlExpressions/Tokenizer.cs [deleted file]
mcs/class/System.Data/ReferenceSources/SqlInternalConnectionTds.cs [new file with mode: 0644]
mcs/class/System.Data/System.Data.Common/CatalogLocation.cs [deleted file]
mcs/class/System.Data/System.Data.Common/ChangeLog [deleted file]
mcs/class/System.Data/System.Data.Common/ComparerFactory.cs [deleted file]
mcs/class/System.Data/System.Data.Common/DataAdapter.cs [deleted file]
mcs/class/System.Data/System.Data.Common/DataContainer.cs [deleted file]
mcs/class/System.Data/System.Data.Common/DbCommand.cs [deleted file]
mcs/class/System.Data/System.Data.Common/DbCommandBuilder.cs [deleted file]
mcs/class/System.Data/System.Data.Common/DbCommandOptionalFeatures.cs [deleted file]
mcs/class/System.Data/System.Data.Common/DbCommandSet.cs [deleted file]
mcs/class/System.Data/System.Data.Common/DbConnection.cs [deleted file]
mcs/class/System.Data/System.Data.Common/DbDataAdapter.cs [deleted file]
mcs/class/System.Data/System.Data.Common/DbDataReader.cs [deleted file]
mcs/class/System.Data/System.Data.Common/DbDataSourceEnumerator.cs [deleted file]
mcs/class/System.Data/System.Data.Common/DbException.cs [deleted file]
mcs/class/System.Data/System.Data.Common/DbMetaDataCollectionNames.cs [deleted file]
mcs/class/System.Data/System.Data.Common/DbMetaDataColumnNames.cs [deleted file]
mcs/class/System.Data/System.Data.Common/DbParameter.cs [deleted file]
mcs/class/System.Data/System.Data.Common/DbParameterCollection.cs [deleted file]
mcs/class/System.Data/System.Data.Common/DbProviderConfigurationHandler.cs [deleted file]
mcs/class/System.Data/System.Data.Common/DbProviderFactories.cs [deleted file]
mcs/class/System.Data/System.Data.Common/DbProviderFactoriesConfigurationHandler.cs [deleted file]
mcs/class/System.Data/System.Data.Common/DbProviderFactory.cs [deleted file]
mcs/class/System.Data/System.Data.Common/DbProviderSpecificTypePropertyAttribute.cs [deleted file]
mcs/class/System.Data/System.Data.Common/DbProviderSupportedClasses.cs [deleted file]
mcs/class/System.Data/System.Data.Common/DbTable.cs [deleted file]
mcs/class/System.Data/System.Data.Common/DbTransaction.cs [deleted file]
mcs/class/System.Data/System.Data.Common/GroupByBehavior.cs [deleted file]
mcs/class/System.Data/System.Data.Common/IdentifierCase.cs [deleted file]
mcs/class/System.Data/System.Data.Common/Index.cs [deleted file]
mcs/class/System.Data/System.Data.Common/Key.cs [deleted file]
mcs/class/System.Data/System.Data.Common/PermissionHelper.cs [deleted file]
mcs/class/System.Data/System.Data.Common/RecordCache.cs [deleted file]
mcs/class/System.Data/System.Data.Common/RowUpdatedEventArgs.cs [deleted file]
mcs/class/System.Data/System.Data.Common/RowUpdatingEventArgs.cs [deleted file]
mcs/class/System.Data/System.Data.Common/SchemaLocation.cs [deleted file]
mcs/class/System.Data/System.Data.Common/SchemaTableColumn.cs [deleted file]
mcs/class/System.Data/System.Data.Common/SchemaTableOptionalColumn.cs [deleted file]
mcs/class/System.Data/System.Data.Common/SupportedJoinOperators.cs [deleted file]
mcs/class/System.Data/System.Data.Common/TaskHelper.cs [deleted file]
mcs/class/System.Data/System.Data.Configuration.jvm/.gitattributes [deleted file]
mcs/class/System.Data/System.Data.Configuration.jvm/GlobalConfig.cs [deleted file]
mcs/class/System.Data/System.Data.Configuration.jvm/ObjectNameResolutionSectionHandler.cs [deleted file]
mcs/class/System.Data/System.Data.Configuration.jvm/ObjectNameResolver.cs [deleted file]
mcs/class/System.Data/System.Data.Configuration.jvm/ObjectNameResolversCollection.cs [deleted file]
mcs/class/System.Data/System.Data.Odbc/ChangeLog [deleted file]
mcs/class/System.Data/System.Data.Odbc/NativeBuffer.cs [deleted file]
mcs/class/System.Data/System.Data.Odbc/OdbcCategoryAttribute.cs [deleted file]
mcs/class/System.Data/System.Data.Odbc/OdbcColumn.cs [deleted file]
mcs/class/System.Data/System.Data.Odbc/OdbcCommand.cs [deleted file]
mcs/class/System.Data/System.Data.Odbc/OdbcCommandBuilder.cs [deleted file]
mcs/class/System.Data/System.Data.Odbc/OdbcConnection.cs [deleted file]
mcs/class/System.Data/System.Data.Odbc/OdbcConnectionFactory.cs [deleted file]
mcs/class/System.Data/System.Data.Odbc/OdbcDataAdapter.cs [deleted file]
mcs/class/System.Data/System.Data.Odbc/OdbcDataReader.cs [deleted file]
mcs/class/System.Data/System.Data.Odbc/OdbcDescriptionAttribute.cs [deleted file]
mcs/class/System.Data/System.Data.Odbc/OdbcErrorCollection.cs [deleted file]
mcs/class/System.Data/System.Data.Odbc/OdbcException.cs [deleted file]
mcs/class/System.Data/System.Data.Odbc/OdbcFactory.cs [deleted file]
mcs/class/System.Data/System.Data.Odbc/OdbcInfoMessageEventArgs.cs [deleted file]
mcs/class/System.Data/System.Data.Odbc/OdbcInfoMessageEventHandler.cs [deleted file]
mcs/class/System.Data/System.Data.Odbc/OdbcMetaDataCollectionNames.cs [deleted file]
mcs/class/System.Data/System.Data.Odbc/OdbcMetaDataColumnNames.cs [deleted file]
mcs/class/System.Data/System.Data.Odbc/OdbcParameter.cs [deleted file]
mcs/class/System.Data/System.Data.Odbc/OdbcParameterCollection.cs [deleted file]
mcs/class/System.Data/System.Data.Odbc/OdbcParameterConverter.cs [deleted file]
mcs/class/System.Data/System.Data.Odbc/OdbcRowUpdatedEventArgs.cs [deleted file]
mcs/class/System.Data/System.Data.Odbc/OdbcRowUpdatedEventHandler.cs [deleted file]
mcs/class/System.Data/System.Data.Odbc/OdbcRowUpdatingEventArgs.cs [deleted file]
mcs/class/System.Data/System.Data.Odbc/OdbcRowUpdatingEventHandler.cs [deleted file]
mcs/class/System.Data/System.Data.Odbc/OdbcTransaction.cs [deleted file]
mcs/class/System.Data/System.Data.Odbc/OdbcType.cs [deleted file]
mcs/class/System.Data/System.Data.Odbc/OdbcTypeConverter.cs [deleted file]
mcs/class/System.Data/System.Data.Odbc/OdbcTypeMap.cs [deleted file]
mcs/class/System.Data/System.Data.Odbc/libodbc.cs [deleted file]
mcs/class/System.Data/System.Data.OleDb.jvm/.gitattributes [deleted file]
mcs/class/System.Data/System.Data.OleDb.jvm/ChangeLog [deleted file]
mcs/class/System.Data/System.Data.OleDb.jvm/OleDbCommandBuilder.cs [deleted file]
mcs/class/System.Data/System.Data.OleDb.jvm/OleDbDataAdapter.cs [deleted file]
mcs/class/System.Data/System.Data.OleDb.jvm/OleDbFactory.cs [deleted file]
mcs/class/System.Data/System.Data.OleDb.jvm/OleDbInfoMessageEventArgs.cs [deleted file]
mcs/class/System.Data/System.Data.OleDb.jvm/OleDbInfoMessageEventHandler.cs [deleted file]
mcs/class/System.Data/System.Data.OleDb.jvm/OleDbLiteral.cs [deleted file]
mcs/class/System.Data/System.Data.OleDb.jvm/OleDbParameterCollection.cs [deleted file]
mcs/class/System.Data/System.Data.OleDb.jvm/OleDbPermission.cs [deleted file]
mcs/class/System.Data/System.Data.OleDb.jvm/OleDbPermissionAttribute.cs [deleted file]
mcs/class/System.Data/System.Data.OleDb.jvm/OleDbRowUpdatedEventArgs.cs [deleted file]
mcs/class/System.Data/System.Data.OleDb.jvm/OleDbRowUpdatedEventHandler.cs [deleted file]
mcs/class/System.Data/System.Data.OleDb.jvm/OleDbRowUpdatingEventArgs.cs [deleted file]
mcs/class/System.Data/System.Data.OleDb.jvm/OleDbRowUpdatingEventHandler.cs [deleted file]
mcs/class/System.Data/System.Data.OleDb.jvm/OleDbSchemaGuid.cs [deleted file]
mcs/class/System.Data/System.Data.OleDb.jvm/OleDbTransaction.cs [deleted file]
mcs/class/System.Data/System.Data.OleDb.jvm/OleDbType.cs [deleted file]
mcs/class/System.Data/System.Data.OleDb/ChangeLog [deleted file]
mcs/class/System.Data/System.Data.OleDb/OleDbCommand.cs [deleted file]
mcs/class/System.Data/System.Data.OleDb/OleDbCommandBuilder.cs [deleted file]
mcs/class/System.Data/System.Data.OleDb/OleDbConnection.cs [deleted file]
mcs/class/System.Data/System.Data.OleDb/OleDbDataAdapter.cs [deleted file]
mcs/class/System.Data/System.Data.OleDb/OleDbDataReader.cs [deleted file]
mcs/class/System.Data/System.Data.OleDb/OleDbError.cs [deleted file]
mcs/class/System.Data/System.Data.OleDb/OleDbErrorCollection.cs [deleted file]
mcs/class/System.Data/System.Data.OleDb/OleDbException.cs [deleted file]
mcs/class/System.Data/System.Data.OleDb/OleDbFactory.cs [deleted file]
mcs/class/System.Data/System.Data.OleDb/OleDbInfoMessageEventArgs.cs [deleted file]
mcs/class/System.Data/System.Data.OleDb/OleDbInfoMessageEventHandler.cs [deleted file]
mcs/class/System.Data/System.Data.OleDb/OleDbLiteral.cs [deleted file]
mcs/class/System.Data/System.Data.OleDb/OleDbMetaDataCollectionNames.cs [deleted file]
mcs/class/System.Data/System.Data.OleDb/OleDbParameter.cs [deleted file]
mcs/class/System.Data/System.Data.OleDb/OleDbParameterCollection.cs [deleted file]
mcs/class/System.Data/System.Data.OleDb/OleDbParameterConverter.cs [deleted file]
mcs/class/System.Data/System.Data.OleDb/OleDbPermission.cs [deleted file]
mcs/class/System.Data/System.Data.OleDb/OleDbPermissionAttribute.cs [deleted file]
mcs/class/System.Data/System.Data.OleDb/OleDbRowUpdatedEventArgs.cs [deleted file]
mcs/class/System.Data/System.Data.OleDb/OleDbRowUpdatedEventHandler.cs [deleted file]
mcs/class/System.Data/System.Data.OleDb/OleDbRowUpdatingEventArgs.cs [deleted file]
mcs/class/System.Data/System.Data.OleDb/OleDbRowUpdatingEventHandler.cs [deleted file]
mcs/class/System.Data/System.Data.OleDb/OleDbSchemaGuid.cs [deleted file]
mcs/class/System.Data/System.Data.OleDb/OleDbTransaction.cs [deleted file]
mcs/class/System.Data/System.Data.OleDb/OleDbType.cs [deleted file]
mcs/class/System.Data/System.Data.OleDb/libgda.cs [deleted file]
mcs/class/System.Data/System.Data.ProviderBase.jvm/.gitattributes [deleted file]
mcs/class/System.Data/System.Data.ProviderBase.jvm/AbstractDbCommandBuilder.cs [deleted file]
mcs/class/System.Data/System.Data.ProviderBase.jvm/AbstractDbParameterCollection.cs [deleted file]
mcs/class/System.Data/System.Data.ProviderBase.jvm/ChangeLog [deleted file]
mcs/class/System.Data/System.Data.ProviderBase.jvm/regex.cs [deleted file]
mcs/class/System.Data/System.Data.ProviderBase/ChangeLog [deleted file]
mcs/class/System.Data/System.Data.ProviderBase/DbCommandBase.cs [deleted file]
mcs/class/System.Data/System.Data.ProviderBase/DbConnectionBase.cs [deleted file]
mcs/class/System.Data/System.Data.ProviderBase/DbConnectionFactory.cs [deleted file]
mcs/class/System.Data/System.Data.ProviderBase/DbConnectionInternal.cs [deleted file]
mcs/class/System.Data/System.Data.ProviderBase/DbConnectionPoolCounters.cs [deleted file]
mcs/class/System.Data/System.Data.ProviderBase/DbConnectionPoolOptions.cs [deleted file]
mcs/class/System.Data/System.Data.ProviderBase/DbDataReaderBase.cs [deleted file]
mcs/class/System.Data/System.Data.ProviderBase/DbMetaDataFactory.cs [deleted file]
mcs/class/System.Data/System.Data.ProviderBase/DbParameterBase.cs [deleted file]
mcs/class/System.Data/System.Data.ProviderBase/DbParameterCollectionBase.cs [deleted file]
mcs/class/System.Data/System.Data.ProviderBase/DbReferenceCollection.cs [deleted file]
mcs/class/System.Data/System.Data.Sql/SqlDataSourceEnumerator.cs [deleted file]
mcs/class/System.Data/System.Data.SqlClient/SqlBulkCopy.cs
mcs/class/System.Data/System.Data.SqlClient/SqlClientPermission.cs [deleted file]
mcs/class/System.Data/System.Data.SqlClient/SqlClientPermissionAttribute.cs [deleted file]
mcs/class/System.Data/System.Data.SqlClient/SqlConnection.cs
mcs/class/System.Data/System.Data.SqlClient/SqlConnectionStringBuilder.cs [deleted file]
mcs/class/System.Data/System.Data.SqlClient/SqlError.cs [deleted file]
mcs/class/System.Data/System.Data.SqlClient/SqlErrorCollection.cs [deleted file]
mcs/class/System.Data/System.Data.SqlClient/SqlException.cs
mcs/class/System.Data/System.Data.SqlClient/SqlInfoMessageEventArgs.cs [deleted file]
mcs/class/System.Data/System.Data.SqlClient/SqlParameter.cs
mcs/class/System.Data/System.Data.dll.sources [deleted file]
mcs/class/System.Data/System.Data/.gitattributes [deleted file]
mcs/class/System.Data/System.Data/AcceptRejectRule.cs [deleted file]
mcs/class/System.Data/System.Data/ChangeLog [deleted file]
mcs/class/System.Data/System.Data/ColumnTypeConverter.cs [deleted file]
mcs/class/System.Data/System.Data/CommandBehavior.cs [deleted file]
mcs/class/System.Data/System.Data/CommandType.cs [deleted file]
mcs/class/System.Data/System.Data/ConflictOption.cs [deleted file]
mcs/class/System.Data/System.Data/ConflictOptions.cs [deleted file]
mcs/class/System.Data/System.Data/ConnectionState.cs [deleted file]
mcs/class/System.Data/System.Data/Constraint.cs [deleted file]
mcs/class/System.Data/System.Data/ConstraintCollection.cs [deleted file]
mcs/class/System.Data/System.Data/ConstraintConverter.cs [deleted file]
mcs/class/System.Data/System.Data/ConstraintException.cs [deleted file]
mcs/class/System.Data/System.Data/CustomDataClassGenerator.cs [deleted file]
mcs/class/System.Data/System.Data/DBConcurrencyException.cs [deleted file]
mcs/class/System.Data/System.Data/DataCategoryAttribute.cs [deleted file]
mcs/class/System.Data/System.Data/DataColumn.cs [deleted file]
mcs/class/System.Data/System.Data/DataColumnChangeEventArgs.cs [deleted file]
mcs/class/System.Data/System.Data/DataColumnChangeEventHandler.cs [deleted file]
mcs/class/System.Data/System.Data/DataColumnCollection.cs [deleted file]
mcs/class/System.Data/System.Data/DataColumnPropertyDescriptor.cs [deleted file]
mcs/class/System.Data/System.Data/DataException.cs [deleted file]
mcs/class/System.Data/System.Data/DataRelation.cs [deleted file]
mcs/class/System.Data/System.Data/DataRelationCollection.cs [deleted file]
mcs/class/System.Data/System.Data/DataRelationPropertyDescriptor.cs [deleted file]
mcs/class/System.Data/System.Data/DataRow.cs [deleted file]
mcs/class/System.Data/System.Data/DataRowAction.cs [deleted file]
mcs/class/System.Data/System.Data/DataRowBuilder.cs [deleted file]
mcs/class/System.Data/System.Data/DataRowChangeEventArgs.cs [deleted file]
mcs/class/System.Data/System.Data/DataRowChangeEventHandler.cs [deleted file]
mcs/class/System.Data/System.Data/DataRowCollection.cs [deleted file]
mcs/class/System.Data/System.Data/DataRowState.cs [deleted file]
mcs/class/System.Data/System.Data/DataRowVersion.cs [deleted file]
mcs/class/System.Data/System.Data/DataRowView.cs [deleted file]
mcs/class/System.Data/System.Data/DataSet.cs [deleted file]
mcs/class/System.Data/System.Data/DataSetDateTime.cs [deleted file]
mcs/class/System.Data/System.Data/DataSysDescriptionAttribute.cs [deleted file]
mcs/class/System.Data/System.Data/DataTable.cs [deleted file]
mcs/class/System.Data/System.Data/DataTableClearEventArgs.cs [deleted file]
mcs/class/System.Data/System.Data/DataTableClearEventHandler.cs [deleted file]
mcs/class/System.Data/System.Data/DataTableCollection.cs [deleted file]
mcs/class/System.Data/System.Data/DataTableNewRowEventArgs.cs [deleted file]
mcs/class/System.Data/System.Data/DataTableNewRowEventHandler.cs [deleted file]
mcs/class/System.Data/System.Data/DataTablePropertyDescriptor.cs [deleted file]
mcs/class/System.Data/System.Data/DataTableReader.cs [deleted file]
mcs/class/System.Data/System.Data/DataTableTypeConverter.cs [deleted file]
mcs/class/System.Data/System.Data/DataView.cs [deleted file]
mcs/class/System.Data/System.Data/DataViewManager.cs [deleted file]
mcs/class/System.Data/System.Data/DataViewManagerListItemTypeDescriptor.cs [deleted file]
mcs/class/System.Data/System.Data/DataViewRowState.cs [deleted file]
mcs/class/System.Data/System.Data/DataViewSetting.cs [deleted file]
mcs/class/System.Data/System.Data/DataViewSettingCollection.cs [deleted file]
mcs/class/System.Data/System.Data/DbMetaData.cs [deleted file]
mcs/class/System.Data/System.Data/DbType.cs [deleted file]
mcs/class/System.Data/System.Data/DefaultValueTypeConverter.cs [deleted file]
mcs/class/System.Data/System.Data/DeletedRowInaccessibleException.cs [deleted file]
mcs/class/System.Data/System.Data/DuplicateNameException.cs [deleted file]
mcs/class/System.Data/System.Data/EvaluateException.cs [deleted file]
mcs/class/System.Data/System.Data/ExpressionElement.cs [deleted file]
mcs/class/System.Data/System.Data/FillErrorEventArgs.cs [deleted file]
mcs/class/System.Data/System.Data/FillErrorEventHandler.cs [deleted file]
mcs/class/System.Data/System.Data/FillOptions.cs [deleted file]
mcs/class/System.Data/System.Data/ForeignKeyConstraint.cs [deleted file]
mcs/class/System.Data/System.Data/IColumnMapping.cs [deleted file]
mcs/class/System.Data/System.Data/IColumnMappingCollection.cs [deleted file]
mcs/class/System.Data/System.Data/IDataAdapter.cs [deleted file]
mcs/class/System.Data/System.Data/IDataParameter.cs [deleted file]
mcs/class/System.Data/System.Data/IDataParameterCollection.cs [deleted file]
mcs/class/System.Data/System.Data/IDataReader.cs [deleted file]
mcs/class/System.Data/System.Data/IDataRecord.cs [deleted file]
mcs/class/System.Data/System.Data/IDbCommand.cs [deleted file]
mcs/class/System.Data/System.Data/IDbConnection.cs [deleted file]
mcs/class/System.Data/System.Data/IDbDataAdapter.cs [deleted file]
mcs/class/System.Data/System.Data/IDbDataParameter.cs [deleted file]
mcs/class/System.Data/System.Data/IDbTransaction.cs [deleted file]
mcs/class/System.Data/System.Data/ISafeDataRecord.cs [deleted file]
mcs/class/System.Data/System.Data/ITableMapping.cs [deleted file]
mcs/class/System.Data/System.Data/ITableMappingCollection.cs [deleted file]
mcs/class/System.Data/System.Data/InRowChangingEventException.cs [deleted file]
mcs/class/System.Data/System.Data/InternalDataCollectionBase.cs [deleted file]
mcs/class/System.Data/System.Data/InvalidConstraintException.cs [deleted file]
mcs/class/System.Data/System.Data/InvalidExpressionException.cs [deleted file]
mcs/class/System.Data/System.Data/IsolationLevel.cs [deleted file]
mcs/class/System.Data/System.Data/LoadOption.cs [deleted file]
mcs/class/System.Data/System.Data/MappingType.cs [deleted file]
mcs/class/System.Data/System.Data/MergeFailedEventArgs.cs [deleted file]
mcs/class/System.Data/System.Data/MergeFailedEventHandler.cs [deleted file]
mcs/class/System.Data/System.Data/MergeManager.cs [deleted file]
mcs/class/System.Data/System.Data/MissingMappingAction.cs [deleted file]
mcs/class/System.Data/System.Data/MissingPrimaryKeyException.cs [deleted file]
mcs/class/System.Data/System.Data/MissingSchemaAction.cs [deleted file]
mcs/class/System.Data/System.Data/NoNullAllowedException.cs [deleted file]
mcs/class/System.Data/System.Data/Node.cs [deleted file]
mcs/class/System.Data/System.Data/OperationAbortedException.cs [deleted file]
mcs/class/System.Data/System.Data/ParameterDirection.cs [deleted file]
mcs/class/System.Data/System.Data/PropertyAttributes.cs [deleted file]
mcs/class/System.Data/System.Data/PropertyCollection.cs [deleted file]
mcs/class/System.Data/System.Data/ReadOnlyException.cs [deleted file]
mcs/class/System.Data/System.Data/RelatedDataView.cs [deleted file]
mcs/class/System.Data/System.Data/RelationshipConverter.cs [deleted file]
mcs/class/System.Data/System.Data/ResDescriptionAttribute.cs [deleted file]
mcs/class/System.Data/System.Data/ResultSetOptions.cs [deleted file]
mcs/class/System.Data/System.Data/ResultSetSensitivity.cs [deleted file]
mcs/class/System.Data/System.Data/RowNotInTableException.cs [deleted file]
mcs/class/System.Data/System.Data/Rule.cs [deleted file]
mcs/class/System.Data/System.Data/SchemaSerializationMode.cs [deleted file]
mcs/class/System.Data/System.Data/SchemaType.cs [deleted file]
mcs/class/System.Data/System.Data/SerializationFormat.cs [deleted file]
mcs/class/System.Data/System.Data/SqlDbType.cs [deleted file]
mcs/class/System.Data/System.Data/StateChangeEventArgs.cs [deleted file]
mcs/class/System.Data/System.Data/StateChangeEventHandler.cs [deleted file]
mcs/class/System.Data/System.Data/StatementCompletedEventArgs.cs [deleted file]
mcs/class/System.Data/System.Data/StatementCompletedEventHandler.cs [deleted file]
mcs/class/System.Data/System.Data/StatementType.cs [deleted file]
mcs/class/System.Data/System.Data/StrongTypingException.cs [deleted file]
mcs/class/System.Data/System.Data/SyntaxErrorException.cs [deleted file]
mcs/class/System.Data/System.Data/TableAdapterSchemaInfo.cs [deleted file]
mcs/class/System.Data/System.Data/TypeDataSetGeneratorException.cs [deleted file]
mcs/class/System.Data/System.Data/TypedDataSetGenerator.cs [deleted file]
mcs/class/System.Data/System.Data/UniqueConstraint.cs [deleted file]
mcs/class/System.Data/System.Data/UpdateOptions.cs [deleted file]
mcs/class/System.Data/System.Data/UpdateRowSource.cs [deleted file]
mcs/class/System.Data/System.Data/UpdateStatus.cs [deleted file]
mcs/class/System.Data/System.Data/VersionNotFoundException.cs [deleted file]
mcs/class/System.Data/System.Data/XmlConstants.cs [deleted file]
mcs/class/System.Data/System.Data/XmlDataInferenceLoader.cs [deleted file]
mcs/class/System.Data/System.Data/XmlDataLoader.cs [deleted file]
mcs/class/System.Data/System.Data/XmlDataReader.cs [deleted file]
mcs/class/System.Data/System.Data/XmlDiffLoader.cs [deleted file]
mcs/class/System.Data/System.Data/XmlHelper.cs [deleted file]
mcs/class/System.Data/System.Data/XmlReadMode.cs [deleted file]
mcs/class/System.Data/System.Data/XmlSchemaDataImporter.cs [deleted file]
mcs/class/System.Data/System.Data/XmlSchemaWriter.cs [deleted file]
mcs/class/System.Data/System.Data/XmlTableWriter.cs [deleted file]
mcs/class/System.Data/System.Data/XmlWriteMode.cs [deleted file]
mcs/class/System.Data/System.Xml/ChangeLog [deleted file]
mcs/class/System.Data/System.Xml/XmlDataDocument.cs [deleted file]
mcs/class/System.Data/Test/Mono.Data.SqlExpressions/DataColumnExpressionTest.cs
mcs/class/System.Data/Test/System.Data/DataSetTest.cs
mcs/class/System.Data/Test/System.Data/DataTableTest.cs
mcs/class/System.Data/mobile_System.Data.dll.sources
mcs/class/System.Data/mobile_referencesource.sources
mcs/class/System.Data/net_4_5_System.Data.dll.sources
mcs/class/System.Data/referencesource.sources
mcs/class/System.Runtime.Serialization.Json/Assembly/AssemblyInfo.cs [deleted file]
mcs/class/System.Runtime.Serialization.Json/Makefile [deleted file]
mcs/class/System.Runtime.Serialization.Json/System.Runtime.Serialization.Json.dll.sources [deleted file]
mcs/class/System.Runtime.Serialization/System.Runtime.Serialization.Configuration/ChangeLog [deleted file]
mcs/class/System.Runtime.Serialization/System.Runtime.Serialization.Configuration/DataContractSerializerSection.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Runtime.Serialization.Configuration/DeclaredTypeElement.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Runtime.Serialization.Configuration/DeclaredTypeElementCollection.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Runtime.Serialization.Configuration/ParameterElement.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Runtime.Serialization.Configuration/ParameterElementCollection.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Runtime.Serialization.Configuration/SerializationSectionGroup.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Runtime.Serialization.Configuration/TypeElement.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Runtime.Serialization.Configuration/TypeElementCollection.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/ChangeLog [deleted file]
mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/DataContractResolver.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/DataContractSerializer.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/DataContractSerializerSettings.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/DataMemberAttribute.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/DateTimeFormat.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/EmitTypeInformation.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/EnumMemberAttribute.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/ExportOptions.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/ExtensionDataObject.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/IDataContractSurrogate.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/IExtensibleDataObject.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/IgnoreDataMemberAttribute.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/ImportOptions.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/InvalidDataContractException.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/KnownTypeAttribute.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/KnownTypeCollection.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/NetDataContractSerializer.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/SerializationMap.XsdExporter.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/SerializationMap.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/XmlFormatterDeserializer.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/XmlFormatterSerializer.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/XmlObjectSerializer.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/XmlSerializableServices.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/XsdDataContractExporter.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/XsdDataContractImporter.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Xml/ChangeLog [deleted file]
mcs/class/System.Runtime.Serialization/System.Xml/IFragmentCapableXmlDictionaryWriter.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Xml/IStreamProvider.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Xml/IXmlBinaryReaderInitializer.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Xml/IXmlBinaryWriterInitializer.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Xml/IXmlDictionary.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Xml/IXmlMtomReaderInitializer.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Xml/IXmlMtomWriterInitializer.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Xml/IXmlUTF8ReaderInitializer.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Xml/IXmlUTF8WriterInitializer.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Xml/OnXmlDictionaryReaderClose.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Xml/UniqueId.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Xml/XmlBinaryDictionaryReader.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Xml/XmlBinaryDictionaryWriter.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Xml/XmlBinaryDictionaryWriterAutoGen.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Xml/XmlBinaryFormat.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Xml/XmlBinaryReaderSession.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Xml/XmlBinaryWriterSession.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Xml/XmlC14NWriter.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Xml/XmlCanonicalWriter.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Xml/XmlDictionary.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Xml/XmlDictionaryReader.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Xml/XmlDictionaryReaderAutoGen.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Xml/XmlDictionaryReaderQuotas.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Xml/XmlDictionaryString.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Xml/XmlDictionaryWriter.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Xml/XmlDictionaryWriterAutoGen.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Xml/XmlMtomDictionaryReader.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Xml/XmlMtomDictionaryWriter.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Xml/XmlSimpleDictionaryReader.cs [deleted file]
mcs/class/System.Runtime.Serialization/System.Xml/XmlSimpleDictionaryWriter.cs [deleted file]
mcs/class/System.Runtime.Serialization/binary-writer-method-gen.cs [deleted file]
mcs/class/System.Runtime.Serialization/net_4_0_System.Runtime.Serialization.dll.sources [deleted file]
mcs/class/System.Runtime.Serialization/reader-method-gen.cs [deleted file]
mcs/class/System.Runtime.Serialization/resources/mstypes.schema [deleted file]
mcs/class/System.Runtime.Serialization/writer-method-gen.cs [deleted file]
mcs/class/System.Windows.Forms/System.Windows.Forms/FileDialog.cs
mcs/class/System.XML/System.Xml.Xsl/XslCompiledTransform_Mobile.cs
mcs/class/System.XML/Test/System.Xml.Xsl/XslCompiledTransformTests.cs
mcs/class/corlib/System.Runtime.Remoting.Contexts/Context.cs
mcs/class/corlib/Test/System.Collections.Generic/DictionaryTest.cs
mcs/class/corlib/Test/System.Reflection/FieldInfoTest.cs
mcs/class/corlib/Test/System.Resources/ResourceReaderTest.cs
mcs/class/corlib/Test/System/DelegateTest.cs
mcs/class/corlib/Test/System/TypeTest.cs
mcs/mcs/ecore.cs
mcs/tests/test-923.cs [new file with mode: 0644]
mcs/tests/ver-il-net_4_5.xml
mono/io-layer/io-layer.h
mono/io-layer/wapi-remap.h
mono/metadata/appdomain.c
mono/metadata/debug-mono-symfile.c
mono/metadata/debug-mono-symfile.h
mono/metadata/gc-internal.h
mono/metadata/gc.c
mono/metadata/icall-def.h
mono/metadata/icall.c
mono/metadata/marshal.c
mono/metadata/object.c
mono/metadata/seq-points-data.c
mono/metadata/seq-points-data.h
mono/metadata/threadpool-ms.c
mono/metadata/threads-types.h
mono/metadata/threads.c
mono/mini/aot-compiler.c
mono/mini/aot-runtime.c
mono/mini/cpu-arm.md
mono/mini/debugger-agent.c
mono/mini/dwarfwriter.c
mono/mini/exceptions-x86.c
mono/mini/genmdesc.c
mono/mini/genmdesc.pl
mono/mini/helpers.c
mono/mini/image-writer.c
mono/mini/image-writer.h
mono/mini/method-to-ir.c
mono/mini/mini-amd64.c
mono/mini/mini-amd64.h
mono/mini/mini-arm.c
mono/mini/mini-arm.h
mono/mini/mini-exceptions.c
mono/mini/mini-ia64.c
mono/mini/mini-mips.h
mono/mini/mini-ppc.h
mono/mini/mini-runtime.c
mono/mini/mini-s390x.h
mono/mini/mini-x86.c
mono/mini/mini-x86.h
mono/mini/mini.c
mono/mini/mini.h
mono/mini/seq-points.c
mono/mini/seq-points.h
mono/mini/xdebug.c
mono/sgen/sgen-debug.c
mono/sgen/sgen-workers.c
mono/utils/dlmalloc.c
mono/utils/hazard-pointer.c
mono/utils/json.c
mono/utils/json.h
mono/utils/lock-free-alloc.c
mono/utils/lock-free-array-queue.c
mono/utils/mono-io-portability.c
mono/utils/mono-io-portability.h
mono/utils/mono-poll.c
mono/utils/mono-proclib.c
mono/utils/mono-threads.c
mono/utils/monobitset.h
mono/utils/sha1.c
mono/utils/sha1.h
tools/sgen/sgen-grep-binprot.c

index 8f71c5c4936b4df81aec224427c222eaec3b6266..e511a928d3f37ece0de6c40aa7cd91ab69ffe319 100644 (file)
@@ -526,12 +526,12 @@ AC_CACHE_CHECK([for clang],
 ])
 
 AC_ARG_ENABLE(visiblity-hidden,
-[  --disable-visibility-hidden    disable usage of -fvisiblity=hidden]
-   disable_visibility_hidden=no, disable_visibility_hidden=yes)
+[  --disable-visibility-hidden    disable usage of -fvisiblity=hidden],
+   disable_visibility_hidden=yes, disable_visibility_hidden=no)
 
 WARN=''
 if test x"$GCC" = xyes; then
-        WARN='-Wall -Wunused -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes  -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wno-cast-qual -Wwrite-strings -Wno-switch -Wno-switch-enum -Wno-unused-value'
+        WARN='-Wall -Wunused -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes  -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wno-cast-qual -Wwrite-strings -Wno-switch -Wno-switch-enum -Wno-unused-value -Wno-attributes'
 
                # We require C99 with some GNU extensions, e.g. `linux` macro
                CFLAGS="$CFLAGS -std=gnu99"
index 8d65dc5494fdbd9069376c2e7117cdb1c4aa581c..953bb1dd278b5e0ae9e74544815d7351743fee2d 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 8d65dc5494fdbd9069376c2e7117cdb1c4aa581c
+Subproject commit 953bb1dd278b5e0ae9e74544815d7351743fee2d
index a576ba602dbff7e642312899cdcacb52ee3a3d13..66a9e9ca594f7037018747104cb848327534bc39 100644 (file)
@@ -85,6 +85,7 @@ endif
 run-test-lib: test-local
        ok=:; \
        PATH="$(TEST_RUNTIME_WRAPPERS_PATH):$(PATH)" MONO_REGISTRY_PATH="$(HOME)/.mono/registry" MONO_TESTS_IN_PROGRESS="yes" $(TEST_RUNTIME) $(RUNTIME_FLAGS) $(TEST_HARNESS) $(test_assemblies) -noshadow $(TEST_HARNESS_FLAGS) $(LOCAL_TEST_HARNESS_FLAGS) $(TEST_HARNESS_EXCLUDES) $(TEST_HARNESS_OUTPUT) -xml=TestResult-$(PROFILE).xml $(FIXTURE_ARG) $(TESTNAME_ARG)|| ok=false; \
+       if [ ! -f "TestResult-$(PROFILE).xml" ]; then echo "<?xml version='1.0' encoding='utf8'?><test-results failures='1' total='1' not-run='0' name='bcl-tests' date='$$(date +%F)' time='$$(date +%T)'><test-suite name='$(strip $(test_assemblies))' success='False' time='0'><results><test-case name='crash' executed='True' success='False' time='0'><failure><message>The test runner didn't produce a test result XML, probably due to a crash of the runtime. Check the log for more details.</message><stack-trace></stack-trace></failure></test-case></results></test-suite></test-results>" > TestResult-$(PROFILE).xml; fi; \
        $(TEST_HARNESS_POSTPROC) ; $$ok
 
 ## Instructs compiler to compile to target .net execution, it can be usefull in rare cases when runtime detection is not possible
index 9c1d478eb180fa0e5ef3be87c4ffc32cd96388b5..bf14075f7ff0dd040cf264e7dca6a96a9c4300fd 100644 (file)
@@ -256,9 +256,8 @@ namespace Microsoft.Build.Tasks {
                {
                        PackageAssemblyInfo pkg = null;
 
-                       if (specific_version) {
-                               pkg = PcCache.GetAssemblyLocation (reference.ItemSpec);
-                       } else {
+                       pkg = PcCache.GetAssemblyLocation (reference.ItemSpec);
+                       if (pkg == null && !specific_version) {
                                // if not specific version, then just match simple name
                                string name = reference.ItemSpec;
                                if (name.IndexOf (',') > 0)
index 580c8dd85fa890b14ecd68d30a0f75260dd644a5..5cb0ae8a4ce2ab27e74207542e28e31427e4efe8 100644 (file)
@@ -932,6 +932,11 @@ namespace Mono.Data.Tds.Protocol
                                        element = new Guid (guidBytes);
                                }
                                break;
+                       case TdsColumnType.Variant :
+                               if (outParam)
+                                       comm.Skip (4);
+                               element = GetVariantValue();
+                               break;
                        default :
                                return DBNull.Value;
                        }
@@ -956,6 +961,40 @@ namespace Mono.Data.Tds.Protocol
                        return result;
                }
 
+               private object GetVariantValue ()
+               {
+                       uint len = (uint)comm.GetTdsInt ();
+                       if (len == 0)
+                               return DBNull.Value;
+
+                       // VARIANT_BASETYPE
+                       TdsColumnType colType = (TdsColumnType)comm.GetByte ();
+                       // VARIANT_PROPBYTES
+                       byte propbytes = comm.GetByte ();
+                       if (propbytes != 0)
+                               // VARIANT_PROPERTIES
+                               comm.Skip (propbytes);
+
+                       len -= (uint)propbytes + 2;
+
+                       switch (colType)
+                       {
+                       case TdsColumnType.Int1 :
+                       case TdsColumnType.Int2 :
+                       case TdsColumnType.Int4 :
+                       case TdsColumnType.BigInt :
+                               return GetIntValue (colType);
+                       default:
+                               // The old code was ignoring variants
+                               // and returning null.  Should we
+                               // throw an exception?
+                               comm.Skip (len);
+                               break;
+                       }
+
+                       return DBNull.Value;
+               }
+
                private object GetDateTimeValue (
                        TdsColumnType? type
                )
@@ -1291,7 +1330,7 @@ namespace Mono.Data.Tds.Protocol
                
                internal bool IsBlobType (TdsColumnType columnType)
                {
-                       return (columnType == TdsColumnType.Text || columnType == TdsColumnType.Image || columnType == TdsColumnType.NText);
+                       return (columnType == TdsColumnType.Text || columnType == TdsColumnType.Image || columnType == TdsColumnType.NText || columnType == TdsColumnType.Variant);
                }
 
                internal bool IsLargeType (TdsColumnType columnType)
index 5421004906785cb63f945e77102930fd436ac1c0..725248a8fc06fac676c14e34288ccaa2c06e402a 100644 (file)
@@ -586,6 +586,13 @@ namespace Mono.Data.Tds.Protocol
                        } else if (colType == TdsColumnType.BigVarBinary) {
                                if (size > 8000)
                                        colType = TdsColumnType.Image;
+                       } else if (colType == TdsColumnType.DateTime2 ||
+                                  colType == TdsColumnType.DateTimeOffset) {
+                               // HACK: Wire-level DateTime{2,Offset}
+                               // require TDS 7.3, which this driver
+                               // does not implement correctly--so we
+                               // serialize to ASCII instead.
+                               colType = TdsColumnType.Char;
                        }
                        // Calculation of TypeInfo field
                        /* 
@@ -715,6 +722,8 @@ namespace Mono.Data.Tds.Protocol
                                case "nchar" :
                                case "text" :
                                case "ntext" :
+                               case "datetime2":
+                               case "datetimeoffset":
                                        byte [] tmp = param.GetBytes ();
                                        Comm.Append (tmp);
                                        break;
index af3f22716476d12b229123e01bed344cbe84436a..bc1f7fb0ba1742b6aae35d315d7c9bd4786f18df 100644 (file)
@@ -35,6 +35,8 @@ namespace Mono.Data.Tds.Protocol {
                Char = 0x2f,            // SYBCHAR
                DateTime = 0x3d,        // SYBDATETIME
                DateTime4 = 0x3a,       // SYBDATETIME4
+               DateTime2 = 0x2a,       // SYBMSDATETIME2
+               DateTimeOffset = 0x2b,  // SYBMSDATETIMEOFFSET
                DateTimeN = 0x6f,       // SYBDATETIMN
                Decimal = 0x6a,         // SYBDECIMAL
                Real = 0x3b,            // SYBREAL
index af8d39044526e94a604bf0b49b3982e41eb9511a..3892035220ce24f61a90e9f1c0c7a632f7936e73 100644 (file)
@@ -219,6 +219,9 @@ namespace Mono.Data.Tds.Protocol {
                        case TypeCode.Object :
                                if (o is byte[])
                                        Append ((byte[]) o);
+                               else if (o is Guid)
+                                       Append (((Guid) o).ToByteArray ());
+                               else break;
                                return;
                        case TypeCode.Int16 :
                                Append ((short) o);
index d8a4b34fb133a8a12c1b7a7342ade66dce57918a..e00b9e4e236d853db25863eae6eaf25bfab1b787 100644 (file)
@@ -287,18 +287,31 @@ namespace Mono.Data.Tds {
                internal string Prepare ()
                {
                        string typeName = TypeName;
-                       
-                       if (typeName == "varbinary") {
-                               int size = Size;
+                       // Cf. GetDateTimeString
+                       TdsColumnType actualType = TdsColumnType.Char;
+                       int size;
+
+                       switch (typeName) {
+                       case "varbinary":
+                               size = Size;
                                if (size <= 0) {
                                        size = GetActualSize ();
                                }
-                               
+
                                if (size > 8000) {
                                        typeName = "varbinary(max)";
                                }
+                               break;
+                       case "datetime2":
+                               actualType = TdsColumnType.DateTime2;
+                               typeName = "char";
+                               break;
+                       case "datetimeoffset":
+                               actualType = TdsColumnType.DateTimeOffset;
+                               typeName = "char";
+                               break;
                        }
-                       
+
                        string includeAt = "@";
                        if (ParameterName [0] == '@')
                                includeAt = "";
@@ -313,7 +326,7 @@ namespace Mono.Data.Tds {
                        case "varchar":
                        case "varbinary":
                                //A size of 0 is not allowed in declarations.
-                               int size = Size;
+                               size = Size;
                                if (size <= 0) {
                                        size = GetActualSize ();
                                        if (size <= 0)
@@ -326,6 +339,14 @@ namespace Mono.Data.Tds {
                                result.Append (paramSize > 0 ? (paramSize > 4000 ? "(max)" : String.Format ("({0})", paramSize)) : "(4000)");
                                break;
                        case "char":
+                               size = -1;
+                               if (actualType != TdsColumnType.Char)
+                                       size = GetDateTimeStringLength (actualType);
+                               else if (isSizeSet)
+                                       size = Size;
+                               if (size > 0)
+                                       result.Append (String.Format ("({0})", size));
+                               break;
                        case "nchar":
                        case "binary":
                                if (isSizeSet && Size > 0)
@@ -366,6 +387,10 @@ namespace Mono.Data.Tds {
                        case "float":
                        case "money":
                                return 8;
+                       case "datetime2":
+                               return GetDateTimeStringLength (TdsColumnType.DateTime2);
+                       case "datetimeoffset":
+                               return GetDateTimeStringLength (TdsColumnType.DateTimeOffset);
                        case "int":
                        case "real":
                        case "smalldatetime":
@@ -386,6 +411,53 @@ namespace Mono.Data.Tds {
                        return size;
                }
 
+               private int GetDateTimePrecision ()
+               {
+                       int precision = Precision;
+
+                       // http://msdn.microsoft.com/en-us/library/bb677335.aspx
+                       // says that default precision is 7.  How do
+                       // we distinguish that from zero?
+                       if (precision == 0 || precision > 7)
+                               precision = 7;
+
+                       return precision;
+               }
+
+               private int GetDateTimeStringLength (TdsColumnType type)
+               {
+                       int precision = GetDateTimePrecision ();
+                       int len = precision == 0 ? 19 : 20 + precision;
+
+                       if (type == TdsColumnType.DateTimeOffset)
+                               len += 6;
+
+                       return len;
+               }
+
+               // HACK: Wire-level DateTime{2,Offset} require TDS
+               // 7.3, which this driver does not implement
+               // correctly--so we serialize to ASCII instead.
+               private string GetDateTimeString (TdsColumnType type)
+               {
+                       int precision = GetDateTimePrecision ();
+                       string fmt = "yyyy-MM-dd'T'HH':'mm':'ss";
+
+                       if (precision > 0)
+                               fmt += ".fffffff".Substring(0, precision + 1);
+
+                       switch (type) {
+                       case TdsColumnType.DateTime2:
+                               DateTime dt = (DateTime)Value;
+                               return dt.ToString(fmt);
+                       case TdsColumnType.DateTimeOffset:
+                               DateTimeOffset dto = (DateTimeOffset)Value;
+                               return dto.ToString(fmt + "zzz");
+                       }
+
+                       throw new ApplicationException("Should be unreachable");
+               }
+
                internal byte[] GetBytes ()
                {
                        byte[] result = {};
@@ -403,6 +475,10 @@ namespace Mono.Data.Tds {
                                case "char" :
                                case "text" :
                                        return Encoding.Default.GetBytes ((string)Value);
+                               case "datetime2":
+                                       return Encoding.Default.GetBytes (GetDateTimeString (TdsColumnType.DateTime2));
+                               case "datetimeoffset":
+                                       return Encoding.Default.GetBytes (GetDateTimeString (TdsColumnType.DateTimeOffset));
                                default :
                                        return ((byte[]) Value);
                        }
@@ -441,6 +517,10 @@ namespace Mono.Data.Tds {
                                if (IsNullable)
                                        return TdsColumnType.DateTimeN;
                                return TdsColumnType.DateTime4;
+                       case "datetime2":
+                               return TdsColumnType.DateTime2;
+                       case "datetimeoffset":
+                               return TdsColumnType.DateTimeOffset;
                        case "float":
                                if (IsNullable)
                                        return TdsColumnType.FloatN ;
@@ -480,6 +560,8 @@ namespace Mono.Data.Tds {
                                return TdsColumnType.BigVarBinary;
                        case "varchar":
                                return TdsColumnType.BigVarChar;
+                       case "sql_variant":
+                               return TdsColumnType.Variant;
                        default:
                                throw new NotSupportedException ("Unknown Type : " + TypeName);
                        }
index c1bb3ed418613b3b90d0caaa530f6688e75a31f2..11934cb345783d9e9205e7e61776f19f85630cb6 100644 (file)
@@ -1,7 +1,11 @@
 y.output
-/gen_OdbcConnection.cs
-/gen_OdbcParameter.cs
-/gen_OdbcParameterCollection.cs
-/gen_OleDbConnection.cs
-/gen_OleDbParameter.cs
-/gen_OleDbParameterCollection.cs
\ No newline at end of file
+gen_OleDbConnection.cs
+gen_OleDbParameter.cs
+gen_OleDbParameterCollection.cs
+gen_OdbcConnection.cs
+gen_OdbcParameter.cs
+gen_OdbcParameterCollection.cs
+gen_SqlConnection.cs
+gen_SqlParameter.cs
+gen_SqlParameterCollection.cs
+
diff --git a/mcs/class/System.Data/Mono.Data.SqlExpressions/.gitignore b/mcs/class/System.Data/Mono.Data.SqlExpressions/.gitignore
deleted file mode 100644 (file)
index ac16218..0000000
+++ /dev/null
@@ -1 +0,0 @@
-/Parser.cs
diff --git a/mcs/class/System.Data/Mono.Data.SqlExpressions/Aggregation.cs b/mcs/class/System.Data/Mono.Data.SqlExpressions/Aggregation.cs
deleted file mode 100644 (file)
index 5f27a84..0000000
+++ /dev/null
@@ -1,216 +0,0 @@
-//
-// Aggregation.cs
-//
-// Author:
-//   Juraj Skripsky (juraj@hotfeet.ch)
-//
-// (C) 2004 HotFeet GmbH (http://www.hotfeet.ch)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections;
-using System.Data;
-
-namespace Mono.Data.SqlExpressions {
-       internal enum AggregationFunction {
-               Count, Sum, Min, Max, Avg, StDev, Var
-       }
-
-       internal class Aggregation : BaseExpression {
-               bool cacheResults;
-               DataRow[] rows;
-               ColumnReference column;
-               AggregationFunction function;
-               int count;
-               IConvertible result;
-               DataRowChangeEventHandler RowChangeHandler;
-               DataTable table ;
-
-               public Aggregation (bool cacheResults, DataRow[] rows, AggregationFunction function, ColumnReference column)
-               {
-                       this.cacheResults = cacheResults;
-                       this.rows = rows;
-                       this.column = column;
-                       this.function = function;
-                       this.result = null;
-                       if (cacheResults)
-                               RowChangeHandler = new DataRowChangeEventHandler (InvalidateCache);
-               }
-
-               public override bool Equals(object obj)
-               {
-                       if (!base.Equals (obj))
-                               return false;
-
-                       if (!(obj is Aggregation))
-                               return false;
-
-                       Aggregation other = (Aggregation) obj;
-                       if (!other.function.Equals( function))
-                               return false;
-
-                       if (!other.column.Equals (column))
-                               return false;           
-
-                       if (other.rows != null && rows != null) {
-                       if (other.rows.Length != rows.Length)
-                               return false;
-
-                       for (int i=0; i < rows.Length; i++)
-                               if (other.rows [i] != rows [i])
-                                       return false;
-
-                       }
-                       else if (!(other.rows == null && rows == null))
-                               return false;
-               
-                       return true;
-               }
-
-               public override int GetHashCode()
-               {
-                       int hashCode = base.GetHashCode ();
-                       hashCode ^= function.GetHashCode ();
-                       hashCode ^= column.GetHashCode ();
-                       for (int i=0; i < rows.Length; i++)
-                               hashCode ^= rows [i].GetHashCode ();
-                       
-                       return hashCode;
-               }
-               
-       
-               public override object Eval (DataRow row)
-               {
-                       //TODO: implement a better caching strategy and a mechanism for cache invalidation.
-                       //for now only aggregation over the table owning 'row' (e.g. 'sum(parts)'
-                       //in constrast to 'sum(child.parts)') is cached.
-                       if (cacheResults && result != null && column.ReferencedTable == ReferencedTable.Self)
-                               return result;
-                               
-                       count = 0;
-                       result = null;
-                       
-                       object[] values;
-                       if (rows == null)
-                               values = column.GetValues (column.GetReferencedRows (row));
-                       else
-                               values = column.GetValues (rows);
-                       
-                       foreach (object val in values) {
-                               if (val == null)
-                                       continue;
-                                       
-                               count++;
-                               Aggregate ((IConvertible)val);
-                       }
-
-                       switch (function) {
-                       case AggregationFunction.StDev:
-                       case AggregationFunction.Var:
-                               result = CalcStatisticalFunction (values);
-                               break;
-                                       
-                       case AggregationFunction.Avg:
-                               result = ((count == 0) ? DBNull.Value : Numeric.Divide (result, count));
-                               break;
-                       
-                       case AggregationFunction.Count:
-                               result = count;
-                               break;
-                       }
-                       
-                       if (result == null)
-                               result = DBNull.Value;
-                       
-                       if (cacheResults && column.ReferencedTable == ReferencedTable.Self) 
-                       {
-                               table = row.Table;
-                               row.Table.RowChanged += RowChangeHandler;
-                       }       
-                       return result;
-               }
-
-               override public bool DependsOn(DataColumn other)
-               {
-                       return column.DependsOn(other);
-               }
-               
-               private void Aggregate (IConvertible val)
-               {
-                       switch (function) {
-                       case AggregationFunction.Min:
-                               result = (result != null ? Numeric.Min (result, val) : val);
-                               return;
-                       
-                       case AggregationFunction.Max:
-                               result = (result != null ? Numeric.Max (result, val) : val);
-                               return;
-
-                       case AggregationFunction.Sum:
-                       case AggregationFunction.Avg:
-                       case AggregationFunction.StDev:
-                       case AggregationFunction.Var:
-                               result = (result != null ? Numeric.Add (result, val) : val);
-                               return;
-                       }
-               }
-               
-               private IConvertible CalcStatisticalFunction (object[] values)
-               {
-                       if (count < 2)
-                               return DBNull.Value;
-
-                       double average = (double)Convert.ChangeType(result, TypeCode.Double) / count;
-                       double res = 0.0;
-                                               
-                       foreach (object val in values) {
-                               if (val == null)
-                                       continue;
-                                       
-                               double diff = average - (double)Convert.ChangeType(val, TypeCode.Double);
-                               res += System.Math.Pow (diff, 2);
-                       }
-                       res /= (count - 1);
-                       
-                       if (function == AggregationFunction.StDev)
-                               res = System.Math.Sqrt (res);
-
-                       return res;
-               }
-
-               public override void ResetExpression ()
-               {
-                       if (table != null)
-                               InvalidateCache (table, null);
-               }
-
-               private void InvalidateCache (Object sender, DataRowChangeEventArgs args)
-               {
-                       result = null; 
-                       ((DataTable)sender).RowChanged -= RowChangeHandler;
-               }
-       }
-}
diff --git a/mcs/class/System.Data/Mono.Data.SqlExpressions/ArithmeticExpressions.cs b/mcs/class/System.Data/Mono.Data.SqlExpressions/ArithmeticExpressions.cs
deleted file mode 100644 (file)
index dc4e084..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-//
-// ArithmeticExpressions.cs
-//
-// Author:
-//   Juraj Skripsky (juraj@hotfeet.ch)
-//
-// (C) 2004 HotFeet GmbH (http://www.hotfeet.ch)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections;
-using System.Data;
-
-namespace Mono.Data.SqlExpressions {
-       internal class Negative : UnaryExpression {
-               public Negative (IExpression e) : base (e) {}
-       
-               override public object Eval (DataRow row)
-               {
-                       return Numeric.Negative ((IConvertible)expr.Eval (row));
-               }
-       }
-       
-       internal class ArithmeticOperation : BinaryOpExpression {
-               public ArithmeticOperation (Operation op, IExpression e1, IExpression e2) : base (op, e1, e2) {}
-       
-               override public object Eval (DataRow row)
-               {
-                       object obj1 = expr1.Eval (row);
-                       if (obj1 == DBNull.Value || obj1 == null)
-                               return obj1;
-                       object obj2 = expr2.Eval (row);
-                       if (obj2 == DBNull.Value || obj2 == null)
-                               return obj2;
-               
-                       if (op == Operation.ADD && (obj1 is string || obj2 is string))
-                               return obj1.ToString () + obj2.ToString ();
-               
-                       IConvertible o1 = (IConvertible)obj1;
-                       IConvertible o2 = (IConvertible)obj2;
-                       
-                       switch (op) {
-                       case Operation.ADD:
-                               return Numeric.Add (o1, o2);
-                       case Operation.SUB:
-                               return Numeric.Subtract (o1, o2);
-                       case Operation.MUL:
-                               return Numeric.Multiply (o1, o2);
-                       case Operation.DIV:
-                               return Numeric.Divide (o1, o2);
-                       case Operation.MOD:
-                               return Numeric.Modulo (o1, o2);
-                       default:
-                               return 0;
-                       }
-               }
-       }
-}
diff --git a/mcs/class/System.Data/Mono.Data.SqlExpressions/BooleanExpressions.cs b/mcs/class/System.Data/Mono.Data.SqlExpressions/BooleanExpressions.cs
deleted file mode 100644 (file)
index 04f05c0..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-//
-// BooleanExpressions.cs
-//
-// Author:
-//   Juraj Skripsky (juraj@hotfeet.ch)
-//
-// (C) 2004 HotFeet GmbH (http://www.hotfeet.ch)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections;
-using System.Data;
-
-namespace Mono.Data.SqlExpressions {
-       internal class Negation : UnaryExpression {
-               public Negation (IExpression e) : base (e) {}
-       
-               override public object Eval (DataRow row)
-               {
-                       object o = expr.Eval (row);
-                       if (o == DBNull.Value)
-                               return o;
-                       return !((bool)o);
-               }
-
-               override public bool EvalBoolean (DataRow row)
-               {
-                       return !expr.EvalBoolean (row);
-               }
-       }
-       
-       internal class BoolOperation : BinaryOpExpression {
-               public BoolOperation (Operation op, IExpression e1, IExpression e2) : base (op, e1, e2) {}
-       
-               override public object Eval (DataRow row)
-               {
-                       return EvalBoolean (row);
-               }
-
-               override public bool EvalBoolean (DataRow row)
-               {
-                       if (op == Operation.OR)
-                               return (expr1.EvalBoolean (row)) || (expr2.EvalBoolean (row));
-                       if (op == Operation.AND)
-                               return (expr1.EvalBoolean (row)) && (expr2.EvalBoolean (row));
-                       return false;
-               }
-       }
-}
diff --git a/mcs/class/System.Data/Mono.Data.SqlExpressions/ChangeLog b/mcs/class/System.Data/Mono.Data.SqlExpressions/ChangeLog
deleted file mode 100644 (file)
index 55aca6a..0000000
+++ /dev/null
@@ -1,240 +0,0 @@
-2009-10-28  Marek Habersack  <mhabersack@novell.com>
-
-       * Tokenizer.cs, Parser.jay: a work around for 3 reduce/reduce
-       conflicts (use of 'NOT LIKE' and 'NOT IN' which would previously
-       be ignored because of the conflicts). The grammar still has 6 more
-       of those - the real fix is to rewrite it.
-
-2009-07-23  Adam Wendt  <adam@awendtconsulting.com>
-
-       * Comparison.cs (Compare): Parse string if other object is DateTime
-       regardless of which side the DateTime is on.
-
-2008-08-18  Marek Habersack  <mhabersack@novell.com>
-
-       * Numeric.cs: Max/Min operations do not convert string
-       IConvertibles to double - they perform a simple string compare
-       instead.
-
-2008-01-23 Konstantin Triger <kostat@mainsoft.com>
-
-       * Like.cs: when rh expresssion is null or DBNull always return false.
-
-2007-12-24 Konstantin Triger <kostat@mainsoft.com>
-
-       * Parser.jay, StringFunctions.cs, Like.cs: add support for string concat.
-
-2007-07-26  Nagappan A  <anagappan@novell.com>
-
-       * Comparison.cs (Compare): Should always parse the object of type
-       DateTime in InvariantCulture CultureInfo, Fixes Bug # 82109.
-
-2007-06-06  Nagappan A  <anagappan@novell.com>
-
-       * ColumnReference.cs (Unify): Return object as it is, if object
-       type is char. Fixes bug # 81625.
-
-       * Numeric.cs (IsNumeric): Return false if object type is
-       char. Fixes bug # 81625.
-
-2007-02-23  Nagappan A  <anagappan@novell.com>
-
-       * Comparison.cs (Compare): Extra space characters issue when using
-       System.Data.DataTable.Select. Fixes bug # 79695.
-
-2006-12-07  Nagappan A  <anagappan@novell.com>
-
-       * Parser.jay (ColumnName): Fix Invalid DataColumn Expression, bug
-       # 80169.
-
-2006-06-15  Senganal T  <tsenganal@novell.com>
-
-       * Expression.cs : 
-               - EvalBoolean : throw EvaluateException unless overridden.
-               - UnaryExpression.EvalBoolean : override EvalBoolean
-       * Like.cs, In.cs, ColumnReference.cs : override EvalBoolean 
-
-2006-06-09  Juraj Skripsky <js@hotfeet.ch>
-
-       * Tokenizer.cs (ProcessEscapes): Inspect the next character, not the one
-       after that.
-
-2006-05-02  Senganal T  <tsenganal@novell.com>
-
-       * Parser.jay : fix the rule for IsNull. Fixes bug #78254
-       * Functions.cs : 
-               - IsNullFunction.Eval : If expr evaluates to null or DBNull.Value, return the
-               default expression value.
-
-2006-03-27     Boris Kirzner <borisk@mainsoft.com>
-       * Aggregation.cs: fix possible NullReferenceException.
-
-2006-02-03  Senganal T  <tsenganal@novell.com>
-       
-       * ColumnReference.cs : 
-               - GetReferencedRow () 
-               - GetReferencedRows() : Verify the column before getting the values.
-                       Validate the ColumnReference even when the table has no rows.
-       * Function.cs : Modified Eval()
-               - A tmp fix to check for null. Expression.Eval needs to be modified all
-               around to return DBNull.Value.
-
-2006-01-18 Boris Kirzner <borisk@mainsoft.com>
-       * ColumnReference.cs: added column and relation lazy evaluation 
-       and caching.
-
-2006-01-09 Senganal T <tsenganal@novell.com>
-       * Aggregation.cs
-       * Expression.cs
-               - resolving a name clash in IExpression 
-
-2006-01-06 Senganal T <tsenganal@novell.com>
-
-       * Aggregation.cs
-               - a correction to the previous check-in
-
-2006-01-06 Senganal T <tsenganal@novell.com>
-
-       * Aggregation.cs
-               - Modified the cache to listen for RowChangedEvents.
-       * Expression.cs
-       * IExpression.cs
-               - Added a Reset Method to cleanup when a Datacolumn is removed
-               from a table.
-       * Parser.jay
-               - Modified to check :
-               1.Aggregate Functions : Only for columns returning multiple values (child/local)
-               2.Other Numeric/Functions : Only for columns that return single value (parent/local)
-
-2005-12-20 Senganal T <tsenganal@novell.com>
-
-       * Aggregation.cs :
-               Modified the Eval and CalculateStatisticalFunction to add boundary checks.
-               Fixes #77025.
-
-2005-11-30 Konstantin Triger <kostat@mainsoft.com>
-
-       * Parser.jay: use Convert.ToInt32() instead of cast to throw OverflowException.
-
-2005-10-26 Konstantin Triger <kostat@mainsoft.com>
-
-       * In.cs: Fix the enumerator initialization problem.
-
-2005-10-21 Senganal T <tsenganal@novell.com>
-
-       * Numeric.cs :
-               - Modified the Max and Min functions to convert strings(numeric) to
-               double. Fixes bug #76213. 
-       
-2005-09-19 Boris Kirzner <borisk@mainsoft.com>
-       * ColumnReference.cs, Expressions.cs, Like.cs, Aggregation.cs, Literal.cs,
-       StringFunctions.cs, In.cs, Functions.cs : implemented Equals() 
-       and GetHashCode() methods for all Mono.Data.SqlExpressions classes,enabling
-       comparison of the filter expressions.
-
-2005-08-02  Sureshkumar T  <tsureshkumar@novell.com>
-
-       * Tokenizer.cs: ReadString (): added an overload where the
-       terminator can be escaped by repeating twice.
-
-2005-06-29  Sureshkumar T  <tsureshkumar@novell.com>
-
-       * ArithmeticExpressions.cs: Eval :if any one of the argument is
-       null for an operator, the result is also NULL.
-
-2005-05-02 Konstantin Triger <kostat@mainsoft.com>
-
-        * IExpression interface: Added DependsOn(DataColumn) method, which checks whether the Expression contains a specific column
-
-2005-04-26 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
-       * Tokenizer.cs: make it not rely in exceptions being thrown to know that
-       the array is entirely processed.
-
-2005-02-10  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * Comparison.cs : allow comparison between guid and string.
-       * ColumnReference.cs : return guid value too. Fixed bug #72426.
-
-2005-01-28  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * Comparison.cs : Eval() could be direct invocation to EvalBoolean().
-
-2005-01-26  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * Tokenizer.cs : just throw SyntaxErrorException instead of Exception.
-
-2005-01-25  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * Expression.cs, ColumnReference.cs, BooleanExpression.cs,
-         Aggregation.cs, Literal.cs : added EvalBoolean() to avoid extraneous
-         boxing in RowFilter.
-
-2005-01-20  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * Numeric.cs : Fixed ToSameType(). It should let conversion result to
-         reference values.
-
-2005-01-20  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * Parser.jay : let's use debug flag when MONO_DEBUG_SQLEXPRESSIONS
-         environment variable is set.
-         Fixed substring() function. C# cast does not allow implicit
-         conversion from object.
-
-2004-07-12 Umadevi S   <sumadevi@novell.com>
-        * Tokenizer.cs - read an Int64 from the text instead of Int32. Resolves
-bug 61203
-
-                                                                                
-2004-06-17  Boris Kirzner <borisk@mainsoft.com>
-        *  Comparison.cs - use 'as' to avoid NullReferenceExeption in casting.
-
-2004-05-13  Umadevi S <sumadevi@novell.com>
-        *  Literal.cs - made class internal
-
-2004-05-12  Umadevi S <sumadevi@novell.com>
-        * Expression.cs, Functions.cs, In.cs, Like.cs, Parser.jay, StringFunctions.cs - made class/enum/interfaces internal
-
-2004-05-12  Umadevi S <sumadevi@novell.com>
-        * BooleanExpression.cs,ColumnReference.cs, Comparision.cs - made class/enum internal
-
-2004-05-12  Umadevi S <sumadevi@novell.com>
-        * ArthimeticExpression.cs - made class internal
-
-2004-05012  Umadevi S <sumadevi@novell.com>
-       * Aggregation.cs - made class/enums/interfaces internal 
-
-2004-05-05  Atsushi Enomoto <atsushi@ximian.com>
-
-       * ArithmeticExpressions.cs: avoid null exception on add operation.
-
-2004-04-29  Juraj Skripsky <juraj@hotfeet.ch>
-
-       * Parser.jay: Fix rule for negative expressions.
-       Add precedence rules for '<' and '>'.
-
-2004-04-28 Boris Kirzner <borisk@mainsoft.com>
-
-       * ColumnReference.cs : using DataRow _inExpressionEvaluation before accessing row value
-         to get an access to deleted rows also.
-
-2004-04-22  Juraj Skripsky <juraj@hotfeet.ch>
-
-       * Parser.jay: Allow computed expressions on left-hand side of
-       "like" operator.
-       Correct ordering for "is null" rule ("NOT IS NULL" => "IS NOT NULL"). 
-
-2004-04-20  Juraj Skripsky <juraj@hotfeet.ch>
-
-       * Tokenizer.cs (ReadNumber): Correctly consume decimal point
-       when reading numbers. Fixes bug #57251.
-
-2004-03-31  Juraj Skripsky <juraj@hotfeet.ch>
-
-       * Parser.jay, ColumnReference.cs, Comparison.cs, Functions.cs,
-       Aggregation.cs : fix bugs exposed by DataColumnTest.cs.
-
-2004-03-29  Juraj Skripsky <juraj@hotfeet.ch>
-
-       * Initial implementation.
diff --git a/mcs/class/System.Data/Mono.Data.SqlExpressions/ColumnReference.cs b/mcs/class/System.Data/Mono.Data.SqlExpressions/ColumnReference.cs
deleted file mode 100644 (file)
index 2284442..0000000
+++ /dev/null
@@ -1,304 +0,0 @@
-//
-// ColumnReference.cs
-//
-// Author:
-//   Juraj Skripsky (juraj@hotfeet.ch)
-//
-// (C) 2004 HotFeet GmbH (http://www.hotfeet.ch)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections;
-using System.Data;
-using System.ComponentModel;
-
-namespace Mono.Data.SqlExpressions {
-       internal enum ReferencedTable {
-               Self,
-               Parent,
-               Child
-       }
-       
-       internal class ColumnReference : BaseExpression {
-               ReferencedTable refTable;
-               string relationName, columnName;
-               DataColumn _cachedColumn;
-               DataRelation _cachedRelation;
-
-               public ColumnReference (string columnName) : this (ReferencedTable.Self, null, columnName) {}
-
-               public ColumnReference (ReferencedTable refTable, string relationName, string columnName)
-               {
-                       this.refTable = refTable;
-                       this.relationName = relationName;
-                       this.columnName = columnName;
-               }
-
-               public override bool Equals(object obj)
-               {
-                       if (!base.Equals (obj))
-                               return false;
-
-                       if (!(obj is ColumnReference))
-                               return false;
-
-                       ColumnReference other = (ColumnReference) obj;
-                       if (other.refTable != refTable)
-                               return false;
-
-                       if (other.columnName != columnName)
-                               return false;           
-
-                       if (other.relationName != relationName)
-                               return false;
-
-                       return true;
-               }
-
-               public override int GetHashCode()
-               {
-                       int hashCode = base.GetHashCode ();
-                       hashCode ^= refTable.GetHashCode ();
-                       hashCode ^= columnName.GetHashCode ();
-                       hashCode ^= relationName.GetHashCode ();
-                       return hashCode;
-               }
-
-               public ReferencedTable ReferencedTable {
-                       get { return refTable; }
-               }
-
-               private DataRelation GetRelation (DataRow row)
-               {
-                       if (_cachedRelation == null) {
-                               DataTable table = row.Table;
-                               DataRelationCollection relations;
-                               if (relationName != null) {
-                                       relations = table.DataSet.Relations;
-                                       _cachedRelation = relations [relations.IndexOf (relationName)];
-                               }
-                               else {
-                                       if (refTable == ReferencedTable.Parent)
-                                               relations = table.ParentRelations;
-                                       else
-                                               relations = table.ChildRelations;
-                                               
-                                       if (relations.Count > 1)
-                                               throw new EvaluateException (String.Format (
-                                                       "The table [{0}] is involved in more than one relation." +
-                                                       "You must explicitly mention a relation name.",
-                                                       table.TableName));
-                                       else
-                                               _cachedRelation = relations [0];
-                               }
-                               _cachedRelation.DataSet.Relations.CollectionChanged += new CollectionChangeEventHandler (OnRelationRemoved);
-                       }
-                       return _cachedRelation;
-               }
-
-               private DataColumn GetColumn (DataRow row)
-               {
-                       if (_cachedColumn == null) {
-                               DataTable table = row.Table;
-                               switch (refTable) {
-                                       case ReferencedTable.Parent:
-                                               table = GetRelation (row).ParentTable;
-                                               break;
-                                       case ReferencedTable.Child:
-                                               table = GetRelation (row).ChildTable;
-                                               break;
-                               }
-                               _cachedColumn = table.Columns [columnName];
-                               if (_cachedColumn == null)
-                                       throw new EvaluateException (String.Format ("Cannot find column [{0}].", columnName));
-
-                               _cachedColumn.PropertyChanged += new PropertyChangedEventHandler (OnColumnPropertyChanged);
-                               _cachedColumn.Table.Columns.CollectionChanged += new CollectionChangeEventHandler (OnColumnRemoved);
-                       }
-                       return _cachedColumn;
-               }
-
-               public DataRow GetReferencedRow (DataRow row)
-               {
-                       // Verify the column reference is valid 
-                       GetColumn (row);
-
-                       switch (refTable) {
-                       case ReferencedTable.Self:
-                       default:
-                               return row;
-
-                       case ReferencedTable.Parent:
-                               return row.GetParentRow (GetRelation (row));
-
-                       case ReferencedTable.Child:
-                               return row.GetChildRows (GetRelation (row)) [0];
-                       }
-               }
-               
-               public DataRow[] GetReferencedRows (DataRow row)
-               {
-                       // Verify the column reference is valid 
-                       GetColumn (row);
-
-                       switch (refTable) {
-                       case ReferencedTable.Self:
-                       default:
-                               DataRow[] rows = row.Table.NewRowArray(row.Table.Rows.Count);
-                               row.Table.Rows.CopyTo (rows, 0);
-                               return rows;
-                               
-                       case ReferencedTable.Parent:
-                               return row.GetParentRows (GetRelation (row));
-
-                       case ReferencedTable.Child:
-                               return row.GetChildRows (GetRelation (row));
-                       }
-               }
-               
-               public object[] GetValues (DataRow[] rows)
-               {
-                       object[] values = new object [rows.Length];
-                       for (int i = 0; i < rows.Length; i++)
-                               values [i] = Unify (rows [i][GetColumn (rows [i])]);
-                               
-                       return values;
-               }
-
-               private object Unify (object val) {
-                       if (Numeric.IsNumeric (val))
-                               return Numeric.Unify ((IConvertible)val);
-                               
-                       if (val == null || val == DBNull.Value)
-                               return null;
-                               
-                       if (val is bool || val is string || val is DateTime || val is Guid || val is char)
-                               return val;
-                       
-                       if (val is Enum)
-                               return (int)val;
-                       
-                       throw new EvaluateException (String.Format ("Cannot handle data type found in column '{0}'.", columnName));                     
-               }
-
-               public override object Eval (DataRow row)
-               {
-                       DataRow referencedRow = GetReferencedRow (row);
-                       if (referencedRow == null)
-                               return null;
-                               
-                       object val;
-                       try {
-                               referencedRow._inExpressionEvaluation = true;
-                               val = referencedRow [GetColumn (row)];
-                               referencedRow._inExpressionEvaluation = false;
-                       } catch (IndexOutOfRangeException) {
-                               throw new EvaluateException (String.Format ("Cannot find column [{0}].", columnName));
-                       }
-                       return Unify (val);
-               }
-
-               public override bool EvalBoolean (DataRow row)
-               {
-                       DataColumn col = GetColumn (row);
-                       if (col.DataType != typeof (bool))
-                               throw new EvaluateException ("Not a Boolean Expression");
-
-                       object result  = Eval (row);
-                       if (result == null || result == DBNull.Value)
-                               return false;
-                       else
-                               return (bool)result;
-               }
-
-               override public bool DependsOn(DataColumn other)
-               {
-                       return refTable == ReferencedTable.Self && columnName == other.ColumnName;
-               }
-
-               private void DropCached (DataColumnCollection columnCollection, DataRelationCollection relationCollection)
-               {
-                       if (_cachedColumn != null) {
-                               // unregister column listener
-                               _cachedColumn.PropertyChanged -= new PropertyChangedEventHandler (OnColumnPropertyChanged);
-
-                               // unregister column collection listener
-                               if (columnCollection != null)   
-                                       columnCollection.CollectionChanged -= new CollectionChangeEventHandler (OnColumnRemoved);
-                               else if (_cachedColumn.Table != null)
-                                       _cachedColumn.Table.Columns.CollectionChanged -= new CollectionChangeEventHandler (OnColumnRemoved);
-                               
-                               _cachedColumn = null;
-                       }
-
-                       if (_cachedRelation != null) {
-                               // unregister relation collection listener
-                               if (relationCollection != null)                         
-                                       relationCollection.CollectionChanged -= new CollectionChangeEventHandler (OnRelationRemoved);
-                               else if (_cachedRelation.DataSet != null)
-                                       _cachedRelation.DataSet.Relations.CollectionChanged -= new CollectionChangeEventHandler (OnRelationRemoved);
-
-                               _cachedRelation = null;
-                       }                       
-               }
-
-               private void OnColumnPropertyChanged (object sender, PropertyChangedEventArgs args)
-               {
-                       if (!(sender is DataColumn))
-                               return;
-                       
-                       DataColumn dc = (DataColumn) sender;
-                       if ((dc == _cachedColumn) && args.PropertyName == "ColumnName")
-                               DropCached (null, null);
-               }
-
-               private void OnColumnRemoved (object sender, CollectionChangeEventArgs args)
-               {
-                       if (!(args.Element is DataColumnCollection))
-                               return;
-
-                       if (args.Action != CollectionChangeAction.Remove)
-                               return;
-
-                       DataColumnCollection columnCollection = (DataColumnCollection) args.Element;
-                       if (_cachedColumn != null && columnCollection != null && (columnCollection.IndexOf (_cachedColumn)) == -1)
-                               DropCached (columnCollection, null);
-               }
-
-               private void OnRelationRemoved (object sender, CollectionChangeEventArgs args)
-               {
-                       if (!(args.Element is DataRelationCollection))
-                               return;
-
-                       if (args.Action != CollectionChangeAction.Remove)
-                               return;                 
-
-                       DataRelationCollection relationCollection = (DataRelationCollection) args.Element;
-                       if (_cachedRelation != null && relationCollection != null && (relationCollection.IndexOf (_cachedRelation)) == -1)
-                               DropCached (null, relationCollection);
-               }
-       }
-}
diff --git a/mcs/class/System.Data/Mono.Data.SqlExpressions/Comparison.cs b/mcs/class/System.Data/Mono.Data.SqlExpressions/Comparison.cs
deleted file mode 100644 (file)
index 2e8d07d..0000000
+++ /dev/null
@@ -1,119 +0,0 @@
-//
-// Comparison.cs
-//
-// Author:
-//   Juraj Skripsky (juraj@hotfeet.ch)
-//
-// (C) 2004 HotFeet GmbH (http://www.hotfeet.ch)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Data;
-using System.Threading;
-using System.Globalization;
-
-namespace Mono.Data.SqlExpressions {
-       internal class Comparison : BinaryOpExpression {
-               public Comparison (Operation op, IExpression e1, IExpression e2) : base (op, e1, e2) {}
-       
-               override public object Eval (DataRow row)
-               {
-                       return EvalBoolean (row);
-               }
-
-               public override bool EvalBoolean (DataRow row)
-               {
-                       IComparable o1 = expr1.Eval (row) as IComparable;
-                       IComparable o2 = expr2.Eval (row) as IComparable;
-
-                       if (o1 == null || o2 == null) {
-                               if (o1 == null && o2 == null)
-                                       return (op == Operation.EQ);
-                               else
-                                       return (op == Operation.NE);
-                       }
-
-                       int result = Compare (o1, o2, row.Table.CaseSensitive);
-                       if (result < 0) {
-                               return (op == Operation.NE || op == Operation.LE || op == Operation.LT);
-                       }
-                       if (result > 0) {
-                               return (op == Operation.NE || op == Operation.GE || op == Operation.GT);
-                       }
-                       // result == 0
-                       return (op == Operation.EQ || op == Operation.LE || op == Operation.GE);
-                       
-               }
-                       
-               // certain trailing whitespace chars (including space) are ignored by .NET when comparing strings. See bug #79695.  
-               private static readonly char[] IgnoredTrailingChars = { (char) 0x20, (char) 0x3000, (char) 0xFEFF };
-
-               internal static int Compare (IComparable o1, IComparable o2, bool caseSensitive)
-               {
-                       //TODO: turn this "conversion pipeline" into something nicer
-
-                       try {
-                               if (o1 is string && Numeric.IsNumeric (o2))
-                                       o1 = (IComparable) Convert.ChangeType (o1, o2.GetType ());
-                               else if (o2 is string && Numeric.IsNumeric (o1))
-                                       o2 = (IComparable) Convert.ChangeType (o2, o1.GetType ());
-                               else if (o1 is string && o2 is Guid)
-                                       o2 = o2.ToString ();
-                               else if (o2 is string && o1 is Guid)
-                                       o1 = o1.ToString ();
-                       } catch (FormatException) {
-                               throw new EvaluateException (String.Format ("Cannot perform compare operation on {0} and {1}.", o1.GetType(), o2.GetType()));
-                       }
-
-                       if (o1 is string && o2 is string) {
-                               o1 = ((string) o1).TrimEnd (IgnoredTrailingChars);
-                               o2 = ((string) o2).TrimEnd (IgnoredTrailingChars);
-                               if (!caseSensitive) {
-                                       o1 = ((string) o1).ToLower ();
-                                       o2 = ((string) o2).ToLower ();
-                               }
-                       }
-
-                       if (o1 is DateTime && o2 is string && Thread.CurrentThread.CurrentCulture != CultureInfo.InvariantCulture) {
-                               // DateTime is always CultureInfo.InvariantCulture
-                               o2 = (IComparable) DateTime.Parse ((string)o2, CultureInfo.InvariantCulture);
-                       } else if (o2 is DateTime && o1 is string && 
-                                  Thread.CurrentThread.CurrentCulture != CultureInfo.InvariantCulture) {
-                               // DateTime is always CultureInfo.InvariantCulture
-                o1 = (IComparable) DateTime.Parse ((string)o1, CultureInfo.InvariantCulture);
-                       }
-                       else if (o2 is DateTime && o1 is string && Thread.CurrentThread.CurrentCulture != CultureInfo.InvariantCulture) {
-                               // DateTime is always CultureInfo.InvariantCulture
-                               o1 = (IComparable) DateTime.Parse ((string)o1, CultureInfo.InvariantCulture);
-                       }
-
-                       if (o1.GetType () != o2.GetType ())
-                               o2 = (IComparable)Convert.ChangeType (o2, o1.GetType ());
-
-                       return o1.CompareTo (o2);
-               }
-       }
-}
diff --git a/mcs/class/System.Data/Mono.Data.SqlExpressions/Expressions.cs b/mcs/class/System.Data/Mono.Data.SqlExpressions/Expressions.cs
deleted file mode 100644 (file)
index 0d6c2b1..0000000
+++ /dev/null
@@ -1,190 +0,0 @@
-//
-// Expressions.cs
-//
-// Author:
-//   Juraj Skripsky (juraj@hotfeet.ch)
-//
-// (C) 2004 HotFeet GmbH (http://www.hotfeet.ch)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Data.Common;
-using System.Collections;
-using System.Data;
-
-namespace Mono.Data.SqlExpressions {
-       internal interface IExpression {
-               object Eval (DataRow row);
-               bool DependsOn(DataColumn other);
-
-               bool EvalBoolean (DataRow row);
-               void ResetExpression ();
-       }
-
-       internal abstract class BaseExpression : IExpression {
-               public abstract object Eval (DataRow row);
-               public abstract bool DependsOn(DataColumn other);
-
-               public virtual bool EvalBoolean (DataRow row)
-               {
-                       throw new EvaluateException ("Not a Boolean Expression");
-               }
-
-               public override bool Equals(object obj)
-               {
-                       if (obj == null || !(obj is BaseExpression))
-                               return false;
-                       
-                       return true;
-               }
-
-               public override int GetHashCode()
-               {
-                       return 0;
-               }
-
-               public virtual void ResetExpression ()
-               {
-               }
-       }
-
-       // abstract base classes
-       internal abstract class UnaryExpression : BaseExpression {
-               protected IExpression expr;
-
-               public override bool Equals(object obj)
-               {
-                       if (!base.Equals (obj))
-                               return false;
-
-                       if (!(obj is UnaryExpression))
-                               return false;
-
-                       UnaryExpression other = (UnaryExpression) obj;
-                       if (!other.expr.Equals (expr))
-                               return false;
-                       
-                       return true;
-               }
-
-               public override int GetHashCode()
-               {
-                       return base.GetHashCode () ^ expr.GetHashCode ();
-               }
-       
-               public UnaryExpression (IExpression e)
-               {
-                       expr = e;
-               }
-
-               override public bool DependsOn(DataColumn other) {
-                       return expr.DependsOn(other);
-               }
-
-               override public bool EvalBoolean (DataRow row)
-               {
-                       return (bool) Eval (row);
-               }
-       }
-       
-       internal abstract class BinaryExpression : BaseExpression {
-               protected IExpression expr1, expr2;
-
-               public override bool Equals(object obj)
-               {
-                       if (!base.Equals (obj))
-                               return false;
-
-                       if (!(obj is BinaryExpression))
-                               return false;
-
-                       BinaryExpression other = (BinaryExpression) obj;
-                       if (!other.expr1.Equals (expr1) || !other.expr2.Equals (expr2))
-                               return false;
-                       
-                       return true;
-               }
-
-               public override int GetHashCode()
-               {
-                       int hashCode = base.GetHashCode ();
-                       hashCode ^= expr1.GetHashCode ();
-                       hashCode ^= expr2.GetHashCode ();
-                       return hashCode;
-               }
-       
-               protected BinaryExpression (IExpression e1, IExpression e2)
-               {
-                       expr1 = e1;
-                       expr2 = e2;
-               }
-               override public bool DependsOn(DataColumn other)
-               {
-                       return expr1.DependsOn(other) || expr2.DependsOn(other);
-               }
-
-               override public void ResetExpression ()
-               {
-                       expr1.ResetExpression ();
-                       expr2.ResetExpression ();
-               }
-       }
-       
-       internal enum Operation {
-               AND, OR,
-               EQ, NE, LT, LE, GT, GE,
-               ADD, SUB, MUL, DIV, MOD
-       }
-       
-       internal abstract class BinaryOpExpression : BinaryExpression {
-               protected Operation op;
-
-               public override bool Equals(object obj)
-               {
-                       if (!base.Equals (obj))
-                               return false;
-
-                       if (!(obj is BinaryOpExpression))
-                               return false;
-
-                       BinaryOpExpression other = (BinaryOpExpression) obj;
-                       if (other.op != op)
-                               return false;
-                       
-                       return true;
-               }
-
-               public override int GetHashCode()
-               {
-                       return base.GetHashCode () ^ op.GetHashCode ();
-               }
-       
-               protected BinaryOpExpression (Operation op, IExpression e1, IExpression e2) : base (e1, e2)
-               {
-                       this.op = op;
-               }
-       }
-}
diff --git a/mcs/class/System.Data/Mono.Data.SqlExpressions/Functions.cs b/mcs/class/System.Data/Mono.Data.SqlExpressions/Functions.cs
deleted file mode 100644 (file)
index 86f6f3f..0000000
+++ /dev/null
@@ -1,199 +0,0 @@
-//
-// Functions.cs
-//
-// Author:
-//   Juraj Skripsky (juraj@hotfeet.ch)
-//
-// (C) 2004 HotFeet GmbH (http://www.hotfeet.ch)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections;
-using System.Data;
-
-namespace Mono.Data.SqlExpressions {
-       internal class IifFunction : UnaryExpression {
-               IExpression trueExpr, falseExpr;
-               public IifFunction (IExpression e, IExpression trueExpr, IExpression falseExpr) : base (e)
-               {
-                       this.trueExpr = trueExpr;
-                       this.falseExpr = falseExpr;
-               }
-
-               public override bool Equals(object obj)
-               {
-                       if (!base.Equals (obj))
-                               return false;
-
-                       if (!(obj is IifFunction))
-                               return false;
-
-                       IifFunction other = (IifFunction) obj;
-                       if (!other.falseExpr.Equals (falseExpr))
-                               return false;
-
-                       if (!other.trueExpr.Equals (trueExpr))
-                               return false;           
-
-                       return true;
-               }
-
-               public override int GetHashCode()
-               {
-                       int hashCode = base.GetHashCode ();
-                       hashCode ^= falseExpr.GetHashCode ();
-                       hashCode ^= trueExpr.GetHashCode ();
-                       return hashCode;
-               }
-               
-               override public object Eval (DataRow row)
-               {
-                       object o = expr.Eval (row);
-                       if (o == DBNull.Value)
-                               return o;
-                       bool val = Convert.ToBoolean(o);
-                       return (val ? trueExpr.Eval (row) : falseExpr.Eval (row));
-               }
-       }
-       
-       internal class IsNullFunction : UnaryExpression {
-               IExpression defaultExpr;
-               public IsNullFunction (IExpression e, IExpression defaultExpr) : base (e)
-               {
-                       this.defaultExpr = defaultExpr;
-               }
-
-               public override bool Equals(object obj)
-               {
-                       if (!base.Equals (obj))
-                               return false;
-
-                       if (!(obj is UnaryExpression))
-                               return false;
-
-                       IsNullFunction other = (IsNullFunction) obj;
-                       if (!other.defaultExpr.Equals (defaultExpr))
-                               return false;           
-
-                       return true;
-               }
-
-               public override int GetHashCode()
-               {
-                       return defaultExpr.GetHashCode () ^ base.GetHashCode ();
-               }
-               
-               override public object Eval (DataRow row)
-               {
-                       object val = expr.Eval (row);
-                       if (val == null || val == DBNull.Value)
-                               return defaultExpr.Eval (row);
-                       return val;
-               }
-       }
-       
-       internal class ConvertFunction : UnaryExpression {
-               Type targetType;
-               public ConvertFunction (IExpression e, string targetType) : base (e)
-               {
-                       try {
-                               this.targetType = Type.GetType (targetType, true);
-                       } catch (TypeLoadException) {
-                               throw new EvaluateException (String.Format ("Invalid type name '{0}'.", targetType));
-                       }
-               }
-
-               public override bool Equals(object obj)
-               {
-                       if (!base.Equals (obj))
-                               return false;
-
-                       if (!(obj is ConvertFunction))
-                               return false;
-
-                       ConvertFunction other = (ConvertFunction) obj;
-                       if (other.targetType != targetType)
-                               return false;           
-
-                       return true;
-               }
-
-               public override int GetHashCode()
-               {
-                       return targetType.GetHashCode () ^ base.GetHashCode ();
-               }
-               
-               override public object Eval (DataRow row)
-               {
-                       object val = expr.Eval (row);
-                       
-                       // TMPFIX :Eval shud never really return a null.. DBNull.Value but not null
-                       // needs to be done for all expressions .. for now ,just check for null
-                       if (val == null)
-                               return DBNull.Value;
-
-                       if (val == DBNull.Value || val.GetType () == targetType)
-                               return val;
-
-                       //--> String is always allowed                  
-                       if (targetType == typeof (string))
-                               return val.ToString();
-                               
-                       //only TimeSpan <--> String is allowed
-                       if (targetType == typeof (TimeSpan)) {
-                               if (val is string)
-                                       return TimeSpan.Parse ((string)val);
-                               else
-                                       ThrowInvalidCastException (val);
-                       }
-                       
-                       if (val is TimeSpan)
-                               ThrowInvalidCastException (val);
-                       
-                       //only Char <--> String/Int32/UInt32 is allowed
-                       if (val is Char && !(targetType == typeof (Int32) || targetType == typeof (UInt32)))
-                               ThrowInvalidCastException (val);
-                               
-                       if (targetType == typeof (Char) && !(val is Int32 || val is UInt32))
-                               ThrowInvalidCastException (val);
-
-                       //bool <--> Char/Single/Double/Decimal/TimeSpan/DateTime is not allowed
-                       if (val is Boolean && (targetType == typeof (Single) || targetType == typeof (Double) || targetType == typeof (Decimal)))
-                               ThrowInvalidCastException (val);
-                               
-                       if (targetType == typeof(Boolean) && (val is Single || val is Double || val is Decimal))
-                               ThrowInvalidCastException (val);
-
-                       //Convert throws the remaining invalid casts
-                       return Convert.ChangeType (val, targetType);
-
-               }
-               
-               private void ThrowInvalidCastException (object val) {
-                       throw new InvalidCastException (String.Format ("Type '{0}' cannot be converted to '{1}'.", val.GetType(), targetType));
-               }
-       }
-}
diff --git a/mcs/class/System.Data/Mono.Data.SqlExpressions/In.cs b/mcs/class/System.Data/Mono.Data.SqlExpressions/In.cs
deleted file mode 100644 (file)
index 2a8589d..0000000
+++ /dev/null
@@ -1,111 +0,0 @@
-//
-// In.cs
-//
-// Author:
-//   Juraj Skripsky (juraj@hotfeet.ch)
-//
-// (C) 2004 HotFeet GmbH (http://www.hotfeet.ch)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections;
-using System.Data;
-
-namespace Mono.Data.SqlExpressions {
-       internal class In : UnaryExpression {
-               IList set;
-       
-               public In(IExpression e, IList set) : base (e)
-               {
-                       this.set = set;
-               }
-
-               public override bool Equals(object obj)
-               {
-                       if (!base.Equals (obj))
-                               return false;
-
-                       if (!(obj is In))
-                               return false;
-
-                       In other = (In) obj;
-                       if (other.set.Count != set.Count)
-                               return false;   
-
-                       for (int i = 0, count = set.Count; i < count; i++) {
-                               object o1 = set[i];
-                               object o2 = other.set[i];
-
-                               if (o1 == null && o2 != null)
-                                       return false;
-
-                               if (!o1.Equals(o2))
-                                       return false;
-                       }
-
-                       return true;
-               }
-
-               public override int GetHashCode()
-               {
-                       int hashCode = base.GetHashCode ();
-                       for (int i = 0, count = set.Count; i < count; i++) {
-                               object o = set[i];
-                               if (o != null)
-                                       hashCode ^= o.GetHashCode();
-                       }
-
-                       return hashCode;
-               }
-       
-               override public object Eval (DataRow row)
-               {
-                       object o = expr.Eval (row);
-                       if (o == DBNull.Value)
-                               return o;
-                       IComparable val = o as IComparable;
-                       if (val == null)
-                               return false;
-
-                       foreach (IExpression e in set) {
-                               IComparable setItem = (IComparable)e.Eval (row);
-                               if (setItem == null)
-                                       continue;
-                               
-                               if (Comparison.Compare (val, setItem, row.Table.CaseSensitive) == 0)    
-                                       return true;
-                       }
-                       
-                       return false;
-               }
-
-               override public bool EvalBoolean (DataRow row)
-               {
-                       return (bool) Eval (row);
-               }
-
-       }
-}
diff --git a/mcs/class/System.Data/Mono.Data.SqlExpressions/Like.cs b/mcs/class/System.Data/Mono.Data.SqlExpressions/Like.cs
deleted file mode 100644 (file)
index 95e16cb..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-//
-// Like.cs
-//
-// Author:
-//   Juraj Skripsky (juraj@hotfeet.ch)
-//
-// (C) 2004 HotFeet GmbH (http://www.hotfeet.ch)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections;
-using System.Data;
-
-namespace Mono.Data.SqlExpressions {
-       internal class Like : UnaryExpression {
-               readonly IExpression _pattern;
-               
-               public Like (IExpression e, IExpression pattern) : base (e)
-               {
-                       _pattern = pattern;
-               }
-
-               public override bool Equals(object obj)
-               {
-                       if (!base.Equals (obj))
-                               return false;
-
-                       if (!(obj is Like))
-                               return false;
-
-                       Like other = (Like) obj;
-                       return _pattern.Equals (other._pattern);
-               }
-
-               public override int GetHashCode()
-               {
-                       return _pattern.GetHashCode () ^ base.GetHashCode ();
-               }
-
-               override public object Eval (DataRow row)
-               {
-                       object o = expr.Eval (row);
-                       if (o == null || o == DBNull.Value)
-                               return false;
-                       string str = (string)o;
-                       bool openStart, openEnd;
-                       string pattern = (string) _pattern.Eval (row);
-                       string original = pattern;
-                       int len = pattern.Length;
-                       openStart = (pattern [0] == '*' || pattern [0] == '%');
-                       openEnd = (pattern [len - 1] == '*' || pattern [len - 1] == '%');
-
-                       pattern = pattern.Trim ('*', '%');
-                       pattern = pattern.Replace ("[*]", "[[0]]");
-                       pattern = pattern.Replace ("[%]", "[[1]]");
-                       if (pattern.IndexOf ('*') != -1 || pattern.IndexOf ('%') != -1)
-                               throw new EvaluateException (String.Format ("Pattern '{0}' is invalid.", original));
-                       pattern = pattern.Replace ("[[0]]", "*");
-                       pattern = pattern.Replace ("[[1]]", "%");
-                       pattern = pattern.Replace ("[[]", "[");
-                       pattern = pattern.Replace ("[]]", "]");
-
-                       if (!row.Table.CaseSensitive) {
-                               str = str.ToLower();
-                               pattern = pattern.ToLower();
-                       }
-                       
-                       int idx = str.IndexOf (pattern);
-                       if (idx == -1)
-                               return false;
-                               
-                       return (idx == 0 || openStart) && (idx + pattern.Length == str.Length || openEnd);
-               }
-
-               override public bool EvalBoolean (DataRow row)
-               {
-                       return (bool)Eval (row);
-               }
-       }
-}
diff --git a/mcs/class/System.Data/Mono.Data.SqlExpressions/Literal.cs b/mcs/class/System.Data/Mono.Data.SqlExpressions/Literal.cs
deleted file mode 100644 (file)
index 28ee4e1..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-//
-// Literal.cs
-//
-// Author:
-//   Juraj Skripsky (juraj@hotfeet.ch)
-//
-// (C) 2004 HotFeet GmbH (http://www.hotfeet.ch)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Data;
-
-namespace Mono.Data.SqlExpressions {
-       internal class Literal : BaseExpression {
-               object val;
-       
-               public Literal (object val)
-               {
-                       this.val = val;
-               }
-
-               public override bool Equals(object obj)
-               {
-                       if (!base.Equals (obj))
-                               return false;
-
-                       if (!(obj is Literal))
-                               return false;
-
-                       Literal other = (Literal) obj;
-                       if (other.val != null) {
-                               if (!other.val.Equals (val))
-                                       return false;
-                       }
-                       else if (val != null)
-                               return false;
-
-                       return true;
-               }
-
-               public override int GetHashCode()
-               {
-                       return val.GetHashCode () ^ base.GetHashCode ();
-               }
-       
-               public override object Eval (DataRow row)
-               {
-                       return val;
-               }
-
-               override public bool DependsOn(DataColumn other)
-               {
-                       return false;
-               }
-       }
-}
diff --git a/mcs/class/System.Data/Mono.Data.SqlExpressions/Numeric.cs b/mcs/class/System.Data/Mono.Data.SqlExpressions/Numeric.cs
deleted file mode 100644 (file)
index 08a0f1d..0000000
+++ /dev/null
@@ -1,227 +0,0 @@
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.Collections;
-
-namespace Mono.Data.SqlExpressions {
-       internal class Numeric {
-               internal static bool IsNumeric (object o) {
-                       if (o is IConvertible) {
-                               TypeCode tc = ((IConvertible)o).GetTypeCode();
-                               if(TypeCode.Char < tc && tc <= TypeCode.Decimal)
-                                       return true;
-                       }
-                       return false;
-               }
-
-               //extends to Int32/Int64/Decimal/Double
-               internal static IConvertible Unify (IConvertible o)
-               {
-                       switch (o.GetTypeCode()) {
-                       case TypeCode.Char:
-                       case TypeCode.SByte:
-                       case TypeCode.Byte:
-                       case TypeCode.Int16:
-                       case TypeCode.UInt16:
-                               return (IConvertible)Convert.ChangeType (o, TypeCode.Int32);
-                       
-                       case TypeCode.UInt32:
-                               return (IConvertible)Convert.ChangeType (o, TypeCode.Int64);
-                               
-                       case TypeCode.UInt64:
-                               return (IConvertible)Convert.ChangeType (o, TypeCode.Decimal);
-                               
-                       case TypeCode.Single:
-                               return (IConvertible)Convert.ChangeType (o, TypeCode.Double);
-                       
-                       default:
-                               return o;
-                       }
-               }
-               
-               //(note: o1 and o2 must both be of type Int32/Int64/Decimal/Double)
-               internal static TypeCode ToSameType (ref IConvertible o1, ref IConvertible o2)
-               {
-                       TypeCode tc1 = o1.GetTypeCode();
-                       TypeCode tc2 = o2.GetTypeCode();
-                       
-                       if (tc1 == tc2)
-                               return tc1;
-
-                       if (tc1 == TypeCode.DBNull || tc2 == TypeCode.DBNull)
-                               return TypeCode.DBNull;
-
-
-                       // is it ok to make such assumptions about the order of an enum?
-                       if (tc1 < tc2)
-                       {
-                               o1 = (IConvertible)Convert.ChangeType (o1, tc2);
-                               return tc2;
-                       }
-                       else
-                       {
-                               o2 = (IConvertible)Convert.ChangeType (o2, tc1);
-                               return tc1;
-                       }
-               }
-               
-               internal static IConvertible Add (IConvertible o1, IConvertible o2)
-               {
-                       switch (ToSameType (ref o1, ref o2)) {
-                       case TypeCode.Int32:
-                               return (long)((int)o1 + (int)o2);
-                       case TypeCode.Int64:
-                               return (long)o1 + (long)o2;
-                       case TypeCode.Double:
-                               return (double)o1 + (double)o2;
-                       case TypeCode.Decimal:
-                               return (decimal)o1 + (decimal)o2;
-                       default:
-                               return DBNull.Value;
-                       }
-               }
-               
-               internal static IConvertible Subtract (IConvertible o1, IConvertible o2)
-               {
-                       switch (ToSameType (ref o1, ref o2)) {
-                       case TypeCode.Int32:
-                               return (int)o1 - (int)o2;
-                       case TypeCode.Int64:
-                               return (long)o1 - (long)o2;
-                       case TypeCode.Double:
-                               return (double)o1 - (double)o2;
-                       case TypeCode.Decimal:
-                               return (decimal)o1 - (decimal)o2;
-                       default:
-                               return DBNull.Value;
-                       }
-               }
-               
-               internal static IConvertible Multiply (IConvertible o1, IConvertible o2)
-               {
-                       switch (ToSameType (ref o1, ref o2)) {
-                       case TypeCode.Int32:
-                               return (int)o1 * (int)o2;
-                       case TypeCode.Int64:
-                               return (long)o1 * (long)o2;
-                       case TypeCode.Double:
-                               return (double)o1 * (double)o2;
-                       case TypeCode.Decimal:
-                               return (decimal)o1 * (decimal)o2;
-                       default:
-                               return DBNull.Value;
-                       }
-               }
-               
-               internal static IConvertible Divide (IConvertible o1, IConvertible o2)
-               {
-                       switch (ToSameType (ref o1, ref o2)) {
-                       case TypeCode.Int32:
-                               return (int)o1 / (int)o2;
-                       case TypeCode.Int64:
-                               return (long)o1 / (long)o2;
-                       case TypeCode.Double:
-                               return (double)o1 / (double)o2;
-                       case TypeCode.Decimal:
-                               return (decimal)o1 / (decimal)o2;
-                       default:
-                               return DBNull.Value;
-                       }
-               }
-               
-               internal static IConvertible Modulo (IConvertible o1, IConvertible o2)
-               {
-                       switch (ToSameType (ref o1, ref o2)) {
-                       case TypeCode.Int32:
-                               return (int)o1 % (int)o2;
-                       case TypeCode.Int64:
-                               return (long)o1 % (long)o2;
-                       case TypeCode.Double:
-                               return (double)o1 % (double)o2;
-                       case TypeCode.Decimal:
-                               return (decimal)o1 % (decimal)o2;
-                       default:
-                               return DBNull.Value;
-                       }
-               }
-               
-               internal static IConvertible Negative (IConvertible o)
-               {
-                       switch (o.GetTypeCode()) {
-                       case TypeCode.Int32:
-                               return -((int)o);
-                       case TypeCode.Int64:
-                               return -((long)o);
-                       case TypeCode.Double:
-                               return -((double)o);
-                       case TypeCode.Decimal:
-                               return -((decimal)o);
-                       default:
-                               return DBNull.Value;
-                       }
-               }
-               
-               internal static IConvertible Min (IConvertible o1, IConvertible o2)
-               {
-                       switch (ToSameType (ref o1, ref o2)) {
-                       case TypeCode.Int32:
-                               return System.Math.Min ((int)o1, (int)o2);
-                       case TypeCode.Int64:
-                               return System.Math.Min ((long)o1, (long)o2);
-                       case TypeCode.Double:
-                               return System.Math.Min ((double)o1, (double)o2);
-                       case TypeCode.Decimal:
-                               return System.Math.Min ((decimal)o1, (decimal)o2);
-                       case TypeCode.String:
-                               int result = String.Compare ((string)o1, (string)o2);
-                               if (result <= 0)
-                                       return o1;
-                               return o2;
-                       default:
-                               return DBNull.Value;
-                       }
-               }
-
-               internal static IConvertible Max (IConvertible o1, IConvertible o2)
-               {
-                       switch (ToSameType (ref o1, ref o2)) {
-                       case TypeCode.Int32:
-                               return System.Math.Max ((int)o1, (int)o2);
-                       case TypeCode.Int64:
-                               return System.Math.Max ((long)o1, (long)o2);
-                       case TypeCode.Double:
-                               return System.Math.Max ((double)o1, (double)o2);
-                       case TypeCode.Decimal:
-                               return System.Math.Max ((decimal)o1, (decimal)o2);
-                       case TypeCode.String:
-                               int result = String.Compare ((string)o1, (string)o2);
-                               if (result >= 0)
-                                       return o1;
-                               return o2;
-                       default:
-                               return DBNull.Value;
-                       }
-               }
-       }
-}
diff --git a/mcs/class/System.Data/Mono.Data.SqlExpressions/Parser.jay b/mcs/class/System.Data/Mono.Data.SqlExpressions/Parser.jay
deleted file mode 100644 (file)
index 135b936..0000000
+++ /dev/null
@@ -1,366 +0,0 @@
-%{
-//
-// Parser.jay
-//
-// Author:
-//   Juraj Skripsky (juraj@hotfeet.ch)
-//
-// (C) 2004 HotFeet GmbH (http://www.hotfeet.ch)
-// Copyright 2011 Xamarin Inc (http://www.xamarin.com)
-//
-
-using System;
-using System.Collections;
-using System.Data;
-
-namespace Mono.Data.SqlExpressions {
-
-       internal class Parser {
-               static Parser ()
-               {
-                       if (Environment.GetEnvironmentVariable ("MONO_DEBUG_SQLEXPRESSIONS") != null)
-                               yacc_verbose_flag = 2;
-               }
-
-               bool cacheAggregationResults = false;
-               DataRow[] aggregationRows = null;
-               static int yacc_verbose_flag;
-               
-               //called by DataTable.Select
-               //called by DataColumn.set_Expression //FIXME: enable cache in this case?
-               public Parser () {
-                       ErrorOutput = System.IO.TextWriter.Null;
-                       cacheAggregationResults = true;
-               }
-               
-               //called by DataTable.Compute
-               public Parser (DataRow[] aggregationRows)
-               {
-                       ErrorOutput = System.IO.TextWriter.Null;
-                       this.aggregationRows = aggregationRows;
-               }
-               
-               public IExpression Compile (string sqlExpr)
-               {
-                       try {
-                               Tokenizer tokenizer = new Tokenizer (sqlExpr);
-                               if (yacc_verbose_flag > 1)
-                                       return (IExpression) yyparse (tokenizer,
-                                               new yydebug.yyDebugSimple ());
-                               else
-                                       return (IExpression) yyparse (tokenizer);
-                       } catch (yyParser.yyException) {
-                               throw new SyntaxErrorException (String.Format ("Expression '{0}' is invalid.", sqlExpr));
-                       }
-               }
-%}
-
-%token PAROPEN PARCLOSE
-
-%token AND OR
-%token NOT
-
-%token TRUE FALSE
-%token NULL
-
-%token PARENT CHILD
-
-%token EQ LT GT
-
-%token PLUS MINUS
-%token MUL DIV MOD
-
-%token DOT COMMA
-
-%token IS IN NOT_IN LIKE NOT_LIKE
-
-%token COUNT SUM AVG MAX MIN STDEV VAR
-%token IIF SUBSTRING ISNULL LEN TRIM CONVERT
-
-%token StringLiteral NumberLiteral DateLiteral
-%token Identifier
-%token FunctionName
-
-%start Expr
-
-%left OR
-%left AND
-%left NOT
-
-%left EQ LT GT
-
-%left PLUS MINUS
-%left MUL DIV MOD
-
-%left UMINUS
-
-%%
-
-Expr
-       : BoolExpr
-       | ArithExpr
-       ;
-
-BoolExpr
-       : PAROPEN BoolExpr PARCLOSE
-       {
-               $$ = (IExpression)$2;
-       }
-       | BoolExpr AND BoolExpr
-       {
-               $$ = new BoolOperation (Operation.AND, (IExpression)$1, (IExpression)$3);
-       }
-       | BoolExpr OR BoolExpr
-       {
-               $$ = new BoolOperation (Operation.OR, (IExpression)$1, (IExpression)$3);
-       }
-       | NOT BoolExpr
-       {
-               $$ = new Negation ((IExpression)$2);
-       }
-       | Predicate
-       ;
-
-Predicate
-       : CompPredicate
-       | IsPredicate
-       | LikePredicate
-       | InPredicate
-       ;
-
-CompPredicate
-       : ArithExpr CompOp ArithExpr
-       {
-               $$ = new Comparison ((Operation)$2, (IExpression)$1, (IExpression)$3);
-       }
-       ;
-
-CompOp
-       : EQ    { $$ = Operation.EQ; }
-       | NE    { $$ = Operation.NE; }
-       | LT    { $$ = Operation.LT; }
-       | GT    { $$ = Operation.GT; }
-       | LE    { $$ = Operation.LE; }
-       | GE    { $$ = Operation.GE; }
-       ;
-
-LE     : LT EQ;                // <=
-NE     : LT GT;                // <>
-GE     : GT EQ;                // >=
-       
-ArithExpr
-       : PAROPEN ArithExpr PARCLOSE
-       {
-               $$ = (IExpression)$2;
-       }
-       | ArithExpr MUL ArithExpr
-       {
-               $$ = new ArithmeticOperation (Operation.MUL, (IExpression)$1, (IExpression)$3);
-       }
-       | ArithExpr DIV ArithExpr
-       {
-               $$ = new ArithmeticOperation (Operation.DIV, (IExpression)$1, (IExpression)$3);
-       }
-       | ArithExpr MOD ArithExpr
-       {
-               $$ = new ArithmeticOperation (Operation.MOD, (IExpression)$1, (IExpression)$3);
-       }
-       | ArithExpr PLUS ArithExpr
-       {
-               $$ = new ArithmeticOperation (Operation.ADD, (IExpression)$1, (IExpression)$3);
-       }
-       | ArithExpr MINUS ArithExpr
-       {
-               $$ = new ArithmeticOperation (Operation.SUB, (IExpression)$1, (IExpression)$3);
-       }
-       | MINUS ArithExpr %prec UMINUS
-       {
-               $$ = new Negative ((IExpression)$2);
-       }
-       | Function
-       | Value
-       ;
-
-Value
-       : LiteralValue
-       | SingleColumnValue
-       ;
-
-LiteralValue
-       : StringLiteral { $$ = new Literal ($1); }
-       | NumberLiteral { $$ = new Literal ($1); }
-       | DateLiteral           { $$ = new Literal ($1); }
-       | BoolLiteral
-       | NULL          { $$ = new Literal (null); }
-       ;
-
-BoolLiteral
-       : TRUE  { $$ = new Literal (true); }
-       | FALSE { $$ = new Literal (false); }
-       ;
-
-SingleColumnValue
-       : LocalColumnValue
-       | ParentColumnValue
-       ;       
-
-MultiColumnValue
-       : LocalColumnValue
-       | ChildColumnValue
-       ;
-
-LocalColumnValue
-       : ColumnName
-       {
-               $$ = new ColumnReference ((string)$1);
-       }
-       ;
-
-ParentColumnValue
-       : PARENT DOT ColumnName
-       {
-               $$ = new ColumnReference (ReferencedTable.Parent, null, (string)$3);
-       }
-       | PARENT PAROPEN RelationName PARCLOSE DOT ColumnName
-       {
-               $$ = new ColumnReference (ReferencedTable.Parent, (string)$3, (string)$6);
-       }
-       ;
-
-ChildColumnValue
-       : CHILD DOT ColumnName
-       {
-               $$ = new ColumnReference (ReferencedTable.Child, null, (string)$3);
-       }
-       | CHILD PAROPEN RelationName PARCLOSE DOT ColumnName
-       {
-               $$ = new ColumnReference (ReferencedTable.Child, (string)$3, (string)$6);
-       }
-       ;
-       
-ColumnName
-       : Identifier
-       | ColumnName DOT Identifier
-       {
-               $$ = (string)$1 + "." + (string)$3;
-       }
-       ;
-       
-RelationName
-       : Identifier;
-
-Function
-       : CalcFunction
-       | AggFunction
-       | StringFunction
-       ;
-
-AggFunction
-       : AggFunctionName PAROPEN MultiColumnValue PARCLOSE
-       {
-               $$ = new Aggregation (cacheAggregationResults, aggregationRows, (AggregationFunction)$1, (ColumnReference)$3);
-       }
-       ;
-
-AggFunctionName
-       : COUNT         { $$ = AggregationFunction.Count; }
-       | SUM           { $$ = AggregationFunction.Sum; }
-       | AVG           { $$ = AggregationFunction.Avg; }
-       | MAX           { $$ = AggregationFunction.Max; }
-       | MIN           { $$ = AggregationFunction.Min; }
-       | STDEV { $$ = AggregationFunction.StDev; }
-       | VAR           { $$ = AggregationFunction.Var; }
-       ;
-
-StringExpr
-       : SingleColumnValue
-       | StringLiteral { $$ = new Literal ($1); }
-       | Function
-       ;
-
-StringFunction
-       : TRIM PAROPEN ArithExpr PARCLOSE
-       {
-               $$ = new TrimFunction ((IExpression)$3);
-       }
-       | SUBSTRING PAROPEN ArithExpr COMMA ArithExpr COMMA ArithExpr PARCLOSE
-       {
-               $$ = new SubstringFunction ((IExpression)$3, (IExpression)$5, (IExpression)$7);
-       }
-       ;
-
-CalcFunction
-       : IIF PAROPEN Expr COMMA Expr COMMA Expr PARCLOSE
-       {
-               $$ = new IifFunction ((IExpression)$3, (IExpression)$5, (IExpression)$7);
-       }
-       | ISNULL PAROPEN Expr COMMA Expr PARCLOSE
-       {
-               $$ = new IsNullFunction ((IExpression)$3, (IExpression)$5);
-       }
-       | LEN PAROPEN Expr PARCLOSE
-       {
-               $$ = new LenFunction ((IExpression)$3);
-       }
-       | CONVERT PAROPEN Expr COMMA TypeSpecifier PARCLOSE
-       {
-               $$ = new ConvertFunction ((IExpression)$3, (string)$5);
-       }
-       ;
-
-TypeSpecifier
-       : StringLiteral
-       | Identifier
-       ;
-
-IsPredicate
-       : ArithExpr IS NULL
-       {
-               $$ = new Comparison (Operation.EQ, (IExpression)$1, new Literal (null));
-       }
-       | ArithExpr IS NOT NULL
-       {
-               $$ = new Comparison (Operation.NE, (IExpression)$1, new Literal (null));
-       }
-       ;
-
-LikePredicate
-       : StringExpr LIKE StringExpr
-       {
-               $$ = new Like ((IExpression)$1, (IExpression)$3);
-       }
-       | StringExpr NOT_LIKE StringExpr
-       {
-               $$ = new Negation (new Like ((IExpression)$1, (IExpression)$3));
-       }
-       ;
-
-InPredicate
-       : ArithExpr IN InPredicateValue
-       {
-               $$ = new In ((IExpression)$1, (IList)$3);
-       }
-       | ArithExpr NOT_IN InPredicateValue
-       {
-               $$ = new Negation (new In ((IExpression)$1, (IList)$3));
-       }
-       ;
-
-InPredicateValue
-       : PAROPEN InValueList PARCLOSE { $$ = $2; }
-       ;
-
-InValueList
-       : LiteralValue
-       {
-               $$ = new ArrayList();
-               ((IList)$$).Add ($1);
-       }
-       | InValueList COMMA LiteralValue
-       {
-               ((IList)($$ = $1)).Add ($3);
-       }
-       ;
-
-%%
-}
diff --git a/mcs/class/System.Data/Mono.Data.SqlExpressions/StringFunctions.cs b/mcs/class/System.Data/Mono.Data.SqlExpressions/StringFunctions.cs
deleted file mode 100644 (file)
index 7312542..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-//
-// StringFunctions.cs
-//
-// Author:
-//   Juraj Skripsky (juraj@hotfeet.ch)
-//
-// (C) 2004 HotFeet GmbH (http://www.hotfeet.ch)
-// Copyright 2011 Xamarin Inc.
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections;
-using System.Data;
-
-namespace Mono.Data.SqlExpressions {
-       internal abstract class StringFunction : UnaryExpression {
-               protected StringFunction (IExpression e) : base (e) {}
-
-               override public object Eval (DataRow row)
-               {
-                       object val = expr.Eval (row);
-                       if(val == null)
-                               return null;
-                               
-                       if (!(val is string)) {
-                               string fnct = this.GetType ().ToString ();
-                               int start = fnct.LastIndexOf('.') + 1;
-                               fnct = fnct.Substring (start, fnct.Length - start - "Function".Length);
-                               throw new EvaluateException (String.Format ("'{0}' can be applied only to strings.", fnct));
-                       }
-                               
-                       return val;
-               }
-       }
-
-       internal class SubstringFunction : StringFunction {
-               IExpression start;
-               IExpression len;
-               public SubstringFunction (IExpression e, IExpression start, IExpression len) : base (e)
-               {
-                       this.start = start;
-                       this.len = len;
-               }
-
-               public override bool Equals(object obj)
-               {
-                       if (!base.Equals (obj))
-                               return false;
-
-                       if (!(obj is SubstringFunction))
-                               return false;
-
-                       SubstringFunction other = (SubstringFunction) obj;
-                       if (other.start != start)
-                               return false;
-
-                       if (other.len != len)
-                               return false;           
-
-                       return true;
-               }
-
-               public override int GetHashCode()
-               {
-                       int hashCode = base.GetHashCode ();
-                       hashCode ^= start.GetHashCode ();
-                       hashCode ^= len.GetHashCode ();
-                       return hashCode;
-               }
-               
-               override public object Eval (DataRow row)
-               {
-                       string str = (string)base.Eval (row);
-                       start.Eval (row);
-                       int istart = Convert.ToInt32 (start.Eval (row));
-                       int ilen = Convert.ToInt32 (len.Eval (row));
-                       
-                       if(str == null)
-                               return null;
-                               
-                       if (istart > str.Length)
-                               return String.Empty;
-                       
-                       return str.Substring (istart - 1, System.Math.Min (ilen, str.Length - (istart - 1)));
-               }
-       }
-       
-       internal class LenFunction : StringFunction {
-               public LenFunction (IExpression e) : base (e) {}
-               
-               override public object Eval (DataRow row)
-               {
-                       string str = (string)base.Eval (row);
-                       if(str == null)
-                               return 0;
-                               
-                       return str.Length;
-               }
-       }
-
-       internal class TrimFunction : StringFunction {
-               public TrimFunction (IExpression e) : base (e) {}
-               
-               override public object Eval (DataRow row)
-               {
-                       string str = (string)base.Eval (row);
-                       if(str == null)
-                               return null;
-                               
-                       return str.Trim();
-               }
-       }
-}
diff --git a/mcs/class/System.Data/Mono.Data.SqlExpressions/Tokenizer.cs b/mcs/class/System.Data/Mono.Data.SqlExpressions/Tokenizer.cs
deleted file mode 100644 (file)
index 1cfa5cb..0000000
+++ /dev/null
@@ -1,380 +0,0 @@
-//
-// SqlWhereClauseTokenizer.cs
-//
-// Author:
-//   Juraj Skripsky (juraj@hotfeet.ch)
-//
-// (C) 2004 HotFeet GmbH (http://www.hotfeet.ch)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Data;
-using System.Globalization;
-using System.IO;
-using System.Text;
-using System.Collections;
-
-namespace Mono.Data.SqlExpressions {
-       internal class Tokenizer : yyParser.yyInput {
-               private static readonly IDictionary tokenMap = new Hashtable ();
-               private static readonly Object [] tokens = {
-                       Token.AND, "and",
-                       Token.OR, "or",
-                       Token.NOT, "not",
-                       
-                       Token.TRUE, "true",
-                       Token.FALSE, "false",
-                       Token.NULL, "null",
-                       
-                       Token.PARENT, "parent",
-                       Token.CHILD, "child",
-                       
-                       Token.IS, "is",
-                       Token.IN, "in",
-                       Token.NOT_IN, "not in",
-                       Token.LIKE, "like",
-                       Token.NOT_LIKE, "not like",
-                       
-                       Token.COUNT, "count",
-                       Token.SUM, "sum",
-                       Token.AVG, "avg",
-                       Token.MAX, "max",
-                       Token.MIN, "min",
-                       Token.STDEV, "stdev",
-                       Token.VAR, "var",
-                       
-                       Token.IIF, "iif",
-                       Token.SUBSTRING, "substring",
-                       Token.ISNULL, "isnull",
-                       Token.LEN, "len",
-                       Token.TRIM, "trim",
-                       Token.CONVERT, "convert"
-               };
-               private char[] input;
-               private int pos;
-
-               private int tok;
-               private object val;
-
-               static Tokenizer ()
-               {
-                       for (int i = 0; i < tokens.Length; i += 2)
-                               tokenMap.Add (tokens [i + 1], tokens [i]);
-               }
-
-               public Tokenizer (string strInput)
-               {
-                       input = strInput.ToCharArray ();
-                       pos = 0;
-               }
-
-               private char Current() {
-                       return input [pos];
-               }
-
-               private char Next() {
-                       if (pos + 1 >= input.Length)
-                               return (char)0;
-                       return input [pos + 1];
-               }
-
-               private bool MoveNext() {
-                       pos++;
-                       if (pos >= input.Length)
-                               return false;
-
-                       return true;
-               }
-               
-               private bool SkipWhiteSpace ()
-               {
-                       if (pos >= input.Length)
-                               return false;
-
-                       while (Char.IsWhiteSpace (Current ())) {
-                               if (!MoveNext ())
-                                       return false;
-                       }
-
-                       return true;
-               }
-
-               private object ReadNumber ()
-               {
-                       StringBuilder sb = new StringBuilder ();
-                       sb.Append (Current ());
-
-                       char next;
-                       while (Char.IsDigit (next = Next ()) || next == '.') {
-                               sb.Append (next);
-                               if (!MoveNext ())
-                                       break;
-                       }
-
-                       string str = sb.ToString ();
-
-                       if (str.IndexOf ('.') < 0)
-                               return Int64.Parse (str, CultureInfo.InvariantCulture);
-
-                       return double.Parse (str, CultureInfo.InvariantCulture);
-               }
-
-               private char ProcessEscapes(char c)
-               {
-                       if (c == '\\') {
-                               if (MoveNext())
-                                       c = Current ();
-                               else
-                                       c = '\0';
-
-                               switch (c) {
-                               case 'n':
-                                       c = '\n';
-                                       break;
-                               case 'r':
-                                       c = '\r';
-                                       break;
-                               case 't':
-                                       c = '\t';
-                                       break;
-
-                               case '\\':
-                                       c = '\\';
-                                       break;
-                                       
-                               default:
-                                       throw new SyntaxErrorException (String.Format ("Invalid escape sequence: '\\{0}'.", c));
-                               }
-                       }
-                       return c;
-               }
-
-               private string ReadString (char terminator)
-               {
-                       return ReadString (terminator, false /* canEscape */);
-               }
-
-               private string ReadString (char terminator, 
-                                          bool canEscape // twice the terminator is not a terminator
-                                          )
-               {
-                       bool terminated = false;
-                       StringBuilder sb = new StringBuilder ();
-                       while (MoveNext ()) {
-                               if (Current () == terminator) {
-                                       if (Next () == terminator) {
-                                               sb.Append (ProcessEscapes (Current ()));
-                                               MoveNext ();
-                                               continue;
-                                       }
-                                       terminated = true;
-                                       break;
-                               }
-                               sb.Append (ProcessEscapes (Current ()));
-                       }
-                       
-                       if (! terminated)
-                               throw new SyntaxErrorException (String.Format ("invalid string at {0}{1}<--",
-                                                                              terminator,
-                                                                              sb.ToString ())
-                                                               );
-                       return sb.ToString ();                  
-               }
-
-               private string ReadIdentifier ()
-               {
-                       StringBuilder sb = new StringBuilder ();
-                       sb.Append (Current ());
-
-                       char next;
-                       string ret;
-                       while ((next = Next ()) == '_' || Char.IsLetterOrDigit (next) || next == '\\') {
-                               sb.Append (ProcessEscapes (next));                              
-                               if (!MoveNext ())
-                                       break;
-                       }
-                       ret = sb.ToString ();
-                       if (String.Compare (ret,
-                                           "not",
-                                           StringComparison.OrdinalIgnoreCase
-                           ) == 0) {
-                               int savedPos = pos;
-                               while (Char.IsWhiteSpace ((next = Next ()))) {
-                                       if (!MoveNext ()) {
-                                               pos = savedPos;
-                                               return ret;
-                                       }
-                               }
-                               MoveNext ();
-                               
-                               string target;
-                               switch (Current ()) {
-                                       case 'i':
-                                       case 'I':
-                                               target = "in";
-                                               break;
-
-                                       case 'l':
-                                       case 'L':
-                                               target = "like";
-                                               break;
-                                       
-                                       default:
-                                               pos = savedPos;
-                                               return ret;
-                               }
-
-                               int tlen = target.Length;
-                               int idx = 1;
-                               while (tlen-- > 0 && Char.IsLetter ((next = Next ()))) {
-                                       if (target [idx++] != Char.ToLowerInvariant (next)) {
-                                               pos = savedPos;
-                                               return ret;
-                                       }
-                                       MoveNext ();
-                               }
-
-                               sb.Append (' ');
-                               sb.Append (target);
-                               ret = sb.ToString ();
-                       }
-
-                       return ret;
-               }
-
-               private int ParseIdentifier ()
-               {
-                       string strToken = ReadIdentifier ();
-                       object tokenObj = tokenMap[strToken.ToLower()];
-
-                       if(tokenObj != null)
-                               return (int)tokenObj;
-                       
-                       val = strToken;
-                       return Token.Identifier;
-               }
-
-               private int ParseToken ()
-               {
-                       char cur;
-                       switch (cur = Current ()) {
-                       case '(':
-                               return Token.PAROPEN;
-
-                       case ')':
-                               return Token.PARCLOSE;
-
-                       case '.':
-                               return Token.DOT;
-
-                       case ',':
-                               return Token.COMMA;
-
-                       case '+':
-                               return Token.PLUS;
-
-                       case '-':
-                               return Token.MINUS;
-
-                       case '*':
-                               return Token.MUL;
-
-                       case '/':
-                               return Token.DIV;
-
-                       case '%':
-                               return Token.MOD;
-                               
-                       case '=':
-                               return Token.EQ;
-
-                       case '<':
-                               return Token.LT;
-
-                       case '>':
-                               return Token.GT;
-
-                       case '[':
-                               val = ReadString (']');
-                               return Token.Identifier;
-
-                       case '#':
-                               string date = ReadString ('#');
-                               val = DateTime.Parse (date, CultureInfo.InvariantCulture);
-                               return Token.DateLiteral;
-
-                       case '\'':
-                       case '\"':
-                               val = ReadString (cur, true);
-                               return Token.StringLiteral;
-
-                       default:
-                               if (Char.IsDigit (cur)) {                               
-                                       val = ReadNumber ();
-                                       return Token.NumberLiteral;
-                               } else if (Char.IsLetter (cur) || cur == '_')
-                                       return ParseIdentifier ();
-                               break;
-                       }
-                       throw new SyntaxErrorException ("invalid token: '" + cur + "'");
-               }
-
-               ///////////////////////////
-               // yyParser.yyInput methods
-               ///////////////////////////
-
-               /** move on to next token.
-                 @return false if positioned beyond tokens.
-                 @throws IOException on input error.
-                 */
-               public bool advance ()
-               {
-                       if (!SkipWhiteSpace())
-                               return false;
-                       tok = ParseToken();
-                       MoveNext ();
-                       return true;
-               }
-
-               /** classifies current token.
-                 Should not be called if advance() returned false.
-                 @return current %token or single character.
-                 */
-               public int token ()
-               {
-                       return tok;
-               }
-
-               /** associated with current token.
-                 Should not be called if advance() returned false.
-                 @return value for token().
-                 */
-               public Object value ()
-               {
-                       return val;
-               }
-       }
-}
diff --git a/mcs/class/System.Data/ReferenceSources/SqlInternalConnectionTds.cs b/mcs/class/System.Data/ReferenceSources/SqlInternalConnectionTds.cs
new file mode 100644 (file)
index 0000000..b82129c
--- /dev/null
@@ -0,0 +1,7 @@
+namespace System.Data.SqlClient
+{
+       class SqlInternalConnectionTds
+       {
+               
+       }
+}
\ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data.Common/CatalogLocation.cs b/mcs/class/System.Data/System.Data.Common/CatalogLocation.cs
deleted file mode 100644 (file)
index 60931f1..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-//
-// System.Data.Common.CatalogLocation.cs
-//
-// Author:
-//   Tim Coleman (tim@timcoleman.com)
-//
-// Copyright (C) Tim Coleman, 2003
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-namespace System.Data.Common {
-       public enum CatalogLocation 
-       {
-               End = 2,
-               Start = 1
-       }
-}
-
diff --git a/mcs/class/System.Data/System.Data.Common/ChangeLog b/mcs/class/System.Data/System.Data.Common/ChangeLog
deleted file mode 100644 (file)
index db8c2a8..0000000
+++ /dev/null
@@ -1,1127 +0,0 @@
-2011-05-05  Veerapuram Varadhan  <v.varadhan@gmail.com>
-
-       ** Fixes 688773
-       * RecordCache.cs (CopyRecord): When copying records, assign default value 
-       for the columns that does not exist in the row being imported.
-
-2010-07-23  Veerapuram Varadhan  <v.varadhan@gmail.com>
-
-       ** Fixes #565616 - Based on Patch by Hubert FONGARNAND
-       * DataContainer.cs (GetContainerData): If typecode is string, 
-       call Convert.ToString() irrespective of whether value is 
-       IConvertible or not. 
-       
-2010-03-26  Veerapuram Varadhan  <vvaradhan@novell.com>
-
-    ** Fixes #564833/580736
-    * DbDataAdapter.cs (*Command): Fix for .NET compatibility which
-    supports both type of adapters with/without discrete command
-    instances.
-               
-2009-10-28  Veerapuram Varadhan  <vvaradhan@novell.com>
-
-       ** Fixes #385028/#385029
-       * DbCommandBuilder.cs (CreateInsertCommand): Workaround for inserting 
-       DEFAULT values to non-null-columns.
-       (GetInsertCommand): New overload added to handle above workaround.
-       (set_DataAdapter): Register for the RowUpdatingEventHandlers.
-        
-2009-10-14  Jonathan Pryor  <jpryor@novell.com>
-
-       * DbConnection.cs: Throw NotImplementedException fom
-         DbConnection.DbProviderFactory, as DbProviderFactories isn't
-         included in the MonoTouch profile.
-
-2009-07-30  Veerapuram Varadhan  <vvaradhan@novell.com>
-
-       * DbDataAdapter.cs (IDbDataAdapter.get_*Command): For non 2.0 profile, do not 
-       implement these properties and related changes.
-       
-2009-07-30  Veerapuram Varadhan  <vvaradhan@novell.com>
-       
-       * DbDataAdapter.cs (set_DeleteCommand): Code cleanup.
-       
-2009-07-29  Veerapuram Varadhan  <vvaradhan@novell.com>
-       
-       * DbDataAdapter.cs (*Command properties): Don't call IDbDataAdapter.*Command, 
-       as provider specific DbDataAdapters would have its own implementation.
-       
-2009-07-27  Veerapuram Varadhan  <vvaradhan@novell.com>
-
-       * DbCommandBuilder.cs (CreateUpdateCommand): Don't set Nullable 
-       property "Original_*" fields.
-       
-2009-07-24  Veerapuram Varadhan  <vvaradhan@novell.com>
-       
-       * DbCommandBuilder.cs (Create*Command): Fill up the missing pieces from 
-       SqlCommandBuilder version of Create*Commands that fixes the failing tests.
-       
-2009-07-24  Veerapuram Varadhan  <vvaradhan@novell.com>
-       
-       * DbCommandBuilder.cs (CreateDeleteCommand, CreateUpdateCommand): Add the 
-       nullcheck-param into the respective command's parameter list.  Fixes 
-       build breaks.  Individual provider's CommandBuilder classes from 2.0 
-       profile onwards use the base version of methods to maintain these commands.
-       (Get*Command): Cleanup code duplication
-       * DbDataAdapter (Update): Use SourceColumnNullMapping property to handle 
-       nullcheckparams.  Fixes #522624.  Patch by 
-       Gert Driesen  <drieseng@users.sourceforge.net>.
-       
-2009-07-15  Veerapuram Varadhan  <vvaradhan@novell.com>
-
-       ** Part of fix for #325464
-       * DbParameter.cs (FrameworkDbType, DbTypeMapping, SystemType): New internal properties 
-       required to convert between DbType/FrameworkType/SystemType.
-       
-2009-05-10  Marek Habersack  <mhabersack@novell.com>
-
-       * DbConnection.cs: implemented the DbProviderFactory property
-
-2009-03-31  Veerapuram Varadhan  <vvaradhan@novell.com>
-
-       * Fixes rest of #480377
-       * DataContainer.cs (GetContainerData, GetExplicitValue): Added to handle cases 
-       where passed type overloads an explicit operator for conversion of values.
-       
-2009-01-03  Gert Driesen  <drieseng@users.sourceforge.net>
-
-       * DbCommandBuilder.cs (QuoteIdentifier): Throw NotSupportedException.
-       * DbDataAdapter.cs (Update): Add row causing concurrency violation
-       to DBConcurrencyException.
-
-2008-12-30  Raja R Harinath  <harinath@hurrynot.org>
-
-       Mildly rewrite duplicate-inferring logic.
-       * Index.cs (IndexDuplicateState): Remove.
-       (_hasDuplicates): Remove.  Replace by ...
-       (know_have_duplicates, know_no_duplicates): ... these.
-
-2008-12-30  Gert Driesen  <drieseng@users.sourceforge.net>
-
-       * DbCommandBuilder.cs: When CatalogSeparator or SchemaSeparator are
-       not set (or explicitly set to null or empty string), then return
-       default separator character. Added value check for CatalogLocation and
-       ConflictOption. Removed regions.
-
-2008-12-30  Gert Driesen  <drieseng@users.sourceforge.net>
-
-       * DbCommandBuilder.cs: Fixed default value for ConflicOption.
-
-2008-12-30  Gert Driesen  <drieseng@users.sourceforge.net>
-
-       * DbCommandBuilder.cs: Return a zero-length string when QuotePrefix or
-       QuoteSuffix are not set (or are set to null). Changing QuotePrefix or
-       QuoteSuffix after a command has been generated should result in an
-       InvalidOperationException.
-       * DbConnectionStringBuilder.cs: Added support for ODBC rules. Major
-       rewrite fixing many compatibility issues, and improving support for
-       connectionstring formats/characters.
-
-2008-11-25  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DbDataRecord.cs : it is abstract, so create different impl. class.
-       * DbEnumerator.cs : use above.
-
-2008-11-17  Raja R Harinath  <harinath@hurrynot.org>
-
-       Avoid allocating empty arrays.
-       * Index.cs (empty): New empty array constant.
-       (Reset): Initialize '_array' to 'empty'.
-       (RebuildIndex): Don't allocate array if it will be empty.
-       (FindAllIndexes): Use 'empty' instead of 'new int [0]'.
-
-2008-11-17  Raja R Harinath  <harinath@hurrynot.org>
-
-       * Index.cs: Remove use of Array and Size properties by taking
-       advantage of the invariant that _array is never null.
-       (EnsureArray): Remove.
-       (Array): Remove.
-
-2008-11-17  Raja R Harinath  <harinath@hurrynot.org>
-
-       * RecordCache.cs: Reduce some extraneous nesting.
-
-2008-10-07  Daniel Morgan  <monodanmorg@yahoo.com>
-
-       * DbConnectionStringBuilder.cs: fix setting and getting
-       the ConnectionString property
-
-2008-09-16  Veerapuram Varadhan  <vvaradhan@novell.com>
-
-       ** Fixes#421336 - Patch provided by <christian_hoff@gmx.net>    
-       DbCommandBuilder.cs: Several scenarios leading to exceptions when
-       creating the update, insert and delete commands: 
-
-       1. The "IsExpression" column in the column schema table can also
-       be DBNull which is equivalent to "false" but the DBCommandBuilder
-       does not check for DBNull and simply tries to cast it into a bool,
-       which will fail.
-
-       2. The commands do not get refreshed after a call to
-       UpdateSchema() because they are not set to NULL. This has the
-       consequence that empty commands(created with CreateNewCommand())
-       are returned afterwards.
-
-       3. Multiple parameters with the same name are generated if the
-       parameter names should be named after the columns.
-       
-2008-09-05  Raja R Harinath  <harinath@hurrynot.org>
-
-       * DataContainer.cs (*.ZeroOut): Rename from the somewhat unclear
-       'SetDefaultValue'.
-       (IsNull): Use a more idiomatic form of the short-circuit.
-       (*.SetValue): Convert to one-liners.
-
-2008-08-08  Raja R Harinath  <harinath@hurrynot.org>
-
-       Reduce massive code duplication
-       * DataContainer.cs (DataContainer): Rename from AbstractDataContainer.
-       Introduce new 'protected abstract' members to encapsulate
-       type-specific handling, and move all common code here.
-       (DataContainer.Create): Rename from CreateInstance.
-
-2008-07-06  Sebastien Pouliot  <sebastien@ximian.com> 
-
-       * DbDataReader.cs: Replace a few Type.GetType by typeof
-       [Found using Gendarme AvoidTypeGetTypeForConstantStringsRule]
-
-2008-07-03  Marek Habersack  <mhabersack@novell.com>
-
-       * DataAdapter.cs (BuildSchema): Check for null.
-       
-2008-07-01  Rodrigo Kumpera  <rkumpera@novell.com>
-
-       * RecordCache.cs: Kill some foreach loops.
-
-2008-04-21  Gert Driesen  <drieseng@users.sourceforge.net>
-
-       * DataColumnMappingCollection.cs: Modified argument names to match
-       MS. Code formatting.
-       * DataTableMappingCollection.cs: Modified argument names to match MS.
-       Code formatting.
-
-2008-03-23  Gert Driesen  <drieseng@users.sourceforge.net>
-
-       * DbDataAdapter.cs: Corcompare fixes and code formatting.
-       * DbDataRecord.cs: Corcompare fixes and code formatting.
-       * DataColumnMappingCollection.cs: Corcompare fixes and code formatting.
-       * RowUpdatedEventArgs.cs: Corcompare fixes and code formatting.
-       * DbParameterCollection.cs: Corcompare fixes and code formatting.
-
-2007-11-15  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DbProviderFactoriesConfigurationHandler.cs : Create() now takes
-         parent DataSet into consideration i.e. it now merges items in
-         different configurations. Fixed bug #323708.
-
-2007-10-21  Gert Driesen  <drieseng@users.sourceforge.net>
-
-       * DbDataPermissionAttribute.cs: In KeyRestrictionBehavior, reuse
-       ExceptionHelper.CheckEnumValue.
-       * ExceptionHelper.cs: Use same exception message for both 1.0 and 2.0.
-       * Index.cs: Fixed compiler warnings. Code formatting.
-
-2007-10-20  Gert Driesen  <drieseng@users.sourceforge.net>
-
-       * DbDataAdapter.cs: Implemented UpdateBatchSize setter.
-       * DataAdapter.cs: In FillLoadOption setter, ensure value is valid.
-       Modified MissingMappingAction and MissingSchemaAction setters to use
-       ExceptionHelper.CheckEnumValue to validate value. Spaces to tabs and
-       code formatting.
-       * ExceptionHelper.cs: Added CheckEnumValue method and modified
-       InvalidEnumValueException method to return AORE on 2.0 profile. Added
-       ConnectionClosed method that returns an InvalidOperationException.
-
-2007-10-19  Gert Driesen  <drieseng@users.sourceforge.net>
-
-       * DbTransaction.cs: Do not perform a rollback in Dispose (bool).
-       Leaves it up to deriving classes to override Dispose (bool) and
-       perform a rollback if necessary. Fixes bug #325397. Code formatting.
-       * ExceptionHelper.cs: Added TransactionNotUsable method that constructs
-       an InvalidOperationException to be thrown by IDbTransaction
-       implementations when the transaction is no longer open.
-
-2007-09-27  Nagappan A <anagappan@novell.com> 
-
-       * DbDataAdapter.cs: Added MonoTODO in appropriate place.
-       
-       * DbCommandBuilder.cs (initializeCommand): Implemented missing API.
-
-2007-09-25  Nagappan A  <anagappan@novell.com>
-
-       * DbConnection.cs: 2.0 attribute fixes.
-
-       * DataColumnMapping.cs: 2.0 attribute fixes.
-
-       * DbParameterCollection.cs: Code alignment.
-
-       * DataAdapter.cs: 2.0 attribute fixes.
-
-       * DataTableMapping.cs: 2.0 attribute fixes.
-
-       * RowUpdatingEventArgs.cs (BaseCommand): Code alignment.
-
-2007-09-24  Konstantin Triger <kostat@mainsoft.com>
-
-       * DbEnumerator.cs, DbDataRecord.cs: refactoring.
-       * DbDataRecord.cs: GetValue() should return null instead of DBNull.
-
-2007-08-10  Nagappan A  <anagappan@novell.com>
-
-       * DbDataAdapter.cs (Fill): Fixed method signature.
-
-2007-07-26  Nagappan A  <anagappan@novell.com>
-
-       * DbConnection.cs: Removed bogus TODO.
-
-2007-07-22  Nagappan A  <anagappan@novell.com>
-
-       * DbConnection.cs: 2.0 missing features.
-
-       * DbDataAdapter.cs: 2.0 missing features.
-
-2007-06-30  Gert Driesen  <drieseng@users.sourceforge.net>
-
-       * DbDataAdapter.cs: Marked ICloneable.Clone obsolete to match MS.
-
-2007-06-21  Nagappan A  <anagappan@novell.com>
-
-       * DbConnectionStringBuilder.cs (Init): Modified the dictionary to
-       use StringComparer.InvariantCultureIgnoreCase.
-       (Add, ContainsKey): Checks whether argument is null or empty string.
-
-2007-05-08  Adar Wesley <adarw@mainsoft.com>
-
-       * DbProviderFactory.cs: minor refactoring for throwing exceptions
-
-2007-04-30  Marek Habersack  <mhabersack@novell.com>
-
-       * DbProviderFactories.cs: throw the same exception MS.NET does.
-
-2007-03-03  Gert Driesen  <drieseng@users.sourceforge.net>
-
-       * DbProviderFactoriesConfigurationHandler.cs: Added support for
-       clear node.
-
-2007-03-03  Gert driesen  <drieseng@users.sourceforge.net>
-
-       * ConnectionStringsSectionHandler.cs: Removed since the 2.0 config
-       API is in place.
-       * DbProviderFactoriesConfigurationHandler.cs: Fixed name of DataSet
-       to match MS. Removed SupportedClasses column since this is no longer
-       part of 2.0 profile (removed during beta). Throw 
-       ConfigurationErrorsException for unrecognized elements. Mark methods
-       private, and refactor them. Added FIXMEs for missing checks for
-       unrecognized attributes.
-       * DbProviderFactories.cs: Marked constants internal. Replaced spaces
-       with tabs. Use ConfigurationManager.GetSection instead of deprecated
-       ConfigurationSettings.GetConfig.
-
-2007-02-26  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DbProviderFactoriesConfigurationHandler.cs : there was a config
-         test that used to be broken.
-
-2007-02-26  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DbProviderFactoriesConfigurationHandler.cs : remove "support"
-         attribute check, as it does not really do anything.
-
-2007-02-19  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DbProviderFactoriesConfigurationHandler.cs : "support" attribute is
-         optional. Fixed bug #80894.
-
-2007-02-09  Nagappan A  <anagappan@novell.com>
-
-       * DbProviderFactory.cs: Derived class has to implement all the
-       methods of this class.
-
-       * DbProviderFactoriesConfigurationHandler.cs (Create): Removed
-       bogus MonoTODO
-
-2007-01-08  Nagappan A  <anagappan@novell.com>
-
-       * DataTableMappingCollection.cs (AddRange):  Implemented missing
-       NET 2.0 API.
-
-       * DbConnection.cs (GetSchema): Implemented missing NET 2.0 API,
-       based on SqlClient implementation.
-
-       * DbConnectionStringBuilder.cs (AppendKeyValuePair): Implemented
-       missing API.
-
-       * DbDataReader.cs (GetData): Implemented missing API.
-       (GetDbDataReader): Implemented missing API.
-
-       * DbCommandBuilder.cs (BuildCache, BuildInformation)
-       (IncludedInInsert, IncludedInUpdate, IncludedInWhereClause)
-       (CreateDeleteCommand, CreateInsertCommand, CreateNewCommand)
-       (CreateUpdateCommand, CreateParameter): Added private methods.
-       (QuotedTableName, GetQuotedString, CatalogLocation)
-       (CatalogSeparator, ConflictOption, DataAdapter, QuotePrefix)
-       (QuoteSuffix, SchemaSeparator): Implemented public properties.
-       (SourceCommand): Implemented private property.
-       (Dispose, RowUpdatingHandler): Implemented protected methods.
-       (GetDeleteCommand, GetInsertCommand, GetUpdateCommand)
-       (QuoteIdentifier, UnquoteIdentifier, RefreshSchema): Implemented
-       public methods.
-
-       * DbProviderFactory.cs: Removed MonoTODO's as the derived class
-       has to implement all the methods in this class.
-
-       * DataAdapter.cs (Fill): Implemented missing method.
-
-       * DbDataAdapter.cs (FillCommandBehavior): Implemented property.
-
-2006-12-20  Nagappan A  <anagappan@novell.com>
-
-       * DataColumnMapping.cs (GetDataColumnBySchemaAction): Implemented
-       2.0 profile method.
-
-       * DbDataReader.cs: Removed TODO's where ever the implementation is
-       available.
-
-       * RowUpdatedEventArgs.cs: Removed TODO's where ever the
-       implementation is available.
-
-       * DataAdapter.cs (FillInternal): Moved from DbDataAdapater.cs to
-       here.
-       (BuildSchema): Moved from DbDataAdapter.cs.
-       (FillTable): Moved from DbDataAdapter.cs.
-       (OnFillErrorInternal): Implemented new internal method to raise an
-       event.
-       (SetupSchema): Moved from DbDataAdapter.cs.
-       (FillInterl): Moved common implementation from DbDataAdapter.cs.
-       Removed TODO's where ever the implementation is available.
-
-       * DbDataAdapter.cs (OnRowUpdated): Implemented protected method.
-       (OnRowUpdating): Implemented protected method.
-       (CreateFillErrorEvent): Moved to DataAdapter.cs.
-       (Fill): Moved common implementation to DataAdapter.cs.
-       (FillTable): Moved to DataAdapter.cs.
-       (BuildSchema): Moved to DataAdapter.cs.
-       (SetupSchema): Moved to DataAdapter.cs.
-
-2006-12-11  Miguel de Icaza  <miguel@novell.com>
-
-       * DataAdapter.cs: Removed TODO, NotSupportedException was the
-       correct implementation. 
-
-2006-11-28  Nagappan A  <anagappan@novell.com>
-
-       * DbDataAdapter.cs: Removed bogus MonoTODOs
-
-       * DataAdapter.cs: Removed bogus MonoTODOs
-       
-2006-11-15  Nagappan A  <anagappan@novell.com>
-
-       * DbDataAdapter.cs (FillFromReader): Implemented missing API to
-       handle FillErrorEventHandler
-       (DataAdapter): Implemented missing .NET 2.0 function
-       (GetDeleteCommand): Returns DbDataAdapter deleteCommand internal
-       variable.
-       (GetInsertCommand): Returns DbDataAdapter insertCommand internal
-       variable.
-       (GetUpdateCommand): Returns DbDataAdapter updateCommand internal
-       variable.
-
-2006-09-06  Konstantin Triger <kostat@mainsoft.com>
-
-       * DbDataAdapter.cs: added basic implementation for some 2.0 features.
-
-2006-08-24  Vladimir Krasnov <vladimirk@mainsoft.com>
-
-       * DbProviderFactories.cs: added TARGET_JVM block to not supported
-       functionality
-
-2006-08-06  Konstantin Triger <kostat@mainsoft.com>
-
-       * DbDataReader.cs: DbDataReader.Dipose(bool) - implemented.
-
-2006-07-17  Senganal T <tsenganal@novell.com>
-
-       * Index.cs :
-               - GetAllRows : Added. Returns all the rows in the current
-               index.
-               - GetDistinctRows :Added. Returns all the distinct rows (based
-               in Key Columns) in the index.
-               
-2006-07-13  Senganal T <tsenganal@novell.com>
-
-       * SchemaInfo.cs DbDataAdapter.cs DbConnectionOptions.cs DbParameter.cs 
-       DbMetaDataColumnNames.cs DbTransaction.cs DataTableMapping.cs DataAdapter.cs 
-       FieldNameLookup.cs DbDataRecord.cs DataColumnMappingCollection.cs DbCommand.cs 
-       DbDataPermission.cs DbProviderFactory.cs DbCommandBuilder.cs DbConnectionString.cs 
-       RowUpdatedEventArgs.cs DbDataReader.cs DbConnectionStringBuilder.cs DbConnection.cs 
-       DataTableMappingCollection.cs :
-               2.0 Api fixes
-
-2006-06-15  Senganal T <tsenganal@novell.com>
-
-       * Key.cs : 
-               -Equals : Check for Equality of Sort Order too.
-               
-2006-04-07  Senganal T <tsenganal@novell.com>
-
-       * DbDataAdapter.cs :
-               * Update () : If the Update/Delete Query has a null check,
-               then populate the parameter value correctly.
-
-2006-03-20  Senganal T <tsenganal@novell.com>
-
-       * DataAdapter.cs :
-               - Ctor () : Set Default Values for DataAdapter members
-       * DbDataAdapter.cs : 
-               - Update () : Call row.AcceptChanges only if AcceptChangesDuringUpdate
-               is true. Fixes bug #77776
-
-2006-03-09  Senganal T <tsenganal@novell.com>
-       
-       * Index.cs :
-               - Update () : Add the new record in the correct position
-
-2006-03-07  Senganal T <tsenganal@novell.com>
-
-       * Key.cs : 
-               Reverted the changes from the earlier patch.
-
-2006-02-22  Senganal T <tsenganal@novell.com>
-
-       * DbDataAdapter.cs :
-               - FillTable : Move BeginLoadData, EndLoadData outside the loop. Also,
-               move EndLoadData outsidet try,catch block. FillError is only for errors
-               occuring during loading the data into datatable.
-       * Key.cs :
-               - Set Default value of RowStateFilter to (CurrentRos | OriginalRows).
-               - ContainsVersion : If RowStateFilter is set to default value, return true
-               for Modified Rows as they can contain Default/Original versions.
-
-2006-02-18  Raja R Harinath  <harinath@gmail.com>
-
-       * DbConnectionStringBuilder.cs (ICollection.CopyTo): Use
-       _dictionary, not 'this' in cast.
-
-2006-02-17  Chris Toshok  <toshok@ximian.com>
-
-       * DbDataAdapter.cs: more 2.0 cleanup.
-
-2006-02-17  Chris Toshok  <toshok@ximian.com>
-
-       * DataAdapter.cs, DataColumnMappingCollection.cs,
-       DataColumnMapping.cs, DataTableMappingCollection.cs,
-       DataTableMapping.cs, DbCommandBuilder.cs,
-       DbConnectionStringBuilder.cs, DbParameterCollection.cs,
-       DbParameter.cs: pretty major attribute work.
-       
-2006-02-17  Chris Toshok  <toshok@ximian.com>
-
-       * DbProviderFactory.cs: remove two methods.  and mark the
-       DbProviderSupportedClasses ctor as internal since it's not part of
-       the public api.
-
-       * DbTable.cs: remove this class from 2.0 build.. leave it for the
-       JVM build, I guess?
-
-       * RowUpdatingEventArgs.cs: this class isn't abstract in 2.0.
-
-       * RowUpdatedEventArgs.cs: this class isn't abstract in 2.0.
-
-       * SupportedJoinOperators.cs: new 2.0 enum.
-
-       * CatalogLocation.cs: fix enum values.
-
-       * GroupByBehavior.cs: same.
-
-       * IdentifierCase.cs: same.
-
-       * SchemaTableColumn.cs: class is static, not sealed.  and add
-       missing elements.
-       
-       * SchemaTableOptionalColumn.cs: same.
-       
-       * DbDataReader.cs: oops, add back in VisibleFieldCount (i missed
-       it in the corcompare output), add EditorBrowsable attributes all
-       over the place, and fix some method signatures.
-
-       * DbDataUpdatableRecord.cs: remove this 2.0 file.
-
-2006-02-17  Chris Toshok  <toshok@ximian.com>
-
-       * DbDataReader.cs: remove VisibleFieldCount attribute, and remove
-       IDataReader2 and IDataRecord2 interfaces.
-       
-2006-02-13  Senganal T  <tsenganal@novell.com>
-
-       * DbDataAdapter.cs :
-               - FillSchema  : 
-                       - Add table to schema only if MissingSchemaAction is not Ignore
-                       Add schema to table if MissingSchemaAction is set to either of
-                       Add or AddWithKey
-               - BuildSchema :
-                       - Set the Schema values only if MissingSchemaAction is set to
-                       AddWithKey
-
-2006-01-31  Senganal T  <tsenganal@novell.com>
-
-       * DbDataAdapter.cs :
-               - Corrected an error in the prev checkin.. Fixes #77415
-
-2006-01-27  Senganal T  <tsenganal@novell.com>
-
-       * DbDataAdapter.cs :
-               - Modified schema population to follow MissingSchemaAction and MissingMappingAction
-               - Add a column to the Primary Key only if its not a hidden key
-               - Added some argument checks
-               - Removed some redundant code
-       * DataAdapter :
-               - Added argument checks
-       * ExceptionHelper :
-               - Added InvalidEnumException , a helper function to print error msg
-               
-2006-01-11 Boris Kirzner <borisk@mainsoft.com>
-       * Index.cs: removed redundant call to RebuildIndex() in constructor.
-
-2005-12-12  Konstantin Triger <kostat@mainsoft.com>
-
-       * Key.cs: Added ContainsVersion function, refactoring.
-       * Index.cs: Fixed Reset() to be ready for Update() calls.
-          Otherwise the index can be rebuilt with new values inside the
-          Update() call itself.
-          Fixed FindIndexExact(), Update(), Delete().
-
-2005-11-22  Konstantin Triger <kostat@mainsoft.com>
-
-       * DbProviderFactory.cs: TARGET_JVM ifdef.
-
-2005-11-21  Senganal T <tsenganal@novell.com>
-
-       * DbDataAdapter.cs
-       * DbParameter.cs
-       * DbTransaction.cs
-       * DbTable.cs
-       * DbProviderFactories.cs
-       * DbException.cs
-       * DbProviderFactory.cs
-       * DbCommandBuilder.cs
-       * DbDataReader.cs
-       * DbParameterCollection.cs
-               - Added stubs and other changes for ADO.NET 2.0 compatibility.
-       * DbMetaDataCollectionNames.cs (new file)
-               - Added DbMetaDataCollectionNames Enumeration 
-
-2005-10-24  Konstantin Triger <kostat@mainsoft.com>
-
-        * DataContainer.cs: removed extra type validation for object container
-
-2005-10-14  Senganal T  <tsenganal@novell.com>
-
-       * DbDataAdapter.cs : 
-               - BuildSchema() : Set the value of DataColumn Property 'AllowDBNull'
-               as returned by database. Fixes bug#76433. 
-
-2005-09-21 Boris Kirzner <borisk@mainsoft.com>
-       * Index.cs: 
-               - Rebuild index immediately after construction.
-               - Do not add records if they do not padd key filtration.
-               - Do not attempt to remove records if the are not in the index.
-       * Key.cs:
-               - Added HasFilter property, CanContain and DependsOn methods.
-               - Equals() uses filter expression comparison.           
-
-2005-09-07 Boris Kirzner <borisk@mainsoft.com>
-       * DataContainer.cs: Do not convert value if container type 
-       is System.Object.
-
-2005-08-08  Gert Driesen  <drieseng@users.sourceforge.net>
-
-       * DbTypes.cs: Marked internal to fix public API.
-
-2005-08-05  Sureshkumar T  <tsureshkumar@novell.com>
-
-       * DbDataAdapter.cs:
-       - Update (): set parameter values only after getting the
-       appropriate command from command builder. Close reader only if it
-       is not closed before. Use parameter's SourceVersion. Whitespace
-       corrections to comply with standard.
-
-2005-07-22  Sureshkumar T  <tsureshkumar@novell.com>
-
-       * DataColumnMappingCollection.cs: updated attributes & attribute
-       descriptions to match with masterinfos.
-
-2005-07-15  Sureshkumar T  <tsureshkumar@novell.com>
-
-       * DataTableMappingCollection.cs: GetTableMappingBySchemaAction:
-       meaningful error message if mapping is missing.
-
-       * DbDataAdapter.cs: Update: meaningful message if table is missing.
-
-2005-06-22  Sureshkumar T  <tsureshkumar@novell.com>
-
-       * Index.cs: Remove : length for Array.Copy (a, i+1, a, i, length -
-       (i+1)) corrected.
-
-2005-06-21  Sureshkumar T  <tsureshkumar@novell.com>
-
-       * DbConnectionStringBuilder.cs: Implemented method for parsing
-       connection string through "ConnectionString" property.
-
-       * DbConnectionStringBuilderHelper.cs: Helper class to provide
-       conversion between string=>.net type mapping for connection string
-       builders. The idea is to use between other providers (odbc) as
-       well.
-
-2005-05-29 Boris Kirzner <borisk@mainsoft.com>
-       * DbCommand.cs - added #ifdef NET_2_0 on DbCommandOptionalFeatures (not used in TARGET_JVM). 
-       * ExceptionHelper.cs - removed java references. Exceptions created on formatted text messages. Code styling fixes.
-       * DbParameterCollection.cs - implemented indexer properties.
-       * DbDataAdapter.cs - delagate exceptions creating to ExceptionHelper.
-       
-2005-05-25 Konstantin Triger <kostat@mainsoft.com>
-
-      * DataContainer.cs: Correcting the order - first the record is queried whether the value it contains is null, and only if not the value is fetched
-
-2005-05-20 Umadevi S <sumadevi@novell.com>
-       * Added file DbProviderSpecificTypePropertyAttribute.cs
-
-2005-05-19 Umadevi S <sumadevi@novell.com>
-
-       * RowUpdatingEventArgs.cs - added BaseCommand property for net 2.0
-
-2005-05-18 Konstantin Triger <kostat@mainsoft.com>
-
-       * DbDataAdapter.cs: Initialize the schema values to defaults if the schema does not contain the information
-
-2005-05-16  Sureshkumar T  <tsureshkumar@novell.com>
-
-       * RecordCache.cs: quick fix to make build 2.0 profile (follow up
-       for check in 2005-05-16).
-
-2005-05-16 Konstantin Triger <kostat@mainsoft.com>
-
-       * Index.cs: validation that the updated row belongs to the index
-
-2005-05-02 Konstantin Triger <kostat@mainsoft.com>
-
-       * DataContainer.cs: 
-               Added CharDataContainer, SByteDataContainer, UInt16DataContainer, UInt32DataContainer, UInt64DataContainer, DateTimeDataContainer, DecimalDataContainer
-               SetItemFromDataRecord: Changed to work with ISafeDataRecord or through GetValue to enable conversion
-               return DBNull.Value when the stored value is null
-       
-       * DbDataAdapter.cs:
-               Ensure correct order for LoadDataRow
-               Fixing schema creation
-               Use NewRowArray API
-       
-       * DbEnumerator.cs:
-               LoadSchema: Retrieve needed fields only
-       
-       * RecordCache.cs:
-               Added Rows-to-Records mapping
-               Added ReadIDataRecord method for correct handling of default/auto increment values
-       
-       * Added Index.cs: Index implementation
-       * Added Key.cs: Index descriptor implementation
-
-
-2005-04-27  Sureshkumar T  <tsureshkumar@novell.com>
-
-       * DbDataReader.cs: Added static method to construct the schema
-       table with default schema. Could be reused in many places.
-
-2005-04-22  Sureshkumar T  <tsureshkumar@novell.com>
-
-       * DbDataAdapter.cs: Moved FillTable and BuildSchema as static
-       methods as they are not operating on the current instance. This
-       could be reused to fill any table from a data reader.
-
-       * RecordCache.cs: While disposing records, make sure that the
-       record is not already disposed. i.e. to make sure later the same
-       record is not reused. Implemented a static method to compare two
-       version of records in a container.
-
-2005-04-18  Sureshkumar T  <tsureshkumar@novell.com>
-
-       * DataAdapter.cs: Implemenetd OnFillError handler.
-
-       * DbDataAdapter.cs: BuildSchema (): the table to be filled might
-       contain few additional columns as well. so mapping length should
-       be columns' length + fields' length.
-
-2005-03-24  Sureshkumar T  <tsureshkumar@novell.com>
-
-       * DbDataAdapter.cs: Update: If  SourceColumn is null, do not set
-       value for the parameter.
-
-2005-05-25 Umadevi S <sumadevi@novell.com>
-       * Added DbException.cs
-
-2005-03-23  Sureshkumar T  <tsureshkumar@novell.com>
-
-       * DbDataAdapter.cs: For Update, disable ReadOnly constraint
-       temporarily before updating the row. Info from Ingo Bauersachs.
-       SkipAllRemainingRows should also skip current row (msdn).
-
-2005-03-22  Sureshkumar T  <tsureshkumar@novell.com>
-
-       * DbDataAdapter.cs: Update (): update the rows based on the
-       UpdateRowSource property. Process further based on the
-       RowUpdatedEvent handler argument's Status property.
-       Fixes bug #73587. Thanks to mono@rankweg.ch (Ingo Bauersachs) for
-       bug report and patch.
-
-       * RowUpdatedEventArgs.cs: if custom error is not set, throw a
-       default error.
-
-2005-03-01  Sureshkumar T  <tsureshkumar@novell.com>
-
-       * ConnectionStringsSectionHandler.cs: Added. configuration section
-       handler for section "connectionStrings". This handler is a ad hoc
-       solution till the new configuration API is available in mono.
-
-2005-02-04  Sureshkumar T  <tsureshkumar@novell.com>
-
-       * DbDataAdapter.cs (Update ()) :
-       - Check for one return result set and map the values back to
-         datatable.
-       - Check for output & return value parameters and update the value
-         back to mapped column
-       - check for recordsAffected only after closing the reader.
-
-2005-02-02  Sureshkumar T  <tsureshkumar@novell.com>
-
-       * DbConnection.cs: Implement Dispose pattern.
-
-2005-01-25  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DbDataPermission.cs : Empty.Union(Empty) is Empty.
-
-2005-01-14  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DbDataPermissionAttribute.cs, PermissionHelper.cs :
-         fixed some incompatible type of exception between 2.0 and 1.x.
-       * DataContainer.cs :
-         Wrap exceptions thrown by SetValue() within ArgumentException.
-
-2004-12-10  Sureshkumar T  <tsureshkumar@novell.com>
-
-       * DbDataAdapter.cs (BuildSchema): Add the primary key schema iff
-       MissingSchemaAction is set to AddWithKey. Also, Add auto increment
-       value from the source table. fixes bug #67757 and #69110.
-
-2004-11-24  Sureshkumar T  <tsureshkumar@novell.com>
-
-       * DbProviderSupportedClasses.cs: Added correct enum values.
-       * DbConnection.cs: Missing virtual method EnlistTransaction Added.
-       * DbCommand.cs: Implemented ProviderFactory base factory methods.
-
-2004-11-22  Sureshkumar T  <tsureshkumar@novell.com>
-
-       * DbConnectionStringBuilder.cs: Class for helping creation of db
-       connection strings added.
-
-2004-10-01  Sureshkumar T  <tsureshkumar@novell.com>
-
-       * DbProviderFactories.cs: Implemented all the stubs. Added functionality for
-       getting available provider factories and creating a specified provider factory.
-
-       * DbProviderFactoriesConfigurationHandler.cs: Added functionality for handling
-       DbProviderFactories configuration section.
-
-       * DbProviderFactory.cs: Added protected constructor. SupportedClasses property
-       is made abstract.
-
-2004-09-14  Sebastien Pouliot  <sebastien@ximian.com>
-
-       * DbDataPermission.cs: Implemented Intersect, IsSubsetOf and Union.
-       Implementation isn't complete as the restrictions seems to change the
-       expected results (breaking some rules like x.IsSubsetOf (x) == false).
-       Better (real-world) tests cases are required.
-       * PermissionHelper.cs: Fixed small differences between System.Data.dll 
-       validations wrt to mscorlib.dll (XML and PermissionState).
-
-2004-09-13  Sebastien Pouliot  <sebastien@ximian.com>
-
-       * DbConnectionOptions.cs: New class for Fx 2.0. Partial implementation
-       to support new methods in DBDataPermission.
-       * DbConnectionString.cs: Updated class to split from/inherit 
-       DbConnectionOptions class.
-       * DbDataPermission.cs: Implemented Add, Clear, Copy, ToXml methods and
-       completed constructors.
-       * DbDataPermissionAttribute.cs: Completed/fixed class.
-       * PermissionHelper.cs: Helper methods to create permission classes.
-
-2004-08-31 Francisco Figueiredo Jr. <fxjrlists@yahoo.com.br>
-       * DbDataAdapter.cs: Fix for out of memory exceptions when trying to fill a dataset with a query which doesn't return a resultset like insert, delete or update.
-
-2004-07-21 Umadevi S <sumadevi@novell.com>
-       * DbDataRecord.cs - Fix for bug 58163. Return DBNull instead of null
-
-2004-07-07 Umadevi S <sumadevi@novell.com>
-       * DataContainer.cs :CheckedforNull before calling the relavant setmethods in each of the
-                SetItemForDataRecord method for the DateTimeClass
-
-
-2004-06-24  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataColumnMappingCollection.cs : fixed typo.
-       * DbDataAdapter.cs : column mappings were not filled.
-
-2004-06-24  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataTableMapping.cs : Clone() should also clone ColumnMappings.
-
-2004-06-18 Umadevi S <sumadevi@novell.com>
-       * DataContainer.cs - CheckedforNull before calling the relavant setmethods in each of the 
-               SetItemForDataRecord method for all the classes.
-
-2004-06-17  Boris Kirzner  <borisk@mainsoft.com>
-       * RecordCache.cs : Added CopyRecord mathod that copies single record from one table to another.
-
-2004-06-17  Boris Kirzner  <borisk@mainsoft.com>
-       * Datacontainer.cs : 
-         - Store and retreival of null and DBNull values reviewed.
-         - Added GetInt64 to support AutoIncrement of DataColumn.
-         - Added missing CopyValue method to BitDataContainer.
-         - Added FillValues method to propagate single value to whole container.
-       
-2004-06-10 Umadevi S <sumadevi@novell.com>
-       * DataTableMappingCollection.cs - fixed nunit testcase errors
-       IndexOfDataSetTable method
-
-2004-06-09 Umadevi S <sumadevi@novell.com>
-       * DataTableMappingCollection.cs - fixed nunit testcase errors
-       - Add, GetByDataSetTable,Insert, Remove, RemoveAt methods.
-
-2004-06-09 Umadevi S <sumadevi@novell.com>
-       * DataColumnMappingCollection.cs - fixed nunit testcase errors
-       - GetByDataSetColumn,IndexOfDataSetColumn, Remove methods.      
-
-2004-06-08 Umadevi S <sumadevi@novell.com>
-       * DataColumnMappingCollection.cs - fixed nunit testcase errors.
-       - remove, removeat, contains methods.
-
-2004-06-04  Gert Driesen <drieseng@users.sourceforge.net>
-
-       * DataAdapter.cs: added missing protected ctor
-       * DbDataAdapter.cs: added stub for missing protected ctor
-       * DbDataPermission.cs: added stubs for missing protected
-       ctors, added stub for missing Clear method
-
-2004-06-02  Gert Driesen <drieseng@users.sourceforge.net>
-       * DataColumnMappingCollection.cs: added missing attributes on
-       indexers
-
-2004-05-27  Boris Kirzner  <borisk@mainsoft.com>
-       * DataContainer.cs : Bug fixes in BitDataContainer.get_Item and StringDataContainer.SetValue .
-
-2004-05-20  Gert Driesen (drieseng@users.sourceforge.net)
-
-        *  DbDataPermissionAttribute.cs: change AllowMultiple and
-        Inherited to match .NET
-
-2004-05-19  Boris Kirzner  <borisk@mainsoft.com>
-       * Datacontainer.cs : CompareValues reviewed. set_Item and get_Item of null and DBNull values in case of DataContainers
-       for primitive types reviewed. Added check for null values when reading from IDataRecord.
-       
-2004-05-19  Boris Kirzner <borisk@mainsoft.com>
-       * RecordCache.cs - added. Each instance of record cache belongs to specific table
-       and manages pool of records ( indexes into data containers) to be used by data rows.
-       * DataContainer.cs - added. Provides implementation for data containers that holds data in arrays 
-       of primitives or objects. Each data container belongs to specific DataColumn.
-       * DbDataAdapter.cs - changes to complete data storage redesign. Bug fix in FillTable 
-       ( to fetch exact number of records required ).
-       
-2004-05-13 Umadevi S (sumadevi@novell.com)
-       * DbDataPermissionAttribute.cs - Added KeyRestrictions property with a TODO tag
-
-2004-05-09  Gert Driesen (drieseng@users.sourceforge.net)
-       * ComparerFactory.cs: marked internal
-
-2003-04-26  Boris Kirzner <borisk@mainsoft.com>
-       * DataColumnMappingCollection.cs : Small fix in exception message thrown.
-         
-2003-04-25  Boris Kirzner <borisk@mainsoft.com>
-       * DbDataAdapter.cs : Fixed bug in Fill :
-         - Reader can have empty results (fo example from UPDATE or DELETE).
-         - Reader can have results with no rows (SELECT that returns 0 rows but have columns)
-         - In FillTable - skip rows only once for each table.
-       
-2003-04-14  Juraj Skripsky <juraj@hotfeet.ch>
-       * DbDataAdapter.cs : Refactoring of Fill. New private method
-       FillTable does most of the work now. Use int[] instead of
-       hashtable for mapping. Move creation of tableArray[] outside
-       of loop.
-
-2004-03-12  Andreas Nahr <ClassDevelopment@A-SoftTech.com>
-
-       * DbDataPermissionAttribute.cs: Added .Net 1.1 marks
-       * DataColumnMapping.cs: DO NOT USE the consts scheme if types can be referenced directly!
-       * DataTableMapping.cs: DO NOT USE the consts scheme if types can be referenced directly!
-       * DataColumnMappingConverter: Added stub
-       * DataTableMappingConverter: Added stub
-
-2004-03-03  Eran Domb  <erand@miansoft.com>
-       
-       * ComparerFactory.cs : Added.
-       
-2004-01-10  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DbDataPermission.cs : tiny fix to pass OleDbPermission.
-
-2004-01-09  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DbDataPermission.cs : .ctor(PermissionState state) should not call
-         obsolete .ctor(state, allowBlankPassword). csc reports an error.
-
-2003-12-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
-       * DbDataAdapter.cs: handle MissingShemaAction.AddWithKey, call
-       AcceptChanges in Update when a CommandBuilder is used and
-       correctly fill information about primary keys in FillSchema.
-       Patch from Sergei Malinin (smalinin@amurnet.ru).
-
-2003-12-23  Tim Coleman <tim@timcoleman.com>
-       * DbConnectionString.cs:
-               Some implementation
-       * DbProviderFactory.cs:
-               Fix typo to make CLS compliant
-
-2003-12-16  Jackson Harper <jackson@ximian.com>
-
-       * SchemaTableOptionalColumn.cs: Add to fix default build
-       
-2003-12-16  Tim Coleman <tim@timcoleman.com>
-       * CatalogLocation.cs DbCommand.cs DbCommandBuilder.cs
-       * DbCommandOptionalFeatures.cs DbCommandSet.cs DbConnection.cs
-       * DbConnectionString.cs DbDataSourceEnumerator.cs
-       * DbDataUpdatableRecord.cs DbParameter.cs DbParameterCollection.cs
-       * DbProviderConfigurationHandler.cs DbProviderFactories.cs
-       * DbProviderFactoriesConfigurationHandler.cs DbProviderFactory.cs
-       * DbProviderSupportedClasses.cs DbTable.cs DbTransaction.cs
-       * GroupByBehavior.cs IdentifierCase.cs SchemaLocation.cs
-       * SchemaTableColumn.cs:
-               New stubs added for .NET 1.2
-       * DataAdapter.cs DataColumnMapping.cs DataColumnMappingCollection.cs
-       * DataTableMapping.cs DataTableMappingCollection.cs DbDataAdapter.cs
-       * DbDataPermission.cs DbDataPermissionAttribute.cs DbDataRecord.cs
-       * FieldNameLookup.cs SchemaInfo.cs:
-               Changes made for .NET 1.2
-
-2003-10-22  Eran Domb  <erand@miansoft.com>
-       * DbDataAdapter.cs : Check if there is mapping to avoid exception.
-
-2003-11-26  Tim Coleman <tim@timcoleman.com>
-       * DbDataReader.cs: Add new stub class
-
-2003-11-23  Pedro Martínez Juliá  <yoros@wanadoo.es>
-
-       * DbDataAdapter.cs: Call command dispose in self dispose method. We
-       need to dispose the connections and other stuff stored in the
-       commands.
-
-2003-11-10  Pedro Martínez Juliá  <yoros@wanadoo.es>
-
-       * DataColumnMappingCollection.cs: Fix a missing exception when the
-       required mapping is not in the collection. MS.NET throws an
-       exception there.
-
-2003-10-22  Eran Domb  <erand@miansoft.com>
-
-       * DbDataAdapter.cs (Fill): add only the mapped column to the dataTable (not all columns of dataReader).
-            Also closing the dataReader if an exception is thrown.
-       (Fill): the same as above.
-       (SetupSchema): in now return string (the table name). 
-       (GetFillParameters): fix a bug.
-       (BuildSchema) - it now return Hashtable. Add columns to the table only if there is a mapping. Build an Hashtable that maps the columns from the table to the column from the reader.
-       (Update): first open the connection if needed. Catch an exception of the ExecuteQuery.
-       
-
-2003-09-30  Duncan Mak  <duncan@ximian.com>
-
-       Patch from Eran Domb <eran@mainsoft.com>.
-       
-       * DbDataAdapter.cs (Fill): Fixed an Exception from being thrown.
-
-2003-09-25  Duncan Mak  <duncan@ximian.com>
-
-       * DbDataAdapter.cs (Fill): Patch from Eran Domb, <eran@mainsoft.com>.
-       Fixes a possible NullReferenceException, more details here:
-
-       http://lists.ximian.com/archives/public/mono-devel-list/2003-September/002116.html
-
-2003-09-21  eran <erand@mainsoft.com>
-
-       * DbDataRecord.cs: The method
-       System.Data.Common.DbDataRecord.GetValues(object[] values) did not
-       put the values of the DbDataRecord into values parameter.
-
-2003-08-26  Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
-       * DbDataAdapter.cs: provide a Type for ToArray to avoid invalid cast
-       exception. Thanks to Mark Easton <measton@tebiki.co.uk>.
-
-2003-07-31  Duncan Mak  <duncan@ximian.com>
-
-       * DataAdapter.cs (CloneInternals): Mark with ObsoleteAttribute for
-       NET_1_1.
-
-2003-03-21  Alan Tam <Tam@SiuLung.com>
-
-       * DbDataAdapter.cs: Update now uses correct DataRowVersion
-       when accessing the data.
-
-2003-03-17  Aleksey Demakov <avd@openlinksw.com>
-
-       * DbDataAdapter.cs: BuildSchema now uses ColumnName instead
-       of BaseColumnName (bug #39830) for DataColumn names.
-       BaseTableName is no longer taken into account as well.
-
-2003-02-28  Aleksey Demakov <avd@openlinksw.com>
-
-       * DbDataAdapter.cs: Update (DataSet) updates the default
-       table only.
-
-2003-02-25  Alan Tam <Tam@SiuLung.com>
-       
-       * DbDataAdapter.cs: Added support for filling when schema is present.
-       Fixed incorrect behavior when ColumnMapping is present
-       when more than one fields have the same name. Implemented Dispose.
-       Fixed error when there is no ColumnMapping at all.
-       Still have some problems in finding the correct TableMapping
-       because the SourceTable name is not present in BuildSchema
-
-2003-02-24  Aleksey Demakov <avd@openlinksw.com>
-
-       * DbDataAdapter.cs: The original code might pass a null DataTableMapping
-       value which is then used to create a RowUpdatingEventArgs
-       instance. So RowUpdatingEvent handler (for instance
-       CommandBuilder) could get null DataTableMapping which
-       might be unexpected. The patch makes sure that a non-null
-       DataTableMapping is passed.
-
-2003-01-26  Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
-       * DbEnumerator.cs: why does the runtime throw an invalid cast here? The
-       object is an Int16... Gotta fill a bug report and when fixed undo this
-       patch.
-
-2003-01-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
-       * DbDataRecord.cs: return DbNull.Value in GetValue () if value is null.
-
-2002-10-31  Daniel Morgan <danmorg@sc.rr.com>
-
-       * SchemaInfo.cs: added missing properties to fix mcs build
-
-2002-05-05  Miguel de Icaza  <miguel@ximian.com>
-
-       * DataTableMapping.cs, DataTableMappingCollection.cs: comment out
-       interfaces we do not implement yet.
-
-       * DbDataAdapter.cs: Stub IEnumerable, comment out interfaces
-       we do not implement yet.
-
-       * DbDataPermissionAttribute.cs: call base constructor.
-
diff --git a/mcs/class/System.Data/System.Data.Common/ComparerFactory.cs b/mcs/class/System.Data/System.Data.Common/ComparerFactory.cs
deleted file mode 100644 (file)
index 406f69d..0000000
+++ /dev/null
@@ -1,169 +0,0 @@
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.Collections;
-
-namespace System.Data.Common
-{
-       /// <summary>
-       /// Summary description for ComparerFactory.
-       /// </summary>
-       internal class DBComparerFactory
-       {
-               private static IComparer comparableComparer = new ComparebleComparer();
-               private static IComparer ignoreCaseComparer = new IgnoreCaseComparer();
-               private static IComparer caseComparer = new CaseComparer();
-               private static IComparer byteArrayComparer = new ByteArrayComparer();
-               private static Type icomparerType = typeof (IComparable);
-
-               public static IComparer GetComparer (Type type, bool ignoreCase)
-               {
-                       if (type == typeof (string)) {
-                               if (ignoreCase)
-                                       return ignoreCaseComparer;
-                               return caseComparer;
-                       }
-                       if (icomparerType.IsAssignableFrom(type))
-                               return comparableComparer;
-                       if (type == typeof (byte[]))
-                               return byteArrayComparer;
-                       return null;
-               }
-
-               class ComparebleComparer :IComparer
-               {
-                       #region IComparer Members
-
-                       public int Compare(object x, object y)
-                       {
-                               if (x == DBNull.Value) {
-                                       if (y == DBNull.Value) 
-                                               return 0;
-
-                                       return -1;
-                               }
-
-                               if (y == DBNull.Value) 
-                                       return 1;
-                               
-                               return ((IComparable)x).CompareTo (y);
-                       }
-
-                       #endregion
-               }
-
-               class CaseComparer : IComparer
-               {
-                       #region IComparer Members
-
-                       public int Compare(object x, object y)
-                       {
-                               if (x == DBNull.Value) {
-                                       if (y == DBNull.Value) 
-                                               return 0;
-
-                                       return -1;
-                               }
-
-                               if (y == DBNull.Value) 
-                                       return 1;
-                               
-                               return String.Compare ((string)x, (string)y, false);
-                       }
-
-                       #endregion
-               }
-
-               class IgnoreCaseComparer : IComparer
-               {
-                       #region IComparer Members
-
-                       public int Compare(object x, object y)
-                       {
-                               if (x == DBNull.Value) {
-                                       if (y == DBNull.Value) 
-                                               return 0;
-
-                                       return -1;
-                               }
-
-                               if (y == DBNull.Value) 
-                                       return 1;
-                               
-                               return String.Compare ((string)x, (string)y, true);
-                       }
-
-                       #endregion
-               }
-
-               class ByteArrayComparer : IComparer
-               {
-                       #region IComparer Members
-
-                       public int Compare(object x, object y)
-                       {
-                               if (x == DBNull.Value) {
-                                       if (y == DBNull.Value) 
-                                               return 0;
-
-                                       return -1;
-                               }
-
-                               if (y == DBNull.Value) 
-                                       return 1;
-                               
-                               byte[] o1 = (byte[])x;
-                               byte[] o2 = (byte[])y;
-                               int len  = o1.Length;
-                               int lenb = o2.Length;
-
-                               for (int i = 0; ; i++) {
-                                       int a = 0;
-                                       int b = 0;
-
-                                       if (i < len) {
-                                               a = o1[i];
-                                       } 
-                                       else if (i >= lenb) {
-                                               return 0;
-                                       }
-
-                                       if (i < lenb) {
-                                               b = o2[i];
-                                       }
-
-                                       if (a > b) {
-                                               return 1;
-                                       }
-
-                                       if (b > a) {
-                                               return -1;
-                                       }
-                               }
-                       }
-
-                       #endregion
-               }
-       }
-}
diff --git a/mcs/class/System.Data/System.Data.Common/DataAdapter.cs b/mcs/class/System.Data/System.Data.Common/DataAdapter.cs
deleted file mode 100644 (file)
index 775feb5..0000000
+++ /dev/null
@@ -1,617 +0,0 @@
-//
-// System.Data.Common.DataAdapter
-//
-// Author:
-//   Rodrigo Moya (rodrigo@ximian.com)
-//   Tim Coleman (tim@timcoleman.com)
-//
-// (C) Ximian, Inc
-// Copyright (C) Tim Coleman, 2002-2003
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Data;
-using System.Collections;
-using System.ComponentModel;
-
-namespace System.Data.Common
-{
-       /// <summary>
-       /// Represents a set of data commands and a database connection that are used to fill the DataSet and update the data source.
-       /// </summary>
-       public
-       class DataAdapter : Component, IDataAdapter
-       {
-               #region Fields
-
-               private bool acceptChangesDuringFill;
-               private bool continueUpdateOnError;
-               private MissingMappingAction missingMappingAction;
-               private MissingSchemaAction missingSchemaAction;
-               private DataTableMappingCollection tableMappings;
-               private const string DefaultSourceTableName = "Table";
-               private const string DefaultSourceColumnName = "Column";
-
-               private bool acceptChangesDuringUpdate;
-               private LoadOption fillLoadOption;
-               private bool returnProviderSpecificTypes;
-               #endregion
-
-               #region Constructors
-
-               protected DataAdapter () 
-               {
-                       acceptChangesDuringFill = true;
-                       continueUpdateOnError = false;
-                       missingMappingAction = MissingMappingAction.Passthrough;
-                       missingSchemaAction = MissingSchemaAction.Add;
-                       tableMappings = new DataTableMappingCollection ();
-                       acceptChangesDuringUpdate = true;
-                       fillLoadOption = LoadOption.OverwriteChanges;
-                       returnProviderSpecificTypes = false;
-               }
-
-               protected DataAdapter (DataAdapter from)
-               {
-                       AcceptChangesDuringFill = from.AcceptChangesDuringFill;
-                       ContinueUpdateOnError = from.ContinueUpdateOnError;
-                       MissingMappingAction = from.MissingMappingAction;
-                       MissingSchemaAction = from.MissingSchemaAction;
-
-                       if (from.tableMappings != null)
-                               foreach (ICloneable cloneable in from.TableMappings)
-                                       TableMappings.Add (cloneable.Clone ());
-                       acceptChangesDuringUpdate = from.AcceptChangesDuringUpdate;
-                       fillLoadOption = from.FillLoadOption;
-                       returnProviderSpecificTypes = from.ReturnProviderSpecificTypes;
-               }
-
-               #endregion
-
-               #region Properties
-
-               [DataCategory ("Fill")]
-               [DefaultValue (true)]
-               public bool AcceptChangesDuringFill {
-                       get { return acceptChangesDuringFill; }
-                       set { acceptChangesDuringFill = value; }
-               }
-
-               [DefaultValue (true)]
-               public bool AcceptChangesDuringUpdate {
-                       get { return acceptChangesDuringUpdate; }
-                       set { acceptChangesDuringUpdate = value; }
-               }
-
-               [DataCategory ("Update")]
-               [DefaultValue (false)]
-               public bool ContinueUpdateOnError {
-                       get { return continueUpdateOnError; }
-                       set { continueUpdateOnError = value; }
-               }
-
-               [RefreshProperties (RefreshProperties.All)]
-               public LoadOption FillLoadOption {
-                       get { return fillLoadOption; }
-                       set {
-                               ExceptionHelper.CheckEnumValue (typeof (LoadOption), value);
-                               fillLoadOption = value;
-               }
-               }
-
-               ITableMappingCollection IDataAdapter.TableMappings {
-                       get { return TableMappings; }
-               }
-
-               [DataCategory ("Mapping")]
-               [DefaultValue (MissingMappingAction.Passthrough)]
-               public MissingMappingAction MissingMappingAction {
-                       get { return missingMappingAction; }
-                       set {
-                               ExceptionHelper.CheckEnumValue (typeof (MissingMappingAction), value);
-                               missingMappingAction = value;
-                       }
-               }
-
-               [DataCategory ("Mapping")]
-               [DefaultValue (MissingSchemaAction.Add)]
-               public MissingSchemaAction MissingSchemaAction {
-                       get { return missingSchemaAction; }
-                       set {
-                               ExceptionHelper.CheckEnumValue (typeof (MissingSchemaAction), value);
-                               missingSchemaAction = value; 
-                       }
-               }
-
-               [DefaultValue (false)]
-               public virtual bool ReturnProviderSpecificTypes {
-                       get { return returnProviderSpecificTypes; }
-                       set { returnProviderSpecificTypes = value; }
-               }
-
-               [DataCategory ("Mapping")]
-               [DesignerSerializationVisibility (DesignerSerializationVisibility.Content)]
-               public DataTableMappingCollection TableMappings {
-                       get { return tableMappings; }
-               }
-
-               #endregion
-
-               #region Events
-
-               public event FillErrorEventHandler FillError;
-
-               #endregion
-
-               #region Methods
-
-               [Obsolete ("Use the protected constructor instead")]
-               [MonoTODO]
-               protected virtual DataAdapter CloneInternals ()
-               {
-                       throw new NotImplementedException ();
-               }
-
-               protected virtual DataTableMappingCollection CreateTableMappings ()
-               {
-                       return new DataTableMappingCollection ();
-               }
-
-               [MonoTODO]
-               protected override void Dispose (bool disposing)
-               {
-               }
-
-               protected virtual bool ShouldSerializeTableMappings ()
-               {
-                       return true;
-               }
-
-
-               internal int FillInternal (DataTable dataTable, IDataReader dataReader)
-               {
-                       if (dataReader.FieldCount == 0) {
-                               dataReader.Close ();
-                               return 0;
-                       }
-                       
-                       int count = 0;
-
-                       try {
-                               string tableName = SetupSchema (SchemaType.Mapped, dataTable.TableName);
-                               if (tableName != null) {
-                                       dataTable.TableName = tableName;
-                                       FillTable (dataTable, dataReader, 0, 0, ref count);
-                               }
-                       } finally {
-                               dataReader.Close ();
-                       }
-
-                       return count;
-               }
-
-               // this method builds the schema for a given datatable. it returns a int array with 
-               // "array[ordinal of datatable column] == index of source column in data reader".
-               // each column in the datatable has a mapping to a specific column in the datareader,
-               // the int array represents this match.
-               internal int[] BuildSchema (IDataReader reader, DataTable table, SchemaType schemaType)
-               {
-                       return BuildSchema (reader, table, schemaType, MissingSchemaAction,
-                                           MissingMappingAction, TableMappings);
-               }
-
-               /// <summary>
-               ///     Creates or Modifies the schema of the given DataTable based on the schema of
-               ///     the reader and the arguments passed.
-               /// </summary>
-               internal static int[] BuildSchema (IDataReader reader, DataTable table,
-                                                   SchemaType schemaType,
-                                                   MissingSchemaAction missingSchAction,
-                                                   MissingMappingAction missingMapAction,
-                                                   DataTableMappingCollection dtMapping
-                                                   )
-               {
-                       int readerIndex = 0;
-                       // FIXME : this fails if query has fewer columns than a table
-                       int[] mapping = new int[table.Columns.Count]; // mapping the reader indexes to the datatable indexes
-                       
-                       for(int i=0; i < mapping.Length; i++) {
-                               mapping[i] = -1;
-                       }
-                       
-                       ArrayList primaryKey = new ArrayList ();
-                       ArrayList sourceColumns = new ArrayList ();
-                       bool createPrimaryKey = true;
-                       
-                       DataTable schemaTable = reader.GetSchemaTable ();
-
-                       DataColumn ColumnNameCol =  schemaTable.Columns["ColumnName"];
-                       DataColumn DataTypeCol = schemaTable.Columns["DataType"];
-                       DataColumn IsAutoIncrementCol = schemaTable.Columns["IsAutoIncrement"];
-                       DataColumn AllowDBNullCol = schemaTable.Columns["AllowDBNull"];
-                       DataColumn IsReadOnlyCol = schemaTable.Columns["IsReadOnly"];
-                       DataColumn IsKeyCol = schemaTable.Columns["IsKey"];
-                       DataColumn IsUniqueCol = schemaTable.Columns["IsUnique"];
-                       DataColumn ColumnSizeCol = schemaTable.Columns["ColumnSize"];
-
-                       foreach (DataRow schemaRow in schemaTable.Rows) {
-                               // generate a unique column name in the source table.
-                               string sourceColumnName;
-                               string realSourceColumnName ;
-                               if (ColumnNameCol == null || schemaRow.IsNull(ColumnNameCol) ||
-                                   (string)schemaRow [ColumnNameCol] == String.Empty) {
-                                       sourceColumnName = DefaultSourceColumnName;
-                                       realSourceColumnName = DefaultSourceColumnName + "1";
-                               } else {
-                                       sourceColumnName = (string) schemaRow [ColumnNameCol];
-                                       realSourceColumnName = sourceColumnName;
-                               }
-
-                               for (int i = 1; sourceColumns.Contains (realSourceColumnName); i += 1)
-                                       realSourceColumnName = String.Format ("{0}{1}", sourceColumnName, i);
-                               sourceColumns.Add(realSourceColumnName);
-
-                               // generate DataSetColumnName from DataTableMapping, if any
-                               DataTableMapping tableMapping = null;
-
-                               //FIXME : The sourcetable name shud get passed as a parameter.. 
-                               int index = dtMapping.IndexOfDataSetTable (table.TableName);
-                               string srcTable = (index != -1 ? dtMapping[index].SourceTable : table.TableName);
-                               tableMapping = DataTableMappingCollection.GetTableMappingBySchemaAction (dtMapping, ADP.IsEmpty (srcTable) ? " " : srcTable, table.TableName, missingMapAction); 
-                               if (tableMapping != null) {
-                                       table.TableName = tableMapping.DataSetTable;
-                                       // check to see if the column mapping exists
-                                       DataColumnMapping columnMapping = DataColumnMappingCollection.GetColumnMappingBySchemaAction(tableMapping.ColumnMappings, realSourceColumnName, missingMapAction);
-                                       if (columnMapping != null) {
-                                               Type columnType = schemaRow[DataTypeCol] as Type;
-                                               DataColumn col = columnType != null ? columnMapping.GetDataColumnBySchemaAction(
-                                                                                                                               table ,
-                                                                                                                               columnType,
-                                                                                                                               missingSchAction) : null;
-
-                                               if (col != null) {
-                                                       // if the column is not in the table - add it.
-                                                       if (table.Columns.IndexOf(col) == -1) {
-                                                               if (missingSchAction == MissingSchemaAction.Add 
-                                                                   || missingSchAction == MissingSchemaAction.AddWithKey)
-                                                                       table.Columns.Add(col);
-
-                                                               int[] tmp = new int[mapping.Length + 1];
-                                                               Array.Copy(mapping,0,tmp,0,col.Ordinal);
-                                                               Array.Copy(mapping,col.Ordinal,tmp,col.Ordinal + 1,mapping.Length - col.Ordinal);
-                                                               mapping = tmp;
-                                                       }
-
-                                                       if (missingSchAction == MissingSchemaAction.AddWithKey) {
-                                                               object value = (AllowDBNullCol != null) ? schemaRow[AllowDBNullCol] : null;
-                                                               bool allowDBNull = value is bool ? (bool)value : true;
-
-                                                               value = (IsKeyCol != null) ? schemaRow[IsKeyCol] : null;
-                                                               bool isKey = value is bool ? (bool)value : false;
-
-                                                               value = (IsAutoIncrementCol != null) ? schemaRow[IsAutoIncrementCol] : null;
-                                                               bool isAutoIncrement = value is bool ? (bool)value : false;
-
-                                                               value = (IsReadOnlyCol != null) ? schemaRow[IsReadOnlyCol] : null;
-                                                               bool isReadOnly = value is bool ? (bool)value : false;
-
-                                                               value = (IsUniqueCol != null) ? schemaRow[IsUniqueCol] : null;
-                                                               bool isUnique = value is bool ? (bool)value : false;
-                                                               
-                                                               col.AllowDBNull = allowDBNull;
-                                                               // fill woth key info
-                                                               if (isAutoIncrement && DataColumn.CanAutoIncrement(columnType)) {
-                                                                       col.AutoIncrement = true;
-                                                                       if (!allowDBNull)
-                                                                               col.AllowDBNull = false;
-                                                               }
-
-                                                               if (columnType == DbTypes.TypeOfString) {
-                                                                       col.MaxLength = (ColumnSizeCol != null) ? (int)schemaRow[ColumnSizeCol] : 0;
-                                                               }
-
-                                                               if (isReadOnly)
-                                                                       col.ReadOnly = true;
-                                                                       
-                                                               if (!allowDBNull && (!isReadOnly || isKey))
-                                                                       col.AllowDBNull = false;
-                                                               if (isUnique && !isKey && !columnType.IsArray) {
-                                                                       col.Unique = true;
-                                                                       if (!allowDBNull)
-                                                                               col.AllowDBNull = false;
-                                                               }
-                                                               
-                                                               // This might not be set by all DataProviders
-                                                               bool isHidden = false;
-                                                               if (schemaTable.Columns.Contains ("IsHidden")) {
-                                                                       value = schemaRow["IsHidden"];
-                                                                       isHidden = ((value is bool) ? (bool)value : false);
-                                                               }
-
-                                                               if (isKey && !isHidden) {
-                                                                       primaryKey.Add (col);
-                                                                       if (allowDBNull)
-                                                                               createPrimaryKey = false;
-                                                               }
-                                                       }
-                                                       // add the ordinal of the column as a key and the index of the column in the datareader as a value.
-                                                       mapping[col.Ordinal] = readerIndex++;
-                                               }
-                                       }
-                               }
-                       }
-                       if (primaryKey.Count > 0) {
-                               DataColumn[] colKey = (DataColumn[])(primaryKey.ToArray(typeof (DataColumn)));
-                               if (createPrimaryKey)
-                                       table.PrimaryKey = colKey;
-                               else {
-                                       UniqueConstraint uConstraint = new UniqueConstraint(colKey);
-                                       for (int i = 0; i < table.Constraints.Count; i++) {
-                                               if (table.Constraints[i].Equals(uConstraint)) {
-                                                       uConstraint = null;
-                                                       break;
-                                               }
-                                       }
-
-                                       if (uConstraint != null)
-                                               table.Constraints.Add(uConstraint);
-                               }
-                       }
-                       return mapping;
-               }
-
-               internal bool FillTable (DataTable dataTable, IDataReader dataReader, int startRecord, int maxRecords, ref int counter)
-               {
-                       if (dataReader.FieldCount == 0)
-                               return false;
-
-                       int counterStart = counter;
-
-                       int[] mapping = BuildSchema (dataReader, dataTable, SchemaType.Mapped);
-                       
-                       int [] sortedMapping = new int [mapping.Length];
-                       int length = sortedMapping.Length;
-                       for (int i = 0; i < sortedMapping.Length; i++) {
-                               if (mapping [i] >= 0)
-                                       sortedMapping [mapping [i]] = i;
-                               else
-                                       sortedMapping [--length] = i;
-                       }
-
-                       for (int i = 0; i < startRecord; i++) {
-                               dataReader.Read ();
-                       }
-
-                       dataTable.BeginLoadData ();
-                       while (dataReader.Read () && (maxRecords == 0 || (counter - counterStart) < maxRecords)) {
-                               try {
-                                       dataTable.LoadDataRow (dataReader, sortedMapping, length, AcceptChangesDuringFill);
-                                       counter++;
-                               }
-                               catch (Exception e) {
-                                       object[] readerArray = new object [dataReader.FieldCount];
-                                       object[] tableArray = new object [mapping.Length];
-                                       // we get the values from the datareader
-                                       dataReader.GetValues (readerArray);
-                                       // copy from datareader columns to table columns according to given mapping
-                                       for (int i = 0; i < mapping.Length; i++) {
-                                               if (mapping [i] >= 0) {
-                                                       tableArray [i] = readerArray [mapping [i]];
-                                               }
-                                       }
-                                       FillErrorEventArgs args = CreateFillErrorEvent (dataTable, tableArray, e);
-                                       OnFillErrorInternal (args);
-
-                                       // if args.Continue is not set to true or if a handler is not set, rethrow the error..
-                                       if(!args.Continue)
-                                               throw e;
-                               }
-                       }
-                       dataTable.EndLoadData ();
-                       return true;
-               }
-
-               internal virtual void OnFillErrorInternal (FillErrorEventArgs value)
-               {
-                       OnFillError (value);
-               }
-
-               internal FillErrorEventArgs CreateFillErrorEvent (DataTable dataTable, object[] values, Exception e)
-               {
-                       FillErrorEventArgs args = new FillErrorEventArgs (dataTable, values);
-                       args.Errors = e;
-                       args.Continue = false;
-                       return args;
-               }
-
-               internal string SetupSchema (SchemaType schemaType, string sourceTableName)
-               {
-                       DataTableMapping tableMapping = null;
-
-                       if (schemaType == SchemaType.Mapped) {
-                               tableMapping = DataTableMappingCollection.GetTableMappingBySchemaAction (TableMappings, sourceTableName, sourceTableName, MissingMappingAction);
-                               if (tableMapping != null)
-                                       return tableMapping.DataSetTable;
-                               return null;
-                       } else
-                               return sourceTableName;
-               }
-
-               internal int FillInternal (DataSet dataSet, string srcTable, IDataReader dataReader, int startRecord, int maxRecords)
-               {
-                       if (dataSet == null)
-                               throw new ArgumentNullException ("DataSet");
-
-                       if (startRecord < 0)
-                               throw new ArgumentException ("The startRecord parameter was less than 0.");
-                       if (maxRecords < 0)
-                               throw new ArgumentException ("The maxRecords parameter was less than 0.");
-
-                       DataTable dataTable = null;
-                       int resultIndex = 0;
-                       int count = 0;
-                       
-                       try {
-                               string tableName = srcTable;
-                               do {
-                                       // Non-resultset queries like insert, delete or update aren't processed.
-                                       if (dataReader.FieldCount != -1) {
-                                               tableName = SetupSchema (SchemaType.Mapped, tableName);
-                                               if (tableName != null) {
-                                                       
-                                                       // check if the table exists in the dataset
-                                                       if (dataSet.Tables.Contains (tableName))
-                                                               // get the table from the dataset
-                                                               dataTable = dataSet.Tables [tableName];
-                                                       else {
-                                                               // Do not create schema if MissingSchemAction is set to Ignore
-                                                               if (this.MissingSchemaAction == MissingSchemaAction.Ignore)
-                                                                       continue;
-                                                               dataTable = dataSet.Tables.Add (tableName);
-                                                       }
-       
-                                                       if (!FillTable (dataTable, dataReader, startRecord, maxRecords, ref count))
-                                                               continue;
-       
-                                                       tableName = String.Format ("{0}{1}", srcTable, ++resultIndex);
-       
-                                                       startRecord = 0;
-                                                       maxRecords = 0;
-                                               }
-                                       }
-                               } while (dataReader.NextResult ());
-                       } finally {
-                               dataReader.Close ();
-                       }
-
-                       return count;
-               }
-
-               public virtual int Fill (DataSet dataSet)
-               {
-                       throw new NotSupportedException();
-               }
-
-               protected virtual int Fill (DataTable dataTable, IDataReader dataReader)
-               {
-                       return FillInternal (dataTable, dataReader);
-               }
-
-               protected virtual int Fill (DataTable[] dataTables, IDataReader dataReader, int startRecord, int maxRecords)
-               {
-                       int count = 0;
-                       if (dataReader.IsClosed)
-                               return 0;
-
-                       if (startRecord < 0)
-                               throw new ArgumentException ("The startRecord parameter was less than 0.");
-                       if (maxRecords < 0)
-                               throw new ArgumentException ("The maxRecords parameter was less than 0.");
-
-                       try {
-                               foreach (DataTable dataTable in dataTables) {
-                                       string tableName = SetupSchema (SchemaType.Mapped, dataTable.TableName);
-                                       if (tableName != null) {
-                                               dataTable.TableName = tableName;
-                                               FillTable (dataTable, dataReader, 0, 0, ref count);
-                                       }
-                               }
-                       } finally {
-                               dataReader.Close ();
-                       }
-
-                       return count;
-               }
-
-               protected virtual int Fill (DataSet dataSet, string srcTable, IDataReader dataReader, int startRecord, int maxRecords)
-               {
-                       return FillInternal (dataSet, srcTable, dataReader, startRecord, maxRecords);
-               }
-
-               [MonoTODO]
-               protected virtual DataTable FillSchema (DataTable dataTable, SchemaType schemaType, IDataReader dataReader)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               protected virtual DataTable[] FillSchema (DataSet dataSet, SchemaType schemaType, string srcTable, IDataReader dataReader)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public virtual DataTable[] FillSchema (DataSet dataSet, SchemaType schemaType)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               [MonoTODO]
-               [EditorBrowsable (EditorBrowsableState.Advanced)]
-               public virtual IDataParameter[] GetFillParameters ()
-               {
-                       throw new NotImplementedException ();
-               }
-
-               protected bool HasTableMappings ()
-               {
-                       return (TableMappings.Count != 0);
-               }
-
-               protected virtual void OnFillError (FillErrorEventArgs value)
-               {
-                       if (FillError != null)
-                               FillError (this, value);
-               }
-
-               [EditorBrowsable (EditorBrowsableState.Never)]
-               public void ResetFillLoadOption ()
-               {
-                       //FIXME: what else ??
-                       FillLoadOption = LoadOption.OverwriteChanges;
-               }
-
-               [EditorBrowsable (EditorBrowsableState.Never)]
-               public virtual bool ShouldSerializeAcceptChangesDuringFill ()
-               {
-                       return true;
-               }
-
-               [EditorBrowsable (EditorBrowsableState.Never)]
-               public virtual bool ShouldSerializeFillLoadOption ()
-               {
-                       return false;
-               }
-
-               [MonoTODO]
-               public virtual int Update (DataSet dataSet)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               #endregion
-               
-       }
-}
diff --git a/mcs/class/System.Data/System.Data.Common/DataContainer.cs b/mcs/class/System.Data/System.Data.Common/DataContainer.cs
deleted file mode 100644 (file)
index 7a46a04..0000000
+++ /dev/null
@@ -1,1010 +0,0 @@
-//
-// Copyright (C) 2008 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.Collections;
-using System.Reflection;
-#if !FULL_AOT_RUNTIME
-using System.Reflection.Emit;
-#endif
-
-namespace System.Data.Common
-{
-       internal abstract class DataContainer {
-               BitArray null_values;
-               System.Type _type;
-               DataColumn _column;
-
-               // implementing class protocol
-               protected internal abstract object GetValue (int index);
-               internal abstract long GetInt64 (int index);
-
-               // used to set the array value to something neutral when the corresponding item is null (in the database sense)
-               // note: we don't actually ever look at the value written there, but the GC may like us to avoid keeping stale
-               // values in the array.
-               protected abstract void ZeroOut (int index);
-               protected abstract void SetValue (int index, object value);
-               protected abstract void SetValueFromSafeDataRecord (int index, ISafeDataRecord record, int field);
-
-               protected abstract void DoCopyValue (DataContainer from, int from_index, int to_index);
-               protected abstract int DoCompareValues (int index1, int index2);
-
-               protected abstract void Resize (int length);
-
-               internal object this [int index] {
-                       get { return IsNull (index) ? DBNull.Value : GetValue (index); }
-                       set {
-                               if (value == null) {
-                                       // Table might not have a default values row to copy from
-                                       if (Column.Table.DefaultValuesRowIndex == -1) {
-                                               ZeroOut (index);
-                                               null_values [index] = true;
-                                       } else {
-                                               CopyValue (Column.Table.DefaultValuesRowIndex, index);
-                                       }
-                                       return;
-                               }
-
-                               bool is_dbnull = value == DBNull.Value;
-                               if (is_dbnull)
-                                       ZeroOut (index);
-                               else
-                                       SetValue (index, value);
-                               null_values [index] = is_dbnull;
-                       }
-               }
-
-               internal int Capacity {
-                       get { return null_values != null ? null_values.Count : 0; }
-                       set {
-                               int old_capacity = Capacity;
-                               if (value == old_capacity)
-                                       return;
-                               if (null_values == null)
-                                       null_values = new BitArray (value);
-                               else
-                                       null_values.Length = value;
-                               Resize (value);
-                       }
-               }
-
-               internal Type Type {
-                       get { return _type; }
-               }
-
-               protected DataColumn Column {
-                       get { return _column; }
-               }
-
-               internal static DataContainer Create (Type type, DataColumn column)
-               {
-                       DataContainer container;
-                       switch (Type.GetTypeCode(type)) {
-                       case TypeCode.Int16:
-                               container = new Int16DataContainer ();
-                               break;
-                       case TypeCode.Int32:
-                               container = new Int32DataContainer ();
-                               break;
-                       case TypeCode.Int64:
-                               container = new Int64DataContainer ();
-                               break;
-                       case TypeCode.String:
-                               container = new StringDataContainer ();
-                               break;
-                       case TypeCode.Boolean:
-                               container = new BitDataContainer ();
-                               break;
-                       case TypeCode.Byte:
-                               container = new ByteDataContainer ();
-                               break;
-                       case TypeCode.Char:
-                               container = new CharDataContainer ();
-                               break;
-                       case TypeCode.Double:
-                               container = new DoubleDataContainer ();
-                               break;
-                       case TypeCode.SByte:
-                               container = new SByteDataContainer ();
-                               break;
-                       case TypeCode.Single:
-                               container = new SingleDataContainer ();
-                               break;
-                       case TypeCode.UInt16:
-                               container = new UInt16DataContainer ();
-                               break;
-                       case TypeCode.UInt32:
-                               container = new UInt32DataContainer ();
-                               break;
-                       case TypeCode.UInt64:
-                               container = new UInt64DataContainer ();
-                               break;
-                       case TypeCode.DateTime:
-                               container = new DateTimeDataContainer ();
-                               break;
-                       case TypeCode.Decimal:
-                               container = new DecimalDataContainer ();
-                               break;
-                       default:
-                               container = new ObjectDataContainer ();
-                               break;
-                       }
-                       container._type = type;
-                       container._column = column;
-                       return container;
-               }
-
-               internal static object GetExplicitValue (object value) 
-               {
-                       Type valueType = value.GetType ();
-                       MethodInfo method = valueType.GetMethod ("op_Explicit", new Type[]{valueType});
-                       if (method != null) 
-                               return (method.Invoke (value, new object[]{value}));
-                       return null;
-               }
-               
-               internal object GetContainerData (object value) 
-               {
-                       object obj; 
-                       TypeCode tc;
-                       
-                       if (value == null)
-                               return null;
-                       
-                       if (_type.IsInstanceOfType (value)) {
-                               return value;
-                       } else if ((tc = Type.GetTypeCode (_type)) == TypeCode.String) {
-                               return (Convert.ToString (value));
-                       } else if (value is IConvertible) {
-                               switch (tc) {
-                                       case TypeCode.Int16:
-                                               return (Convert.ToInt16 (value));
-                                       case TypeCode.Int32:
-                                               return (Convert.ToInt32 (value));
-                                       case TypeCode.Int64:
-                                               return (Convert.ToInt64 (value));
-                                       case TypeCode.Boolean:
-                                               return (Convert.ToBoolean (value));
-                                       case TypeCode.Byte:
-                                               return (Convert.ToByte (value));
-                                       case TypeCode.Char:
-                                               return (Convert.ToChar (value));
-                                       case TypeCode.Double:
-                                               return (Convert.ToDouble (value));
-                                       case TypeCode.SByte:
-                                               return (Convert.ToSByte (value));
-                                       case TypeCode.Single:
-                                               return (Convert.ToSingle (value));
-                                       case TypeCode.UInt16:
-                                               return (Convert.ToUInt16 (value));
-                                       case TypeCode.UInt32:
-                                               return (Convert.ToUInt32 (value));
-                                       case TypeCode.UInt64:
-                                               return (Convert.ToUInt64 (value));
-                                       case TypeCode.DateTime:
-                                               if (value == DBNull.Value)
-                                                       return DBNull.Value;
-                                               return (Convert.ToDateTime (value));
-                                       case TypeCode.Decimal:
-                                               return (Convert.ToDecimal (value));
-                                       default:
-                                               throw new InvalidCastException (string.Format ("Cannot convert from {0} to {1}", value.GetType ().FullName, _type.FullName));
-                               }
-                       } else if ((obj = GetExplicitValue (value)) != null) {
-                               return (obj);
-                       } else {
-                               throw new InvalidCastException ();
-                       }
-               }
-               
-               internal bool IsNull (int index)
-               {
-                       return null_values == null || null_values [index];
-               }
-
-               internal void FillValues (int fromIndex)
-               {
-                       for (int i = 0; i < Capacity; i++)
-                               CopyValue (fromIndex, i);
-               }
-
-               internal void CopyValue (int from_index, int to_index)
-               {
-                       CopyValue (this, from_index, to_index);
-               }
-
-               internal void CopyValue (DataContainer from, int from_index, int to_index)
-               {
-                       DoCopyValue (from, from_index, to_index);
-                       null_values [to_index] = from.null_values [from_index];
-               }
-
-               internal void SetItemFromDataRecord (int index, IDataRecord record, int field)
-               {
-                       if (record.IsDBNull (field))
-                               this [index] = DBNull.Value;
-                       else if (record is ISafeDataRecord)
-                               SetValueFromSafeDataRecord (index, (ISafeDataRecord) record, field);
-                       else
-                               this [index] = record.GetValue (field);
-               }
-
-               internal int CompareValues (int index1, int index2)
-               {
-                       bool null1 = IsNull (index1);
-                       bool null2 = IsNull (index2);
-
-                       if (null1 == null2)
-                               return null1 ? 0 : DoCompareValues (index1, index2);
-                       return null1 ? -1 : 1;
-               }
-       }
-
-       sealed class BitDataContainer : DataContainer {
-               BitArray _values;
-
-               protected internal override object GetValue (int index)
-               {
-                       return _values [index];
-               }
-
-               protected override void ZeroOut (int index)
-               {
-                       _values [index] = false;
-               }
-
-               protected override void SetValue (int index, object value)
-               {
-                       _values [index] = (bool) GetContainerData (value);
-               }
-
-               protected override void SetValueFromSafeDataRecord (int index, ISafeDataRecord record, int field)
-               {
-                       _values [index] = record.GetBooleanSafe (field);
-               }
-
-               protected override void DoCopyValue (DataContainer from, int from_index, int to_index)
-               {
-                       _values [to_index] = (bool) GetContainerData (from.GetValue (from_index));
-               }
-
-               protected override int DoCompareValues (int index1, int index2)
-               {
-                       bool val1 = _values [index1];
-                       bool val2 = _values [index2];
-                       return val1 == val2 ? 0 : val1 ? 1 : -1;
-               }
-
-               protected override void Resize (int size)
-               {
-                       if (_values == null)
-                               _values = new BitArray (size);
-                       else
-                               _values.Length = size;
-               }
-
-               internal override long GetInt64 (int index)
-               {
-                       return Convert.ToInt64 (_values [index]);
-               }
-       }
-
-       sealed class CharDataContainer : DataContainer {
-               char [] _values;
-
-               protected internal override object GetValue (int index)
-               {
-                       return _values [index];
-               }
-
-               protected override void ZeroOut (int index)
-               {
-                       _values [index] = '\0';
-               }
-
-               protected override void SetValue (int index, object value)
-               {
-                       _values [index] = (char) GetContainerData (value);
-               }
-
-               protected override void SetValueFromSafeDataRecord (int index, ISafeDataRecord record, int field)
-               {
-                       _values [index] = record.GetCharSafe (field);
-               }
-
-               protected override void DoCopyValue (DataContainer from, int from_index, int to_index)
-               {
-                       _values [to_index] = (char) GetContainerData (from.GetValue (from_index));
-               }
-
-               protected override int DoCompareValues (int index1, int index2)
-               {
-                       char val1 = _values [index1];
-                       char val2 = _values [index2];
-                       return val1 == val2 ? 0 : val1 < val2 ? -1 : 1;
-               }
-
-               protected override void Resize (int size)
-               {
-                       if (_values == null) {
-                               _values = new char [size];
-                               return;
-                       }
-
-                       char[] tmp = new char [size];
-                       Array.Copy (_values, 0, tmp, 0, _values.Length);
-                       _values = tmp;
-               }
-
-               internal override long GetInt64 (int index)
-               {
-                       return Convert.ToInt64 (_values [index]);
-               }
-       }
-
-       sealed class ByteDataContainer : DataContainer {
-               byte [] _values;
-
-               protected internal override object GetValue (int index)
-               {
-                       return _values [index];
-               }
-
-               protected override void ZeroOut (int index)
-               {
-                       _values [index] = 0;
-               }
-
-               protected override void SetValue (int index, object value)
-               {
-                       _values [index] = (byte) GetContainerData (value);
-               }
-
-               protected override void SetValueFromSafeDataRecord (int index, ISafeDataRecord record, int field)
-               {
-                       _values [index] = record.GetByteSafe (field);
-               }
-
-               protected override void DoCopyValue (DataContainer from, int from_index, int to_index)
-               {
-                       _values [to_index] = (byte) GetContainerData (from.GetValue (from_index));
-               }
-
-               protected override int DoCompareValues (int index1, int index2)
-               {
-                       int val1 = _values [index1];
-                       int val2 = _values [index2];
-                       return val1 - val2;
-               }
-
-               protected override void Resize (int size)
-               {
-                       if (_values == null) {
-                               _values = new byte [size];
-                               return;
-                       }
-
-                       byte[] tmp = new byte [size];
-                       Array.Copy (_values, 0, tmp, 0, _values.Length);
-                       _values = tmp;
-               }
-
-               internal override long GetInt64 (int index)
-               {
-                       return _values [index];
-               }
-       }
-
-       sealed class SByteDataContainer : DataContainer {
-               sbyte [] _values;
-
-               protected internal override object GetValue (int index)
-               {
-                       return _values [index];
-               }
-
-               protected override void ZeroOut (int index)
-               {
-                       _values [index] = 0;
-               }
-
-               protected override void SetValue (int index, object value)
-               {
-                       _values [index] = (sbyte) GetContainerData (value);
-               }
-
-               protected override void SetValueFromSafeDataRecord (int index, ISafeDataRecord record, int field)
-               {
-                       _values [index] = (sbyte) record.GetByteSafe (field);
-               }
-
-               protected override void DoCopyValue (DataContainer from, int from_index, int to_index)
-               {
-                       _values [to_index] = (sbyte) GetContainerData (from.GetValue (from_index));
-               }
-
-               protected override int DoCompareValues (int index1, int index2)
-               {
-                       int val1 = _values [index1];
-                       int val2 = _values [index2];
-                       return val1 - val2;
-               }
-
-               protected override void Resize (int size)
-               {
-                       if (_values == null) {
-                               _values = new sbyte [size];
-                               return;
-                       }
-
-                       sbyte[] tmp = new sbyte [size];
-                       Array.Copy (_values, 0, tmp, 0, _values.Length);
-                       _values = tmp;
-               }
-
-               internal override long GetInt64 (int index)
-               {
-                       return _values [index];
-               }
-       }
-
-       sealed class Int16DataContainer : DataContainer {
-               short [] _values;
-
-               protected internal override object GetValue (int index)
-               {
-                       return _values [index];
-               }
-
-               protected override void ZeroOut (int index)
-               {
-                       _values [index] = 0;
-               }
-
-               protected override void SetValue (int index, object value)
-               {
-                       _values [index] = (short) GetContainerData (value);
-               }
-
-               protected override void SetValueFromSafeDataRecord (int index, ISafeDataRecord record, int field)
-               {
-                       _values [index] = record.GetInt16Safe (field);
-               }
-
-               protected override void DoCopyValue (DataContainer from, int from_index, int to_index)
-               {
-                       _values [to_index] = (short) GetContainerData (from.GetValue (from_index));
-               }
-
-               protected override int DoCompareValues (int index1, int index2)
-               {
-                       int val1 = _values [index1];
-                       int val2 = _values [index2];
-                       return val1 - val2;
-               }
-
-               protected override void Resize (int size)
-               {
-                       if (_values == null) {
-                               _values = new short [size];
-                               return;
-                       }
-
-                       short[] tmp = new short [size];
-                       Array.Copy (_values, 0, tmp, 0, _values.Length);
-                       _values = tmp;
-               }
-
-               internal override long GetInt64 (int index)
-               {
-                       return _values [index];
-               }
-       }
-
-       sealed class UInt16DataContainer : DataContainer {
-               ushort [] _values;
-
-               protected internal override object GetValue (int index)
-               {
-                       return _values [index];
-               }
-
-               protected override void ZeroOut (int index)
-               {
-                       _values [index] = 0;
-               }
-
-               protected override void SetValue (int index, object value)
-               {
-                       _values [index] = (ushort) GetContainerData (value);
-               }
-
-               protected override void SetValueFromSafeDataRecord (int index, ISafeDataRecord record, int field)
-               {
-                       _values [index] = (ushort) record.GetInt16Safe (field);
-               }
-
-               protected override void DoCopyValue (DataContainer from, int from_index, int to_index)
-               {
-                       _values [to_index] = (ushort) GetContainerData (from.GetValue (from_index));
-               }
-
-               protected override int DoCompareValues (int index1, int index2)
-               {
-                       int val1 = _values [index1];
-                       int val2 = _values [index2];
-                       return val1 - val2;
-               }
-
-               protected override void Resize (int size)
-               {
-                       if (_values == null) {
-                               _values = new ushort [size];
-                               return;
-                       }
-
-                       ushort[] tmp = new ushort [size];
-                       Array.Copy (_values, 0, tmp, 0, _values.Length);
-                       _values = tmp;
-               }
-
-               internal override long GetInt64 (int index)
-               {
-                       return _values [index];
-               }
-       }
-
-       sealed class Int32DataContainer : DataContainer {
-               int [] _values;
-
-               protected internal override object GetValue (int index)
-               {
-                       return _values [index];
-               }
-
-               protected override void ZeroOut (int index)
-               {
-                       _values [index] = 0;
-               }
-
-               protected override void SetValue (int index, object value)
-               {
-                       _values [index] = (int) GetContainerData (value);
-               }
-
-               protected override void SetValueFromSafeDataRecord (int index, ISafeDataRecord record, int field)
-               {
-                       _values [index] = record.GetInt32Safe (field);
-               }
-
-               protected override void DoCopyValue (DataContainer from, int from_index, int to_index)
-               {
-                       _values [to_index] = (int) GetContainerData (from.GetValue (from_index));
-               }
-
-               protected override int DoCompareValues (int index1, int index2)
-               {
-                       int val1 = _values [index1];
-                       int val2 = _values [index2];
-                       return val1 == val2 ? 0 : val1 < val2 ? -1 : 1;
-               }
-
-               protected override void Resize (int size)
-               {
-                       if (_values == null) {
-                               _values = new int [size];
-                               return;
-                       }
-
-                       int[] tmp = new int [size];
-                       Array.Copy (_values, 0, tmp, 0, _values.Length);
-                       _values = tmp;
-               }
-
-               internal override long GetInt64 (int index)
-               {
-                       return _values [index];
-               }
-       }
-
-       sealed class UInt32DataContainer : DataContainer {
-               uint [] _values;
-
-               protected internal override object GetValue (int index)
-               {
-                       return _values [index];
-               }
-
-               protected override void ZeroOut (int index)
-               {
-                       _values [index] = 0;
-               }
-
-               protected override void SetValue (int index, object value)
-               {
-                       _values [index] = (uint) GetContainerData (value);
-               }
-
-               protected override void SetValueFromSafeDataRecord (int index, ISafeDataRecord record, int field)
-               {
-                       _values [index] = (uint) record.GetInt32Safe (field);
-               }
-
-               protected override void DoCopyValue (DataContainer from, int from_index, int to_index)
-               {
-                       _values [to_index] = (uint) GetContainerData (from.GetValue (from_index));
-               }
-
-               protected override int DoCompareValues (int index1, int index2)
-               {
-                       uint val1 = _values [index1];
-                       uint val2 = _values [index2];
-                       return val1 == val2 ? 0 : val1 < val2 ? -1 : 1;
-               }
-
-               protected override void Resize (int size)
-               {
-                       if (_values == null) {
-                               _values = new uint [size];
-                               return;
-                       }
-
-                       uint[] tmp = new uint [size];
-                       Array.Copy (_values, 0, tmp, 0, _values.Length);
-                       _values = tmp;
-               }
-
-               internal override long GetInt64 (int index)
-               {
-                       return _values [index];
-               }
-       }
-
-       sealed class Int64DataContainer : DataContainer {
-               long [] _values;
-
-               protected internal override object GetValue (int index)
-               {
-                       return _values [index];
-               }
-
-               protected override void ZeroOut (int index)
-               {
-                       _values [index] = 0;
-               }
-
-               protected override void SetValue (int index, object value)
-               {
-                       _values [index] = (long) GetContainerData (value);
-               }
-
-               protected override void SetValueFromSafeDataRecord (int index, ISafeDataRecord record, int field)
-               {
-                       _values [index] = record.GetInt64Safe (field);
-               }
-
-               protected override void DoCopyValue (DataContainer from, int from_index, int to_index)
-               {
-                       _values [to_index] = (long) GetContainerData (from.GetValue (from_index));
-               }
-
-               protected override int DoCompareValues (int index1, int index2)
-               {
-                       long val1 = _values [index1];
-                       long val2 = _values [index2];
-                       return val1 == val2 ? 0 : val1 < val2 ? -1 : 1;
-               }
-
-               protected override void Resize (int size)
-               {
-                       if (_values == null) {
-                               _values = new long [size];
-                               return;
-                       }
-
-                       long[] tmp = new long [size];
-                       Array.Copy (_values, 0, tmp, 0, _values.Length);
-                       _values = tmp;
-               }
-
-               internal override long GetInt64 (int index)
-               {
-                       return _values [index];
-               }
-       }
-
-       sealed class UInt64DataContainer : DataContainer {
-               ulong [] _values;
-
-               protected internal override object GetValue (int index)
-               {
-                       return _values [index];
-               }
-
-               protected override void ZeroOut (int index)
-               {
-                       _values [index] = 0;
-               }
-
-               protected override void SetValue (int index, object value)
-               {
-                       _values [index] = (ulong) GetContainerData (value);
-               }
-
-               protected override void SetValueFromSafeDataRecord (int index, ISafeDataRecord record, int field)
-               {
-                       _values [index] = (ulong) record.GetInt64Safe (field);
-               }
-
-               protected override void DoCopyValue (DataContainer from, int from_index, int to_index)
-               {
-                       _values [to_index] = (ulong) GetContainerData (from.GetValue (from_index));
-               }
-
-               protected override int DoCompareValues (int index1, int index2)
-               {
-                       ulong val1 = _values [index1];
-                       ulong val2 = _values [index2];
-                       return val1 == val2 ? 0 : val1 < val2 ? -1 : 1;
-               }
-
-               protected override void Resize (int size)
-               {
-                       if (_values == null) {
-                               _values = new ulong [size];
-                               return;
-                       }
-
-                       ulong[] tmp = new ulong [size];
-                       Array.Copy (_values, 0, tmp, 0, _values.Length);
-                       _values = tmp;
-               }
-
-               internal override long GetInt64 (int index)
-               {
-                       return Convert.ToInt64 (_values [index]);
-               }
-       }
-
-       sealed class SingleDataContainer : DataContainer {
-               float [] _values;
-
-               protected internal override object GetValue (int index)
-               {
-                       return _values [index];
-               }
-
-               protected override void ZeroOut (int index)
-               {
-                       _values [index] = 0;
-               }
-
-               protected override void SetValue (int index, object value)
-               {
-                       _values [index] = (float) GetContainerData (value);
-               }
-
-               protected override void SetValueFromSafeDataRecord (int index, ISafeDataRecord record, int field)
-               {
-                       _values [index] = record.GetFloatSafe (field);
-               }
-
-               protected override void DoCopyValue (DataContainer from, int from_index, int to_index)
-               {
-                       _values [to_index] = (float) GetContainerData (from.GetValue (from_index));
-               }
-
-               protected override int DoCompareValues (int index1, int index2)
-               {
-                       float val1 = _values [index1];
-                       float val2 = _values [index2];
-                       return val1 == val2 ? 0 : val1 < val2 ? -1 : 1;
-               }
-
-               protected override void Resize (int size)
-               {
-                       if (_values == null) {
-                               _values = new float [size];
-                               return;
-                       }
-
-                       float[] tmp = new float [size];
-                       Array.Copy (_values, 0, tmp, 0, _values.Length);
-                       _values = tmp;
-               }
-
-               internal override long GetInt64 (int index)
-               {
-                       return Convert.ToInt64 (_values [index]);
-               }
-       }
-
-       sealed class DoubleDataContainer : DataContainer {
-               double [] _values;
-
-               protected internal override object GetValue (int index)
-               {
-                       return _values [index];
-               }
-
-               protected override void ZeroOut (int index)
-               {
-                       _values [index] = 0;
-               }
-
-               protected override void SetValue (int index, object value)
-               {
-                       _values [index] = (double) GetContainerData (value);
-               }
-
-               protected override void SetValueFromSafeDataRecord (int index, ISafeDataRecord record, int field)
-               {
-                       _values [index] = record.GetDoubleSafe (field);
-               }
-
-               protected override void DoCopyValue (DataContainer from, int from_index, int to_index)
-               {
-                       _values [to_index] = (double) GetContainerData (from.GetValue (from_index));
-               }
-
-               protected override int DoCompareValues (int index1, int index2)
-               {
-                       double val1 = _values [index1];
-                       double val2 = _values [index2];
-                       return val1 == val2 ? 0 : val1 < val2 ? -1 : 1;
-               }
-
-               protected override void Resize (int size)
-               {
-                       if (_values == null) {
-                               _values = new double [size];
-                               return;
-                       }
-
-                       double[] tmp = new double [size];
-                       Array.Copy (_values, 0, tmp, 0, _values.Length);
-                       _values = tmp;
-               }
-
-               internal override long GetInt64 (int index)
-               {
-                       return Convert.ToInt64 (_values[index]);
-               }
-       }
-
-       class ObjectDataContainer : DataContainer {
-               object [] _values;
-
-               protected internal override object GetValue (int index)
-               {
-                       return _values [index];
-               }
-
-               protected override void ZeroOut (int index)
-               {
-                       _values [index] = null;
-               }
-
-               protected override void SetValue (int index, object value)
-               {
-                       _values [index] = value;
-               }
-
-               protected override void SetValueFromSafeDataRecord (int index, ISafeDataRecord record, int field)
-               {
-                       _values [index] = record.GetValue (field);
-               }
-
-               protected override void DoCopyValue (DataContainer from, int from_index, int to_index)
-               {
-                       _values [to_index] = GetContainerData (from.GetValue (from_index));
-               }
-
-               protected override int DoCompareValues (int index1, int index2)
-               {
-                       object obj1 = _values [index1];
-                       object obj2 = _values [index2];
-
-                       if (obj1 == obj2)
-                               return 0;
-
-                       if (obj1 is IComparable) {
-                               try {
-                                       return ((IComparable)obj1).CompareTo (obj2);
-                               } catch {
-                                       if (obj2 is IComparable) {
-                                               obj2 = Convert.ChangeType (obj2, Type.GetTypeCode (obj1.GetType ()));
-                                               return ((IComparable)obj1).CompareTo (obj2);
-                                       }
-                               }
-                       }
-
-                       return String.Compare (obj1.ToString (), obj2.ToString ());
-               }
-
-               protected override void Resize (int size)
-               {
-                       if (_values == null) {
-                               _values = new object [size];
-                               return;
-                       }
-
-                       object[] tmp = new object [size];
-                       Array.Copy (_values, 0, tmp, 0, _values.Length);
-                       _values = tmp;
-               }
-
-               internal override long GetInt64 (int index)
-               {
-                       return Convert.ToInt64 (_values [index]);
-               }
-       }
-
-       sealed class DateTimeDataContainer : ObjectDataContainer {
-               protected override void SetValueFromSafeDataRecord (int index, ISafeDataRecord record, int field)
-               {
-                       base.SetValue (index, record.GetDateTimeSafe (field));
-               }
-
-               protected override void SetValue (int index, object value)
-               {
-                       base.SetValue (index, GetContainerData (value));
-               }
-       }
-
-       sealed class DecimalDataContainer : ObjectDataContainer {
-               protected override void SetValueFromSafeDataRecord (int index, ISafeDataRecord record, int field)
-               {
-                       base.SetValue (index, record.GetDecimalSafe (field));
-               }
-
-               protected override void SetValue (int index, object value)
-               {
-                       base.SetValue (index, GetContainerData (value));
-               }
-       }
-
-       sealed class StringDataContainer : ObjectDataContainer {
-               private void SetValue (int index, string value)
-               {
-                       if (value != null && Column.MaxLength >= 0 && Column.MaxLength < value.Length)
-                               throw new ArgumentException ("Cannot set column '" + Column.ColumnName + "' to '" + value + "'. The value violates the MaxLength limit of this column.");
-                       base.SetValue (index, value);
-               }
-
-               protected override void SetValue (int index, object value)
-               {
-                       SetValue (index, (string) GetContainerData (value));
-               }
-
-               protected override void SetValueFromSafeDataRecord (int index, ISafeDataRecord record, int field)
-               {
-                       SetValue (index, record.GetStringSafe (field));
-               }
-
-               protected override int DoCompareValues (int index1, int index2)
-               {
-                       DataTable table = Column.Table;
-                       return String.Compare ((string) this [index1], (string) this [index2], !table.CaseSensitive, table.Locale);
-               }
-       }
-}
diff --git a/mcs/class/System.Data/System.Data.Common/DbCommand.cs b/mcs/class/System.Data/System.Data.Common/DbCommand.cs
deleted file mode 100644 (file)
index ad56931..0000000
+++ /dev/null
@@ -1,240 +0,0 @@
-//
-// System.Data.Common.DbCommand
-//
-// Author:
-//   Tim Coleman (tim@timcoleman.com)
-//
-// Copyright (C) Tim Coleman, 2003
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.ComponentModel;
-using System.Data;
-
-using System.Threading;
-using System.Threading.Tasks;
-
-namespace System.Data.Common {
-       public abstract class DbCommand : Component, IDbCommand, IDisposable
-       {
-               protected DbCommand ()
-               {
-               }
-
-               #region Properties
-
-               [DefaultValue ("")]
-               [RefreshProperties (RefreshProperties.All)]
-               public abstract string CommandText { get; set; }
-
-               public abstract int CommandTimeout { get; set; }
-
-               [DefaultValue (CommandType.Text)]
-               [RefreshProperties (RefreshProperties.All)]
-               public abstract CommandType CommandType { get; set; }
-
-               [DefaultValue (null)]
-               [Browsable (false)]
-               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
-               public DbConnection Connection {
-                       get { return DbConnection; }
-                       set { DbConnection = value; }
-               }
-
-               protected abstract DbConnection DbConnection { get; set; }
-               protected abstract DbParameterCollection DbParameterCollection { get; }
-               protected abstract DbTransaction DbTransaction { get; set; }
-
-               [EditorBrowsable (EditorBrowsableState.Never)]
-               [Browsable (false)]
-               [DefaultValue (true)]
-               [DesignOnly (true)]
-               public abstract bool DesignTimeVisible { get; set; }
-
-               IDbConnection IDbCommand.Connection {
-                       get { return Connection; }
-                       set { Connection = (DbConnection) value; }
-               }
-
-               IDataParameterCollection IDbCommand.Parameters {
-                       get { return Parameters; }
-               }
-
-               IDbTransaction IDbCommand.Transaction {
-                       get { return Transaction; }
-                       set { Transaction = (DbTransaction) value; }
-               }
-
-               [Browsable (false)]
-               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
-               public DbParameterCollection Parameters {
-                       get { return DbParameterCollection; }
-               }
-
-               [Browsable (false)]
-               [DefaultValue (null)]
-               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
-               public DbTransaction Transaction {
-                       get { return DbTransaction; }
-                       set { DbTransaction = value; }
-               }
-
-               [DefaultValue (UpdateRowSource.Both)]
-               public abstract UpdateRowSource UpdatedRowSource { get; set; }
-
-               #endregion // Properties
-
-               #region Methods
-
-               public abstract void Cancel ();
-               protected abstract DbParameter CreateDbParameter ();
-
-               public DbParameter CreateParameter ()
-               {
-                       return CreateDbParameter ();
-               }
-
-               protected abstract DbDataReader ExecuteDbDataReader (CommandBehavior behavior);
-               public abstract int ExecuteNonQuery ();
-               
-               public DbDataReader ExecuteReader ()
-               {
-                       return ExecuteDbDataReader (CommandBehavior.Default);
-               }
-
-               public DbDataReader ExecuteReader (CommandBehavior behavior)
-               {
-                        return ExecuteDbDataReader (behavior);
-               }
-
-               public abstract object ExecuteScalar ();
-
-               IDbDataParameter IDbCommand.CreateParameter ()
-               {
-                       return CreateParameter ();
-               }
-
-               IDataReader IDbCommand.ExecuteReader ()
-               {
-                       return ExecuteReader ();
-               }
-
-               IDataReader IDbCommand.ExecuteReader (CommandBehavior behavior)
-               {
-                       return ExecuteReader (behavior);
-               }
-
-               public abstract void Prepare ();
-               
-               protected virtual Task<DbDataReader> ExecuteDbDataReaderAsync (CommandBehavior behavior, CancellationToken cancellationToken)
-               {
-                       if (cancellationToken.IsCancellationRequested) {
-                               return TaskHelper.CreateCanceledTask<DbDataReader> ();
-                       }
-                       
-                       try {
-                               return Task.FromResult (ExecuteDbDataReader (behavior));
-                       } catch (Exception e) {
-                               return TaskHelper.CreateExceptionTask<DbDataReader> (e);
-                       }
-               }
-               
-               public Task<int> ExecuteNonQueryAsync ()
-               {
-                       return ExecuteNonQueryAsync (CancellationToken.None);
-               }
-               
-               public virtual Task<int> ExecuteNonQueryAsync (CancellationToken cancellationToken)
-               {
-                       if (cancellationToken.IsCancellationRequested) {
-                               return TaskHelper.CreateCanceledTask<int> ();
-                       }
-                       
-                       try {
-                               return Task.FromResult (ExecuteNonQuery ());
-                       } catch (Exception e) {
-                               return TaskHelper.CreateExceptionTask<int> (e);
-                       }
-               }
-               
-               public Task<Object> ExecuteScalarAsync ()
-               {
-                       return ExecuteScalarAsync (CancellationToken.None);
-               }
-               
-               public virtual Task<Object> ExecuteScalarAsync (CancellationToken cancellationToken)
-               {
-                       if (cancellationToken.IsCancellationRequested) {
-                               return TaskHelper.CreateCanceledTask<Object> ();
-                       }
-                       
-                       try {
-                               return Task.FromResult (ExecuteScalar ());
-                       } catch (Exception e) {
-                               return TaskHelper.CreateExceptionTask<Object> (e);
-                       }
-               }
-               
-               public Task<DbDataReader> ExecuteReaderAsync ()
-               {
-                       return ExecuteReaderAsync (CancellationToken.None);
-               }
-               
-               public Task<DbDataReader> ExecuteReaderAsync (CancellationToken cancellationToken)
-               {
-                       if (cancellationToken.IsCancellationRequested) {
-                               return TaskHelper.CreateCanceledTask<DbDataReader> ();
-                       }
-                       
-                       try {
-                               return Task.FromResult (ExecuteReader ());
-                       } catch (Exception e) {
-                               return TaskHelper.CreateExceptionTask<DbDataReader> (e);
-                       }
-               }
-               
-               public Task<DbDataReader> ExecuteReaderAsync (CommandBehavior behavior)
-               {
-                       return ExecuteReaderAsync (behavior, CancellationToken.None);
-               }
-               
-               public Task<DbDataReader> ExecuteReaderAsync (CommandBehavior behavior, CancellationToken cancellationToken)
-               {
-                       if (cancellationToken.IsCancellationRequested) {
-                               return TaskHelper.CreateCanceledTask<DbDataReader> ();
-                       }
-                       
-                       try {
-                               return Task.FromResult (ExecuteReader (behavior));
-                       } catch (Exception e) {
-                               return TaskHelper.CreateExceptionTask<DbDataReader> (e);
-                       }
-               }
-
-               
-               #endregion // Methods
-
-       }
-}
diff --git a/mcs/class/System.Data/System.Data.Common/DbCommandBuilder.cs b/mcs/class/System.Data/System.Data.Common/DbCommandBuilder.cs
deleted file mode 100644 (file)
index 2f83b30..0000000
+++ /dev/null
@@ -1,696 +0,0 @@
-//
-// System.Data.Common.DbCommandBuilder
-//
-// Author:
-//   Tim Coleman (tim@timcoleman.com)
-//
-// Copyright (C) Tim Coleman, 2003
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-using System.ComponentModel;
-using System.Data;
-using System.Globalization;
-using System.Text;
-
-namespace System.Data.Common {
-       public abstract class DbCommandBuilder : Component
-       {
-               bool _setAllValues;
-               bool _disposed;
-
-               DataTable _dbSchemaTable;
-               DbDataAdapter _dbDataAdapter;
-               private CatalogLocation _catalogLocation = CatalogLocation.Start;
-               private ConflictOption _conflictOption = ConflictOption.CompareAllSearchableValues;
-
-               private string _tableName;
-               private string _catalogSeparator;
-               private string _quotePrefix;
-               private string _quoteSuffix;
-               private string _schemaSeparator;
-               private DbCommand _dbCommand;
-
-               DbCommand _deleteCommand;
-               DbCommand _insertCommand;
-               DbCommand _updateCommand;
-
-               static readonly string SEPARATOR_DEFAULT = ".";
-               // Used to construct WHERE clauses
-               static readonly string clause1 = "({0} = 1 AND {1} IS NULL)";
-               static readonly string clause2 = "({0} = {1})";
-
-               protected DbCommandBuilder ()
-               {
-               }
-
-               private void BuildCache (bool closeConnection)
-               {
-                       DbCommand sourceCommand = SourceCommand;
-                       if (sourceCommand == null)
-                               throw new InvalidOperationException ("The DataAdapter.SelectCommand property needs to be initialized.");
-                       DbConnection connection = sourceCommand.Connection;
-                       if (connection == null)
-                               throw new InvalidOperationException ("The DataAdapter.SelectCommand.Connection property needs to be initialized.");
-
-                       if (_dbSchemaTable == null) {
-                               if (connection.State == ConnectionState.Open)
-                                       closeConnection = false;        
-                               else
-                                       connection.Open ();
-       
-                               DbDataReader reader = sourceCommand.ExecuteReader (CommandBehavior.SchemaOnly | CommandBehavior.KeyInfo);
-                               _dbSchemaTable = reader.GetSchemaTable ();
-                               reader.Close ();
-                               if (closeConnection)
-                                       connection.Close ();    
-                               BuildInformation (_dbSchemaTable);
-                       }
-               }
-               
-               private string QuotedTableName {
-                       get { return GetQuotedString (_tableName); }
-               }
-
-               bool IsCommandGenerated {
-                       get {
-                               return (_insertCommand != null || _updateCommand != null || _deleteCommand != null);
-                       }
-               }
-
-               private string GetQuotedString (string value)
-               {
-                       if (value == String.Empty || value == null)
-                               return value;
-
-                       string prefix = QuotePrefix;
-                       string suffix = QuoteSuffix;
-
-                       if (prefix.Length == 0 && suffix.Length == 0)
-                               return value;
-                       return String.Format ("{0}{1}{2}", prefix, value, suffix);
-               }
-
-               private void BuildInformation (DataTable schemaTable)
-               {
-                       _tableName = String.Empty;
-                       foreach (DataRow schemaRow in schemaTable.Rows) {
-                               if (schemaRow.IsNull ("BaseTableName") || (string) schemaRow ["BaseTableName"] == String.Empty)
-                                       continue;
-
-                               if (_tableName == String.Empty) 
-                                       _tableName = (string) schemaRow ["BaseTableName"];
-                               else if (_tableName != (string) schemaRow["BaseTableName"])
-                                       throw new InvalidOperationException ("Dynamic SQL generation is not supported against multiple base tables.");
-                       }
-                       if (_tableName == String.Empty)
-                               throw new InvalidOperationException ("Dynamic SQL generation is not supported with no base table.");
-                       _dbSchemaTable = schemaTable;
-               }
-
-               private bool IncludedInInsert (DataRow schemaRow)
-               {
-                       // If the parameter has one of these properties, then we don't include it in the insert:
-                       // AutoIncrement, Hidden, Expression, RowVersion, ReadOnly
-
-                       if (!schemaRow.IsNull ("IsAutoIncrement") && (bool) schemaRow ["IsAutoIncrement"])
-                               return false;
-//                     if (!schemaRow.IsNull ("IsHidden") && (bool) schemaRow ["IsHidden"])
-//                             return false;
-                       if (!schemaRow.IsNull ("IsExpression") && (bool) schemaRow ["IsExpression"])
-                               return false;
-                       if (!schemaRow.IsNull ("IsRowVersion") && (bool) schemaRow ["IsRowVersion"])
-                               return false;
-                       if (!schemaRow.IsNull ("IsReadOnly") && (bool) schemaRow ["IsReadOnly"])
-                               return false;
-                       return true;
-               }
-
-               private bool IncludedInUpdate (DataRow schemaRow)
-               {
-                       // If the parameter has one of these properties, then we don't include it in the insert:
-                       // AutoIncrement, Hidden, RowVersion
-
-                       if (!schemaRow.IsNull ("IsAutoIncrement") && (bool) schemaRow ["IsAutoIncrement"])
-                               return false;
-//                     if (!schemaRow.IsNull ("IsHidden") && (bool) schemaRow ["IsHidden"])
-//                             return false;
-                       if (!schemaRow.IsNull ("IsRowVersion") && (bool) schemaRow ["IsRowVersion"])
-                               return false;
-                       if (!schemaRow.IsNull ("IsExpression") && (bool) schemaRow ["IsExpression"])
-                               return false;
-                       if (!schemaRow.IsNull ("IsReadOnly") && (bool) schemaRow ["IsReadOnly"])
-                               return false;
-
-                       return true;
-               }
-
-               private bool IncludedInWhereClause (DataRow schemaRow)
-               {
-                       if ((bool) schemaRow ["IsLong"])
-                               return false;
-                       return true;
-               }
-
-               private DbCommand CreateDeleteCommand (bool option)
-               {
-                       // If no table was found, then we can't do an delete
-                       if (QuotedTableName == String.Empty)
-                               return null;
-                       
-                       CreateNewCommand (ref _deleteCommand);
-
-                       string command = String.Format ("DELETE FROM {0}", QuotedTableName);
-                       StringBuilder whereClause = new StringBuilder ();
-                       bool keyFound = false;
-                       int parmIndex = 1;
-
-                       foreach (DataRow schemaRow in _dbSchemaTable.Rows) {
-                               if (!schemaRow.IsNull ("IsExpression") && (bool)schemaRow["IsExpression"] == true)
-                                       continue;
-                               if (!IncludedInWhereClause (schemaRow)) 
-                                       continue;
-
-                               if (whereClause.Length > 0) 
-                                       whereClause.Append (" AND ");
-
-                               bool isKey = (bool) schemaRow ["IsKey"];
-                               DbParameter parameter = null;
-                               string sourceColumnName;
-
-                               if (isKey)
-                                       keyFound = true;
-
-                               //ms.net 1.1 generates the null check for columns even if AllowDBNull is false
-                               //while ms.net 2.0 does not. Anyways, since both forms are logically equivalent
-                               //following the 2.0 approach
-                               bool allowNull = (bool) schemaRow ["AllowDBNull"];
-                               if (!isKey && allowNull) {
-                                       parameter = _deleteCommand.CreateParameter ();
-                                       if (option) {
-                                               parameter.ParameterName = String.Format ("@IsNull_{0}",
-                                                                                        schemaRow ["BaseColumnName"]);
-                                       } else {
-                                               parameter.ParameterName = String.Format ("@p{0}", parmIndex++);
-                                       }
-                                       parameter.Value = 1;
-                                       parameter.DbType = DbType.Int32;
-                                       // This should be set for nullcheckparam
-                                       sourceColumnName = (string) schemaRow ["BaseColumnName"];
-                                       parameter.SourceColumn = sourceColumnName;
-                                       parameter.SourceColumnNullMapping = true;
-                                       parameter.SourceVersion = DataRowVersion.Original;
-                                       _deleteCommand.Parameters.Add (parameter);
-                                       
-                                       whereClause.Append ("(");
-                                       whereClause.Append (String.Format (clause1, parameter.ParameterName, 
-                                                                          GetQuotedString (sourceColumnName)));
-                                       whereClause.Append (" OR ");
-                               }
-
-                               if (option)
-                                       parameter = CreateParameter (_deleteCommand, schemaRow, true);
-                               else 
-                                       parameter = CreateParameter (_deleteCommand, parmIndex++, schemaRow);
-                               
-                               parameter.SourceVersion = DataRowVersion.Original;
-                               ApplyParameterInfo (parameter, schemaRow, StatementType.Delete, true);
-                               //parameter.IsNullable = allowNull;
-
-                               whereClause.Append (String.Format (clause2, GetQuotedString (parameter.SourceColumn), parameter.ParameterName));
-
-                               if (!isKey && allowNull)
-                                       whereClause.Append (")");
-                       }
-                       if (!keyFound)
-                               throw new InvalidOperationException ("Dynamic SQL generation for the DeleteCommand is not supported against a SelectCommand that does not return any key column information.");
-
-                       // We're all done, so bring it on home
-                       string sql = String.Format ("{0} WHERE ({1})", command, whereClause.ToString ());
-                       _deleteCommand.CommandText = sql;
-                       _dbCommand = _deleteCommand;
-                       return _deleteCommand;
-               }
-
-               private DbCommand CreateInsertCommand (bool option, DataRow row)
-               {
-                       if (QuotedTableName == String.Empty)
-                               return null;
-
-                       CreateNewCommand (ref _insertCommand);
-
-                       string command = String.Format ("INSERT INTO {0}", QuotedTableName);
-                       string sql;
-                       StringBuilder columns = new StringBuilder ();
-                       StringBuilder values = new StringBuilder ();
-
-                       int parmIndex = 1;
-                       DbParameter parameter = null;
-                       foreach (DataRow schemaRow in _dbSchemaTable.Rows) {
-                               if (!IncludedInInsert (schemaRow))
-                                       continue;
-
-                               if (columns.Length > 0) {
-                                       columns.Append (", ");
-                                       values.Append (", ");
-                               }
-
-                               if (option)
-                                       parameter = CreateParameter (_insertCommand, schemaRow, false);
-                               else 
-                                       parameter = CreateParameter (_insertCommand, parmIndex++, schemaRow);                   
-                               parameter.SourceVersion = DataRowVersion.Current;
-                               ApplyParameterInfo (parameter, schemaRow, StatementType.Insert, false);
-                               
-                               columns.Append (GetQuotedString (parameter.SourceColumn));
-
-                               // Workaround for columns that may have a default/bound value and for now, 
-                               // the framework, don't provide a mechanism to read these values yet
-                               // AllowDBNull and DataRow is used to workaround #385028 by using DEFAULT 
-                               string colName = schemaRow ["ColumnName"] as string;
-                               bool allowDBNull = !schemaRow.IsNull ("AllowDBNull") & (bool) schemaRow ["AllowDBNull"];
-                               if (!allowDBNull && row != null &&
-                                   (row [colName] == DBNull.Value || row [colName] == null)) {
-                                       values.Append ("DEFAULT");
-                               } else {
-                                       values.Append (parameter.ParameterName);
-                               }
-                       }
-
-                       sql = String.Format ("{0} ({1}) VALUES ({2})", command, columns.ToString (), values.ToString ());
-                       _insertCommand.CommandText = sql;
-                       _dbCommand = _insertCommand;
-                       return _insertCommand;
-               }
-
-               private void CreateNewCommand (ref DbCommand command)
-               {
-                       DbCommand sourceCommand = SourceCommand;
-                       if (command == null) {
-                               command = sourceCommand.Connection.CreateCommand ();
-                               command.CommandTimeout = sourceCommand.CommandTimeout;
-                               command.Transaction = sourceCommand.Transaction;
-                       }
-                       command.CommandType = CommandType.Text;
-                       command.UpdatedRowSource = UpdateRowSource.None;
-                       command.Parameters.Clear ();
-               }
-
-               private DbCommand CreateUpdateCommand (bool option)
-               {
-                       // If no table was found, then we can't do an update
-                       if (QuotedTableName == String.Empty)
-                               return null;
-
-                       CreateNewCommand (ref _updateCommand);
-
-                       string command = String.Format ("UPDATE {0} SET ", QuotedTableName);
-                       StringBuilder columns = new StringBuilder ();
-                       StringBuilder whereClause = new StringBuilder ();
-                       int parmIndex = 1;
-                       bool keyFound = false;
-                       DbParameter parameter = null;
-
-                       // First, create the X=Y list for UPDATE
-                       foreach (DataRow schemaRow in _dbSchemaTable.Rows) {
-                               if (!IncludedInUpdate (schemaRow))
-                                       continue;
-                               if (columns.Length > 0) 
-                                       columns.Append (", ");
-
-                               if (option)
-                                       parameter = CreateParameter (_updateCommand, schemaRow, false);
-                               else 
-                                       parameter = CreateParameter (_updateCommand, parmIndex++, schemaRow);
-                               parameter.SourceVersion = DataRowVersion.Current;
-                               ApplyParameterInfo (parameter, schemaRow, StatementType.Update, false);
-                               //parameter.IsNullable = (bool) schemaRow ["AllowDBNull"];
-                               columns.Append (String.Format ("{0} = {1}", GetQuotedString (parameter.SourceColumn), parameter.ParameterName));
-                       }
-
-                       // Now, create the WHERE clause.  This may be optimizable, but it would be ugly to incorporate
-                       // into the loop above.  "Premature optimization is the root of all evil." -- Knuth
-                       foreach (DataRow schemaRow in _dbSchemaTable.Rows) {
-                               if (!schemaRow.IsNull ("IsExpression") && (bool) schemaRow ["IsExpression"] == true)
-                                       continue;
-
-                               if (!IncludedInWhereClause (schemaRow)) 
-                                       continue;
-
-                               if (whereClause.Length > 0) 
-                                       whereClause.Append (" AND ");
-
-                               bool isKey = (bool) schemaRow ["IsKey"];
-                               if (isKey)
-                                       keyFound = true;
-
-                               //ms.net 1.1 generates the null check for columns even if AllowDBNull is false
-                               //while ms.net 2.0 does not. Anyways, since both forms are logically equivalent
-                               //following the 2.0 approach
-                               bool allowNull = (bool) schemaRow ["AllowDBNull"];
-                               if (!isKey && allowNull) {
-                                       parameter = _updateCommand.CreateParameter ();
-                                       if (option) {
-                                               parameter.ParameterName = String.Format ("@IsNull_{0}",
-                                                                                        schemaRow ["BaseColumnName"]);
-                                       } else {
-                                               parameter.ParameterName = String.Format ("@p{0}", parmIndex++);
-                                       }
-                                       parameter.DbType = DbType.Int32;
-                                       parameter.Value = 1;
-                                       parameter.SourceColumn = (string) schemaRow ["BaseColumnName"];
-                                       parameter.SourceColumnNullMapping = true;
-                                       parameter.SourceVersion = DataRowVersion.Original;
-                                       whereClause.Append ("(");
-                                       whereClause.Append (String.Format (clause1, parameter.ParameterName,
-                                                                          GetQuotedString ((string) schemaRow ["BaseColumnName"])));
-                                       whereClause.Append (" OR ");
-                                       _updateCommand.Parameters.Add (parameter);
-                               }
-
-                               if (option)
-                                       parameter = CreateParameter (_updateCommand, schemaRow, true);
-                               else 
-                                       parameter = CreateParameter (_updateCommand, parmIndex++, schemaRow);
-                               parameter.SourceVersion = DataRowVersion.Original;
-                               //parameter.IsNullable = allowNull;
-                               ApplyParameterInfo (parameter, schemaRow, StatementType.Update, true);
-
-                               whereClause.Append (String.Format (clause2, GetQuotedString (parameter.SourceColumn), parameter.ParameterName));
-
-                               if (!isKey && allowNull)
-                                       whereClause.Append (")");
-                       }
-                       if (!keyFound)
-                               throw new InvalidOperationException ("Dynamic SQL generation for the UpdateCommand is not supported against a SelectCommand that does not return any key column information.");
-
-                       // We're all done, so bring it on home
-                       string sql = String.Format ("{0}{1} WHERE ({2})", command, columns.ToString (), whereClause.ToString ());
-                       _updateCommand.CommandText = sql;
-                       _dbCommand = _updateCommand;
-                       return _updateCommand;
-               }
-
-               private DbParameter CreateParameter (DbCommand _dbCommand, DataRow schemaRow, bool whereClause)
-               {
-                       string sourceColumn = (string) schemaRow ["BaseColumnName"];
-                       DbParameter parameter = _dbCommand.CreateParameter ();
-                       if (whereClause)
-                               parameter.ParameterName = GetParameterName ("Original_" + sourceColumn);
-                       else
-                               parameter.ParameterName = GetParameterName (sourceColumn);
-                       parameter.SourceColumn = sourceColumn;
-                       //parameter.Size = (int) schemaRow ["ColumnSize"];
-                       _dbCommand.Parameters.Add (parameter);
-                       return parameter;
-               }
-
-               private DbParameter CreateParameter (DbCommand _dbCommand, int paramIndex, DataRow schemaRow)
-               {
-                       string sourceColumn = (string) schemaRow ["BaseColumnName"];
-                       DbParameter parameter = _dbCommand.CreateParameter ();
-                       parameter.ParameterName = GetParameterName (paramIndex);
-                       parameter.SourceColumn = sourceColumn;
-                       //parameter.Size = (int) schemaRow ["ColumnSize"];
-                       _dbCommand.Parameters.Add (parameter);
-                       return parameter;
-               }
-               
-               [DefaultValue (CatalogLocation.Start)]
-               public virtual CatalogLocation CatalogLocation {
-                       get { return _catalogLocation; }
-                       set {
-                               CheckEnumValue (typeof (CatalogLocation),
-                                       (int) value);
-                               _catalogLocation = value;
-                       }
-               }
-
-               [DefaultValue (".")]
-               public virtual string CatalogSeparator {
-                       get {
-                               if (_catalogSeparator == null || _catalogSeparator.Length == 0)
-                                       return SEPARATOR_DEFAULT;
-                               return _catalogSeparator;
-                       }
-                       set { _catalogSeparator = value; }
-               }
-
-               [DefaultValue (ConflictOption.CompareAllSearchableValues)]
-               public virtual ConflictOption ConflictOption {
-                       get { return _conflictOption; }
-                       set {
-                               CheckEnumValue (typeof (ConflictOption),
-                                       (int) value);
-                               _conflictOption = value;
-                       }
-               }
-
-               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
-               [Browsable (false)]
-               public DbDataAdapter DataAdapter {
-                       get { return _dbDataAdapter; }
-                       set {  if (value != null) 
-                               SetRowUpdatingHandler (value);
-                               _dbDataAdapter = value; 
-                       }
-               }
-
-               [DefaultValue ("")]
-               public virtual string QuotePrefix {
-                       get {
-                               if (_quotePrefix == null)
-                                       return string.Empty;
-                               return _quotePrefix;
-                       }
-                       set {
-                               if (IsCommandGenerated)
-                                       throw new InvalidOperationException (
-                                               "QuotePrefix cannot be set after " +
-                                               "an Insert, Update or Delete command " +
-                                               "has been generated.");
-                               _quotePrefix = value;
-                       }
-               }
-
-               [DefaultValue ("")]
-               public virtual string QuoteSuffix {
-                       get {
-                               if (_quoteSuffix == null)
-                                       return string.Empty;
-                               return _quoteSuffix;
-                       }
-                       set {
-                               if (IsCommandGenerated)
-                                       throw new InvalidOperationException (
-                                               "QuoteSuffix cannot be set after " +
-                                               "an Insert, Update or Delete command " +
-                                               "has been generated.");
-                               _quoteSuffix = value;
-                       }
-               }
-
-               [DefaultValue (".")]
-               public virtual string SchemaSeparator {
-                       get {
-                               if (_schemaSeparator == null || _schemaSeparator.Length == 0)
-                                       return SEPARATOR_DEFAULT;
-                               return _schemaSeparator;
-                       }
-                       set { _schemaSeparator = value; }
-               }
-
-               [DefaultValue (false)]
-               public bool SetAllValues {
-                       get { return _setAllValues; }
-                       set { _setAllValues = value; }
-               }
-
-               private DbCommand SourceCommand {
-                       get {
-                               if (_dbDataAdapter != null)
-                                       return _dbDataAdapter.SelectCommand;
-                               return null;
-                       }
-               }
-
-               protected abstract void ApplyParameterInfo (DbParameter parameter, 
-                                                           DataRow row, 
-                                                           StatementType statementType, 
-                                                           bool whereClause);
-
-               protected override void Dispose (bool disposing)
-               {
-                       if (!_disposed) {
-                               if (disposing) {
-                                       if (_insertCommand != null)
-                                               _insertCommand.Dispose ();
-                                       if (_deleteCommand != null)
-                                               _deleteCommand.Dispose ();
-                                       if (_updateCommand != null)
-                                               _updateCommand.Dispose ();
-                                       if (_dbSchemaTable != null)
-                                               _dbSchemaTable.Dispose ();
-                               }
-                               _disposed = true;
-                       }
-               }
-
-               public DbCommand GetDeleteCommand ()
-               {
-                       return GetDeleteCommand (false);
-               }
-
-               public DbCommand GetDeleteCommand (bool useColumnsForParameterNames)
-               {
-                       BuildCache (true);
-                       if (_deleteCommand == null || useColumnsForParameterNames)
-                               return CreateDeleteCommand (useColumnsForParameterNames);
-                       return _deleteCommand;
-               }
-
-               public DbCommand GetInsertCommand ()
-               {
-                       return GetInsertCommand (false, null);
-               }
-
-               public DbCommand GetInsertCommand (bool useColumnsForParameterNames)
-               {
-                       return GetInsertCommand (useColumnsForParameterNames, null);
-               }
-
-               internal DbCommand GetInsertCommand (bool useColumnsForParameterNames, DataRow row)
-               {
-                       BuildCache (true);
-                       if (_insertCommand == null || useColumnsForParameterNames)
-                               return CreateInsertCommand (useColumnsForParameterNames, row);
-                       return _insertCommand;
-               }
-
-               public DbCommand GetUpdateCommand ()
-               {
-                       return GetUpdateCommand (false);
-               }
-
-               public DbCommand GetUpdateCommand (bool useColumnsForParameterNames)
-               {
-                       BuildCache (true);
-                       if (_updateCommand == null || useColumnsForParameterNames)
-                               return CreateUpdateCommand (useColumnsForParameterNames);
-                       return _updateCommand;
-               }
-
-               protected virtual DbCommand InitializeCommand (DbCommand command)
-               {
-                       if (_dbCommand == null) {
-                               _dbCommand = SourceCommand;
-                       } else {
-                               _dbCommand.CommandTimeout = 30;
-                               _dbCommand.Transaction = null;
-                               _dbCommand.CommandType = CommandType.Text;
-                               _dbCommand.UpdatedRowSource = UpdateRowSource.None;
-                       }
-                       return _dbCommand;
-
-               }
-
-               public virtual string QuoteIdentifier (string unquotedIdentifier)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public virtual string UnquoteIdentifier (string quotedIdentifier)
-               {
-                       if (quotedIdentifier == null) {
-                               throw new ArgumentNullException ("Quoted identifier parameter cannot be null");
-                       }
-                       string unquotedIdentifier = quotedIdentifier.Trim ();
-                       if (unquotedIdentifier.StartsWith (this.QuotePrefix)) {
-                               unquotedIdentifier = unquotedIdentifier.Remove (0, 1);
-                       }
-                       if (unquotedIdentifier.EndsWith (this.QuoteSuffix)) {
-                               unquotedIdentifier = unquotedIdentifier.Remove (unquotedIdentifier.Length - 1, 1);
-                       }
-                       return unquotedIdentifier;
-               }
-
-               public virtual void RefreshSchema ()
-               {
-                       _tableName = String.Empty;
-                       _dbSchemaTable = null;
-                       _deleteCommand = null;
-                       _updateCommand = null;
-                       _insertCommand = null;
-               }
-
-               protected void RowUpdatingHandler (RowUpdatingEventArgs rowUpdatingEvent)
-               {
-                       if (rowUpdatingEvent.Command != null)
-                               return;
-                       try {
-                               switch (rowUpdatingEvent.StatementType) {
-                               case StatementType.Insert:
-                                       rowUpdatingEvent.Command = GetInsertCommand (false, rowUpdatingEvent.Row);
-                                       break;
-                               case StatementType.Update:
-                                       rowUpdatingEvent.Command = GetUpdateCommand ();
-                                       break;
-                               case StatementType.Delete:
-                                       rowUpdatingEvent.Command = GetDeleteCommand ();
-                                       break;
-                               }
-                       } catch (Exception e) {
-                               rowUpdatingEvent.Errors = e;
-                               rowUpdatingEvent.Status = UpdateStatus.ErrorsOccurred;
-                       }
-               }
-
-               protected abstract string GetParameterName (int parameterOrdinal);
-               protected abstract string GetParameterName (String parameterName);
-               protected abstract string GetParameterPlaceholder (int parameterOrdinal);
-
-               protected abstract void SetRowUpdatingHandler (DbDataAdapter adapter);
-
-               protected virtual DataTable GetSchemaTable (DbCommand sourceCommand)
-               {
-                       using (DbDataReader rdr = sourceCommand.ExecuteReader ())
-                               return rdr.GetSchemaTable ();
-               }
-
-               static void CheckEnumValue (Type type, int value)
-               {
-                       if (Enum.IsDefined (type, value))
-                               return;
-
-                       string typename = type.Name;
-                       string msg = string.Format (CultureInfo.CurrentCulture,
-                               "Value {0} is not valid for {1}.", value,
-                               typename);
-                       throw new ArgumentOutOfRangeException (typename, msg);
-               }
-       }
-}
-
diff --git a/mcs/class/System.Data/System.Data.Common/DbCommandOptionalFeatures.cs b/mcs/class/System.Data/System.Data.Common/DbCommandOptionalFeatures.cs
deleted file mode 100644 (file)
index 3d59212..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-//
-// System.Data.Common.DbCommandOptionalFeatures.cs
-//
-// Author:
-//   Tim Coleman (tim@timcoleman.com)
-//
-// Copyright (C) Tim Coleman, 2003
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-namespace System.Data.Common {
-       public enum DbCommandOptionalFeatures 
-       {
-               ExecutePageReader,
-               None
-       }
-}
-
diff --git a/mcs/class/System.Data/System.Data.Common/DbCommandSet.cs b/mcs/class/System.Data/System.Data.Common/DbCommandSet.cs
deleted file mode 100644 (file)
index fe065b2..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-//
-// System.Data.Common.DbCommandSet
-//
-// Author:
-//   Tim Coleman (tim@timcoleman.com)
-//
-// Copyright (C) Tim Coleman, 2003
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-using System.ComponentModel;
-using System.Data;
-
-namespace System.Data.Common {
-       public abstract class DbCommandSet : IDisposable
-       {
-               #region Constructors
-
-               protected DbCommandSet ()
-               {
-               }
-
-               #endregion // Constructors
-
-               #region Properties
-
-               public abstract int CommandCount { get; }
-               public abstract int CommandTimeout { get; set; }
-
-               public DbConnection Connection {
-                       get { return DbConnection; }
-                       set { DbConnection = value; }
-               }
-
-               protected abstract DbConnection DbConnection { get; set; }
-               protected abstract DbTransaction DbTransaction { get; set; }
-
-               public DbTransaction Transaction {
-                       get { return DbTransaction; }
-               }
-
-               #endregion // Properties
-
-               #region Methods
-
-               public abstract void Append (DbCommand command);
-               public abstract void Cancel ();
-               public abstract void Clear ();
-               public abstract void CopyToParameter (int commandIndex, int parameterIndex, DbParameter destination);
-               public abstract void CopyToParameter (int commandIndex, string parameterName, DbParameter destination);
-               public abstract void CopyToParameterCollection (int commandIndex, DbParameterCollection destination);
-               public abstract void Dispose ();
-               public abstract DbDataReader ExecuteDbDataReader (CommandBehavior behavior);
-               public abstract int ExecuteNonQuery ();
-
-               [MonoTODO]
-               public DbDataReader ExecuteReader ()
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               public DbDataReader ExecuteReader (CommandBehavior behavior)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public abstract int GetParameterCount (int commandIndex);
-               
-               #endregion // Methods
-
-       }
-}
-
diff --git a/mcs/class/System.Data/System.Data.Common/DbConnection.cs b/mcs/class/System.Data/System.Data.Common/DbConnection.cs
deleted file mode 100644 (file)
index c8c51f2..0000000
+++ /dev/null
@@ -1,767 +0,0 @@
-//
-// System.Data.Common.DbConnection
-//
-// Author:
-//   Tim Coleman (tim@timcoleman.com)
-//
-// Copyright (C) Tim Coleman, 2003
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.ComponentModel;
-using System.Data;
-using System.Transactions;
-
-using System.Threading;
-using System.Threading.Tasks;
-
-namespace System.Data.Common {
-       public abstract class DbConnection : Component, IDbConnection, IDisposable
-       {
-               #region Constructors
-
-               protected DbConnection ()
-               {
-               }
-
-               #endregion // Constructors
-
-               #region Properties
-               [RecommendedAsConfigurable (true)]
-               [RefreshProperties (RefreshProperties.All)]
-               [DefaultValue ("")]
-               public abstract string ConnectionString { get; set; }
-
-               public abstract string Database { get; }
-               public abstract string DataSource { get; }
-               
-               [Browsable (false)]
-               public abstract string ServerVersion { get; }
-               
-               [Browsable (false)]
-               public abstract ConnectionState State { get; }
-
-               public virtual int ConnectionTimeout { 
-                       get { return 15; }
-               }
-
-               #endregion // Properties
-
-               #region Methods
-
-               protected abstract DbTransaction BeginDbTransaction (IsolationLevel isolationLevel);
-
-               public DbTransaction BeginTransaction ()
-               {
-                       return BeginDbTransaction (IsolationLevel.Unspecified);
-               }
-
-               public DbTransaction BeginTransaction (IsolationLevel isolationLevel)
-               {
-                       return BeginDbTransaction (isolationLevel);
-               }
-
-               public abstract void ChangeDatabase (string databaseName);
-               public abstract void Close ();
-
-               public DbCommand CreateCommand ()
-               {
-                       return CreateDbCommand ();
-               }
-
-               protected abstract DbCommand CreateDbCommand ();
-
-               public virtual void EnlistTransaction (Transaction transaction)
-               {
-                       throw new NotSupportedException ();                        
-               }
-
-               static class DataTypes
-               {
-                       static readonly ColumnInfo [] columns = {
-                               new ColumnInfo ("TypeName", typeof(string)),
-                               new ColumnInfo ("ProviderDbType", typeof(int)),
-                               new ColumnInfo ("ColumnSize", typeof(long)),
-                               new ColumnInfo ("CreateFormat", typeof(string)),
-                               new ColumnInfo ("CreateParameters", typeof(string)),
-                               new ColumnInfo ("DataType", typeof(string)),
-                               new ColumnInfo ("IsAutoIncrementable", typeof(bool)),
-                               new ColumnInfo ("IsBestMatch", typeof(bool)),
-                               new ColumnInfo ("IsCaseSensitive", typeof(bool)),
-                               new ColumnInfo ("IsFixedLength", typeof(bool)),
-                               new ColumnInfo ("IsFixedPrecisionScale", typeof(bool)),
-                               new ColumnInfo ("IsLong", typeof(bool)),
-                               new ColumnInfo ("IsNullable", typeof(bool)),
-                               new ColumnInfo ("IsSearchable", typeof(bool)),
-                               new ColumnInfo ("IsSearchableWithLike", typeof(bool)),
-                               new ColumnInfo ("IsUnsigned", typeof(bool)),
-                               new ColumnInfo ("MaximumScale", typeof(short)),
-                               new ColumnInfo ("MinimumScale", typeof(short)),
-                               new ColumnInfo ("IsConcurrencyType", typeof(bool)),
-                               new ColumnInfo ("IsLiteralSupported", typeof(bool)),
-                               new ColumnInfo ("LiteralPrefix", typeof(string)),
-                               new ColumnInfo ("LiteralSuffix", typeof(string))
-                       };
-
-                       static readonly object [][] rows = {
-                               new object [] {"smallint", 16, 5, "smallint", null, "System.Int16", true, true,
-                                              false, true, true, false, true, true, false, false, null,
-                                              null, false, null, null, null},
-                               new object [] {"int", 8, 10, "int", null, "System.Int32",
-                                              true, true, false, true, true, false, true, true, false,
-                                              false, null, null, false, null, null, null},
-                               new object [] {"real", 13, 7, "real", null,
-                                              "System.Single", false, true, false, true, false, false,
-                                              true, true, false, false, null, null, false, null, null, null},
-                               new object [] {"float", 6, 53, "float({0})",
-                                              "number of bits used to store the mantissa", "System.Double",
-                                              false, true, false, true, false, false, true, true,
-                                              false, false, null, null, false, null, null, null},
-                               new object [] {"money", 9, 19, "money", null,
-                                              "System.Decimal", false, false, false, true, true,
-                                              false, true, true, false, false, null, null, false,
-                                              null, null, null},
-                               new object [] {"smallmoney", 17, 10, "smallmoney", null,
-                                              "System.Decimal", false, false, false, true, true, false,
-                                              true, true, false, false, null, null, false, null, null, null},
-                               new object [] {"bit", 2, 1, "bit", null, "System.Boolean",
-                                              false, false, false, true, false, false, true, true,
-                                              false, null, null, null, false, null, null, null},
-                               new object [] {"tinyint", 20, 3, "tinyint", null,
-                                              "System.SByte", true, true, false, true, true, false,
-                                              true, true, false, true, null, null, false, null, null, null},
-                               new object [] {"bigint", 0, 19, "bigint", null,
-                                              "System.Int64", true, true, false, true, true, false,
-                                              true, true, false, false, null, null, false, null, null, null},
-                               new object [] {"timestamp", 19, 8, "timestamp", null,
-                                              "System.Byte[]", false, false, false, true, false, false,
-                                              false, true, false, null, null, null, true, null, "0x", null},
-                               new object [] {"binary", 1, 8000, "binary({0})", "length",
-                                              "System.Byte[]", false, true, false, true, false, false,
-                                              true, true, false, null, null, null, false, null, "0x", null},
-                               new object [] {"image", 7, 2147483647, "image", null,
-                                              "System.Byte[]", false, true, false, false, false, true,
-                                              true, false, false, null, null, null, false, null, "0x", null},
-                               new object [] {"text", 18, 2147483647, "text", null,
-                                              "System.String", false, true, false, false, false, true,
-                                              true, false, true, null, null, null, false, null, "'", "'"},
-                               new object [] {"ntext", 11, 1073741823, "ntext", null,
-                                              "System.String", false, true, false, false, false, true,
-                                              true, false, true, null, null, null, false, null, "N'", "'"},
-                               new object [] {"decimal", 5, 38, "decimal({0}, {1})",
-                                              "precision,scale", "System.Decimal", true, true, false,
-                                              true, false, false, true, true, false, false, 38, 0,
-                                              false, null, null, null},
-                               new object [] {"numeric", 5, 38, "numeric({0}, {1})",
-                                              "precision,scale", "System.Decimal", true, true, false,
-                                              true, false, false, true, true, false, false, 38, 0,
-                                              false, null, null, null},
-                               new object [] {"datetime", 4, 23, "datetime", null,
-                                              "System.DateTime", false, true, false, true, false, false,
-                                              true, true, true, null, null, null, false, null, "{ts '", "'}"},
-                               new object [] {"smalldatetime", 15, 16, "smalldatetime", null,
-                                              "System.DateTime", false, true, false, true, false, false,
-                                              true, true, true, null, null, null, false, null, "{ts '", "'}"},
-                               new object [] {"sql_variant", 23, null, "sql_variant",
-                                              null, "System.Object", false, true, false, false, false,
-                                              false, true, true, false, null, null, null, false, false,
-                                              null, null},
-                               new object [] {"xml", 25, 2147483647, "xml", null,
-                                              "System.String", false, false, false, false, false, true,
-                                              true, false, false, null, null, null, false, false, null, null},
-                               new object [] {"varchar", 22, 2147483647, "varchar({0})",
-                                              "max length", "System.String", false, true, false, false,
-                                              false, false, true, true, true, null, null, null, false,
-                                              null, "'", "'"},
-                               new object [] {"char", 3, 2147483647, "char({0})", "length",
-                                              "System.String", false, true, false, true, false, false,
-                                              true, true, true, null, null, null, false, null, "'", "'"},
-                               new object [] {"nchar", 10, 1073741823, "nchar({0})", "length",
-                                              "System.String", false, true, false, true, false, false,
-                                              true, true, true, null, null, null, false, null, "N'", "'"},
-                               new object [] {"nvarchar", 12, 1073741823, "nvarchar({0})", "max length",
-                                              "System.String", false, true, false, false, false, false, true, true,
-                                              true, null, null, null, false, null, "N'", "'"},
-                               new object [] {"varbinary", 21, 1073741823, "varbinary({0})",
-                                              "max length", "System.Byte[]", false, true, false, false,
-                                              false, false, true, true, false, null, null, null, false,
-                                              null, "0x", null},
-                               new object [] {"uniqueidentifier", 14, 16, "uniqueidentifier", null,
-                                              "System.Guid", false, true, false, true, false, false, true,
-                                              true, false, null, null, null, false, null, "'", "'"}
-                       };
-
-                       static DataTable instance;
-                       static public DataTable Instance {
-                               get {
-                                       if (instance == null) {
-                                               instance = new DataTable ("DataTypes");
-                                               foreach (ColumnInfo c in columns)
-                                                       instance.Columns.Add (c.name, c.type);
-                                               foreach (object [] row in rows)
-                                                       instance.LoadDataRow (row, true);
-                                       }
-                                       return instance;
-                               }
-                       }
-               }
-
-               struct ColumnInfo {
-                       public string name;
-                       public Type type;
-                       public ColumnInfo (string name, Type type)
-                       {
-                               this.name = name; this.type = type;
-                       }
-               }
-
-               internal static class MetaDataCollections
-               {
-                       static readonly ColumnInfo [] columns = {
-                               new ColumnInfo ("CollectionName", typeof (string)),
-                               new ColumnInfo ("NumberOfRestrictions", typeof (int)),
-                               new ColumnInfo ("NumberOfIdentifierParts", typeof (int))
-                       };
-
-                       static readonly object [][] rows = {
-                               new object [] {"MetaDataCollections", 0, 0},
-                               new object [] {"DataSourceInformation", 0, 0},
-                               new object [] {"DataTypes", 0, 0},
-                               new object [] {"Restrictions", 0, 0},
-                               new object [] {"ReservedWords", 0, 0},
-                               new object [] {"Users", 1, 1},
-                               new object [] {"Databases", 1, 1},
-                               new object [] {"Tables", 4, 3},
-                               new object [] {"Columns", 4, 4},
-                               new object [] {"Views", 3, 3},
-                               new object [] {"ViewColumns", 4, 4},
-                               new object [] {"ProcedureParameters", 4, 1},
-                               new object [] {"Procedures", 4, 3},
-                               new object [] {"ForeignKeys", 4, 3},
-                               new object [] {"IndexColumns", 5, 4},
-                               new object [] {"Indexes", 4, 3},
-                               new object [] {"UserDefinedTypes", 2, 1}
-                       };
-
-                       static DataTable instance;
-                       static public DataTable Instance {
-                               get {
-                                       if (instance == null) {
-                                               instance = new DataTable ("GetSchema");
-                                               foreach (ColumnInfo c in columns)
-                                                       instance.Columns.Add (c.name, c.type);
-                                               foreach (object [] row in rows)
-                                                       instance.LoadDataRow (row, true);
-                                       }
-                                       return instance;
-                               }
-                       }
-               }
-
-               static class Restrictions
-               {
-                       static readonly ColumnInfo [] columns = {
-                               new ColumnInfo ("CollectionName", typeof (string)),
-                               new ColumnInfo ("RestrictionName", typeof(string)),
-                               new ColumnInfo ("ParameterName", typeof(string)),
-                               new ColumnInfo ("RestrictionDefault", typeof(string)),
-                               new ColumnInfo ("RestrictionNumber", typeof(int))
-                       };
-
-                       static readonly object [][] rows = {
-                               new object [] {"Users", "User_Name", "@Name", "name", 1},
-                               new object [] {"Databases", "Name", "@Name", "Name", 1},
-
-                               new object [] {"Tables", "Catalog", "@Catalog", "TABLE_CATALOG", 1},
-                               new object [] {"Tables", "Owner", "@Owner", "TABLE_SCHEMA", 2},
-                               new object [] {"Tables", "Table", "@Name", "TABLE_NAME", 3},
-                               new object [] {"Tables", "TableType", "@TableType", "TABLE_TYPE", 4},
-
-                               new object [] {"Columns", "Catalog", "@Catalog", "TABLE_CATALOG", 1},
-                               new object [] {"Columns", "Owner", "@Owner", "TABLE_SCHEMA", 2},
-                               new object [] {"Columns", "Table", "@Table", "TABLE_NAME", 3},
-                               new object [] {"Columns", "Column", "@Column", "COLUMN_NAME", 4},
-
-                               new object [] {"Views", "Catalog", "@Catalog", "TABLE_CATALOG", 1},
-                               new object [] {"Views", "Owner", "@Owner", "TABLE_SCHEMA", 2},
-                               new object [] {"Views", "Table", "@Table", "TABLE_NAME", 3},
-
-                               new object [] {"ViewColumns", "Catalog", "@Catalog", "VIEW_CATALOG", 1},
-                               new object [] {"ViewColumns", "Owner", "@Owner", "VIEW_SCHEMA", 2},
-                               new object [] {"ViewColumns", "Table", "@Table", "VIEW_NAME", 3},
-                               new object [] {"ViewColumns", "Column", "@Column", "COLUMN_NAME", 4},
-
-                               new object [] {"ProcedureParameters", "Catalog", "@Catalog", "SPECIFIC_CATALOG", 1},
-                               new object [] {"ProcedureParameters", "Owner", "@Owner", "SPECIFIC_SCHEMA", 2},
-                               new object [] {"ProcedureParameters", "Name", "@Name", "SPECIFIC_NAME", 3},
-                               new object [] {"ProcedureParameters", "Parameter", "@Parameter", "PARAMETER_NAME", 4},
-
-                               new object [] {"Procedures", "Catalog", "@Catalog", "SPECIFIC_CATALOG", 1},
-                               new object [] {"Procedures", "Owner", "@Owner", "SPECIFIC_SCHEMA", 2},
-                               new object [] {"Procedures", "Name", "@Name", "SPECIFIC_NAME", 3},
-                               new object [] {"Procedures", "Type", "@Type", "ROUTINE_TYPE", 4},
-
-                               new object [] {"IndexColumns", "Catalog", "@Catalog", "db_name(}", 1},
-                               new object [] {"IndexColumns", "Owner", "@Owner", "user_name(}", 2},
-                               new object [] {"IndexColumns", "Table", "@Table", "o.name", 3},
-                               new object [] {"IndexColumns", "ConstraintName", "@ConstraintName", "x.name", 4},
-                               new object [] {"IndexColumns", "Column", "@Column", "c.name", 5},
-
-                               new object [] {"Indexes", "Catalog", "@Catalog", "db_name(}", 1},
-                               new object [] {"Indexes", "Owner", "@Owner", "user_name(}", 2},
-                               new object [] {"Indexes", "Table", "@Table", "o.name", 3},
-                               new object [] {"Indexes", "Name", "@Name", "x.name", 4},
-
-                               new object [] {"UserDefinedTypes", "assembly_name", "@AssemblyName", "assemblies.name", 1},
-                               new object [] {"UserDefinedTypes", "udt_name", "@UDTName", "types.assembly_class", 2},
-
-                               new object [] {"ForeignKeys", "Catalog", "@Catalog", "CONSTRAINT_CATALOG", 1},
-                               new object [] {"ForeignKeys", "Owner", "@Owner", "CONSTRAINT_SCHEMA", 2},
-                               new object [] {"ForeignKeys", "Table", "@Table", "TABLE_NAME", 3},
-                               new object [] {"ForeignKeys", "Name", "@Name", "CONSTRAINT_NAME", 4}
-                       };
-
-                       static DataTable instance;
-                       static public DataTable Instance {
-                               get {
-                                       if (instance == null) {
-                                               instance = new DataTable ("Restrictions");
-                                               foreach (ColumnInfo c in columns)
-                                                       instance.Columns.Add (c.name, c.type);
-                                               foreach (object [] row in rows)
-                                                       instance.LoadDataRow (row, true);
-                                       }
-                                       return instance;
-                               }
-                       }
-               }
-
-               static class ReservedWords
-               {
-                       static readonly string [] reservedWords =
-                       {
-                               "ADD", "EXCEPT", "PERCENT", "ALL", "EXEC", "PLAN", "ALTER",
-                                 "EXECUTE", "PRECISION", "AND", "EXISTS", "PRIMARY", "ANY",
-                                 "EXIT", "PRINT", "AS", "FETCH", "PROC", "ASC", "FILE",
-                                 "PROCEDURE", "AUTHORIZATION", "FILLFACTOR", "PUBLIC",
-                                 "BACKUP", "FOR", "RAISERROR", "BEGIN", "FOREIGN", "READ",
-                                 "BETWEEN", "FREETEXT", "READTEXT", "BREAK", "FREETEXTTABLE",
-                                 "RECONFIGURE", "BROWSE", "FROM", "REFERENCES", "BULK",
-                                 "FULL", "REPLICATION", "BY", "FUNCTION", "RESTORE",
-                                 "CASCADE", "GOTO", "RESTRICT", "CASE", "GRANT", "RETURN",
-                                 "CHECK", "GROUP", "REVOKE", "CHECKPOINT", "HAVING", "RIGHT",
-                                 "CLOSE", "HOLDLOCK", "ROLLBACK", "CLUSTERED", "IDENTITY",
-                                 "ROWCOUNT", "COALESCE", "IDENTITY_INSERT", "ROWGUIDCOL",
-                                 "COLLATE", "IDENTITYCOL", "RULE", "COLUMN", "IF", "SAVE",
-                                 "COMMIT", "IN", "SCHEMA", "COMPUTE", "INDEX", "SELECT",
-                                 "CONSTRAINT", "INNER", "SESSION_USER", "CONTAINS", "INSERT",
-                                 "SET", "CONTAINSTABLE", "INTERSECT", "SETUSER", "CONTINUE",
-                                 "INTO", "SHUTDOWN", "CONVERT", "IS", "SOME", "CREATE",
-                                 "JOIN", "STATISTICS", "CROSS", "KEY", "SYSTEM_USER",
-                                 "CURRENT", "KILL", "TABLE", "CURRENT_DATE", "LEFT",
-                                 "TEXTSIZE", "CURRENT_TIME", "LIKE", "THEN",
-                                 "CURRENT_TIMESTAMP", "LINENO", "TO", "CURRENT_USER", "LOAD",
-                                 "TOP", "CURSOR", "NATIONAL", "TRAN", "DATABASE", "NOCHECK",
-                                 "TRANSACTION", "DBCC", "NONCLUSTERED", "TRIGGER",
-                                 "DEALLOCATE", "NOT", "TRUNCATE", "DECLARE", "NULL",
-                                 "TSEQUAL", "DEFAULT", "NULLIF", "UNION", "DELETE", "OF",
-                                 "UNIQUE", "DENY", "OFF", "UPDATE", "DESC", "OFFSETS",
-                                 "UPDATETEXT", "DISK", "ON", "USE", "DISTINCT", "OPEN",
-                                 "USER", "DISTRIBUTED", "OPENDATASOURCE", "VALUES", "DOUBLE",
-                                 "OPENQUERY", "VARYING", "DROP", "OPENROWSET", "VIEW",
-                                 "DUMMY", "OPENXML", "WAITFOR", "DUMP", "OPTION", "WHEN",
-                                 "ELSE", "OR", "WHERE", "END", "ORDER", "WHILE", "ERRLVL",
-                                 "OUTER", "WITH", "ESCAPE", "OVER", "WRITETEXT", "ABSOLUTE",
-                                 "FOUND", "PRESERVE", "ACTION", "FREE", "PRIOR", "ADMIN",
-                                 "GENERAL", "PRIVILEGES", "AFTER", "GET", "READS",
-                                 "AGGREGATE", "GLOBAL", "REAL", "ALIAS", "GO", "RECURSIVE",
-                                 "ALLOCATE", "GROUPING", "REF", "ARE", "HOST", "REFERENCING",
-                                 "ARRAY", "HOUR", "RELATIVE", "ASSERTION", "IGNORE", "RESULT",
-                                 "AT", "IMMEDIATE", "RETURNS", "BEFORE", "INDICATOR", "ROLE",
-                                 "BINARY", "INITIALIZE", "ROLLUP", "BIT", "INITIALLY",
-                                 "ROUTINE", "BLOB", "INOUT", "ROW", "BOOLEAN", "INPUT",
-                                 "ROWS", "BOTH", "INT", "SAVEPOINT", "BREADTH", "INTEGER",
-                                 "SCROLL", "CALL", "INTERVAL", "SCOPE", "CASCADED",
-                                 "ISOLATION", "SEARCH", "CAST", "ITERATE", "SECOND",
-                                 "CATALOG", "LANGUAGE", "SECTION", "CHAR", "LARGE",
-                                 "SEQUENCE", "CHARACTER", "LAST", "SESSION", "CLASS",
-                                 "LATERAL", "SETS", "CLOB", "LEADING", "SIZE", "COLLATION",
-                                 "LESS", "SMALLINT", "COMPLETION", "LEVEL", "SPACE",
-                                 "CONNECT", "LIMIT", "SPECIFIC", "CONNECTION", "LOCAL",
-                                 "SPECIFICTYPE", "CONSTRAINTS", "LOCALTIME", "SQL",
-                                 "CONSTRUCTOR", "LOCALTIMESTAMP", "SQLEXCEPTION",
-                                 "CORRESPONDING", "LOCATOR", "SQLSTATE", "CUBE", "MAP",
-                                 "SQLWARNING", "CURRENT_PATH", "MATCH", "START",
-                                 "CURRENT_ROLE", "MINUTE", "STATE", "CYCLE", "MODIFIES",
-                                 "STATEMENT", "DATA", "MODIFY", "STATIC", "DATE", "MODULE",
-                                 "STRUCTURE", "DAY", "MONTH", "TEMPORARY", "DEC", "NAMES",
-                                 "TERMINATE", "DECIMAL", "NATURAL", "THAN", "DEFERRABLE",
-                                 "NCHAR", "TIME", "DEFERRED", "NCLOB", "TIMESTAMP", "DEPTH",
-                                 "NEW", "TIMEZONE_HOUR", "DEREF", "NEXT", "TIMEZONE_MINUTE",
-                                 "DESCRIBE", "NO", "TRAILING", "DESCRIPTOR", "NONE",
-                                 "TRANSLATION", "DESTROY", "NUMERIC", "TREAT", "DESTRUCTOR",
-                                 "OBJECT", "TRUE", "DETERMINISTIC", "OLD", "UNDER",
-                                 "DICTIONARY", "ONLY", "UNKNOWN", "DIAGNOSTICS", "OPERATION",
-                                 "UNNEST", "DISCONNECT", "ORDINALITY", "USAGE", "DOMAIN",
-                                 "OUT", "USING", "DYNAMIC", "OUTPUT", "VALUE", "EACH",
-                                 "PAD", "VARCHAR", "END-EXEC", "PARAMETER", "VARIABLE",
-                                 "EQUALS", "PARAMETERS", "WHENEVER", "EVERY", "PARTIAL",
-                                 "WITHOUT", "EXCEPTION", "PATH", "WORK", "EXTERNAL",
-                                 "POSTFIX", "WRITE", "FALSE", "PREFIX", "YEAR", "FIRST",
-                                 "PREORDER", "ZONE", "FLOAT", "PREPARE", "ADA", "AVG",
-                                 "BIT_LENGTH", "CHAR_LENGTH", "CHARACTER_LENGTH", "COUNT",
-                                 "EXTRACT", "FORTRAN", "INCLUDE", "INSENSITIVE", "LOWER",
-                                 "MAX", "MIN", "OCTET_LENGTH", "OVERLAPS", "PASCAL",
-                                 "POSITION", "SQLCA", "SQLCODE", "SQLERROR", "SUBSTRING",
-                                 "SUM", "TRANSLATE", "TRIM", "UPPER"
-                       };
-                       static DataTable instance;
-                       static public DataTable Instance {
-                               get {
-                                       if (instance == null) {
-                                               DataRow row = null;
-                                               instance = new DataTable ("ReservedWords");
-                                               instance.Columns.Add ("ReservedWord", typeof(string));
-                                               foreach (string reservedWord in reservedWords)
-                                               {
-                                                       row = instance.NewRow();
-
-                                                       row["ReservedWord"] = reservedWord;
-                                                       instance.Rows.Add(row);
-                                               }
-                                       }
-                                       return instance;
-                               }
-                       }
-               }
-
-               public virtual DataTable GetSchema ()
-               {
-                       return MetaDataCollections.Instance;
-               }
-
-               public virtual DataTable GetSchema (string collectionName)
-               {
-                       return GetSchema (collectionName, null);
-               }
-
-               private void AddParameter (DbCommand command, string parameterName, DbType parameterType, int parameterSize)
-               {
-                       DbParameter parameter = command.CreateParameter ();
-                       parameter.ParameterName = parameterName;
-                       parameter.DbType = parameterType;
-                       parameter.Size = parameterSize;
-                       command.Parameters.Add (parameter);
-               }
-
-               public virtual DataTable GetSchema (string collectionName, string[] restrictionValues)
-               {
-                       if (collectionName == null)
-                               //LAMESPEC: In MS.NET, if collectionName is null, it throws ArgumentException.
-                               throw new ArgumentException ();
-
-                       String cName          = null;
-                       DataTable schemaTable = MetaDataCollections.Instance;
-                       int length = restrictionValues == null ? 0 : restrictionValues.Length;
-
-                       foreach (DataRow row in schemaTable.Rows) {
-                               if (String.Compare ((string) row ["CollectionName"], collectionName, true) == 0) {
-                                       if (length > (int) row ["NumberOfRestrictions"]) {
-                                               throw new ArgumentException ("More restrictions were provided " +
-                                                                            "than the requested schema ('" +
-                                                                            row ["CollectionName"].ToString () + "') supports");
-                                       }
-                                       cName = row ["CollectionName"].ToString ();
-                               }
-                       }
-                       if (cName == null)
-                               throw new ArgumentException ("The requested collection ('" + collectionName + "') is not defined.");
-
-                       DbCommand command     = null;
-                       DataTable dataTable   = new DataTable ();
-
-                       switch (cName)
-                       {
-                       case "Databases":
-                               command = CreateCommand ();
-                               command.Connection = this;
-                               command.CommandText = "select name as database_name, dbid, crdate as create_date " +
-                                 "from master.sys.sysdatabases where (name = @Name or (@Name " +
-                                 "is null))";
-                               AddParameter (command, "@Name", DbType.StringFixedLength, 4000);
-                               break;
-                       case "ForeignKeys":
-                               command = CreateCommand ();
-                               command.Connection = this;
-                               command.CommandText = "select CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA, CONSTRAINT_NAME, " +
-                                 "TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, CONSTRAINT_TYPE, " +
-                                 "IS_DEFERRABLE, INITIALLY_DEFERRED from " +
-                                 "INFORMATION_SCHEMA.TABLE_CONSTRAINTS where (CONSTRAINT_CATALOG" +
-                                 " = @Catalog or (@Catalog is null)) and (CONSTRAINT_SCHEMA = " +
-                                 "@Owner or (@Owner is null)) and (TABLE_NAME = @Table or (" +
-                                 "@Table is null)) and (CONSTRAINT_NAME = @Name or (@Name is null))" +
-                                 " and CONSTRAINT_TYPE = 'FOREIGN KEY' order by CONSTRAINT_CATALOG," +
-                                 " CONSTRAINT_SCHEMA, CONSTRAINT_NAME";
-                               AddParameter (command, "@Catalog", DbType.StringFixedLength, 4000);
-                               AddParameter (command, "@Owner", DbType.StringFixedLength, 4000);
-                               AddParameter (command, "@Table", DbType.StringFixedLength, 4000);
-                               AddParameter (command, "@Name", DbType.StringFixedLength, 4000);
-                               break;
-                       case "Indexes":
-                               command = CreateCommand ();
-                               command.Connection = this;
-                               command.CommandText = "select distinct db_name() as constraint_catalog, " +
-                                 "constraint_schema = user_name (o.uid), " +
-                                 "constraint_name = x.name, table_catalog = db_name (), " +
-                                 "table_schema = user_name (o.uid), table_name = o.name, " +
-                                 "index_name  = x.name from sysobjects o, sysindexes x, " +
-                                 "sysindexkeys xk where o.type in ('U') and x.id = o.id and " +
-                                 "o.id = xk.id and x.indid = xk.indid and xk.keyno = x.keycnt " +
-                                 "and (db_name() = @Catalog or (@Catalog is null)) and " +
-                                 "(user_name() = @Owner or (@Owner is null)) and (o.name = " +
-                                 "@Table or (@Table is null)) and (x.name = @Name or (@Name is null))" +
-                                 "order by table_name, index_name";
-                               AddParameter (command, "@Catalog", DbType.StringFixedLength, 4000);
-                               AddParameter (command, "@Owner", DbType.StringFixedLength, 4000);
-                               AddParameter (command, "@Table", DbType.StringFixedLength, 4000);
-                               AddParameter (command, "@Name", DbType.StringFixedLength, 4000);
-                               break;
-                       case "IndexColumns":
-                               command = CreateCommand ();
-                               command.Connection = this;
-                               command.CommandText = "select distinct db_name() as constraint_catalog, " +
-                                 "constraint_schema = user_name (o.uid), constraint_name = x.name, " +
-                                 "table_catalog = db_name (), table_schema = user_name (o.uid), " +
-                                 "table_name = o.name, column_name = c.name, " +
-                                 "ordinal_position = convert (int, xk.keyno), keyType = c.xtype, " +
-                                 "index_name = x.name from sysobjects o, sysindexes x, syscolumns c, " +
-                                 "sysindexkeys xk where o.type in ('U') and x.id = o.id and o.id = c.id " +
-                                 "and o.id = xk.id and x.indid = xk.indid and c.colid = xk.colid " +
-                                 "and xk.keyno <= x.keycnt and permissions (o.id, c.name) <> 0 " +
-                                 "and (db_name() = @Catalog or (@Catalog is null)) and (user_name() " +
-                                 "= @Owner or (@Owner is null)) and (o.name = @Table or (@Table is" +
-                                 " null)) and (x.name = @ConstraintName or (@ConstraintName is null)) " +
-                                 "and (c.name = @Column or (@Column is null)) order by table_name, " +
-                                 "index_name";
-                               AddParameter (command, "@Catalog", DbType.StringFixedLength, 8);
-                               AddParameter (command, "@Owner", DbType.StringFixedLength, 4000);
-                               AddParameter (command, "@Table", DbType.StringFixedLength, 13);
-                               AddParameter (command, "@ConstraintName", DbType.StringFixedLength, 4000);
-                               AddParameter (command, "@Column", DbType.StringFixedLength, 4000);
-                               break;
-                       case "Procedures":
-                               command = CreateCommand ();
-                               command.Connection = this;
-                               command.CommandText = "select SPECIFIC_CATALOG, SPECIFIC_SCHEMA, SPECIFIC_NAME, " +
-                                 "ROUTINE_CATALOG, ROUTINE_SCHEMA, ROUTINE_NAME, ROUTINE_TYPE, " +
-                                 "CREATED, LAST_ALTERED from INFORMATION_SCHEMA.ROUTINES where " +
-                                 "(SPECIFIC_CATALOG = @Catalog or (@Catalog is null)) and " +
-                                 "(SPECIFIC_SCHEMA = @Owner or (@Owner is null)) and (SPECIFIC_NAME" +
-                                 " = @Name or (@Name is null)) and (ROUTINE_TYPE = @Type or (@Type " +
-                                 "is null)) order by SPECIFIC_CATALOG, SPECIFIC_SCHEMA, SPECIFIC_NAME";
-                               AddParameter (command, "@Catalog", DbType.StringFixedLength, 4000);
-                               AddParameter (command, "@Owner", DbType.StringFixedLength, 4000);
-                               AddParameter (command, "@Name", DbType.StringFixedLength, 4000);
-                               AddParameter (command, "@Type", DbType.StringFixedLength, 4000);
-                               break;
-                       case "ProcedureParameters":
-                               command = CreateCommand ();
-                               command.Connection = this;
-                               command.CommandText = "select SPECIFIC_CATALOG, SPECIFIC_SCHEMA, SPECIFIC_NAME, " +
-                                 "ORDINAL_POSITION, PARAMETER_MODE, IS_RESULT, AS_LOCATOR, " +
-                                 "PARAMETER_NAME, DATA_TYPE, CHARACTER_MAXIMUM_LENGTH, " +
-                                 "CHARACTER_OCTET_LENGTH, COLLATION_CATALOG, COLLATION_SCHEMA, " +
-                                 "COLLATION_NAME, CHARACTER_SET_CATALOG, CHARACTER_SET_SCHEMA, " +
-                                 "CHARACTER_SET_NAME, NUMERIC_PRECISION, NUMERIC_PRECISION_RADIX, " +
-                                 "NUMERIC_SCALE, DATETIME_PRECISION, INTERVAL_TYPE, " +
-                                 "INTERVAL_PRECISION from INFORMATION_SCHEMA.PARAMETERS where " +
-                                 "(SPECIFIC_CATALOG = @Catalog or (@Catalog is null)) and " +
-                                 "(SPECIFIC_SCHEMA = @Owner or (@Owner is null)) and (SPECIFIC_NAME = " +
-                                 "@Name or (@Name is null)) and (PARAMETER_NAME = @Parameter or (" +
-                                 "@Parameter is null)) order by SPECIFIC_CATALOG, SPECIFIC_SCHEMA," +
-                                 " SPECIFIC_NAME, PARAMETER_NAME";
-                               AddParameter (command, "@Catalog", DbType.StringFixedLength, 4000);
-                               AddParameter (command, "@Owner", DbType.StringFixedLength, 4000);
-                               AddParameter (command, "@Name", DbType.StringFixedLength, 4000);
-                               AddParameter (command, "@Parameter", DbType.StringFixedLength, 4000);
-                               break;
-                       case "Tables":
-                               command = CreateCommand ();
-                               command.Connection = this;
-                               command.CommandText = "select TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, TABLE_TYPE " +
-                                 "from INFORMATION_SCHEMA.TABLES where" +
-                                 " (TABLE_CATALOG = @catalog or (@catalog is null)) and " +
-                                 "(TABLE_SCHEMA = @owner or (@owner is null))and " +
-                                 "(TABLE_NAME = @name or (@name is null)) and " +
-                                 "(TABLE_TYPE = @table_type or (@table_type is null))";
-                               AddParameter (command, "@catalog", DbType.StringFixedLength, 8);
-                               AddParameter (command, "@owner", DbType.StringFixedLength, 3);
-                               AddParameter (command, "@name", DbType.StringFixedLength, 11);
-                               AddParameter (command, "@table_type", DbType.StringFixedLength, 10);
-                               break;
-                       case "Columns":
-                               command = CreateCommand ();
-                               command.Connection = this;
-                               command.CommandText = "select TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, COLUMN_NAME, " +
-                                 "ORDINAL_POSITION, COLUMN_DEFAULT, IS_NULLABLE, DATA_TYPE, " +
-                                 "CHARACTER_MAXIMUM_LENGTH, CHARACTER_OCTET_LENGTH, " +
-                                 "NUMERIC_PRECISION, NUMERIC_PRECISION_RADIX, NUMERIC_SCALE, " +
-                                 "DATETIME_PRECISION, CHARACTER_SET_CATALOG, CHARACTER_SET_SCHEMA, " +
-                                 "CHARACTER_SET_NAME, COLLATION_CATALOG from INFORMATION_SCHEMA.COLUMNS" +
-                                 " where (TABLE_CATALOG = @Catalog or (@Catalog is null)) and (" +
-                                 "TABLE_SCHEMA = @Owner or (@Owner is null)) and (TABLE_NAME = @table" +
-                                 " or (@Table is null)) and (COLUMN_NAME = @column or (@Column is null" +
-                                 ")) order by TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, COLUMN_NAME";
-                               AddParameter (command, "@Catalog", DbType.StringFixedLength, 4000);
-                               AddParameter (command, "@Owner", DbType.StringFixedLength, 4000);
-                               AddParameter (command, "@Table", DbType.StringFixedLength, 4000);
-                               AddParameter (command, "@Column", DbType.StringFixedLength, 4000);
-                               break;
-                       case "Users":
-                               command = CreateCommand ();
-                               command.Connection = this;
-                               command.CommandText = "select uid, name as user_name, createdate, updatedate from sysusers" +
-                                 " where (name = @Name or (@Name is null))";
-                               AddParameter (command, "@Name", DbType.StringFixedLength, 4000);
-                               break;
-                       case "Views":
-                               command = CreateCommand ();
-                               command.Connection = this;
-                               command.CommandText = "select TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, CHECK_OPTION, " +
-                                 "IS_UPDATABLE from INFORMATION_SCHEMA.VIEWS where (TABLE_CATALOG" +
-                                 " = @Catalog or (@Catalog is null)) TABLE_SCHEMA = @Owner or " +
-                                 "(@Owner is null)) and (TABLE_NAME = @table or (@Table is null))" +
-                                 " order by TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME";
-                               AddParameter (command, "@Catalog", DbType.StringFixedLength, 4000);
-                               AddParameter (command, "@Owner", DbType.StringFixedLength, 4000);
-                               AddParameter (command, "@Table", DbType.StringFixedLength, 4000);
-                               break;
-                       case "ViewColumns":
-                               command = CreateCommand ();
-                               command.Connection = this;
-                               command.CommandText = "select VIEW_CATALOG, VIEW_SCHEMA, VIEW_NAME, TABLE_CATALOG, " +
-                                 "TABLE_SCHEMA, TABLE_NAME, COLUMN_NAME from " +
-                                 "INFORMATION_SCHEMA.VIEW_COLUMN_USAGE where (VIEW_CATALOG = " +
-                                 "@Catalog (@Catalog is null)) and (VIEW_SCHEMA = @Owner (@Owner" +
-                                 " is null)) and (VIEW_NAME = @Table or (@Table is null)) and " +
-                                 "(COLUMN_NAME = @Column or (@Column is null)) order by " +
-                                 "VIEW_CATALOG, VIEW_SCHEMA, VIEW_NAME";
-                               AddParameter (command, "@Catalog", DbType.StringFixedLength, 4000);
-                               AddParameter (command, "@Owner", DbType.StringFixedLength, 4000);
-                               AddParameter (command, "@Table", DbType.StringFixedLength, 4000);
-                               AddParameter (command, "@Column", DbType.StringFixedLength, 4000);
-                               break;
-                       case "UserDefinedTypes":
-                               command = CreateCommand ();
-                               command.Connection = this;
-                               command.CommandText = "select assemblies.name as assembly_name, types.assembly_class " +
-                                 "as udt_name, ASSEMBLYPROPERTY(assemblies.name, 'VersionMajor') " +
-                                 "as version_major, ASSEMBLYPROPERTY(assemblies.name, 'VersionMinor') " +
-                                 "as version_minor, ASSEMBLYPROPERTY(assemblies.name, 'VersionBuild') " +
-                                 "as version_build, ASSEMBLYPROPERTY(assemblies.name, 'VersionRevision') " +
-                                 "as version_revision, ASSEMBLYPROPERTY(assemblies.name, 'CultureInfo') " +
-                                 "as culture_info, ASSEMBLYPROPERTY(assemblies.name, 'PublicKey') " +
-                                 "as public_key, is_fixed_length, max_length, Create_Date, " +
-                                 "Permission_set_desc from sys.assemblies as assemblies join " +
-                                 "sys.assembly_types as types on assemblies.assembly_id = types.assembly_id" +
-                                 " where (assemblies.name = @AssemblyName or (@AssemblyName is null)) and " +
-                                 "(types.assembly_class = @UDTName or (@UDTName is null))";
-                               AddParameter (command, "@AssemblyName", DbType.StringFixedLength, 4000);
-                               AddParameter (command, "@UDTName", DbType.StringFixedLength, 4000);
-                               break;
-                       case "MetaDataCollections":
-                               return MetaDataCollections.Instance;
-                       case "DataSourceInformation":
-                               throw new NotImplementedException ();
-                       case "DataTypes":
-                               return DataTypes.Instance;
-                       case "ReservedWords":
-                               return ReservedWords.Instance;
-                       case "Restrictions":
-                               return Restrictions.Instance;
-                       }
-                       for (int i = 0; i < length; i++) {
-                               command.Parameters [i].Value = restrictionValues [i];
-                       }
-                       DbDataAdapter dataAdapter = DbProviderFactory.CreateDataAdapter ();
-                       dataAdapter.SelectCommand = command;
-                       dataAdapter.Fill (dataTable);
-                       return dataTable;
-               }
-
-               protected internal virtual DbProviderFactory DbProviderFactory {
-                       get {
-                               return null;
-                       }
-               }
-
-               IDbTransaction IDbConnection.BeginTransaction ()
-               {
-                       return BeginTransaction ();
-               }
-
-               IDbTransaction IDbConnection.BeginTransaction (IsolationLevel il)
-               {
-                       return BeginTransaction (il);
-               }
-
-               IDbCommand IDbConnection.CreateCommand ()
-               {
-                       return CreateCommand ();
-               }
-               
-               public abstract void Open ();
-
-               protected virtual void OnStateChange (StateChangeEventArgs stateChange)
-               {
-                       if (StateChange != null)
-                               StateChange (this, stateChange);
-               }
-               
-               public Task OpenAsync ()
-               {
-                       return OpenAsync (CancellationToken.None);
-               }
-               
-               public virtual Task OpenAsync (CancellationToken cancellationToken)
-               {
-                       if (cancellationToken.IsCancellationRequested) {
-                               return TaskHelper.CreateCanceledTask ();
-                       }
-                       
-                       try {
-                               Open ();
-                               return TaskHelper.CreateVoidTask ();
-                       } catch (Exception e) {
-                               return TaskHelper.CreateExceptionTask (e);
-                       }
-               }
-
-               #endregion // Methods
-
-               public virtual event StateChangeEventHandler StateChange;
-
-       }
-}
diff --git a/mcs/class/System.Data/System.Data.Common/DbDataAdapter.cs b/mcs/class/System.Data/System.Data.Common/DbDataAdapter.cs
deleted file mode 100644 (file)
index 918da04..0000000
+++ /dev/null
@@ -1,875 +0,0 @@
-//
-// System.Data.Common.DbDataAdapter.cs
-//
-// Author:
-//   Rodrigo Moya (rodrigo@ximian.com)
-//   Tim Coleman (tim@timcoleman.com)
-//   Sureshkumar T <tsureshkumar@novell.com>
-//   Veerapuram Varadhan  <vvaradhan@novell.com>
-//
-// (C) Ximian, Inc
-// Copyright (C) Tim Coleman, 2002-2003
-//
-
-//
-// Copyright (C) 2004, 2009 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections;
-using System.ComponentModel;
-using System.Data;
-using System.Reflection;
-using System.Runtime.InteropServices;
-
-namespace System.Data.Common
-{
-       public abstract class DbDataAdapter : DataAdapter, IDbDataAdapter, IDataAdapter, ICloneable
-       {
-               #region Fields
-
-               public const string DefaultSourceTableName = "Table";
-               const string DefaultSourceColumnName = "Column";
-               CommandBehavior _behavior = CommandBehavior.Default;
-
-               IDbCommand _selectCommand;
-               IDbCommand _updateCommand;
-               IDbCommand _deleteCommand;
-               IDbCommand _insertCommand;
-
-               #endregion // Fields
-               
-               #region Constructors
-
-               protected DbDataAdapter ()
-               {
-               }
-
-               protected DbDataAdapter (DbDataAdapter adapter) : base (adapter)
-               {
-               }
-
-               #endregion // Fields
-
-               #region Properties
-
-               protected internal CommandBehavior FillCommandBehavior {
-                       get { return _behavior; }
-                       set { _behavior = value; }
-               }
-
-               IDbCommand IDbDataAdapter.SelectCommand {
-                   get { return ((DbDataAdapter)this).SelectCommand; }
-                   set { ((DbDataAdapter)this).SelectCommand = (DbCommand)value; }
-               }
-
-               IDbCommand IDbDataAdapter.UpdateCommand{
-                   get { return ((DbDataAdapter)this).UpdateCommand; }
-                   set { ((DbDataAdapter)this).UpdateCommand = (DbCommand)value; }
-               }
-               
-               IDbCommand IDbDataAdapter.DeleteCommand{
-                   get { return ((DbDataAdapter)this).DeleteCommand; }
-                   set { ((DbDataAdapter)this).DeleteCommand = (DbCommand)value; }
-               }
-
-               IDbCommand IDbDataAdapter.InsertCommand{
-                   get { return ((DbDataAdapter)this).InsertCommand; }
-                   set { ((DbDataAdapter)this).InsertCommand = (DbCommand)value; }
-               }
-               
-               [Browsable (false)]
-               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
-               public DbCommand SelectCommand {
-                   get {
-                                       return (DbCommand) _selectCommand;
-                                       //return (DbCommand) ((IDbDataAdapter)this).SelectCommand; 
-                       }
-                   set {
-                                       if (_selectCommand != value) {
-                                               _selectCommand = value;
-                                               ((IDbDataAdapter)this).SelectCommand = value; 
-                                       }
-                       }
-               }
-
-               [Browsable (false)]
-               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
-               public DbCommand DeleteCommand {
-                   get {
-                                       return (DbCommand) _deleteCommand;
-                                       //return (DbCommand) ((IDbDataAdapter)this).DeleteCommand; 
-                       }
-                   set {
-                                       if (_deleteCommand != value) {
-                                               _deleteCommand = value;
-                                               ((IDbDataAdapter)this).DeleteCommand = value; 
-                                       }
-                       }
-               }
-
-               [Browsable (false)]
-               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
-               public DbCommand InsertCommand {
-                   get {
-                                       return (DbCommand) _insertCommand;
-                                       //return (DbCommand) ((IDbDataAdapter)this).InsertCommand; 
-                       }
-                   set {
-                                       if (_insertCommand != value) {
-                                               _insertCommand = value;
-                                               ((IDbDataAdapter)this).InsertCommand = value; 
-                                       }
-                       }
-               }
-
-               [Browsable (false)]
-               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
-               public DbCommand UpdateCommand {
-                   get {
-                                       return (DbCommand) _updateCommand;
-                                       //return (DbCommand) ((IDbDataAdapter)this).DeleteCommand; 
-                       }
-                   set {
-                                       if (_updateCommand != value) {
-                                               _updateCommand = value;
-                                               ((IDbDataAdapter)this).UpdateCommand = value; 
-                                       }
-                       }
-               }
-
-               [DefaultValue (1)]
-               public virtual int UpdateBatchSize {
-                       get { return 1; }
-                       set {
-                               if (value != 1)
-                                       throw new NotSupportedException ();
-                       }
-               }
-
-               #endregion // Properties
-               
-               #region Methods
-
-               protected virtual RowUpdatedEventArgs CreateRowUpdatedEvent (DataRow dataRow, IDbCommand command,
-                                                                            StatementType statementType,
-                                                                            DataTableMapping tableMapping)
-               {
-                       return new RowUpdatedEventArgs (dataRow, command, statementType, tableMapping);
-               }
-
-               protected virtual RowUpdatingEventArgs CreateRowUpdatingEvent (DataRow dataRow, IDbCommand command,
-                                                                              StatementType statementType,
-                                                                              DataTableMapping tableMapping)
-               {
-                       return new RowUpdatingEventArgs (dataRow, command, statementType, tableMapping);
-               }
-
-               protected virtual void OnRowUpdated (RowUpdatedEventArgs value)
-               {
-                       if (Events ["RowUpdated"] != null) {
-                               Delegate [] rowUpdatedList = Events ["RowUpdated"].GetInvocationList ();
-                               foreach (Delegate rowUpdated in rowUpdatedList) {
-                                       MethodInfo rowUpdatedMethod = rowUpdated.Method;
-                                       rowUpdatedMethod.Invoke (value, null);
-                               }
-                       }
-               }
-
-               protected virtual void OnRowUpdating (RowUpdatingEventArgs value)
-               {
-                       if (Events ["RowUpdating"] != null) {
-                               Delegate [] rowUpdatingList = Events ["RowUpdating"].GetInvocationList ();
-                               foreach (Delegate rowUpdating in rowUpdatingList) {
-                                       MethodInfo rowUpdatingMethod = rowUpdating.Method;
-                                       rowUpdatingMethod.Invoke (value, null);
-                               }
-                       }
-               }
-
-               protected override void Dispose (bool disposing)
-               {
-                       if (disposing) {
-                               IDbDataAdapter da = (IDbDataAdapter) this;
-                               if (da.SelectCommand != null) {
-                                       da.SelectCommand.Dispose();
-                                       da.SelectCommand = null;
-                               }
-                               if (da.InsertCommand != null) {
-                                       da.InsertCommand.Dispose();
-                                       da.InsertCommand = null;
-                               }
-                               if (da.UpdateCommand != null) {
-                                       da.UpdateCommand.Dispose();
-                                       da.UpdateCommand = null;
-                               }
-                               if (da.DeleteCommand != null) {
-                                       da.DeleteCommand.Dispose();
-                                       da.DeleteCommand = null;
-                               }
-                       }
-               }
-
-               public override int Fill (DataSet dataSet)
-               {
-                       return Fill (dataSet, 0, 0, DefaultSourceTableName, ((IDbDataAdapter) this).SelectCommand, _behavior);
-               }
-
-               public int Fill (DataTable dataTable)
-               {
-                       if (dataTable == null)
-                               throw new ArgumentNullException ("DataTable");
-
-                       return Fill (dataTable, ((IDbDataAdapter) this).SelectCommand, _behavior);
-               }
-
-               public int Fill (DataSet dataSet, string srcTable)
-               {
-                       return Fill (dataSet, 0, 0, srcTable, ((IDbDataAdapter) this).SelectCommand, _behavior);
-               }
-
-
-               protected virtual int Fill (DataTable dataTable, IDbCommand command, CommandBehavior behavior)
-               {
-                       CommandBehavior commandBehavior = behavior;
-
-                       // first see that the connection is not close.
-                       if (command.Connection.State == ConnectionState.Closed) {
-                               command.Connection.Open ();
-                               commandBehavior |= CommandBehavior.CloseConnection;
-                       }
-                       return Fill (dataTable, command.ExecuteReader (commandBehavior));
-               }
-
-               public int Fill (DataSet dataSet, int startRecord, int maxRecords, string srcTable)
-               {
-                       return this.Fill (dataSet, startRecord, maxRecords, srcTable, ((IDbDataAdapter) this).SelectCommand, _behavior);
-               }
-
-               [MonoTODO]
-               public int Fill (int startRecord, int maxRecords, params DataTable[] dataTables)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               protected virtual int Fill (DataTable[] dataTables, int startRecord, int maxRecords, IDbCommand command, CommandBehavior behavior)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               protected virtual int Fill (DataSet dataSet, int startRecord, int maxRecords, string srcTable, IDbCommand command, CommandBehavior behavior)
-               {
-                       if (command.Connection == null)
-                               throw new InvalidOperationException ("Connection state is closed");
-
-                       if (MissingSchemaAction == MissingSchemaAction.AddWithKey)
-                               behavior |= CommandBehavior.KeyInfo;
-                       CommandBehavior commandBehavior = behavior;
-
-                       if (command.Connection.State == ConnectionState.Closed) {
-                               command.Connection.Open ();
-                               commandBehavior |= CommandBehavior.CloseConnection;
-                       }
-                       return Fill (dataSet, srcTable, command.ExecuteReader (commandBehavior),
-                               startRecord, maxRecords);
-               }
-
-               /// <summary>
-               /// Fills the given datatable using values from reader. if a value 
-               /// for a column is  null, that will be filled with default value. 
-               /// </summary>
-               /// <returns>No. of rows affected </returns>
-               internal static int FillFromReader (DataTable table,
-                                                    IDataReader reader,
-                                                    int start,
-                                                    int length,
-                                                    int [] mapping,
-                                                    LoadOption loadOption
-                                                    )
-               {
-                       if (reader.FieldCount == 0)
-                               return 0 ;
-
-                       for (int i = 0; i < start; i++)
-                               reader.Read ();
-
-                       int counter = 0;
-                       object [] values = new object [mapping.Length];
-                       while (reader.Read () && (length == 0 || counter < length)) {
-                               for (int i = 0 ; i < mapping.Length; i++)
-                                       values [i] = mapping [i] < 0 ? null : reader [mapping [i]];
-                               table.BeginLoadData ();
-                               table.LoadDataRow (values, loadOption);
-                               table.EndLoadData ();
-                               counter++;
-                       }
-                       return counter;
-               }
-
-               internal static int FillFromReader (DataTable table,
-                                                    IDataReader reader,
-                                                    int start,
-                                                    int length,
-                                                    int [] mapping,
-                                                    LoadOption loadOption,
-                                                    FillErrorEventHandler errorHandler)
-               {
-                       if (reader.FieldCount == 0)
-                               return 0 ;
-
-                       for (int i = 0; i < start; i++)
-                               reader.Read ();
-
-                       int counter = 0;
-                       object [] values = new object [mapping.Length];
-                       while (reader.Read () && (length == 0 || counter < length)) {
-                               for (int i = 0 ; i < mapping.Length; i++)
-                                       values [i] = mapping [i] < 0 ? null : reader [mapping [i]];
-                               table.BeginLoadData ();
-                               try {
-                                       table.LoadDataRow (values, loadOption);
-                               } catch (Exception e) {
-                                       FillErrorEventArgs args = new FillErrorEventArgs (table, values);
-                                       args.Errors = e;
-                                       args.Continue = false;
-                                       errorHandler (table, args);
-                                       // if args.Continue is not set to true or if a handler is not set, rethrow the error..
-                                       if(!args.Continue)
-                                               throw e;
-                               }
-                               table.EndLoadData ();
-                               counter++;
-                       }
-                       return counter;
-               }
-
-               public override DataTable [] FillSchema (DataSet dataSet, SchemaType schemaType)
-               {
-                       return FillSchema (dataSet, schemaType, ((IDbDataAdapter) this).SelectCommand, DefaultSourceTableName, _behavior);
-               }
-
-               public DataTable FillSchema (DataTable dataTable, SchemaType schemaType)
-               {
-                       return FillSchema (dataTable, schemaType, ((IDbDataAdapter) this).SelectCommand, _behavior);
-               }
-
-               public DataTable [] FillSchema (DataSet dataSet, SchemaType schemaType, string srcTable)
-               {
-                       return FillSchema (dataSet, schemaType, ((IDbDataAdapter) this).SelectCommand, srcTable, _behavior);
-               }
-
-               protected virtual DataTable FillSchema (DataTable dataTable, SchemaType schemaType, IDbCommand command, CommandBehavior behavior)
-               {
-                       if (dataTable == null)
-                               throw new ArgumentNullException ("DataTable");
-
-                       behavior |= CommandBehavior.SchemaOnly | CommandBehavior.KeyInfo;
-                       if (command.Connection.State == ConnectionState.Closed) {
-                               command.Connection.Open ();
-                               behavior |= CommandBehavior.CloseConnection;
-                       }
-
-                       IDataReader reader = command.ExecuteReader (behavior);
-                       try {
-                               string tableName =  SetupSchema (schemaType, dataTable.TableName);
-                               if (tableName != null) {
-                                       // FillSchema should add the KeyInfo unless MissingSchemaAction
-                                       // is set to Ignore or Error.
-                                       MissingSchemaAction schemaAction = MissingSchemaAction;
-                                       if (!(schemaAction == MissingSchemaAction.Ignore ||
-                                               schemaAction == MissingSchemaAction.Error))
-                                               schemaAction = MissingSchemaAction.AddWithKey;
-
-                                       BuildSchema (reader, dataTable, schemaType, schemaAction,
-                                               MissingMappingAction, TableMappings);
-                               }
-                       } finally {
-                               reader.Close ();
-                       }
-                       return dataTable;
-               }
-
-               protected virtual DataTable[] FillSchema (DataSet dataSet, SchemaType schemaType, IDbCommand command, string srcTable, CommandBehavior behavior)
-               {
-                       if (dataSet == null)
-                               throw new ArgumentNullException ("DataSet");
-
-                       behavior |= CommandBehavior.SchemaOnly | CommandBehavior.KeyInfo;
-                       if (command.Connection.State == ConnectionState.Closed) {
-                               command.Connection.Open ();
-                               behavior |= CommandBehavior.CloseConnection;
-                       }
-
-                       IDataReader reader = command.ExecuteReader (behavior);
-                       ArrayList output = new ArrayList ();
-                       string tableName = srcTable;
-                       int index = 0;
-                       DataTable table;
-                       try {
-                               // FillSchema should add the KeyInfo unless MissingSchemaAction
-                               // is set to Ignore or Error.
-                               MissingSchemaAction schemaAction = MissingSchemaAction;
-                               if (!(MissingSchemaAction == MissingSchemaAction.Ignore ||
-                                       MissingSchemaAction == MissingSchemaAction.Error))
-                                       schemaAction = MissingSchemaAction.AddWithKey;
-
-                               do {
-                                       tableName = SetupSchema (schemaType, tableName);
-                                       if (tableName != null) {
-                                               if (dataSet.Tables.Contains (tableName))
-                                                       table = dataSet.Tables [tableName];
-                                               else {
-                                                       // Do not create schema if MissingSchemAction is set to Ignore
-                                                       if (this.MissingSchemaAction == MissingSchemaAction.Ignore)
-                                                               continue;
-                                                       table =  dataSet.Tables.Add (tableName);
-                                               }
-                                               
-                                               BuildSchema (reader, table, schemaType, schemaAction,
-                                                       MissingMappingAction, TableMappings);
-                                               output.Add (table);
-                                               tableName = String.Format ("{0}{1}", srcTable, ++index);
-                                       }
-                               }while (reader.NextResult ());
-                       } finally {
-                               reader.Close ();
-                       }
-                       return (DataTable []) output.ToArray (typeof (DataTable));
-               }
-
-               [EditorBrowsable (EditorBrowsableState.Advanced)]
-               public override IDataParameter[] GetFillParameters ()
-               {
-                       IDbCommand selectCmd = ((IDbDataAdapter) this).SelectCommand;
-                       IDataParameter[] parameters = new IDataParameter [selectCmd.Parameters.Count];
-                       selectCmd.Parameters.CopyTo (parameters, 0);
-                       return parameters;
-               }
-               
-               [MonoTODO]
-               [Obsolete ("use 'protected DbDataAdapter(DbDataAdapter)' ctor")]
-               object ICloneable.Clone ()
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public int Update (DataRow [] dataRows)
-               {
-                       if (dataRows == null)
-                               throw new ArgumentNullException("dataRows");
-                       
-                       if (dataRows.Length == 0)
-                               return 0;
-
-                       if (dataRows [0] == null)
-                               throw new ArgumentException("dataRows[0].");
-
-                       DataTable table = dataRows [0].Table;
-                       if (table == null)
-                               throw new ArgumentException("table is null reference.");
-                       
-                       // all rows must be in the same table
-                       for (int i = 0; i < dataRows.Length; i++) {
-                               if (dataRows [i] == null)
-                                       throw new ArgumentException ("dataRows[" + i + "].");
-                               if (dataRows [i].Table != table)
-                                       throw new ArgumentException(
-                                                                   " DataRow["
-                                                                   + i
-                                                                   + "] is from a different DataTable than DataRow[0].");
-                       }
-                       
-                       // get table mapping for this rows
-                       DataTableMapping tableMapping = TableMappings.GetByDataSetTable(table.TableName);
-                       if (tableMapping == null) {
-                               tableMapping = DataTableMappingCollection.GetTableMappingBySchemaAction(
-                                                                                                       TableMappings,
-                                                                                                       table.TableName,
-                                                                                                       table.TableName,
-                                                                                                       MissingMappingAction);
-                               if (tableMapping != null) {
-                                       foreach (DataColumn col in table.Columns) {
-                                               if (tableMapping.ColumnMappings.IndexOf (col.ColumnName) >= 0)
-                                                       continue;
-                                               DataColumnMapping columnMapping = DataColumnMappingCollection.GetColumnMappingBySchemaAction (tableMapping.ColumnMappings, col.ColumnName, MissingMappingAction);
-                                               if (columnMapping == null)
-                                                       columnMapping = new DataColumnMapping (col.ColumnName, col.ColumnName);
-                                               tableMapping.ColumnMappings.Add (columnMapping);
-                                       }
-                               } else {
-                                       ArrayList cmc = new ArrayList ();
-                                       foreach (DataColumn col in table.Columns)
-                                               cmc.Add (new DataColumnMapping (col.ColumnName, col.ColumnName));
-                                       tableMapping =
-                                               new DataTableMapping (
-                                                                     table.TableName,
-                                                                     table.TableName,
-                                                                     cmc.ToArray (typeof (DataColumnMapping)) as DataColumnMapping []);
-                               }
-                       }
-
-                       DataRow[] copy = table.NewRowArray (dataRows.Length);
-                       Array.Copy (dataRows, 0, copy, 0, dataRows.Length);
-                       return Update (copy, tableMapping);
-               }
-
-               public override int Update (DataSet dataSet)
-               {
-                       return Update (dataSet, DefaultSourceTableName);
-               }
-
-               public int Update (DataTable dataTable)
-               {
-                       /*
-                         int index = TableMappings.IndexOfDataSetTable (dataTable.TableName);
-                         if (index < 0)
-                         throw new ArgumentException ();
-                         return Update (dataTable, TableMappings [index]);
-                       */
-                       DataTableMapping tableMapping = TableMappings.GetByDataSetTable (dataTable.TableName);
-                       if (tableMapping == null) {
-                               tableMapping = DataTableMappingCollection.GetTableMappingBySchemaAction (
-                                                                                                        TableMappings,
-                                                                                                        dataTable.TableName,
-                                                                                                        dataTable.TableName,
-                                                                                                        MissingMappingAction);
-                               if (tableMapping != null) {
-                                       foreach (DataColumn col in dataTable.Columns) {
-                                               if (tableMapping.ColumnMappings.IndexOf (col.ColumnName) >= 0)
-                                                       continue;
-                                               DataColumnMapping columnMapping = DataColumnMappingCollection.GetColumnMappingBySchemaAction (tableMapping.ColumnMappings, col.ColumnName, MissingMappingAction);
-                                               if (columnMapping == null)
-                                                       columnMapping = new DataColumnMapping (col.ColumnName, col.ColumnName);
-                                               tableMapping.ColumnMappings.Add (columnMapping);
-                                       }
-                               } else {
-                                       ArrayList cmc = new ArrayList ();
-                                       foreach (DataColumn col in dataTable.Columns)
-                                               cmc.Add (new DataColumnMapping (col.ColumnName, col.ColumnName));
-                                       tableMapping =
-                                               new DataTableMapping (
-                                                                     dataTable.TableName,
-                                                                     dataTable.TableName,
-                                                                     cmc.ToArray (typeof (DataColumnMapping)) as DataColumnMapping []);
-                               }
-                       }
-                       return Update (dataTable, tableMapping);
-               }
-
-               private int Update (DataTable dataTable, DataTableMapping tableMapping)
-               {
-                       DataRow [] rows = dataTable.NewRowArray(dataTable.Rows.Count);
-                       dataTable.Rows.CopyTo (rows, 0);
-                       return Update (rows, tableMapping);
-               }
-
-               protected virtual int Update (DataRow [] dataRows, DataTableMapping tableMapping)
-               {
-                       int updateCount = 0;
-                       foreach (DataRow row in dataRows) {
-                               StatementType statementType = StatementType.Update;
-                               IDbCommand command = null;
-                               string commandName = String.Empty;
-
-                               switch (row.RowState) {
-                               case DataRowState.Added:
-                                       statementType = StatementType.Insert;
-                                       command = ((IDbDataAdapter) this).InsertCommand;
-                                       commandName = "Insert";
-                                       break;
-                               case DataRowState.Deleted:
-                                       statementType = StatementType.Delete;
-                                       command = ((IDbDataAdapter) this).DeleteCommand;
-                                       commandName = "Delete";
-                                       break;
-                               case DataRowState.Modified:
-                                       statementType = StatementType.Update;
-                                       command = ((IDbDataAdapter) this).UpdateCommand;
-                                       commandName = "Update";
-                                       break;
-                               case DataRowState.Unchanged:
-                               case DataRowState.Detached:
-                                       continue;
-                               }
-
-                               RowUpdatingEventArgs argsUpdating = CreateRowUpdatingEvent (row, command, statementType, tableMapping);
-                               row.RowError = String.Empty;
-                               OnRowUpdating (argsUpdating);
-                               switch (argsUpdating.Status) {
-                               case UpdateStatus.Continue :
-                                       //continue in update operation
-                                       break;
-                               case UpdateStatus.ErrorsOccurred :
-                                       if (argsUpdating.Errors == null)
-                                               argsUpdating.Errors = ExceptionHelper.RowUpdatedError();
-                                       row.RowError += argsUpdating.Errors.Message;
-                                       if (!ContinueUpdateOnError)
-                                               throw argsUpdating.Errors;
-                                       continue;
-                               case UpdateStatus.SkipAllRemainingRows :
-                                       return updateCount;
-                               case UpdateStatus.SkipCurrentRow :
-                                       updateCount++;
-                                       continue;
-                               default :
-                                       throw ExceptionHelper.InvalidUpdateStatus (argsUpdating.Status);
-                               }
-                               command = argsUpdating.Command;
-                               try {
-                                       if (command != null) {
-                                               DataColumnMappingCollection columnMappings = tableMapping.ColumnMappings;
-                                               foreach (IDataParameter parameter in command.Parameters) {
-                                                       if ((parameter.Direction & ParameterDirection.Input) == 0)
-                                                               continue;
-
-                                                       DataRowVersion rowVersion = parameter.SourceVersion;
-                                                       // Parameter version is ignored for non-update commands
-                                                       if (statementType == StatementType.Delete)
-                                                               rowVersion = DataRowVersion.Original;
-
-                                                       string dsColumnName = parameter.SourceColumn;
-                                                       if (columnMappings.Contains(dsColumnName)) {
-                                                               dsColumnName = columnMappings [dsColumnName].DataSetColumn;
-                                                               parameter.Value = row [dsColumnName, rowVersion];
-                                                       } else {
-                                                               parameter.Value = null;
-                                                       }
-
-                                                       DbParameter nullCheckParam = parameter as DbParameter;
-
-                                                       if (nullCheckParam != null && nullCheckParam.SourceColumnNullMapping) {
-                                                               if (parameter.Value != null && parameter.Value != DBNull.Value)
-                                                                       nullCheckParam.Value = 0;
-                                                               else
-                                                                       nullCheckParam.Value = 1;
-                                                               nullCheckParam = null;
-                                                       }
-                                               }
-                                       }
-                               } catch (Exception e) {
-                                       argsUpdating.Errors = e;
-                                       argsUpdating.Status = UpdateStatus.ErrorsOccurred;
-                               }
-
-                               IDataReader reader = null;
-                               try {
-                                       if (command == null)
-                                               throw ExceptionHelper.UpdateRequiresCommand (commandName);
-                               
-                                       CommandBehavior commandBehavior = CommandBehavior.Default;
-                                       if (command.Connection.State == ConnectionState.Closed) {
-                                               command.Connection.Open ();
-                                               commandBehavior |= CommandBehavior.CloseConnection;
-                                       }
-                               
-                                       // use ExecuteReader because we want to use the commandbehavior parameter.
-                                       // so the connection will be closed if needed.
-                                       reader = command.ExecuteReader (commandBehavior);
-
-                                       // update the current row, if the update command returns any resultset
-                                       // ignore other than the first record.
-                                       DataColumnMappingCollection columnMappings = tableMapping.ColumnMappings;
-
-                                       if (command.UpdatedRowSource == UpdateRowSource.Both ||
-                                           command.UpdatedRowSource == UpdateRowSource.FirstReturnedRecord) {
-                                               if (reader.Read ()){
-                                                       DataTable retSchema = reader.GetSchemaTable ();
-                                                       foreach (DataRow dr in retSchema.Rows) {
-                                                               string columnName = dr ["ColumnName"].ToString ();
-                                                               string dstColumnName = columnName;
-                                                               if (columnMappings != null &&
-                                                                   columnMappings.Contains(columnName))
-                                                                       dstColumnName = columnMappings [dstColumnName].DataSetColumn;
-                                                               DataColumn dstColumn = row.Table.Columns [dstColumnName];
-                                                               if (dstColumn == null
-                                                                   || (dstColumn.Expression != null
-                                                                       && dstColumn.Expression.Length > 0))
-                                                                       continue;
-                                                               // info from : http://www.error-bank.com/microsoft.public.dotnet.framework.windowsforms.databinding/
-                                                               // _35_hcsyiv0dha.2328@tk2msftngp10.phx.gbl_Thread.aspx
-                                                               // disable readonly for non-expression columns.
-                                                               bool readOnlyState = dstColumn.ReadOnly;
-                                                               dstColumn.ReadOnly = false;
-                                                               try {
-                                                                       row [dstColumnName] = reader [columnName];
-                                                               } finally {
-                                                                       dstColumn.ReadOnly = readOnlyState;
-                                                               }
-                                                       }
-                                               }
-                                       }
-                                       reader.Close ();
-
-                                       int tmp = reader.RecordsAffected; // records affected is valid only after closing reader
-                                       // if the execute does not effect any rows we throw an exception.
-                                       if (tmp == 0)
-                                               throw new DBConcurrencyException("Concurrency violation: the " + 
-                                                       commandName +"Command affected 0 records.", null,
-                                                       new DataRow [] { row });
-                                       updateCount += tmp;
-
-                                       if (command.UpdatedRowSource == UpdateRowSource.Both ||
-                                           command.UpdatedRowSource == UpdateRowSource.OutputParameters) {
-                                               // Update output parameters to row values
-                                               foreach (IDataParameter parameter in command.Parameters) {
-                                                       if (parameter.Direction != ParameterDirection.InputOutput
-                                                           && parameter.Direction != ParameterDirection.Output
-                                                           && parameter.Direction != ParameterDirection.ReturnValue)
-                                                               continue;
-
-                                                       string dsColumnName = parameter.SourceColumn;
-                                                       if (columnMappings != null &&
-                                                           columnMappings.Contains(parameter.SourceColumn))
-                                                               dsColumnName = columnMappings [parameter.SourceColumn].DataSetColumn;
-                                                       DataColumn dstColumn = row.Table.Columns [dsColumnName];
-                                                       if (dstColumn == null
-                                                           || (dstColumn.Expression != null 
-                                                               && dstColumn.Expression.Length > 0))
-                                                               continue;
-                                                       bool readOnlyState = dstColumn.ReadOnly;
-                                                       dstColumn.ReadOnly  = false;
-                                                       try {
-                                                               row [dsColumnName] = parameter.Value;
-                                                       } finally {
-                                                               dstColumn.ReadOnly = readOnlyState;
-                                                       }
-                                               }
-                                       }
-
-                                       RowUpdatedEventArgs updatedArgs = CreateRowUpdatedEvent (row, command, statementType, tableMapping);
-                                       OnRowUpdated (updatedArgs);
-                                       switch (updatedArgs.Status) {
-                                       case UpdateStatus.Continue:
-                                               break;
-                                       case UpdateStatus.ErrorsOccurred:
-                                               if (updatedArgs.Errors == null)
-                                                       updatedArgs.Errors = ExceptionHelper.RowUpdatedError();
-                                               row.RowError += updatedArgs.Errors.Message;
-                                               if (!ContinueUpdateOnError)
-                                                       throw updatedArgs.Errors;
-                                               break;
-                                       case UpdateStatus.SkipCurrentRow:
-                                               continue;
-                                       case UpdateStatus.SkipAllRemainingRows:
-                                               return updateCount;
-                                       }
-                                       if (!AcceptChangesDuringUpdate)
-                                               continue;
-                                       row.AcceptChanges ();
-                               } catch (Exception e) {
-                                       row.RowError = e.Message;
-                                       if (!ContinueUpdateOnError)
-                                               throw e;
-                               } finally {
-                                       if (reader != null && ! reader.IsClosed)
-                                               reader.Close ();
-                               }
-                       }
-                       return updateCount;
-               }
-
-               public int Update (DataSet dataSet, string srcTable)
-               {
-                       MissingMappingAction mappingAction = MissingMappingAction;
-
-                       if (mappingAction == MissingMappingAction.Ignore)
-                               mappingAction = MissingMappingAction.Error;
-
-                       DataTableMapping tableMapping = DataTableMappingCollection.GetTableMappingBySchemaAction (TableMappings, srcTable, srcTable, mappingAction);
-
-                       DataTable dataTable = dataSet.Tables [tableMapping.DataSetTable];
-                       if (dataTable == null)
-                               throw new ArgumentException (String.Format ("Missing table {0}",
-                                                                           srcTable));
-
-                       /** Copied from another Update function **/
-                       if (tableMapping != null) {
-                               foreach (DataColumn col in dataTable.Columns) {
-                                       if (tableMapping.ColumnMappings.IndexOf (col.ColumnName) >= 0)
-                                               continue;
-                                       DataColumnMapping columnMapping = DataColumnMappingCollection.GetColumnMappingBySchemaAction (tableMapping.ColumnMappings, col.ColumnName, MissingMappingAction);
-                                       if (columnMapping == null)
-                                               columnMapping = new DataColumnMapping (col.ColumnName, col.ColumnName);
-                                       tableMapping.ColumnMappings.Add (columnMapping);
-                               }
-                       } else {
-                               ArrayList cmc = new ArrayList ();
-                               foreach (DataColumn col in dataTable.Columns)
-                                       cmc.Add (new DataColumnMapping (col.ColumnName, col.ColumnName));
-                               tableMapping =
-                                       new DataTableMapping (
-                                                             dataTable.TableName,
-                                                             dataTable.TableName,
-                                                             cmc.ToArray (typeof (DataColumnMapping)) as DataColumnMapping []);
-                       }
-                       /**end insert from another update**/
-                       return Update (dataTable, tableMapping);
-               }
-
-               // All the batch methods, should be implemented, if supported,
-               // by individual providers
-
-               protected virtual int AddToBatch (IDbCommand command)
-               {
-                       throw CreateMethodNotSupportedException ();
-               }
-
-               protected virtual void ClearBatch ()
-               {
-                       throw CreateMethodNotSupportedException ();
-               }
-
-               protected virtual int ExecuteBatch ()
-               {
-                       throw CreateMethodNotSupportedException ();
-               }
-
-               protected virtual IDataParameter GetBatchedParameter (int commandIdentifier, int parameterIndex)
-               {
-                       throw CreateMethodNotSupportedException ();
-               }
-
-               protected virtual bool GetBatchedRecordsAffected (int commandIdentifier, out int recordsAffected, out Exception error)
-               {
-                       recordsAffected = 1;
-                       error = null;
-                       return true;
-               }
-
-               protected virtual void InitializeBatching ()
-               {
-                       throw CreateMethodNotSupportedException ();
-               }
-
-               protected virtual void TerminateBatching ()
-               {
-                       throw CreateMethodNotSupportedException ();
-               }
-
-               Exception CreateMethodNotSupportedException ()
-               {
-                       return new NotSupportedException ("Method is not supported.");
-               }
-               #endregion // Methods
-       }
-}
diff --git a/mcs/class/System.Data/System.Data.Common/DbDataReader.cs b/mcs/class/System.Data/System.Data.Common/DbDataReader.cs
deleted file mode 100644 (file)
index 45b5a5c..0000000
+++ /dev/null
@@ -1,288 +0,0 @@
-//
-// System.Data.Common.DbDataReader.cs
-//
-// Author:
-//   Tim Coleman (tim@timcoleman.com)
-//
-// Copyright (C) Tim Coleman, 2003
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Collections;
-using System.ComponentModel;
-using System.Data;
-using System.IO;
-
-using System.Threading;
-using System.Threading.Tasks;
-
-namespace System.Data.Common {
-       public abstract class DbDataReader : MarshalByRefObject, IDataReader, IDataRecord, IDisposable, IEnumerable
-       {
-               #region Constructors
-
-               protected DbDataReader ()
-               {
-               }
-
-               #endregion // Constructors
-
-               #region Properties
-
-               public abstract int Depth { get; }
-               public abstract int FieldCount { get; }
-               public abstract bool HasRows { get; }
-               public abstract bool IsClosed { get; }
-               public abstract object this [int ordinal] { get; }
-               public abstract object this [string name] { get; }
-               public abstract int RecordsAffected { get; }
-
-               public virtual int VisibleFieldCount {
-                       get { return FieldCount; }
-               }
-               #endregion // Properties
-
-               #region Methods
-
-               public abstract void Close ();
-               public abstract bool GetBoolean (int ordinal);
-               public abstract byte GetByte (int ordinal);
-               public abstract long GetBytes (int ordinal, long dataOffset, byte[] buffer, int bufferOffset, int length);
-               public abstract char GetChar (int ordinal);
-               public abstract long GetChars (int ordinal, long dataOffset, char[] buffer, int bufferOffset, int length);
-
-               [EditorBrowsable (EditorBrowsableState.Never)]
-               public void Dispose ()
-               {
-                       Dispose (true); 
-               }
-               
-               protected virtual void Dispose (bool disposing)
-               {
-                       if (disposing)
-                               Close ();
-               }
-               [EditorBrowsable (EditorBrowsableState.Never)]
-               public DbDataReader GetData (int ordinal)
-               {
-                       return ((DbDataReader) this [ordinal]);
-               }
-
-               public abstract string GetDataTypeName (int ordinal);
-               public abstract DateTime GetDateTime (int ordinal);
-               public abstract decimal GetDecimal (int ordinal);
-               public abstract double GetDouble (int ordinal);
-
-               [EditorBrowsable (EditorBrowsableState.Never)]
-               public abstract IEnumerator GetEnumerator ();
-
-               public abstract Type GetFieldType (int ordinal);
-               public abstract float GetFloat (int ordinal);
-               public abstract Guid GetGuid (int ordinal);
-               public abstract short GetInt16 (int ordinal);
-               public abstract int GetInt32 (int ordinal);
-               public abstract long GetInt64 (int ordinal);
-               public abstract string GetName (int ordinal);
-               public abstract int GetOrdinal (string name);
-
-               [EditorBrowsable (EditorBrowsableState.Never)]
-               public virtual Type GetProviderSpecificFieldType (int ordinal)
-               {
-                       return GetFieldType (ordinal);
-               }
-
-               [EditorBrowsable (EditorBrowsableState.Never)]
-               public virtual object GetProviderSpecificValue (int ordinal)
-               {
-                       return GetValue (ordinal);
-               }
-
-               [EditorBrowsable (EditorBrowsableState.Never)]
-               public virtual int GetProviderSpecificValues (object[] values)
-               {
-                       return GetValues (values);
-               }
-       
-               protected virtual DbDataReader GetDbDataReader (int ordinal)
-               {
-                       return ((DbDataReader) this [ordinal]);
-               }
-
-               public abstract DataTable GetSchemaTable ();
-               public abstract string GetString (int ordinal);
-               public abstract object GetValue (int ordinal);
-               public abstract int GetValues (object[] values);
-
-               IDataReader IDataRecord.GetData (int ordinal)
-               {
-                       return ((IDataReader) this).GetData (ordinal);
-               }
-
-               public abstract bool IsDBNull (int ordinal);
-               public abstract bool NextResult ();
-               public abstract bool Read ();
-
-                internal static DataTable GetSchemaTableTemplate ()
-               {
-                       Type booleanType = typeof (bool);
-                       Type stringType = typeof (string);
-                       Type intType = typeof (int);
-                       Type typeType = typeof (Type);
-                       Type shortType = typeof (short);
-
-                       DataTable schemaTable = new DataTable ("SchemaTable");
-                       schemaTable.Columns.Add ("ColumnName",       stringType);
-                       schemaTable.Columns.Add ("ColumnOrdinal",    intType);
-                       schemaTable.Columns.Add ("ColumnSize",       intType);
-                       schemaTable.Columns.Add ("NumericPrecision", shortType);
-                       schemaTable.Columns.Add ("NumericScale",     shortType);
-                       schemaTable.Columns.Add ("IsUnique",         booleanType);
-                       schemaTable.Columns.Add ("IsKey",            booleanType);
-                       schemaTable.Columns.Add ("BaseServerName",   stringType);
-                       schemaTable.Columns.Add ("BaseCatalogName",  stringType);
-                       schemaTable.Columns.Add ("BaseColumnName",   stringType);
-                       schemaTable.Columns.Add ("BaseSchemaName",   stringType);
-                       schemaTable.Columns.Add ("BaseTableName",    stringType);
-                       schemaTable.Columns.Add ("DataType",         typeType);
-                       schemaTable.Columns.Add ("AllowDBNull",      booleanType);
-                       schemaTable.Columns.Add ("ProviderType",     intType);
-                       schemaTable.Columns.Add ("IsAliased",        booleanType);
-                       schemaTable.Columns.Add ("IsExpression",     booleanType);
-                       schemaTable.Columns.Add ("IsIdentity",       booleanType);
-                       schemaTable.Columns.Add ("IsAutoIncrement",  booleanType);
-                       schemaTable.Columns.Add ("IsRowVersion",     booleanType);
-                       schemaTable.Columns.Add ("IsHidden",         booleanType);
-                       schemaTable.Columns.Add ("IsLong",           booleanType);
-                       schemaTable.Columns.Add ("IsReadOnly",       booleanType);
-
-                       return schemaTable;
-               }
-               
-               public virtual T GetFieldValue<T> (int i)
-               {
-                       return (T) GetValue (i);
-               }
-
-               public Task<T> GetFieldValueAsync<T> (int ordinal)
-               {
-                       return GetFieldValueAsync<T> (ordinal, CancellationToken.None);
-               }
-               
-               public virtual Task<T> GetFieldValueAsync<T> (int ordinal, CancellationToken cancellationToken)
-               {
-                       if (cancellationToken.IsCancellationRequested) {
-                               return TaskHelper.CreateCanceledTask<T> ();
-                       }
-                       
-                       try {
-                               return Task.FromResult<T> (GetFieldValue<T> (ordinal));
-                       } catch (Exception e) {
-                               return TaskHelper.CreateExceptionTask<T> (e);
-                       }
-               }
-               
-               public Task<bool> NextResultAsync ()
-               {
-                       return NextResultAsync (CancellationToken.None);
-               }
-               
-               public Task<bool> IsDBNullAsync (int ordinal)
-               {
-                       return IsDBNullAsync (ordinal, CancellationToken.None);
-               }
-
-               public virtual Stream GetStream (int i)
-               {
-
-                       long offset = 0L;
-                       byte [] buffer = new byte [1024 * 8];
-                       long read;
-                       MemoryStream memoryStream = new MemoryStream ();
-                       while ((read = this.GetBytes (i, offset, buffer, 0, buffer.Length)) > 0) {
-                               memoryStream.Write (buffer, 0, (int) read);
-                               offset += read;
-                       }
-                       memoryStream.Seek (0, SeekOrigin.Begin);
-                       return memoryStream;
-               }
-               
-               public virtual TextReader GetTextReader (int i)
-               {
-                       String value;
-                       if (IsDBNull (i))
-                               value = string.Empty;
-                       else
-                               value = this.GetString (i);
-                       return new StringReader (value);
-               }
-
-               public virtual Task<bool> IsDBNullAsync (int ordinal, CancellationToken cancellationToken)
-               {
-                       if (cancellationToken.IsCancellationRequested) {
-                               return TaskHelper.CreateCanceledTask<bool> ();
-                       }
-                       
-                       try {
-                               return Task.FromResult (IsDBNull (ordinal));
-                       } catch (Exception e) {
-                               return TaskHelper.CreateExceptionTask<bool> (e);
-                       }
-               }
-               
-               public virtual Task<bool> NextResultAsync (CancellationToken cancellationToken)
-               {
-                       if (cancellationToken.IsCancellationRequested) {
-                               return TaskHelper.CreateCanceledTask<bool> ();
-                       }
-                       
-                       try {
-                               return Task.FromResult (NextResult ());
-                       } catch (Exception e) {
-                               return TaskHelper.CreateExceptionTask<bool> (e);
-                       }
-               }
-               
-               public Task<bool> ReadAsync ()
-               {
-                       return ReadAsync (CancellationToken.None);
-               }
-               
-               public virtual Task<bool> ReadAsync (CancellationToken cancellationToken)
-               {
-                       if (cancellationToken.IsCancellationRequested) {
-                               return TaskHelper.CreateCanceledTask<bool> ();
-                       }
-                       
-                       try {
-                               return Task.FromResult (Read ());
-                       } catch (Exception e) {
-                               return TaskHelper.CreateExceptionTask<bool> (e);
-                       }
-               }
-
-               #endregion // Methods
-       }
-}
-
diff --git a/mcs/class/System.Data/System.Data.Common/DbDataSourceEnumerator.cs b/mcs/class/System.Data/System.Data.Common/DbDataSourceEnumerator.cs
deleted file mode 100644 (file)
index bd09283..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-//
-// System.Data.Common.DbDataSourceEnumerator.cs
-//
-// Author:
-//   Tim Coleman (tim@timcoleman.com)
-//
-// Copyright (C) Tim Coleman, 2003
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-namespace System.Data.Common {
-       public abstract class DbDataSourceEnumerator
-       {
-               #region Constructors
-
-               protected DbDataSourceEnumerator ()
-               {
-               }
-
-               #endregion // Constructors
-
-               #region Methods
-
-               public abstract DataTable GetDataSources ();
-
-               #endregion // Methods
-       }
-}
-
diff --git a/mcs/class/System.Data/System.Data.Common/DbException.cs b/mcs/class/System.Data/System.Data.Common/DbException.cs
deleted file mode 100644 (file)
index 0a57d99..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-//
-// System.Data.Common.DbException.cs
-//
-// Author: Umadevi S  (sumadevi@novell.com)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Globalization;
-using System.Runtime.Serialization;
-using System.Runtime.InteropServices;
-
-namespace System.Data.Common {
-       [Serializable]
-       public abstract class DbException : ExternalException
-       {
-               protected DbException ()
-               {
-               }
-
-               protected DbException (string message) : base(message) 
-               {
-               }
-
-               protected DbException (string message, Exception innerException)
-                       : base (message, innerException)
-               {
-               }
-
-               protected DbException (SerializationInfo info, StreamingContext context)
-                       : base (info, context)
-               {
-               }
-
-               protected DbException (string message, int errorCode) : base(message,errorCode) 
-               {
-               }
-       }
-}
-
diff --git a/mcs/class/System.Data/System.Data.Common/DbMetaDataCollectionNames.cs b/mcs/class/System.Data/System.Data.Common/DbMetaDataCollectionNames.cs
deleted file mode 100644 (file)
index b605967..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-// System.Data.Common.DbMetaDataCollectionNames
-//
-// Author: Senganal T  (tsenganal@novell.com)
-//
-// (C)  Senganal T 2005
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System.Data.Common {
-       [MonoTODO]
-       public static class DbMetaDataCollectionNames {
-
-               public static readonly string DataSourceInformation = "DataSourceInformation";
-               public static readonly string DataTypes = "DataTypes" ;
-               public static readonly string MetaDataCollections = "MetaDataCollections";
-               public static readonly string ReservedWords = "ReservedWords";
-               public static readonly string Restrictions = "Restrictions";
-       }
-}
diff --git a/mcs/class/System.Data/System.Data.Common/DbMetaDataColumnNames.cs b/mcs/class/System.Data/System.Data.Common/DbMetaDataColumnNames.cs
deleted file mode 100644 (file)
index b51a1fd..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-// System.Data.Common.DbMetaDataCollectionNames
-//
-// Author: Senganal T  (tsenganal@novell.com)
-//
-// (C)  Senganal T 2005
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System.Data.Common {
-       public static class DbMetaDataColumnNames {
-               public static readonly string CollectionName = "CollectionName";
-               public static readonly string ColumnSize = "ColumnSize";
-               public static readonly string CompositeIdentifierSeparatorPattern = "CompositeIdentifierSeparatorPattern";
-               public static readonly string CreateFormat = "CreateFormat";
-               public static readonly string CreateParameters = "CreateParameters";
-               public static readonly string DataSourceProductName = "DataSourceProductName";
-               public static readonly string DataSourceProductVersion = "DataSourceProductVersion";
-               public static readonly string DataType = "DataType";
-               public static readonly string DataSourceProductVersionNormalized = "DataSourceProductVersionNormalized";
-               public static readonly string GroupByBehavior = "GroupByBehavior";
-               public static readonly string IdentifierCase = "IdentifierCase";
-               public static readonly string IdentifierPattern = "IdentifierPattern";
-               public static readonly string IsAutoIncrementable = "IsAutoIncrementable";
-               public static readonly string IsBestMatch = "IsBestMatch";
-               public static readonly string IsCaseSensitive = "IsCaseSensitive";
-               public static readonly string IsConcurrencyType = "IsConcurrencyType";
-               public static readonly string IsFixedLength = "IsFixedLength";
-               public static readonly string IsFixedPrecisionScale = "IsFixedPrecisionScale";
-               public static readonly string IsLiteralSupported = "IsLiteralSupported";
-               public static readonly string IsLong = "IsLong";
-               public static readonly string IsNullable = "IsNullable";
-               public static readonly string IsSearchable = "IsSearchable";
-               public static readonly string IsSearchableWithLike = "IsSearchableWithLike";
-               public static readonly string IsUnsigned = "IsUnsigned";
-               public static readonly string LiteralPrefix = "LiteralPrefix";
-               public static readonly string LiteralSuffix = "LiteralSuffix";
-               public static readonly string MaximumScale = "MaximumScale";
-               public static readonly string MinimumScale = "MinimumScale";
-               public static readonly string NumberOfIdentifierParts = "NumberOfIdentifierParts";
-               public static readonly string NumberOfRestrictions = "NumberOfRestrictions";
-               public static readonly string OrderByColumnsInSelect = "OrderByColumnsInSelect";
-               public static readonly string ParameterMarkerFormat = "ParameterMarkerFormat";
-               public static readonly string ParameterMarkerPattern = "ParameterMarkerPattern";
-               public static readonly string ParameterNameMaxLength = "ParameterNameMaxLength";
-               public static readonly string ParameterNamePattern = "ParameterNamePattern";
-               public static readonly string ProviderDbType = "ProviderDbType";
-               public static readonly string QuotedIdentifierCase = "QuotedIdentifierCase";
-               public static readonly string QuotedIdentifierPattern = "QuotedIdentifierPattern";
-               public static readonly string ReservedWord = "ReservedWord";
-               public static readonly string StatementSeparatorPattern = "StatementSeparatorPattern";
-               public static readonly string StringLiteralPattern = "StringLiteralPattern";
-               public static readonly string SupportedJoinOperators = "SupportedJoinOperators";
-               public static readonly string TypeName = "TypeName";
-       }
-}
diff --git a/mcs/class/System.Data/System.Data.Common/DbParameter.cs b/mcs/class/System.Data/System.Data.Common/DbParameter.cs
deleted file mode 100644 (file)
index a589d29..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-//
-// System.Data.Common.DbParameter.cs
-//
-// Author:
-//   Tim Coleman (tim@timcoleman.com)
-//
-// Copyright (C) Tim Coleman, 2003
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Collections;
-using System.ComponentModel;
-
-namespace System.Data.Common {
-       public abstract class DbParameter : MarshalByRefObject, IDbDataParameter, IDataParameter
-       {
-               #region Constructors
-               internal static Hashtable dbTypeMapping;
-               protected DbParameter ()
-               {
-               }
-
-               #endregion // Constructors
-
-               #region Properties
-
-               [Browsable (false)]
-               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
-               [RefreshProperties (RefreshProperties.All)]
-               public abstract DbType DbType { get; set; }
-
-               [DefaultValue (ParameterDirection.Input)]
-               [RefreshProperties (RefreshProperties.All)]
-               public abstract ParameterDirection Direction { get; set; }
-
-               [DefaultValue ("")]
-               public abstract string ParameterName { get; set; }
-               public abstract int Size { get; set; }
-               byte IDbDataParameter.Precision { 
-                       get { return  0; }
-                       set {} 
-               }
-               byte IDbDataParameter.Scale { 
-                       get { return 0; }
-                       set {} 
-               }
-
-               [DefaultValue (null)]
-               [RefreshProperties (RefreshProperties.All)]
-               public abstract object Value { get; set; }
-
-               [Browsable (false)]
-               [DesignOnly (true)]
-               [EditorBrowsable (EditorBrowsableState.Never)]
-               public abstract bool IsNullable { get; set; }
-
-               [DefaultValue ("")]
-               public abstract string SourceColumn { get; set; }
-
-               [RefreshProperties (RefreshProperties.All)]
-               [DefaultValue (false)]
-               [EditorBrowsable (EditorBrowsableState.Advanced)]
-               public abstract bool SourceColumnNullMapping { get; set; }
-
-               [DefaultValue (DataRowVersion.Current)]
-               public abstract DataRowVersion SourceVersion { get; set; }
-
-               #endregion // Properties
-
-               #region Methods
-               [EditorBrowsable (EditorBrowsableState.Advanced)]
-               public abstract void ResetDbType ();
-               
-               internal virtual object FrameworkDbType {
-                       get {return null;}
-                       set {}
-               }
-               
-               internal static Hashtable DbTypeMapping {
-                       get { return dbTypeMapping;}
-                       set { dbTypeMapping = value;}
-               }
-               
-               // LAMESPEC: Implementors should populate the dbTypeMapping accordingly
-               internal virtual Type SystemType {
-                       get {
-                               return (Type) dbTypeMapping [DbType];
-                       }
-               }
-               #endregion // Methods
-       }
-}
-
diff --git a/mcs/class/System.Data/System.Data.Common/DbParameterCollection.cs b/mcs/class/System.Data/System.Data.Common/DbParameterCollection.cs
deleted file mode 100644 (file)
index f9d0082..0000000
+++ /dev/null
@@ -1,142 +0,0 @@
-//
-// System.Data.Common.DbParameterCollection.cs
-//
-// Author:
-//   Tim Coleman (tim@timcoleman.com)
-//
-// Copyright (C) Tim Coleman, 2003
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-using System.Collections;
-using System.ComponentModel;
-using System.Runtime.InteropServices;
-
-namespace System.Data.Common {
-       public abstract class DbParameterCollection : MarshalByRefObject, IDataParameterCollection, IList, ICollection, IEnumerable
-       {
-               #region Constructors
-
-               protected DbParameterCollection ()
-               {
-               }
-
-               #endregion // Constructors
-
-               #region Properties
-
-               [Browsable (false)]
-               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
-               public abstract int Count {
-                       get;
-               }
-
-               object IDataParameterCollection.this [string parameterName] {
-                       get { return this [parameterName]; }
-                       set { this [parameterName] = (DbParameter) value; }
-               }
-
-               object IList.this [int index] {
-                       get { return this [index]; }
-                       set { this [index] = (DbParameter) value; }
-               }
-
-               [Browsable (false)]
-               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
-               [EditorBrowsable (EditorBrowsableState.Never)]
-               public abstract bool IsFixedSize {
-                       get;
-               }
-
-               [Browsable (false)]
-               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
-               [EditorBrowsable (EditorBrowsableState.Never)]
-               public abstract bool IsReadOnly {
-                       get;
-               }
-
-               [Browsable (false)]
-               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
-               [EditorBrowsable (EditorBrowsableState.Never)]
-               public abstract bool IsSynchronized {
-                       get;
-               }
-
-               public DbParameter this [string parameterName] {
-                       get {
-                               int index = IndexOf (parameterName);
-                               return this [index];
-                       }
-                       set {
-                               int index = IndexOf (parameterName);
-                               this [index] = value;
-                       }
-               }
-
-               public DbParameter this [int index] {
-                       get { return GetParameter (index); }
-                       set { SetParameter (index, value); }
-               }
-
-               [Browsable (false)]
-               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
-               [EditorBrowsable (EditorBrowsableState.Never)]
-               public abstract object SyncRoot {
-                       get;
-               }
-
-               #endregion // Properties
-
-               #region Methods
-
-               public abstract int Add (object value);
-
-               public abstract void AddRange (Array values);
-               protected abstract DbParameter GetParameter (String parameterName);
-               protected abstract void SetParameter (String parameterName, 
-                                                     DbParameter value);
-
-               public abstract void Clear ();
-               public abstract bool Contains (object value);
-               public abstract bool Contains (string value);
-               public abstract void CopyTo (Array array, int index);
-
-               [EditorBrowsable (EditorBrowsableState.Never)]
-               public abstract IEnumerator GetEnumerator ();
-
-               protected abstract DbParameter GetParameter (int index);
-               public abstract int IndexOf (object value);
-               public abstract int IndexOf (string parameterName);
-               public abstract void Insert (int index, object value);
-               public abstract void Remove (object value);
-               public abstract void RemoveAt (int index);
-               public abstract void RemoveAt (string parameterName);
-               protected abstract void SetParameter (int index, DbParameter value);
-
-               #endregion // Methods
-       }
-}
-
diff --git a/mcs/class/System.Data/System.Data.Common/DbProviderConfigurationHandler.cs b/mcs/class/System.Data/System.Data.Common/DbProviderConfigurationHandler.cs
deleted file mode 100644 (file)
index 5706442..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-//
-// System.Data.Common.DbProviderConfigurationHandler.cs
-//
-// Author:
-//   Tim Coleman (tim@timcoleman.com)
-//
-// Copyright (C) Tim Coleman, 2003
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-using System.Configuration;
-using System.Xml;
-
-namespace System.Data.Common {
-       public class DbProviderConfigurationHandler : IConfigurationSectionHandler
-       {
-               #region Constructors
-
-               public DbProviderConfigurationHandler ()
-               {
-               }
-
-               #endregion // Constructors
-
-               #region Methods
-
-               [MonoTODO]
-               public virtual object Create (object parent, object configContext, XmlNode section)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               #endregion // Methods
-       }
-}
-
diff --git a/mcs/class/System.Data/System.Data.Common/DbProviderFactories.cs b/mcs/class/System.Data/System.Data.Common/DbProviderFactories.cs
deleted file mode 100644 (file)
index d9c2b48..0000000
+++ /dev/null
@@ -1,114 +0,0 @@
-//
-// System.Data.Common.DbProviderFactories.cs
-//
-// Author:
-//   Sureshkumar T (tsureshkumar@novell.com)
-//   Tim Coleman (tim@timcoleman.com)
-//
-// Copyright (C) Tim Coleman, 2003
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Threading;
-using System.Reflection;
-using System.Collections;
-using System.Configuration;
-
-namespace System.Data.Common {
-       public static class DbProviderFactories
-       {
-               private static object configEntries; // DataSet
-
-               internal const string CONFIG_SECTION_NAME        = "system.data";
-               internal const string CONFIG_SEC_TABLE_NAME      = "DbProviderFactories";
-
-               #region Methods
-
-               public static DbProviderFactory GetFactory (DataRow providerRow)
-               {
-                       string assemblyType = (string) providerRow ["AssemblyQualifiedName"];
-                       Type type = Type.GetType (assemblyType, false, true);
-                       if (type != null && type.IsSubclassOf (typeof (DbProviderFactory))) {
-                               // Provider factories are singletons with Instance field having
-                               // the sole instance
-                               FieldInfo field = type.GetField ("Instance", BindingFlags.Public |
-                                       BindingFlags.Static);
-                               if (field != null) {
-                                       return field.GetValue (null) as DbProviderFactory;
-                               }
-                       }
-
-                       throw new ConfigurationErrorsException("Failed to find or load the registered .Net Framework Data Provider.");
-               }
-
-               public static DbProviderFactory GetFactory (string providerInvariantName)
-               {
-                       if (providerInvariantName == null)
-                               throw new ArgumentNullException ("providerInvariantName");
-
-                       DataTable table = GetFactoryClasses ();
-                       if (table != null) {
-                               DataRow row = table.Rows.Find (providerInvariantName);
-                               if (row != null)
-                                       return GetFactory (row);
-                       }
-
-                       throw new ConfigurationErrorsException (String.Format("Failed to find or load the registered .Net Framework Data Provider '{0}'.", providerInvariantName));
-               }
-               
-               public static DbProviderFactory GetFactory (DbConnection connection)
-               {
-                       if (connection == null)
-                               throw new ArgumentNullException ("connection");
-
-                       return connection.DbProviderFactory;
-               }
-
-               public static DataTable GetFactoryClasses ()
-               {
-                               DataSet ds = GetConfigEntries ();
-                               DataTable table = ds != null ? ds.Tables [CONFIG_SEC_TABLE_NAME] : null;
-                               if (table != null)
-                                       table = table.Copy (); // avoid modifications by user
-                               return table;
-               }
-
-               #endregion // Methods
-
-               #region Internal Methods
-
-               internal static DataSet GetConfigEntries ()
-               {
-                       if (configEntries != null)
-                               return configEntries as DataSet;
-
-                       DataSet ds = (DataSet) ConfigurationManager.GetSection (CONFIG_SECTION_NAME);
-                       Interlocked.CompareExchange (ref configEntries, ds, null);
-                       return configEntries as DataSet;
-               }
-
-               #endregion Internal Methods
-       }
-}
diff --git a/mcs/class/System.Data/System.Data.Common/DbProviderFactoriesConfigurationHandler.cs b/mcs/class/System.Data/System.Data.Common/DbProviderFactoriesConfigurationHandler.cs
deleted file mode 100644 (file)
index be3146b..0000000
+++ /dev/null
@@ -1,156 +0,0 @@
-//
-// System.Data.Common.DbProviderFactoriesConfigurationHandler.cs
-//
-// Author:
-//   Sureshkumar T (tsureshkumar@novell.com)
-//   Tim Coleman (tim@timcoleman.com)
-//
-// Copyright (C) Tim Coleman, 2003
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-using System.IO;
-using System.Xml;
-using System.Globalization;
-using System.Configuration;
-
-namespace System.Data.Common
-{
-       public class DbProviderFactoriesConfigurationHandler : IConfigurationSectionHandler
-       {
-               #region Constructors
-
-               public DbProviderFactoriesConfigurationHandler ()
-               {
-               }
-
-               #endregion // Constructors
-
-               #region Methods
-
-               public virtual object Create (object parent, object configContext, XmlNode section)
-               {
-                       DataSet ds = parent as DataSet ?? CreateDataSet ();
-                       FillDataTables (ds, section);
-                       return ds;
-               }
-
-               DataSet CreateDataSet ()
-               {
-                       DataSet ds = new DataSet (DbProviderFactories.CONFIG_SECTION_NAME);
-                       DataTable dt = ds.Tables.Add (DbProviderFactories.CONFIG_SEC_TABLE_NAME);
-                       DataColumn [] columns = new DataColumn [4];
-                       columns [0] = new DataColumn ("Name", typeof (string));
-                       columns [1] = new DataColumn ("Description", typeof (string));
-                       columns [2] = new DataColumn ("InvariantName", typeof (string));
-                       columns [3] = new DataColumn ("AssemblyQualifiedName", typeof (string));
-                       dt.Columns.AddRange (columns);
-                       dt.PrimaryKey = new DataColumn [] { columns [2] };
-                       return ds;
-               }
-
-               void FillDataTables (DataSet ds, XmlNode section)
-               {
-                       DataTable dt = ds.Tables [0];
-                       foreach (XmlNode node in section.ChildNodes) {
-                               if (node.NodeType != XmlNodeType.Element)
-                                       continue;
-
-                               if (node.Name == DbProviderFactories.CONFIG_SEC_TABLE_NAME) {
-                                       foreach (XmlNode factoryNode in node.ChildNodes) {
-                                               if (factoryNode.NodeType != XmlNodeType.Element)
-                                                       continue;
-
-                                               switch (factoryNode.Name) {
-                                               case "add":
-                                                       AddRow (dt, factoryNode);
-                                                       break;
-                                               case "clear":
-                                                       dt.Rows.Clear ();
-                                                       break;
-                                               case "remove":
-                                                       RemoveRow (dt, factoryNode);
-                                                       break;
-                                               default:
-                                                       throw new ConfigurationErrorsException (
-                                                               "Unrecognized element.", factoryNode);
-                                               }
-                                       }
-                               }
-                       }
-               }
-
-               string GetAttributeValue (XmlNode node, string name, bool required)
-               {
-                       XmlAttribute attr = node.Attributes [name];
-                       if (attr == null) {
-                               if (!required)
-                                       return null;
-                               throw new ConfigurationErrorsException ("Required Attribute '" 
-                                       + name + "' is  missing!", node);
-                       }
-                       string value = attr.Value;
-                       if (value == "")
-                               throw new ConfigurationException ("Attribute '" + name 
-                                       + "' cannot be empty!", node);
-                       return value;
-               }
-
-               void AddRow (DataTable dt, XmlNode addNode)
-               {
-                       string name = GetAttributeValue (addNode, "name", true);
-                       string description = GetAttributeValue (addNode, "description", true);
-                       string invariant = GetAttributeValue (addNode, "invariant", true);
-                       string type = GetAttributeValue (addNode, "type", true);
-
-                       // FIXME: throw ConfigurationErrorsException for unrecognized
-                       // attributes. Consider "supports" valid although we're not using
-                       // it
-
-                       DataRow row = dt.NewRow ();
-                       row [0] = name;
-                       row [1] = description;
-                       row [2] = invariant;
-                       row [3] = type;
-
-                       dt.Rows.Add (row);
-               }
-
-               void RemoveRow (DataTable dt, XmlNode removeNode)
-               {
-                       // FIXME: throw ConfigurationErrorsException for unrecognized
-                       // attributes.
-
-                       string invariant = GetAttributeValue (removeNode, "invariant", true);
-                       DataRow row = dt.Rows.Find (invariant);
-                       if (row != null)
-                               row.Delete ();
-               }
-
-               #endregion // Methods
-       }
-}
-
diff --git a/mcs/class/System.Data/System.Data.Common/DbProviderFactory.cs b/mcs/class/System.Data/System.Data.Common/DbProviderFactory.cs
deleted file mode 100644 (file)
index c407145..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-//
-// System.Data.Common.DbProviderFactory.cs
-//
-// Author:
-//   Tim Coleman (tim@timcoleman.com)
-//
-// Copyright (C) Tim Coleman, 2003
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-using System.Collections;
-using System.Security;
-using System.Security.Permissions;
-
-namespace System.Data.Common {
-       public abstract class DbProviderFactory
-       {
-               #region Constructors
-
-               protected DbProviderFactory ()
-               {
-               }
-
-               #endregion // Constructors
-
-               #region Properties
-
-               private NotImplementedException CreateNotImplementedException ()
-               {
-                       return new NotImplementedException ();
-               }
-
-               public virtual bool CanCreateDataSourceEnumerator { 
-                       get {
-                               throw CreateNotImplementedException ();
-                       }
-               }
-               #endregion // Properties
-
-               #region Methods
-
-               public virtual DbCommand CreateCommand ()
-               {
-                       throw CreateNotImplementedException ();
-               }
-
-               public virtual DbCommandBuilder CreateCommandBuilder ()
-               {
-                       throw CreateNotImplementedException ();
-               }
-
-               public virtual DbConnection CreateConnection ()
-               {
-                       throw CreateNotImplementedException ();
-               }
-
-               public virtual DbDataAdapter CreateDataAdapter ()
-               {
-                       throw CreateNotImplementedException ();
-               }
-
-               public virtual DbDataSourceEnumerator CreateDataSourceEnumerator ()
-               {
-                       throw CreateNotImplementedException ();
-               }
-
-               public virtual DbParameter CreateParameter ()
-               {
-                       throw CreateNotImplementedException ();
-               }
-
-               public virtual CodeAccessPermission CreatePermission (PermissionState state)
-               {
-                       throw CreateNotImplementedException ();
-               }
-
-               public virtual DbConnectionStringBuilder CreateConnectionStringBuilder ()
-               {
-                       throw CreateNotImplementedException ();
-               }
-               #endregion // Methods
-       }
-}
-
diff --git a/mcs/class/System.Data/System.Data.Common/DbProviderSpecificTypePropertyAttribute.cs b/mcs/class/System.Data/System.Data.Common/DbProviderSpecificTypePropertyAttribute.cs
deleted file mode 100644 (file)
index dfecbce..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-//
-// System.Data.Common.DbProviderSpecificTypePropertyAttribute
-//
-// Author:
-//     Umadevi S (sumadevi@novell.com)
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-using System;
-
-namespace System.Data.Common {
-       [AttributeUsage (AttributeTargets.Property, AllowMultiple = false, Inherited = true)]
-       [SerializableAttribute()]
-       public sealed class DbProviderSpecificTypePropertyAttribute : Attribute
-       {
-               #region Fields
-
-               bool isProviderSpecificTypeProperty;
-
-               #endregion // Fields
-
-               #region Constructors
-
-               public DbProviderSpecificTypePropertyAttribute (bool isProviderSpecificTypeProperty)                {
-                       this.isProviderSpecificTypeProperty = isProviderSpecificTypeProperty;
-               }
-
-               #endregion // Constructors
-
-               #region Properties
-
-               public bool IsProviderSpecificTypeProperty{
-                       get {
-                               return this.isProviderSpecificTypeProperty;
-                       }
-               }
-
-               #endregion // Properties
-       }
-}
-
diff --git a/mcs/class/System.Data/System.Data.Common/DbProviderSupportedClasses.cs b/mcs/class/System.Data/System.Data.Common/DbProviderSupportedClasses.cs
deleted file mode 100644 (file)
index 0941f87..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-//
-// System.Data.Common.DbProviderSupportedClasses.cs
-//
-// Author:
-//   Sureshkumar T (tsureshkumar@novell.com)
-//   Tim Coleman (tim@timcoleman.com)
-//
-// Copyright (C) Tim Coleman, 2003
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-namespace System.Data.Common {
-       public enum DbProviderSupportedClasses 
-       {
-                CodeAccessPermission = 0x80,
-                DbCommand = 0x02,
-                DbCommandBuilder = 0x10,
-                DbCommandSet = 0x100,
-                DbConnection = 0x01,
-                DbConnectionStringBuilder = 0x08,
-                DbDataAdapter = 0x20,
-                DbDataSourceEnumerator = 0x40,
-                DbParameter = 0x04,
-                None = 0x00
-       }
-}
-
diff --git a/mcs/class/System.Data/System.Data.Common/DbTable.cs b/mcs/class/System.Data/System.Data.Common/DbTable.cs
deleted file mode 100644 (file)
index ae4da77..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-//
-// System.Data.Common.DbTable.cs
-//
-// Author:
-//   Tim Coleman (tim@timcoleman.com)
-//
-// Copyright (C) Tim Coleman, 2003
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
diff --git a/mcs/class/System.Data/System.Data.Common/DbTransaction.cs b/mcs/class/System.Data/System.Data.Common/DbTransaction.cs
deleted file mode 100644 (file)
index 8f0d744..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-
-// System.Data.Common.DbTransaction.cs
-//
-// Author:
-//   Tim Coleman (tim@timcoleman.com)
-//
-// Copyright (C) Tim Coleman, 2003
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-namespace System.Data.Common
-{
-       public abstract class DbTransaction : MarshalByRefObject, IDbTransaction, IDisposable
-       {
-               #region Constructors
-
-               protected DbTransaction ()
-               {
-               }
-
-               #endregion // Constructors
-
-               #region Properties
-
-               public DbConnection Connection {
-                       get { return DbConnection; }
-               }
-
-               protected abstract DbConnection DbConnection {
-                       get;
-               }
-
-               IDbConnection IDbTransaction.Connection {
-                       get { return (IDbConnection) Connection; }
-               }
-
-               public abstract IsolationLevel IsolationLevel {
-                       get;
-               }
-
-               #endregion // Properties
-
-               #region Methods
-
-               public abstract void Commit ();
-
-               public abstract void Rollback ();
-
-               public void Dispose ()
-               {
-                       Dispose (true);
-               }
-
-               protected virtual void Dispose (bool disposing)
-               {
-               }
-
-               #endregion // Methods
-       }
-}
-
diff --git a/mcs/class/System.Data/System.Data.Common/GroupByBehavior.cs b/mcs/class/System.Data/System.Data.Common/GroupByBehavior.cs
deleted file mode 100644 (file)
index 75269a8..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-//
-// System.Data.Common.GroupByBehavior.cs
-//
-// Author:
-//   Tim Coleman (tim@timcoleman.com)
-//
-// Copyright (C) Tim Coleman, 2003
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-namespace System.Data.Common {
-       public enum GroupByBehavior 
-       {
-               ExactMatch = 4,
-               MustContainAll = 3,
-               NotSupported = 1,
-               Unknown = 0,
-               Unrelated = 2
-       }
-}
-
diff --git a/mcs/class/System.Data/System.Data.Common/IdentifierCase.cs b/mcs/class/System.Data/System.Data.Common/IdentifierCase.cs
deleted file mode 100644 (file)
index 3d15fc6..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-//
-// System.Data.Common.IdentifierCase.cs
-//
-// Author:
-//   Tim Coleman (tim@timcoleman.com)
-//
-// Copyright (C) Tim Coleman, 2003
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-namespace System.Data.Common {
-       public enum IdentifierCase 
-       {
-               Insensitive = 1,
-               Sensitive = 2,
-               Unknown = 0
-       }
-}
-
diff --git a/mcs/class/System.Data/System.Data.Common/Index.cs b/mcs/class/System.Data/System.Data.Common/Index.cs
deleted file mode 100644 (file)
index 1c57d4e..0000000
+++ /dev/null
@@ -1,643 +0,0 @@
-//\r
-// System.Data.Common.Key.cs\r
-//\r
-// Author:\r
-//   Boris Kirzner  <borisk@mainsoft.com>\r
-//   Konstantin Triger (kostat@mainsoft.com)\r
-//\r
-\r
-/*\r
-  * Copyright (c) 2002-2004 Mainsoft Corporation.\r
-  *\r
-  * Permission is hereby granted, free of charge, to any person obtaining a\r
-  * copy of this software and associated documentation files (the "Software"),\r
-  * to deal in the Software without restriction, including without limitation\r
-  * the rights to use, copy, modify, merge, publish, distribute, sublicense,\r
-  * and/or sell copies of the Software, and to permit persons to whom the\r
-  * Software is furnished to do so, subject to the following conditions:\r
-  *\r
-  * The above copyright notice and this permission notice shall be included in\r
-  * all copies or substantial portions of the Software.\r
-  *\r
-  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
-  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
-  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
-  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
-  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\r
-  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\r
-  * DEALINGS IN THE SOFTWARE.\r
-  */\r
-\r
-using System;\r
-using System.Collections;\r
-\r
-using System.Text;\r
-\r
-namespace System.Data.Common\r
-{\r
-       /// <summary>\r
-       /// Summary description for Index.\r
-       /// </summary>\r
-       internal class Index {\r
-               #region Fields\r
-\r
-               static readonly int [] empty = new int [0];\r
-\r
-               int [] _array;\r
-               int _size;\r
-               Key _key;\r
-               int _refCount;\r
-\r
-               // Implement a tri-state, with the property that 'know_no_duplicates' has meaning only when '!know_have_duplicates'\r
-               bool know_have_duplicates, know_no_duplicates;\r
-\r
-               #endregion // Fields\r
-\r
-               #region Constructors\r
-\r
-               internal Index (Key key)\r
-               {\r
-                       _key = key;\r
-                       Reset ();\r
-               }\r
-\r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               internal Key Key {\r
-                       get { return _key; }\r
-               }\r
-\r
-               internal int Size {\r
-                       get { return _size; }\r
-               }\r
-\r
-               internal int RefCount {\r
-                       get { return _refCount; }\r
-               }\r
-\r
-               internal int IndexToRecord (int index)\r
-               {\r
-                       return index < 0 ? index : _array [index];\r
-               }\r
-\r
-               internal bool HasDuplicates {\r
-                       get {\r
-                               if (!know_have_duplicates && !know_no_duplicates) {\r
-                                       for (int i = 0; i < _size - 1; i++) {\r
-                                               if (Key.CompareRecords (_array [i], _array [i + 1]) == 0) {\r
-                                                       know_have_duplicates = true;\r
-                                                       break;\r
-                                               }\r
-                                       }\r
-                                       know_no_duplicates = !know_have_duplicates;\r
-                               }\r
-                               return know_have_duplicates;\r
-                       }\r
-               }\r
-\r
-               #endregion // Properties\r
-\r
-               #region Methods\r
-\r
-               internal int [] Duplicates {\r
-                       get {\r
-                               if (!HasDuplicates)\r
-                                       return null;\r
-\r
-                               ArrayList dups = new ArrayList ();\r
-\r
-                               bool inRange = false;\r
-                               for (int i = 0; i < _size - 1; i++) {\r
-                                       if (Key.CompareRecords (_array [i], _array [i + 1]) == 0) {\r
-                                               if (!inRange) {\r
-                                                       dups.Add (_array [i]);\r
-                                                       inRange = true;\r
-                                               }\r
-\r
-                                               dups.Add (_array [i + 1]);\r
-                                       } else {\r
-                                               inRange = false;\r
-                                       }\r
-                               }\r
-\r
-                               return (int []) dups.ToArray (typeof (int));\r
-                       }\r
-               }\r
-\r
-               internal int [] GetAll ()\r
-               {\r
-                       return _array;\r
-               }\r
-\r
-               internal DataRow [] GetAllRows ()\r
-               {\r
-                       DataRow [] list = new DataRow [_size];\r
-                       for (int i = 0; i < _size; ++i)\r
-                               list [i] = Key.Table.RecordCache [_array [i]];\r
-                       return list;\r
-               }\r
-\r
-               internal DataRow [] GetDistinctRows ()\r
-               {\r
-                       ArrayList list = new ArrayList ();\r
-                       list.Add (Key.Table.RecordCache [_array [0]]);\r
-                       int currRecord = _array [0];\r
-                       for (int i = 1; i <  _size; ++i) {\r
-                               if (Key.CompareRecords (currRecord, _array [i]) == 0)\r
-                                       continue;\r
-                               list.Add (Key.Table.RecordCache [_array [i]]);\r
-                               currRecord = _array [i];\r
-                       }\r
-                       return (DataRow []) list.ToArray (typeof (DataRow));\r
-               }\r
-\r
-               internal void Reset ()\r
-               {\r
-                       _array = empty;\r
-                       _size = 0;\r
-                       RebuildIndex ();\r
-               }\r
-\r
-               private void RebuildIndex ()\r
-               {\r
-                       int rows_upperbound = Key.Table.RecordCache.CurrentCapacity;\r
-\r
-                       if (rows_upperbound == 0)\r
-                               return;\r
-\r
-                       // consider better capacity approximation\r
-                       _array = new int [rows_upperbound];\r
-                       _size = 0;\r
-                       foreach (DataRow row in Key.Table.Rows) {\r
-                               int record = Key.GetRecord (row);\r
-                               if (record != -1)\r
-                                       _array [_size++] = record;\r
-                       }\r
-                       know_have_duplicates = know_no_duplicates = false;\r
-                       Sort ();\r
-                       know_no_duplicates = !know_have_duplicates;\r
-               }\r
-\r
-               private void Sort ()\r
-               {\r
-                       //QuickSort(_array,0,_size-1);\r
-                       MergeSort (_array, _size);\r
-               }\r
-\r
-               /*\r
-                * Returns record number of the record equal to the key values supplied\r
-                * in the meaning of index key, or -1 if no equal record found.\r
-                */\r
-               internal int Find (object [] keys)\r
-               {\r
-                       int index = FindIndex (keys);\r
-                       return IndexToRecord (index);\r
-               }\r
-\r
-               /*\r
-                * Returns record index (location) of the record equal to the key values supplied\r
-                * in the meaning of index key, or -1 if no equal record found.\r
-                */\r
-               internal int FindIndex (object [] keys)\r
-               {\r
-                       if (keys == null || keys.Length != Key.Columns.Length)\r
-                               throw new ArgumentException("Expecting " + Key.Columns.Length + " value(s) for the key being indexed, " +\r
-                                       "but received " + ((keys == null) ? 0 : keys.Length) + " value(s).");\r
-\r
-                       int tmp = Key.Table.RecordCache.NewRecord ();\r
-                       try {\r
-                               // init key values for temporal record\r
-                               for (int i = 0; i < Key.Columns.Length; i++)\r
-                                       Key.Columns [i].DataContainer [tmp] = keys [i];\r
-                               return FindIndex (tmp);\r
-                       } finally {\r
-                               Key.Table.RecordCache.DisposeRecord (tmp);\r
-                       }\r
-               }\r
-\r
-               /*\r
-                * Returns record number of the record equal to the record supplied\r
-                * in the meaning of index key, or -1 if no equal record found.\r
-                */\r
-               internal int Find (int record)\r
-               {\r
-                       int index = FindIndex (record);\r
-                       return IndexToRecord (index);\r
-               }\r
-\r
-               /*\r
-                * Returns array of record numbers of the records equal equal to the key values supplied\r
-                * in the meaning of index key, or -1 if no equal record found.\r
-                */\r
-               internal int [] FindAll (object [] keys)\r
-               {\r
-                       int [] indexes = FindAllIndexes (keys);\r
-                       IndexesToRecords (indexes);\r
-                       return indexes;\r
-               }\r
-\r
-               /*\r
-                * Returns array of indexes of the records inside the index equal equal to the key values supplied\r
-                * in the meaning of index key, or -1 if no equal record found.\r
-                */\r
-               internal int [] FindAllIndexes (object [] keys)\r
-               {\r
-                       if (keys == null || keys.Length != Key.Columns.Length)\r
-                               throw new ArgumentException("Expecting " + Key.Columns.Length + " value(s) for the key being indexed," +\r
-                                       "but received " + ((keys == null) ? 0 : keys.Length) + " value(s).");\r
-\r
-                       int tmp = Key.Table.RecordCache.NewRecord ();\r
-                       try {\r
-                               // init key values for temporal record\r
-                               for (int i = 0; i < Key.Columns.Length; i++)\r
-                                       Key.Columns [i].DataContainer [tmp] = keys [i];\r
-                               return FindAllIndexes (tmp);\r
-                       } catch (FormatException) {\r
-                               return empty;\r
-                       } catch (InvalidCastException) {\r
-                               return empty;\r
-                       } finally {\r
-                               Key.Table.RecordCache.DisposeRecord (tmp);\r
-                       }\r
-               }\r
-\r
-               /*\r
-                * Returns array of record numbers of the records equal to the record supplied\r
-                * in the meaning of index key, or empty list if no equal records found.\r
-                */\r
-               internal int [] FindAll (int record)\r
-               {\r
-                       int [] indexes = FindAllIndexes (record);\r
-                       IndexesToRecords (indexes);\r
-                       return indexes;\r
-               }\r
-\r
-               /*\r
-                * Returns array of indexes of the records inside the index that equal to the record supplied\r
-                * in the meaning of index key, or empty list if no equal records found.\r
-                */\r
-               internal int [] FindAllIndexes (int record)\r
-               {\r
-                       int index = FindIndex (record);\r
-                       if (index == -1)\r
-                               return empty;\r
-\r
-                       int startIndex = index++;\r
-                       int endIndex = index;\r
-\r
-                       for (; startIndex >= 0 && Key.CompareRecords (_array [startIndex], record) == 0; startIndex--) {\r
-                       }\r
-                       for (; endIndex < _size && Key.CompareRecords (_array [endIndex], record) == 0; endIndex++) {\r
-                       }\r
-\r
-                       int length = endIndex - startIndex - 1;\r
-                       int [] indexes = new int [length];\r
-\r
-                       for (int i = 0; i < length; i++)\r
-                               indexes [i] = ++startIndex;\r
-\r
-                       return indexes;\r
-               }\r
-\r
-               /*\r
-                * Returns index inside the array where record number of the record equal to the record supplied\r
-                * in the meaning of index key is sored, or -1 if no equal record found.\r
-                */\r
-               private int FindIndex (int record)\r
-               {\r
-                       if (_size == 0)\r
-                               return -1;\r
-                       return BinarySearch (_array, 0, _size - 1, record);\r
-               }\r
-\r
-               /*\r
-                * Finds exact location of the record specified\r
-                */\r
-               private int FindIndexExact (int record)\r
-               {\r
-                       for (int i = 0, size = _size; i < size; i++)\r
-                               if (_array [i] == record)\r
-                                       return i;\r
-                       return -1;\r
-               }\r
-\r
-               /*\r
-                * Returns array of records from the indexes (locations) inside the index\r
-                */\r
-               private void IndexesToRecords (int [] indexes)\r
-               {\r
-                       for (int i = 0; i < indexes.Length; i++)\r
-                               indexes [i] = _array [indexes [i]];\r
-               }\r
-\r
-               internal void Delete (DataRow row)\r
-               {\r
-                       int oldRecord = Key.GetRecord (row);\r
-                       Delete (oldRecord);\r
-               }\r
-\r
-               internal void Delete (int oldRecord)\r
-               {\r
-                       if (oldRecord == -1)\r
-                               return;\r
-\r
-                       int index = FindIndexExact (oldRecord);\r
-                       if (index != -1) {\r
-                               if (know_have_duplicates) {\r
-                                       int c1 = 1;\r
-                                       int c2 = 1;\r
-\r
-                                       if (index > 0)\r
-                                               c1 = Key.CompareRecords (_array [index - 1], oldRecord);\r
-                                       if (index < _size - 1)\r
-                                               c2 = Key.CompareRecords (_array [index + 1], oldRecord);\r
-\r
-                                       if (c1 == 0 ^ c2 == 0)\r
-                                               know_have_duplicates = know_no_duplicates = false;\r
-                               }\r
-                               Remove (index);\r
-                       }\r
-               }\r
-\r
-               private void Remove (int index)\r
-               {\r
-                       if (_size > 1)\r
-                               System.Array.Copy (_array, index + 1, _array, index, _size - index - 1);\r
-                       _size--;\r
-               }\r
-\r
-               internal void Update (DataRow row, int oldRecord, DataRowVersion oldVersion, DataRowState oldState)\r
-               {\r
-                       bool contains = Key.ContainsVersion (oldState, oldVersion);\r
-                       int newRecord = Key.GetRecord (row);\r
-                       // the record did not appeared in the index before update\r
-                       if (oldRecord == -1 || _size == 0 || !contains) {\r
-                               if (newRecord >= 0)\r
-                                       if (FindIndexExact (newRecord) < 0)\r
-                                               Add (row,newRecord);\r
-                               return;\r
-                       }\r
-\r
-                       // the record will not appeare in the index after update\r
-                       if (newRecord < 0 || !Key.CanContain (newRecord)) {\r
-                               Delete (oldRecord);\r
-                               return;\r
-                       }\r
-\r
-                       int oldIdx = FindIndexExact (oldRecord);\r
-                       if (oldIdx == -1) {\r
-                               Add (row, newRecord);\r
-                               return;\r
-                       }\r
-\r
-                       int newIdx = -1;\r
-                       int compare = Key.CompareRecords (_array [oldIdx], newRecord);\r
-                       int start, end;\r
-\r
-                       int c1 = 1;\r
-                       int c2 = 1;\r
-\r
-                       if (compare == 0) {\r
-                               if (_array [oldIdx] == newRecord) {\r
-                                       // we deal with the same record that didn't change\r
-                                       // in the context of current index.\r
-                                       // so , do nothing.\r
-                                       return;\r
-                               }\r
-                       } else {\r
-                               if (know_have_duplicates) {\r
-                                       if (oldIdx > 0)\r
-                                               c1 = Key.CompareRecords (_array [oldIdx - 1], newRecord);\r
-                                       if (oldIdx < _size - 1)\r
-                                               c2 = Key.CompareRecords (_array [oldIdx + 1], newRecord);\r
-\r
-                                       if ((c1 == 0 ^ c2 == 0) && compare != 0)\r
-                                               know_have_duplicates = know_no_duplicates = false;\r
-                               }\r
-                       }\r
-\r
-                       if ((oldIdx == 0 && compare > 0) || (oldIdx == (_size - 1) && compare < 0) || (compare == 0)) {\r
-                               // no need to switch cells\r
-                               newIdx = oldIdx;\r
-                       } else {\r
-                               if (compare < 0) {\r
-                                       // search after the old place\r
-                                       start = oldIdx + 1;\r
-                                       end = _size - 1;\r
-                               } else {\r
-                                       // search before the old palce\r
-                                       start = 0;\r
-                                       end = oldIdx - 1;\r
-                               }\r
-\r
-                               newIdx = LazyBinarySearch (_array, start, end, newRecord);\r
-\r
-                               if (oldIdx < newIdx) {\r
-                                       System.Array.Copy (_array, oldIdx + 1, _array, oldIdx, newIdx - oldIdx);\r
-                                       if (Key.CompareRecords (_array [newIdx], newRecord) > 0)\r
-                                               --newIdx;\r
-                               } else if (oldIdx > newIdx){\r
-                                       System.Array.Copy (_array, newIdx, _array, newIdx + 1, oldIdx - newIdx);\r
-                                       if (Key.CompareRecords (_array [newIdx], newRecord) < 0)\r
-                                               ++newIdx;\r
-                               }\r
-                       }\r
-                       _array[newIdx] = newRecord;\r
-\r
-                       if (compare != 0) {\r
-                               if (!know_have_duplicates) {\r
-                                       if (newIdx > 0)\r
-                                               c1 = Key.CompareRecords (_array [newIdx - 1], newRecord);\r
-                                       if (newIdx < _size - 1)\r
-                                               c2 = Key.CompareRecords (_array [newIdx + 1], newRecord);\r
-\r
-                                       if (c1 == 0 || c2 == 0)\r
-                                               know_have_duplicates = true;\r
-                               }\r
-                       }\r
-               }\r
-\r
-               internal void Add (DataRow row)\r
-               {\r
-                       Add(row, Key.GetRecord (row));\r
-               }\r
-\r
-               private void Add (DataRow row, int newRecord)\r
-               {\r
-                       int newIdx;\r
-\r
-                       if (newRecord < 0 || !Key.CanContain (newRecord))\r
-                               return;\r
-\r
-                       if (_size == 0) {\r
-                               newIdx = 0;\r
-                       } else {\r
-                               newIdx = LazyBinarySearch (_array, 0, _size - 1, newRecord);\r
-                               // if newl value is greater - insert afer old value\r
-                               // else - insert before old value\r
-                               if (Key.CompareRecords (_array [newIdx], newRecord) < 0)\r
-                                       newIdx++;\r
-                       }\r
-\r
-                       Insert (newIdx, newRecord);\r
-\r
-                       int c1 = 1;\r
-                       int c2 = 1;\r
-                       if (!know_have_duplicates) {\r
-                               if (newIdx > 0)\r
-                                       c1 = Key.CompareRecords (_array [newIdx - 1], newRecord);\r
-                               if (newIdx < _size - 1)\r
-                                       c2 = Key.CompareRecords (_array [newIdx + 1], newRecord);\r
-\r
-                               if (c1 == 0 || c2 == 0)\r
-                                       know_have_duplicates = true;\r
-                       }\r
-               }\r
-\r
-               private void Insert (int index, int r)\r
-               {\r
-                       if (_array.Length == _size) {\r
-                               int [] tmp = (_size == 0) ? new int [16] : new int [_size << 1];\r
-                               System.Array.Copy (_array, 0, tmp, 0, index);\r
-                               tmp [index] = r;\r
-                               System.Array.Copy (_array, index, tmp, index + 1, _size - index);\r
-                               _array = tmp;\r
-                       } else {\r
-                               System.Array.Copy (_array, index, _array, index + 1, _size - index);\r
-                               _array [index] = r;\r
-                       }\r
-                       _size++;\r
-               }\r
-\r
-               private void MergeSort (int [] to, int length)\r
-               {\r
-                       int [] from = new int [length];\r
-                       System.Array.Copy (to, 0, from, 0, from.Length);\r
-                       MergeSort (from, to, 0, from.Length);\r
-               }\r
-\r
-               private void MergeSort (int [] from, int [] to, int p, int r)\r
-               {\r
-                       int q = (p + r) >> 1;\r
-                       if (q == p)\r
-                               return;\r
-\r
-                       MergeSort (to, from, p, q);\r
-                       MergeSort (to, from, q, r);\r
-\r
-                       // merge\r
-                       for (int middle = q, current = p;;) {\r
-                               int res = Key.CompareRecords (from[p], from[q]);\r
-                               if (res > 0) {\r
-                                       to [current++] = from [q++];\r
-\r
-                                       if (q == r) {\r
-                                               while (p < middle)\r
-                                                       to [current++] = from [p++];\r
-                                               break;\r
-                                       }\r
-                               } else {\r
-                                       if (res == 0)\r
-                                               know_have_duplicates = true;\r
-\r
-                                       to [current++] = from [p++];\r
-\r
-                                       if (p == middle) {\r
-                                               while (q < r)\r
-                                                       to [current++] = from [q++];\r
-                                               break;\r
-                                       }\r
-                               }\r
-                       }\r
-               }\r
-\r
-               private void QuickSort (int [] a, int p, int r)\r
-               {\r
-                       if (p < r) {\r
-                               int q = Partition (a, p, r);\r
-                               QuickSort (a, p, q);\r
-                               QuickSort (a, q + 1, r);\r
-                       }\r
-               }\r
-\r
-               private int Partition (int [] a, int p, int r)\r
-               {\r
-                       int x = a [p];\r
-                       int i = p - 1;\r
-                       int j = r + 1;\r
-\r
-                       while (true) {\r
-                               // decrement upper limit while values are greater then border value\r
-                               do {\r
-                                       j--;\r
-                               } while (Key.CompareRecords (a [j], x) > 0);\r
-\r
-                               do {\r
-                                       i++;\r
-                               } while (Key.CompareRecords (a [i], x) < 0);\r
-\r
-                               if (i < j) {\r
-                                       int tmp = a [j];\r
-                                       a [j] = a [i];\r
-                                       a [i] = tmp;\r
-                               } else {\r
-                                       return j;\r
-                               }\r
-                       }\r
-               }\r
-\r
-               private int BinarySearch (int [] a, int p, int r, int b)\r
-               {\r
-                       int i = LazyBinarySearch (a, p, r, b);\r
-                       return (Key.CompareRecords (a [i], b) == 0) ? i : -1;\r
-               }\r
-\r
-               // Lazy binary search only returns the cell number the search finished in,\r
-               // but does not checks that the correct value was actually found\r
-               private int LazyBinarySearch (int [] a, int p, int r, int b)\r
-               {\r
-                       if (p == r)\r
-                               return p;\r
-\r
-                       int q = (p + r) >> 1;\r
-\r
-                       int compare = Key.CompareRecords (a [q], b);\r
-                       if (compare < 0)\r
-                               return LazyBinarySearch (a, q + 1, r, b);\r
-                       else if (compare > 0)\r
-                               return LazyBinarySearch (a, p, q, b);\r
-                       else\r
-                               return q;\r
-               }\r
-\r
-               internal void AddRef ()\r
-               {\r
-                       _refCount++;\r
-               }\r
-\r
-               internal void RemoveRef ()\r
-               {\r
-                       _refCount--;\r
-               }\r
-\r
-               /*\r
-               // Prints indexes. For debugging.\r
-               internal void Print ()\r
-               {\r
-                       for (int i=0; i < _size; i++) {\r
-                               Console.Write ("Index {0} record {1}: ", i, _array [i]);\r
-                               for (int j=0; j < Key.Table.Columns.Count; j++) {\r
-                                       DataColumn col = Key.Table.Columns [j];\r
-                                       if (_array [i] >= 0)\r
-                                               Console.Write ("{0,15} ", col [_array [i]]);\r
-                               }\r
-                               Console.WriteLine ();\r
-                       }\r
-               }\r
-               */\r
-\r
-               #endregion // Methods\r
-       }\r
-}\r
diff --git a/mcs/class/System.Data/System.Data.Common/Key.cs b/mcs/class/System.Data/System.Data.Common/Key.cs
deleted file mode 100644 (file)
index a41dd79..0000000
+++ /dev/null
@@ -1,276 +0,0 @@
-//\r
-// System.Data.Common.Key.cs\r
-//\r
-// Author:\r
-//   Boris Kirzner  <borisk@mainsoft.com>\r
-//   Konstantin Triger (kostat@mainsoft.com)\r
-//\r
-\r
-/*\r
-  * Copyright (c) 2002-2004 Mainsoft Corporation.\r
-  *\r
-  * Permission is hereby granted, free of charge, to any person obtaining a\r
-  * copy of this software and associated documentation files (the "Software"),\r
-  * to deal in the Software without restriction, including without limitation\r
-  * the rights to use, copy, modify, merge, publish, distribute, sublicense,\r
-  * and/or sell copies of the Software, and to permit persons to whom the\r
-  * Software is furnished to do so, subject to the following conditions:\r
-  *\r
-  * The above copyright notice and this permission notice shall be included in\r
-  * all copies or substantial portions of the Software.\r
-  *\r
-  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
-  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
-  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
-  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
-  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\r
-  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\r
-  * DEALINGS IN THE SOFTWARE.\r
-  */\r
-\r
-using System;\r
-using Mono.Data.SqlExpressions;\r
-using System.ComponentModel;\r
-\r
-namespace System.Data.Common\r
-{\r
-       internal class Key\r
-       {\r
-               #region Fields\r
-\r
-               DataTable _table;\r
-               DataColumn[] _columns;\r
-               ListSortDirection[] _sortDirection;\r
-               DataViewRowState _rowStateFilter;\r
-               IExpression _filter;\r
-               //Currently IExpression.Eval does not receive DataRowVersion\r
-               //      and always uses the _current version\r
-               //so need a temp row for Eval calls\r
-               DataRow _tmpRow;\r
-\r
-               #endregion //Fields\r
-\r
-               #region Constructors\r
-\r
-               internal Key(DataTable table,DataColumn[] columns,ListSortDirection[] sort, DataViewRowState rowState, IExpression filter)\r
-               {\r
-                       _table = table;\r
-                       _filter = filter;\r
-                       if (_filter != null)\r
-                               _tmpRow = _table.NewNotInitializedRow();\r
-                       _columns = columns;\r
-                       if (sort != null && sort.Length == columns.Length) {\r
-                               _sortDirection = sort;\r
-                       }\r
-                       else {\r
-                               _sortDirection = new ListSortDirection[columns.Length];\r
-                               for(int i=0; i < _sortDirection.Length; i++) {\r
-                                       _sortDirection[i] = ListSortDirection.Ascending;\r
-                               }\r
-                       }\r
-\r
-                       if (rowState != DataViewRowState.None)\r
-                               _rowStateFilter = rowState;\r
-                       else\r
-                               // FIXME : what is the correct value ?\r
-                               _rowStateFilter = DataViewRowState.CurrentRows;\r
-               }\r
-\r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               internal DataColumn[] Columns\r
-               {\r
-                       get {\r
-                               return _columns;\r
-                       }\r
-               }\r
-\r
-               internal DataTable Table\r
-               {\r
-                       get {\r
-                               return _table;\r
-                       }\r
-               }\r
-\r
-               ListSortDirection[] Sort \r
-               {\r
-                       get {\r
-                               return _sortDirection;\r
-                       }\r
-               }\r
-\r
-               internal DataViewRowState RowStateFilter\r
-               {\r
-                       get {\r
-                               return _rowStateFilter;\r
-                       }\r
-\r
-                       set {\r
-                               _rowStateFilter = value;\r
-                       }\r
-               }\r
-\r
-               internal bool HasFilter\r
-               {\r
-                       get { return _filter != null; }\r
-               }\r
-\r
-               #endregion // Properties\r
-\r
-               #region Methods\r
-\r
-               internal int CompareRecords(int first, int second)\r
-               {\r
-                       if (first == second) {\r
-                               return 0;\r
-                       }\r
-\r
-                       for(int i = 0; i < Columns.Length; i++) {\r
-\r
-                               int res = Columns[i].CompareValues(first,second);\r
-\r
-                               if (res == 0) {\r
-                                       continue;\r
-                               }\r
-\r
-                               return (Sort[i] == ListSortDirection.Ascending) ? res : -res;\r
-                       }\r
-                       return 0;\r
-               }\r
-\r
-               internal int GetRecord(DataRow row)\r
-               {\r
-                       int index = Key.GetRecord(row,_rowStateFilter);\r
-                       if (_filter == null)\r
-                               return index;\r
-\r
-                       if (index < 0)\r
-                               return index;\r
-\r
-                       return CanContain (index) ? index : -1;\r
-               }\r
-\r
-               internal bool CanContain (int index)\r
-               {\r
-                       if (_filter == null)\r
-                               return true;\r
-\r
-                       _tmpRow._current = index;\r
-                       return _filter.EvalBoolean(_tmpRow);\r
-               }\r
-\r
-               internal bool ContainsVersion (DataRowState state, DataRowVersion version)\r
-               {\r
-                       switch (state) {\r
-                               case DataRowState.Unchanged:\r
-                                       if ((_rowStateFilter & DataViewRowState.Unchanged) != DataViewRowState.None)\r
-                                               return ((version & DataRowVersion.Default) != 0);\r
-                                       break;\r
-                               case DataRowState.Added:\r
-                                       if ((_rowStateFilter & DataViewRowState.Added) != DataViewRowState.None)\r
-                                               return ((version & DataRowVersion.Default) != 0);\r
-                                       break;\r
-                               case DataRowState.Deleted:\r
-                                       if ((_rowStateFilter & DataViewRowState.Deleted) != DataViewRowState.None)\r
-                                               return (version == DataRowVersion.Original);\r
-                                       break;\r
-                               default:\r
-                                       if ((_rowStateFilter & DataViewRowState.ModifiedCurrent) != DataViewRowState.None)\r
-                                               return ((version & DataRowVersion.Default) != 0);\r
-                                       if ((_rowStateFilter & DataViewRowState.ModifiedOriginal) != DataViewRowState.None)\r
-                                               return (version == DataRowVersion.Original);\r
-                                       break;\r
-                       }\r
-\r
-                       return false;\r
-               }\r
-\r
-               internal static int GetRecord(DataRow row, DataViewRowState rowStateFilter)\r
-               {\r
-                       switch (row.RowState) {\r
-                               case DataRowState.Unchanged: {\r
-                                       if ((rowStateFilter & DataViewRowState.Unchanged) != DataViewRowState.None)\r
-                                               return row.Proposed >= 0 ? row.Proposed : row.Current;\r
-                                       break;\r
-                               }\r
-                               case DataRowState.Added: {\r
-                                       if ((rowStateFilter & DataViewRowState.Added) != DataViewRowState.None)\r
-                                               return row.Proposed >= 0 ? row.Proposed : row.Current;\r
-                                       break;\r
-                               }\r
-                               case DataRowState.Deleted: {\r
-                                       if ((rowStateFilter & DataViewRowState.Deleted) != DataViewRowState.None)\r
-                                               return row.Original;\r
-                                       break;\r
-                               }\r
-                               default:\r
-                                       if ((rowStateFilter & DataViewRowState.ModifiedCurrent) != DataViewRowState.None)\r
-                                               return row.Proposed >= 0 ? row.Proposed : row.Current;\r
-                                       if ((rowStateFilter & DataViewRowState.ModifiedOriginal) != DataViewRowState.None)\r
-                                               return row.Original;\r
-                                       break;\r
-                       }\r
-\r
-                       return -1;\r
-               }\r
-\r
-               /// <summary>\r
-               /// Checks for key equality to parameters set given\r
-               /// </summary>\r
-               /// <param name="columns">Columns the key consits of. If this parameter is null, it does not affects equality check</param>\r
-               /// <param name="sort">Sort order of columns. If this parameter is null, it does not affects equality check</param>\r
-               /// <param name="rowState">DataViewRowState to check for.If this parameter is null, it does not affects equality check</param>\r
-               /// <param name="unique">Indicates whenever the index managed by this key allows non-uniqie keys to appear.</param>\r
-               /// <param name="strict">Indicates whenever unique parameter should affect the equality check.</param>\r
-               /// <returns></returns>\r
-               internal bool Equals(DataColumn[] columns, ListSortDirection[] sort, DataViewRowState rowState, IExpression filter) \r
-               {\r
-                       if (rowState != DataViewRowState.None && RowStateFilter != rowState) {\r
-                               return false;\r
-                       }\r
-\r
-                       if (_filter != null) {\r
-                               if (!_filter.Equals (filter))\r
-                                       return false;\r
-                       }\r
-                       else if (filter != null)\r
-                                       return false;\r
-\r
-                       if (Columns.Length != columns.Length) {\r
-                               return false;\r
-                       }\r
-\r
-                       if (sort != null && Sort.Length != sort.Length) {\r
-                               return false;\r
-                       }\r
-\r
-                       if (sort != null) {\r
-                               for(int i=0; i < columns.Length; i++) {\r
-                                       if (Sort[i] != sort[i] || Columns[i] != columns[i]) {\r
-                                               return false;\r
-                                       }\r
-                               }\r
-                       }\r
-                       else {\r
-                               for(int i=0; i < columns.Length; i++) {\r
-                                       if (Sort [i] != ListSortDirection.Ascending || Columns[i] != columns[i]) {\r
-                                               return false;\r
-                                       }\r
-                               }\r
-                       }\r
-                       return true;\r
-               }\r
-\r
-               internal bool DependsOn (DataColumn column)\r
-               {\r
-                       if (_filter == null)\r
-                               return false;\r
-\r
-                       return _filter.DependsOn (column);\r
-               }\r
-\r
-               #endregion // Methods\r
-       }\r
-}\r
diff --git a/mcs/class/System.Data/System.Data.Common/PermissionHelper.cs b/mcs/class/System.Data/System.Data.Common/PermissionHelper.cs
deleted file mode 100644 (file)
index e2e5c08..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-//
-// System.Data.Common.PermissionHelper.cs
-//
-// Author:
-//     Sebastien Pouliot  <sebastien@ximian.com>
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Globalization;
-using System.Security;
-using System.Security.Permissions;
-
-namespace System.Data.Common {
-
-       // NOTE: This version of PermissionHelper was customized for System.Data
-
-       internal sealed class PermissionHelper {
-
-               // snippet moved from FileIOPermission (nickd) to be reused in all derived classes
-               internal static SecurityElement Element (Type type, int version) 
-               {
-                       SecurityElement se = new SecurityElement ("IPermission");
-                       se.AddAttribute ("class", type.FullName + ", " + type.Assembly.ToString ().Replace ('\"', '\''));
-                       se.AddAttribute ("version", version.ToString ());
-                       return se;
-               }
-
-               internal static PermissionState CheckPermissionState (PermissionState state, bool allowUnrestricted)
-               {
-                       string msg;
-                       switch (state) {
-                       case PermissionState.None:
-                               break;
-                       case PermissionState.Unrestricted:
-                               if (!allowUnrestricted) {
-                                       msg = Locale.GetText ("Unrestricted isn't not allowed for identity permissions.");
-                                       throw new ArgumentException (msg, "state");
-                               }
-                               break;
-                       default:
-                               msg = String.Format (Locale.GetText ("Invalid enum {0}"), state);
-                               throw new ArgumentOutOfRangeException (msg, "state");
-                       }
-                       return state;
-               }
-
-               internal static int CheckSecurityElement (SecurityElement se, string parameterName, int minimumVersion, int maximumVersion) 
-               {
-                       if (se == null)
-                               throw new ArgumentNullException (parameterName);
-
-                       if (se.Tag != "IPermission") {
-                               string msg = Locale.GetText ("Invalid tag '{0}' expected 'IPermission'.");
-                               throw new ArgumentException (String.Format (msg, se.Tag), parameterName);
-                       }
-
-                       // we assume minimum version if no version number is supplied
-                       int version = minimumVersion;
-                       string v = se.Attribute ("version");
-                       if (v != null) {
-                               try {
-                                       version = Int32.Parse (v);
-                               }
-                               catch (Exception e) {
-                                       string msg = Locale.GetText ("Couldn't parse version from '{0}'.");
-                                       msg = String.Format (msg, v);
-                                       throw new ArgumentException (msg, parameterName, e);
-                               }
-                       }
-
-                       if ((version < minimumVersion) || (version > maximumVersion)) {
-                               string msg = Locale.GetText ("Unknown version '{0}', expected versions between ['{1}','{2}'].");
-                               msg = String.Format (msg, version, minimumVersion, maximumVersion);
-                               throw new ArgumentException (msg, parameterName);
-                       }
-                       return version;
-               }
-
-               // must be called after CheckSecurityElement (i.e. se != null)
-               internal static bool IsUnrestricted (SecurityElement se) 
-               {
-                       string value = se.Attribute ("Unrestricted");
-                       if (value == null)
-                               return false;
-                       return (String.Compare (value, Boolean.TrueString, true, CultureInfo.InvariantCulture) == 0);
-               }
-
-               internal static void ThrowInvalidPermission (IPermission target, Type expected) 
-               {
-                       string msg = Locale.GetText ("Invalid permission type '{0}', expected type '{1}'.");
-                       msg = String.Format (msg, target.GetType (), expected);
-                       throw new ArgumentException (msg, "target");
-               }
-       }
-}
diff --git a/mcs/class/System.Data/System.Data.Common/RecordCache.cs b/mcs/class/System.Data/System.Data.Common/RecordCache.cs
deleted file mode 100644 (file)
index f7ce6fb..0000000
+++ /dev/null
@@ -1,148 +0,0 @@
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.Collections;
-
-namespace System.Data.Common
-{
-       internal class RecordCache {
-               #region Fields
-
-               const int MIN_CACHE_SIZE = 128;
-
-               Stack _records = new Stack (16);
-               int _nextFreeIndex = 0;
-               int _currentCapacity = 0;
-               DataTable _table;
-               DataRow [] _rowsToRecords;
-
-               #endregion // Fields
-
-               #region Constructors
-
-               internal RecordCache (DataTable table)
-               {
-                       _table = table;
-                       _rowsToRecords = table.NewRowArray (16);
-               }
-
-               #endregion //Constructors
-
-               #region Properties
-
-               internal int CurrentCapacity {
-                       get { return _currentCapacity; }
-               }
-
-               internal DataRow this [int index] {
-                       get { return _rowsToRecords [index]; }
-                       set {
-                               if (index >= 0)
-                                       _rowsToRecords [index] = value;
-                       }
-               }
-
-               #endregion // Properties
-
-               #region Methods
-
-               internal int NewRecord ()
-               {
-                       if (_records.Count > 0)
-                               return (int) _records.Pop ();
-
-                       DataColumnCollection cols = _table.Columns;
-                       if (_nextFreeIndex >= _currentCapacity) {
-                               _currentCapacity *= 2;
-                               if (_currentCapacity < MIN_CACHE_SIZE)
-                                       _currentCapacity = MIN_CACHE_SIZE;
-
-                               for (int i = 0; i < cols.Count; ++i)
-                                       cols [i].DataContainer.Capacity = _currentCapacity;
-
-                               DataRow [] old = _rowsToRecords;
-                               _rowsToRecords = _table.NewRowArray (_currentCapacity);
-                               Array.Copy (old, 0, _rowsToRecords, 0, old.Length);
-                       }
-                       return _nextFreeIndex++;
-               }
-
-               internal void DisposeRecord (int index)
-               {
-                       if (index < 0)
-                               throw new ArgumentException ();
-
-                       if (!_records.Contains (index))
-                               _records.Push (index);
-
-                       this [index] = null;
-               }
-
-               // FIXME: This doesn't seem to be the right class to have this method
-               internal int CopyRecord (DataTable fromTable, int fromRecordIndex, int toRecordIndex)
-               {
-                       int recordIndex = toRecordIndex;
-                       if (toRecordIndex == -1)
-                               recordIndex = NewRecord ();
-
-                       try {
-                               foreach (DataColumn toColumn in _table.Columns) {
-                                       DataColumn fromColumn = fromTable.Columns [toColumn.ColumnName];
-                                       if (fromColumn != null)
-                                               toColumn.DataContainer.CopyValue (fromColumn.DataContainer, fromRecordIndex, recordIndex);
-                                       else
-                                               toColumn.DataContainer.CopyValue (_table.DefaultValuesRowIndex, recordIndex);                                   
-                               }
-                               return recordIndex;
-                       } catch {
-                               if (toRecordIndex == -1)
-                                       DisposeRecord (recordIndex);
-
-                               throw;
-                       }
-               }
-
-               // FIXME: This doesn't seem to be the right class to have this method
-               internal void ReadIDataRecord (int recordIndex, IDataRecord record, int [] mapping, int length)
-               {
-                       if (mapping.Length > _table.Columns.Count)
-                               throw new ArgumentException ();
-
-                       int i = 0;
-                       for(; i < length; i++) {
-                               DataColumn column = _table.Columns [mapping [i]];
-                               column.DataContainer.SetItemFromDataRecord (recordIndex, record, i);
-                       }
-
-                       for (; i < mapping.Length; i++) {
-                               DataColumn column = _table.Columns [mapping [i]];
-                               if (column.AutoIncrement)
-                                       column.DataContainer [recordIndex] = column.AutoIncrementValue ();
-                               else
-                                       column.DataContainer [recordIndex] = column.DefaultValue;
-                       }
-               }
-
-               #endregion // Methods
-       }
-}
diff --git a/mcs/class/System.Data/System.Data.Common/RowUpdatedEventArgs.cs b/mcs/class/System.Data/System.Data.Common/RowUpdatedEventArgs.cs
deleted file mode 100644 (file)
index 03343fa..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-//
-// System.Data.Common.RowUpdatedEventArgs.cs
-//
-// Author:
-//   Rodrigo Moya (rodrigo@ximian.com)
-//   Tim Coleman (tim@timcoleman.com)
-//
-// (C) Ximian, Inc
-// Copyright (C) Tim Coleman, 2002
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Data;
-
-namespace System.Data.Common
-{
-       public
-       class RowUpdatedEventArgs : EventArgs
-       {
-               #region Fields
-
-               DataRow dataRow;
-               IDbCommand command;
-               StatementType statementType;
-               DataTableMapping tableMapping;
-               Exception errors;
-               UpdateStatus status;
-               int recordsAffected;
-
-               #endregion // Fields
-
-               #region Constructors
-
-               public
-               RowUpdatedEventArgs (DataRow dataRow, IDbCommand command, StatementType statementType, DataTableMapping tableMapping) 
-               {
-                       this.dataRow = dataRow;
-                       this.command = command;
-                       this.statementType = statementType;
-                       this.tableMapping = tableMapping;
-                       this.status = UpdateStatus.Continue;
-               }
-
-               #endregion // Constructors
-
-               #region Properties
-               
-               public IDbCommand Command {
-                       get { return command; }
-               }
-
-               public Exception Errors {
-                       get {
-                               if (errors == null)
-                                       errors =  new DataException ("RowUpdatedEvent: No additional information is available!");
-                               return errors; 
-                       }
-                       set { errors = value; }
-               }
-
-               public int RecordsAffected {
-                       get { return recordsAffected; }
-               }
-
-               public DataRow Row {
-                       get { return dataRow; }
-               }
-
-               public StatementType StatementType {
-                       get { return statementType; }
-               }
-
-               public UpdateStatus Status {
-                       get { return status; }
-                       set { status = value; }
-               }
-
-               public DataTableMapping TableMapping {
-                       get { return tableMapping; }
-               }
-
-               public int RowCount {
-                       get { return 0; }
-               }
-
-               #endregion // Properties
-
-               #region Methods
-
-               public void CopyToRows (DataRow[] array)
-               {
-               }
-
-               public void CopyToRows (DataRow[] array, int arrayIndex)
-               {
-               }
-
-               #endregion //Methods
-       }
-}
diff --git a/mcs/class/System.Data/System.Data.Common/RowUpdatingEventArgs.cs b/mcs/class/System.Data/System.Data.Common/RowUpdatingEventArgs.cs
deleted file mode 100644 (file)
index e7d714c..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-//
-// System.Data.Common.RowUpdatingEventArgs.cs
-//
-// Author:
-//   Rodrigo Moya (rodrigo@ximian.com)
-//   Tim Coleman (tim@timcoleman.com)
-//
-// (C) Ximian, Inc
-// Copyright (C) Tim Coleman, 2002
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System.Data.Common {
-       public
-       class RowUpdatingEventArgs : EventArgs
-       {
-               #region Fields
-
-               DataRow dataRow;
-               IDbCommand command;
-               StatementType statementType;
-               DataTableMapping tableMapping;
-               UpdateStatus status;
-               Exception errors;
-               
-
-               #endregion // Fields
-
-               #region Constructors
-
-               public
-               RowUpdatingEventArgs (DataRow dataRow, IDbCommand command, StatementType statementType, DataTableMapping tableMapping) 
-               {
-                       this.dataRow = dataRow;
-                       this.command = command;
-                       this.statementType = statementType;
-                       this.tableMapping = tableMapping;
-                       this.status = UpdateStatus.Continue;
-                       this.errors = null;
-               }
-
-               #endregion // Constructors
-
-               #region Properties
-               
-               public IDbCommand Command {
-                       get { return command; }
-                       set { command = value; }
-               }
-
-               public Exception Errors {
-                       get { return errors; }
-                       set { errors = value; }
-               }
-
-               public DataRow Row {
-                       get { return dataRow; }
-               }
-
-               public StatementType StatementType {
-                       get { return statementType; }
-               }
-
-               public UpdateStatus Status {
-                       get { return status; }
-                       set { status = value; }
-               }
-
-               public DataTableMapping TableMapping {
-                       get { return tableMapping; }
-               }
-
-               
-               protected virtual IDbCommand BaseCommand {
-                       get { return this.command; }    
-                       set { this.command = value; }
-               }
-
-
-               #endregion // Properties
-       }
-}
diff --git a/mcs/class/System.Data/System.Data.Common/SchemaLocation.cs b/mcs/class/System.Data/System.Data.Common/SchemaLocation.cs
deleted file mode 100644 (file)
index 2bebedf..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-//
-// System.Data.Common.SchemaLocation.cs
-//
-// Author:
-//   Tim Coleman (tim@timcoleman.com)
-//
-// Copyright (C) Tim Coleman, 2003
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-namespace System.Data.Common {
-       public enum SchemaLocation 
-       {
-               DataTable,
-               SelectCommand
-       }
-}
-
diff --git a/mcs/class/System.Data/System.Data.Common/SchemaTableColumn.cs b/mcs/class/System.Data/System.Data.Common/SchemaTableColumn.cs
deleted file mode 100644 (file)
index f88e956..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-//
-// System.Data.Common.SchemaTableColumn.cs
-//
-// Author:
-//   Tim Coleman (tim@timcoleman.com)
-//
-// Copyright (C) Tim Coleman, 2003
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-namespace System.Data.Common {
-       public static class SchemaTableColumn 
-       {
-               #region Fields
-                       public static readonly string AllowDBNull = "AllowDBNull";
-                       public static readonly string BaseColumnName = "BaseColumnName";
-                       public static readonly string BaseSchemaName = "BaseSchemaName";
-                       public static readonly string BaseTableName = "BaseTableName";
-                       public static readonly string ColumnName = "ColumnName";
-                       public static readonly string ColumnOrdinal = "ColumnOrdinal";
-                       public static readonly string ColumnSize = "ColumnSize";
-                       public static readonly string DataType = "DataType";
-                       public static readonly string IsAliased = "IsAliased";
-                       public static readonly string IsExpression = "IsExpression";
-                       public static readonly string IsKey = "IsKey";
-                       public static readonly string IsLong = "IsLong";
-                       public static readonly string IsUnique = "IsUnique";
-                       public static readonly string NonVersionedProviderType = "NonVersionedProviderType";
-                       public static readonly string NumericPrecision = "NumericPrecision";
-                       public static readonly string NumericScale = "NumericScale";
-                       public static readonly string ProviderType = "ProviderType";
-
-               #endregion // Fields
-       }
-}
-
diff --git a/mcs/class/System.Data/System.Data.Common/SchemaTableOptionalColumn.cs b/mcs/class/System.Data/System.Data.Common/SchemaTableOptionalColumn.cs
deleted file mode 100644 (file)
index fe54dfa..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-//
-// System.Data.Common.SchemaTableOptionalColumn.cs
-//
-// Author:
-//   Tim Coleman (tim@timcoleman.com)
-//
-// Copyright (C) Tim Coleman, 2003
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-namespace System.Data.Common {
-       public static class SchemaTableOptionalColumn 
-       {
-               #region Fields
-                       public static readonly string AutoIncrementSeed = "AutoIncrementSeed";
-                       public static readonly string AutoIncrementStep = "AutoIncrementStep";
-                       public static readonly string BaseCatalogName = "BaseCatalogName";
-                       public static readonly string BaseColumnNamespace = "BaseColumnNamespace";
-                       public static readonly string BaseServerName = "BaseServerName";
-                       public static readonly string BaseTableNamespace = "BaseTableNamespace";
-                       public static readonly string ColumnMapping = "ColumnMapping";
-                       public static readonly string DefaultValue = "DefaultValue";
-                       public static readonly string Expression = "Expression";
-                       public static readonly string IsAutoIncrement = "IsAutoIncrement";
-                       public static readonly string IsHidden = "IsHidden";
-                       public static readonly string IsReadOnly = "IsReadOnly";
-                       public static readonly string IsRowVersion = "IsRowVersion";
-                       public static readonly string ProviderSpecificDataType = "ProviderSpecificDataType";
-
-
-               #endregion // Fields
-       }
-}
-
diff --git a/mcs/class/System.Data/System.Data.Common/SupportedJoinOperators.cs b/mcs/class/System.Data/System.Data.Common/SupportedJoinOperators.cs
deleted file mode 100644 (file)
index f7ad936..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-//
-// System.Data.Common.SupportedJoinOperators.cs
-//
-// Author:
-//   Chris Toshok (toshok@ximian.com)
-//
-
-//
-// Copyright (C) 2006 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-namespace System.Data.Common {
-
-       [Flags]
-       public enum SupportedJoinOperators
-       {
-               None = 0,
-               Inner = 1 << 0,
-               LeftOuter = 1 << 1,
-               RightOuter = 1 << 2,
-               FullOuter = 1 << 3
-       }
-}
-
diff --git a/mcs/class/System.Data/System.Data.Common/TaskHelper.cs b/mcs/class/System.Data/System.Data.Common/TaskHelper.cs
deleted file mode 100644 (file)
index d10c73f..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-//
-// System.Data.Common.TaskHelper.cs
-//
-// Copyright (C) 2013 Pēteris Ņikiforovs
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-using System;
-using System.Threading.Tasks;
-
-namespace System.Data.Common {
-       static class TaskHelper
-       {
-               internal static Task CreateCanceledTask ()
-               {
-                       TaskCompletionSource<object> tsc = new TaskCompletionSource<object> ();
-                       tsc.SetCanceled ();
-                       return tsc.Task;
-               }
-               
-               internal static Task<T> CreateCanceledTask<T> ()
-               {
-                       TaskCompletionSource<T> tsc = new TaskCompletionSource<T> ();
-                       tsc.SetCanceled ();
-                       return tsc.Task;
-               }
-               
-               internal static Task CreateExceptionTask (Exception e)
-               {
-                       TaskCompletionSource<object> tsc = new TaskCompletionSource<object> ();
-                       tsc.SetException (e);
-                       return tsc.Task;
-               }
-               
-               internal static Task<T> CreateExceptionTask<T> (Exception e)
-               {
-                       TaskCompletionSource<T> tsc = new TaskCompletionSource<T> ();
-                       tsc.SetException (e);
-                       return tsc.Task;
-               }
-               
-               internal static Task CreateVoidTask ()
-               {
-                       TaskCompletionSource<object> tsc = new TaskCompletionSource<object> ();
-                       tsc.SetResult (null);
-                       return tsc.Task;
-               }
-       }
-}
-
diff --git a/mcs/class/System.Data/System.Data.Configuration.jvm/.gitattributes b/mcs/class/System.Data/System.Data.Configuration.jvm/.gitattributes
deleted file mode 100644 (file)
index 8036553..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-/GlobalConfig.cs -crlf
-/ObjectNameResolutionSectionHandler.cs -crlf
-/ObjectNameResolver.cs -crlf
-/ObjectNameResolversCollection.cs -crlf
diff --git a/mcs/class/System.Data/System.Data.Configuration.jvm/GlobalConfig.cs b/mcs/class/System.Data/System.Data.Configuration.jvm/GlobalConfig.cs
deleted file mode 100644 (file)
index 88a08a1..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-// 
-// System.Data.Configuration.GlobaConfig.cs
-//
-// Authors:
-//     Konstantin Triger <kostat@mainsoft.com>
-//     
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//\r
-\r
-using System.Collections;\r
-using System.Configuration;\r
-using System.Xml;\r
-using System.Collections.Specialized;\r
-\r
-namespace System.Data.Configuration {\r
-\r
-       internal enum BooleanSetting {\r
-               False,\r
-               True,\r
-               NotSet\r
-       }\r
-\r
-       internal sealed class Switches {\r
-\r
-               private Switches() {}\r
-\r
-               const string SwitchesSection = "Mainsoft.Data.Configuration/switches";\r
-               const string PrefetchSchemaConfigName = "JDBC.PrefetchSchema";\r
-               static readonly string AppDomainPrefetchSchemaConfigName = String.Concat(SwitchesSection, "/", PrefetchSchemaConfigName);\r
-\r
-               internal static BooleanSetting PrefetchSchema {\r
-                       get {\r
-\r
-                               object value = AppDomain.CurrentDomain.GetData(AppDomainPrefetchSchemaConfigName);\r
-                               if (value != null)\r
-                                       return (BooleanSetting)value;\r
-\r
-                               BooleanSetting setting = BooleanSetting.NotSet;\r
-\r
-                               NameValueCollection switches = (NameValueCollection)ConfigurationSettings.GetConfig(SwitchesSection);\r
-                               if (switches != null) {\r
-                                       string strVal = (string)switches[PrefetchSchemaConfigName];\r
-                                       if (strVal != null) {\r
-                                               try {\r
-                                                       setting = Boolean.Parse(strVal) ? BooleanSetting.True : BooleanSetting.False;\r
-                                               }\r
-                                               catch (Exception e) {\r
-                                                       throw new ConfigurationException(e.Message, e);\r
-                                               }\r
-                                       }\r
-                               }\r
-\r
-                               //lock(AppDomainPrefetchSchemaConfigName)\r
-                               AppDomain.CurrentDomain.SetData(AppDomainPrefetchSchemaConfigName, setting);\r
-\r
-                               return setting;\r
-                       }\r
-               }\r
-       }\r
-}
\ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data.Configuration.jvm/ObjectNameResolutionSectionHandler.cs b/mcs/class/System.Data/System.Data.Configuration.jvm/ObjectNameResolutionSectionHandler.cs
deleted file mode 100644 (file)
index 2093522..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-// 
-// System.Data.Configuration.ObjectNameResolutionSectionHandler.cs
-//
-// Authors:
-//     Konstantin Triger <kostat@mainsoft.com>
-//     
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//\r
-\r
-using System.Collections;\r
-using System.Configuration;\r
-using System.Xml;\r
-\r
-namespace System.Data.Configuration {\r
-       class ObjectNameResolutionSectionHandler : IConfigurationSectionHandler {\r
-               public virtual object Create (object parent, object configContext, XmlNode section) {\r
-                       if (section.Attributes != null && section.Attributes.Count != 0)\r
-                               HandlersUtil.ThrowException ("Unrecognized attribute", section);\r
-\r
-                       ObjectNameResolversCollection col = new ObjectNameResolversCollection(parent as ObjectNameResolversCollection);\r
-\r
-                       XmlNodeList resolvers = section.ChildNodes;\r
-                       foreach (XmlNode child in resolvers) {\r
-                               XmlNodeType ntype = child.NodeType;\r
-                               if (ntype == XmlNodeType.Whitespace || ntype == XmlNodeType.Comment)\r
-                                       continue;\r
-\r
-                               if (ntype != XmlNodeType.Element)\r
-                                       HandlersUtil.ThrowException ("Only elements allowed", child);\r
-\r
-                               string dbname = HandlersUtil.ExtractAttributeValue ("dbname", child,false,true);\r
-                               string match = HandlersUtil.ExtractAttributeValue ("match", child);\r
-                               string pri = HandlersUtil.ExtractAttributeValue ("priority", child);\r
-\r
-                               ObjectNameResolver resolver = new ObjectNameResolver(dbname, match, int.Parse(pri));\r
-                               col.Add(resolver);\r
-                       }\r
-\r
-                       col.Sort();\r
-                       \r
-                       return col;\r
-               }\r
-       }\r
-\r
-       internal sealed class HandlersUtil {\r
-               private HandlersUtil () {\r
-               }\r
-\r
-               static internal string ExtractAttributeValue (string attKey, XmlNode node) {\r
-                       return ExtractAttributeValue (attKey, node, false);\r
-               }\r
-                       \r
-               static internal string ExtractAttributeValue (string attKey, XmlNode node, bool optional) {\r
-                       return ExtractAttributeValue (attKey, node, optional, false);\r
-               }\r
-               \r
-               static internal string ExtractAttributeValue (string attKey, XmlNode node, bool optional,\r
-                       bool allowEmpty) {\r
-                       if (node.Attributes == null) {\r
-                               if (optional)\r
-                                       return null;\r
-\r
-                               ThrowException ("Required attribute not found: " + attKey, node);\r
-                       }\r
-\r
-                       XmlNode att = node.Attributes.RemoveNamedItem (attKey);\r
-                       if (att == null) {\r
-                               if (optional)\r
-                                       return null;\r
-                               ThrowException ("Required attribute not found: " + attKey, node);\r
-                       }\r
-\r
-                       string value = att.Value;\r
-                       if (!allowEmpty && value == String.Empty) {\r
-                               string opt = optional ? "Optional" : "Required";\r
-                               ThrowException (opt + " attribute is empty: " + attKey, node);\r
-                       }\r
-\r
-                       return value;\r
-               }\r
-\r
-               static internal void ThrowException (string msg, XmlNode node) {\r
-                       if (node != null && node.Name != String.Empty)\r
-                               msg = msg + " (node name: " + node.Name + ") ";\r
-                       throw new ConfigurationException (msg, node);\r
-               }\r
-       }\r
-}
\ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data.Configuration.jvm/ObjectNameResolver.cs b/mcs/class/System.Data/System.Data.Configuration.jvm/ObjectNameResolver.cs
deleted file mode 100644 (file)
index 9f50c28..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-// 
-// System.Data.Configuration.ObjectNameResolver.cs
-//
-// Authors:
-//     Konstantin Triger <kostat@mainsoft.com>
-//     
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//\r
-\r
-using System.Collections;\r
-using System.Configuration;\r
-using System.Xml;\r
-using System.Text.RegularExpressions;\r
-\r
-namespace System.Data.Configuration {\r
-       sealed class ObjectNameResolver : IComparable {\r
-               string _dbname;\r
-               int _priority;\r
-               Regex _regex;\r
-               \r
-               public ObjectNameResolver(string dbname, string match, int priority) {\r
-                       _dbname = dbname;\r
-                       _regex = new Regex(match, RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture);\r
-                       \r
-                       _priority = priority;\r
-               }\r
-\r
-               public ObjectNameResolver(Regex regex) {\r
-                       _regex = regex;\r
-                       _dbname = null;\r
-                       _priority = int.MaxValue;\r
-               }\r
-\r
-               public string DbName {\r
-                       get {\r
-                               return _dbname;\r
-                       }\r
-               }\r
-\r
-               public static string GetCatalog(Match match) {\r
-                       return GetCapture(match, "CATALOG");\r
-               }\r
-\r
-               public static string GetSchema(Match match) {\r
-                       return GetCapture(match, "SCHEMA");\r
-               }\r
-\r
-               public static string GetName(Match match) {\r
-                       return GetCapture(match, "NAME");\r
-               }\r
-\r
-               public Match Match(string expression) {\r
-                       return _regex.Match(expression.Trim());\r
-               }\r
-\r
-               static string GetCapture(Match match, string captureName) {\r
-                       Group g = match.Groups[captureName];\r
-                       if (!g.Success)\r
-                               return String.Empty;\r
-\r
-                       return g.Value.Trim();\r
-               }\r
-\r
-               #region IComparable Members\r
-\r
-               public int CompareTo(object obj) {\r
-                       // TODO:  Add ObjectNameResolver.CompareTo implementation\r
-                       return _priority.CompareTo(((ObjectNameResolver)obj)._priority);\r
-               }\r
-\r
-               #endregion\r
-\r
-       }\r
-}
\ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data.Configuration.jvm/ObjectNameResolversCollection.cs b/mcs/class/System.Data/System.Data.Configuration.jvm/ObjectNameResolversCollection.cs
deleted file mode 100644 (file)
index dfdea04..0000000
+++ /dev/null
@@ -1,114 +0,0 @@
-// 
-// System.Data.Configuration.ObjectNameResolversCollection.cs
-//
-// Authors:
-//     Konstantin Triger <kostat@mainsoft.com>
-//     
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//\r
-\r
-using System.Collections;\r
-using System.Configuration;\r
-using System.Xml;\r
-using System.Text.RegularExpressions;\r
-\r
-namespace System.Data.Configuration {\r
-       sealed class ObjectNameResolversCollection : IEnumerable, ICollection {\r
-\r
-               ArrayList _resolvers;\r
-\r
-               #region ctors\r
-\r
-               internal ObjectNameResolversCollection(ObjectNameResolversCollection parent) {\r
-                       _resolvers = new ArrayList();\r
-\r
-                       if (parent != null)\r
-                               _resolvers.AddRange(parent);\r
-               }\r
-\r
-               #endregion\r
-\r
-               #region methods\r
-\r
-               internal void Add(ObjectNameResolver value) {\r
-                       _resolvers.Add(value);\r
-               }\r
-\r
-               internal void Sort() {\r
-                       _resolvers.Sort();\r
-               }\r
-\r
-               #endregion\r
-\r
-               #region props\r
-\r
-               internal ObjectNameResolver this[int index] {\r
-                       get {\r
-                               return (ObjectNameResolver)_resolvers[index];\r
-                       }\r
-               }\r
-\r
-               #endregion\r
-\r
-               #region IEnumerable Members\r
-\r
-               public IEnumerator GetEnumerator() {\r
-                       // TODO:  Add ObjectNameResolversCollection.GetEnumerator implementation\r
-                       return _resolvers.GetEnumerator();\r
-               }\r
-\r
-               #endregion\r
-\r
-               #region ICollection Members\r
-\r
-               public bool IsSynchronized {\r
-                       get {\r
-                               // TODO:  Add ObjectNameResolversCollection.IsSynchronized getter implementation\r
-                               return _resolvers.IsSynchronized;\r
-                       }\r
-               }\r
-\r
-               public int Count {\r
-                       get {\r
-                               // TODO:  Add ObjectNameResolversCollection.Count getter implementation\r
-                               return _resolvers.Count;\r
-                       }\r
-               }\r
-\r
-               public void CopyTo(Array array, int index) {\r
-                       // TODO:  Add ObjectNameResolversCollection.CopyTo implementation\r
-                       _resolvers.CopyTo(array, index);\r
-               }\r
-\r
-               public object SyncRoot {\r
-                       get {\r
-                               // TODO:  Add ObjectNameResolversCollection.SyncRoot getter implementation\r
-                               return _resolvers.SyncRoot;\r
-                       }\r
-               }\r
-\r
-               #endregion\r
-       }\r
-\r
-}
\ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data.Odbc/ChangeLog b/mcs/class/System.Data/System.Data.Odbc/ChangeLog
deleted file mode 100644 (file)
index 41f2b51..0000000
+++ /dev/null
@@ -1,1019 +0,0 @@
-2011-03-22  Veerapuram Varadhan  <v.varadhan@gmail.com>
-
-       ** Fixes #676368 - Patch by 0richardkk.novell@chiark.greenend.org.uk
-       * OdbcConnection.cs: Make linking/unlinking of OdbcCommands thread safe.
-       * OdbcCommand.cs: Check generation object from connection in order to 
-       free the associated statement handle.
-       
-2010-12-07  Veerapuram Varadhan  <vvaradhan@novell.com>
-
-       ** Fixes #456234 - Patch by amc1999@gmail.com
-       * OdbcDataReader.cs (GetValue): Handle SQL_NO_TOTAL sanely and 
-       use corresponding Decoder.GetChars instead of Encoding.GetString.
-       
-2010-06-15 Jonathan Chambers  <joncham@gmail.com>
-
-       * OdbcDataReader.cs: Remove unneeded cast on ref parameter
-
-2009-07-15  Veerapuram Varadhan  <vvaradhan@novell.com>
-
-       * OdbcParameter.cs (OdbcType): Return appropriate type from the typeMap.
-       
-2009-02-20  Veerapuram Varadhan  <vvaradhan@novell.com>
-
-       * OdbcDataReader.cs (GetValue): Handle null image data.  Fixes ##419224
-       Patch by John Mortlock <johnm@hlaustralia.com.au>.
-       
-2009-01-18  Gert Driesen  <drieseng@users.sourceforge.net>
-
-       * OdbcDataReader.cs: Fixed GetBytes with limited length. Added reader
-       state and argument checks.
-
-2009-01-18  Gert Driesen  <drieseng@users.sourceforge.net>
-
-       * OdbcCommand.cs: Do not allow negative CommandTimeout. Reject invalid
-       value for CommandType and UpdatedRowSource. In Dispose, clear
-       CommandText (2.0 only) and Parameters. Include method that is being
-       executed in the exception messages for Connection and CommandText
-       verification.
-
-2009-01-03  Gert Driesen  <drieseng@users.sourceforge.net>
-
-       * OdbcCommandBuilder.cs (QuoteIdentifier): Escape QuoteSuffix
-       character(s) in unquoted identifier.
-
-2008-12-30  Gert Driesen  <drieseng@users.sourceforge.net>
-
-       * OdbcColumn.cs: Treat OdbcType.Numeric as decimal.
-       * OdbcConnection.cs: Keep (weak) list of commands to allow us to
-       dispose them (and free their corresponding statement handles) when
-       the connection is closed. Fixed bug #341743.
-       * OdbcCommand.cs: Add internal Unlink method that is invoked when the
-       OdbcConnection is disposed, and which frees the statement handle.
-       Modified ExecuteNonQuery helper to take CommandBehavior and rename
-       freeHandle argument to createReader. Added CommandBehavior argument
-       to ExecSQL. Added FreeStatement overload that takes an option to not
-       perform an unlink. Fixes bug #3417434.
-
-2008-12-30  Gert Driesen  <drieseng@users.sourceforge.net>
-
-       * libodbc.cs: Add IdentifierQuoteChar to OdbcInfo.
-       * OdbcCommandBuilder.cs: Return a zero-length string when QuotePrefix
-       or QuoteSuffix are not set (or are set to null). Changing QuotePrefix
-       or QuoteSuffix after a command has been generated should result in an
-       InvalidOperationException. Implemented support for obtaining
-       character(s) for quoting identifiers from specified connection.
-       Modified generated SQL to match MS.
-       * OdbcConnectionStringBuilder.cs: Improved special casing of Driver
-       and Dsn keywords. Re-use implemenation of DbConnectionStringBuilder.
-       Improved argument checks to match MS.
-
-2008-10-09 Gonzalo Paniagua Javier <gonzalo@novell.com>
-
-       * OdbcDataReader.cs: apply patch from Steve ? that fixes bug #433741.
-       GetBytes() was returning only the last byte.
-
-2008-08-26  Veerapuram Varadhan  <vvaradhan@novell.com>
-
-       Patch provided by Ernesto <equistango@gmail.com>
-       * OdbcDataReader.cs: Don't call GetSchemaTable in the constructor
-       instead just get column information.  Enhances performance of
-       DataReader.
-       
-2008-08-26  Veerapuram Varadhan  <vvaradhan@novell.com>
-
-       Patch provided by Ernesto <equistango@gmail.com>
-       * OdbcParameter.cs (CopyValue): Handle Binary type along with
-       VarBinary and Image. 
-       
-2008-07-06  Sebastien Pouliot  <sebastien@ximian.com>
-
-       * OdbcDataReader.cs: Fix unneeded self-assignment for 'length'. Also
-       fix a bad setter where "value = behavior" instead of "behavior = value"
-       [Found using Gendarme ReviewSelfAssignmentRule]
-
-2008-04-21  Gert Driesen  <drieseng@users.sourceforge.net>
-
-       * OdbcParameterCollection.cs: Changed argument names to match MS.
-       Code formatting.
-
-2008-03-24  Gert Driesen  <drieseng@users.sourceforge.net>
-
-       * OdbcTransaction.cs: Use internal CreateOdbcException method on
-       OdbcConnection to create OdbcException.
-       * OdbcException.cs: Added support for multiple OdbcError instances
-       and fixed Message property on 2.0 profile.
-       * OdbcCommand.cs: Use internal CreateOdbcException method on
-       OdbcConnection to create OdbcException. Code formatting.
-       * OdbcError.cs: Moved code to obtain ODBC error info to newly
-       introduced CreateOdbcException on OdbcConnection. Code formatting.
-       * OdbcDataReader.cs: Use internal CreateOdbcException method on
-       OdbcTransaction to create OdbcException.
-       * OdbcParameterCollection.cs: Removed obsolete Bind method.
-       * OdbcConnection.cs: Added SafeDriver property that returns
-       name of driver if available and a zero-length string otherwise.
-       Use CreateOdbcException method to create OdbcException from ODBC
-       error info. Added CreateOdbcException method to construct
-       OdbcException from all available ODBC error info.
-       * OdbcParameter.cs: Use internal CreateOdbcException method on
-       OdbcConnection to create OdbcException.
-
-2008-03-23  Gert Driesen  <drieseng@users.sourceforge.net>
-
-       * OdbcErrorCollection.cs: Corcompare fixes and code formatting.
-       * OdbcCommandBuilder.cs: Corcompare fixes and code formatting.
-       * OdbcPermission.cs: Corcompare fixes and code formatting.
-       * OdbcDataReader.cs: Corcompare fixes and code formatting.
-       * OdbcParameterCollection.cs: Corcompare fixes and code formatting.
-       * OdbcConnection.cs: Corcompare fixes and code formatting. Use
-       unicode encoding in ChangeDatabase and GetInfo.
-       * OdbcDataAdapter.cs: Corcompare fixes and code formatting.
-       * OdbcParameter.cs: Corcompare fixes and code formatting.
-
-2008-03-21  Gert Driesen  <drieseng@users.sourceforge.net>
-
-       * libodbc.cs: Always use unicode version of ODBC functions. Fixes part
-       of bug #372823.
-       * OdbcTypeMap.cs: Fixed mapping for NChar, NText and NVarChar.
-       * OdbcDataReader.cs (GetColumn): Use Unicode encoding to decode
-       column name buffer.
-       (GetDataTypeName): Use SQLColAttribute to determine type name of
-       column.
-       (GetValue): Fixed retrieving value of nchar column. When retrieving
-       variable length unicode value, use Unicode encoding to decode buffer
-       and remove trailing null characters. Fixes bug #364430.
-
-2008-03-03  Veerapuram Varadhan  <vvaradhan@novell.com>
-
-       ** Fixes Bug#324025
-       * OdbcDataReader (GetString): Use Convert.ToString() to return
-       appropriate typed values.
-       (GetValue): Fixes a regression. 
-       
-2008-03-03  Veerapuram Varadhan  <vvaradhan@novell.com>
-
-       * OdbcCommandBuilder.cs: Clean up.
-       
-2008-03-03  Veerapuram Varadhan  <vvaradhan@novell.com>
-
-       ** Fixes Bug#340451 - patch provided by Ernesto Carrea
-       <equistango@gmail.com>
-       * OdbcConnection.cs (GetInfo): Trim the value to actual length
-       returned by libodbc.
-       
-2008-03-03  Veerapuram Varadhan  <vvaradhan@novell.com>
-
-       ** Fixes from BNC#332809 - patch provided by Ernesto Carrea
-       <equistango@gmail.com>
-       * OdbcParameter.cs (Bind): Do not allocate buffer if value is
-       DBNull.
-       * OdbcTypeConverter.cs (InferFromValue): Incase of DBNull, do not
-       throw exception, instead return NVarChar to match MS.NET
-       implementation.
-       
-2008-03-03  Ankit Jain  <jankit@novell.com>
-
-       * OdbcMetaDataCollectionNames.cs: Set the field values.
-
-2008-02-26  Veerapuram Varadhan  <vvaradhan@novell.com>
-
-       ** Fixes BNC#364432.
-       * OdbcParameter.cs: (Bind): Set StrLen parameter of
-       SQLBindParameter to reflect NullData in case of DBNull.
-       (CopyValue): If Value is DBNull.Value, just don't try any
-       heroics. 
-       
-2008-02-25  Veerapuram Varadhan  <vvaradhan@novell.com>
-
-       ** Fixes BNC#364426.
-       * OdbcDataReader.cs: (GetValue): Map OdbcType.Time to
-       System.TimeSpan.  
-
-       * OdbcTypeConverter.cs: (GetTypeMap): Map OdbcType.Time and
-       SqlType.TIME to corresponding types. 
-
-       * OdbcColumn.cs: -- ditto --
-       
-2008-02-20  Veerapuram Varadhan  <vvaradhan@novell.com>
-
-       * OdbcDataReader.cs: (GetValue): Handle cases when certain 
-       ODBC drivers return unexpected results.  Fixes #326740.  Patch 
-       provided by Mark Junker <mjscod@gmx.de>.
-       
-2008-01-16  Veerapuram Varadhan  <vvaradhan@novell.com>
-
-       * OdbcCommandBuilder.cs: Implemented 2.0 APIs and code
-       restructuring. 
-       
-2007-10-28  Gert Driesen  <drieseng@users.sourceforge.net>
-
-       * OdbcDataReader.cs: Code formatting, spaces to tabs.
-
-2007-10-20  Gert Driesen  <drieseng@users.sourceforge.net>
-
-       * OdbcCommand.cs: Added constant for default CommandTimeout, instead
-       of using a magic number. Avoid unnecessary initialization. Fixed
-       default value for DesignTimeVisible. Return zero-length string if
-       CommandText is null. Spaces to tabs and code formatting.
-       * OdbcError.cs: Fixed typo in exception message.
-       * OdbcConnection.cs: Return zero-length string if ConnectionString is
-       null. In getters for Database, DataSource and Driver return a
-       zero-length string if connection is closed. In BeginTransaction and
-       GetSchema throw InvalidOperationException if connection is closed.
-       Added override for GetSchema (string, string []). Use string.Empty
-       instead of "".
-       * OdbcDataAdapter.cs: Avoid unnecessary initializations. Use direct
-       assignment in IDbDataAdapter implementation. In default ctor, set
-       SelectCommand to null.
-
-2007-10-19  Gert Driesen  <drieseng@users.sourceforge.net>
-
-       * OdbcTransaction.cs: Clear connection in Commit and Rollback.
-       In IsolationLevel, throw IOE if transaction is no longer open.
-
-2007-10-19  Gert Driesen  <drieseng@users.sourceforge.net>
-
-       * OdbcTransaction.cs: Keep state of the transaction, and update it
-       when performing commit or rollback. In Dispose (bool), only perform
-       a rollback if transaction was not committed or rollback before.
-       In Commit and Rollback, throw an InvalidOperationException if
-       transaction is no longer open.
-
-2007-10-19  Gert Driesen  <drieseng@users.sourceforge.net>
-
-       * OdbcTransaction.cs: Use OdbcIsolationLevel enum value instead of
-       magic numbers. For Snapshot isolation level, the attribute
-       SQL_COPT_SS_TXN_ISOLATION must be used instead. When isolation level
-       is Unspecified, then do not modify the isolation level at all and
-       lazy initlization the IsolationLevel property. Modified exceptions
-       for invalid / not supported isolation levels to match MS.
-       * libodbc.cs: Added attribute for changing SQL Server specific
-       connection option. Added enum for ODBC isolation level options.
-       Added SQLGetConnectAttr method.
-
-2007-10-19  Gert Driesen  <drieseng@users.sourceforge.net>
-
-       * libodbc.cs: Spaces to tabs. Code formatting.
-       * OdbcConnection.cs: Spaces to tabs. Code formatting.
-       * OdbcTransaction.cs: Code formatting.
-
-2007-10-19  Nagappan <anagappan@novell.com> 
-
-       * OdbcCommandBuilder.cs, OdbcParameterCollection.cs: Code alignment.
-       * OdbcDataReader.cs: Fixes numeric columns, bug # 332404.
-
-2007-10-19  Nagappan <anagappan@novell.com> 
-
-       * OdbcCommand.cs: (Clone): Implemented new method. Code alignment.
-
-2007-10-12  Nagappan <anagappan@novell.com> 
-
-       * OdbcDataReader.cs: Bug 332400 - ODBC and LONGBLOB columns. Thanks to
-         Ernesto Carrea <equistango@gmail.com> for the patch and the test case.
-
-2007-10-08  Marek Safar <marek.safar@gmail.com> 
-
-       * OdbcParameterCollection.cs (SetParameter): Fixed missing cast.
-
-2007-09-27  Nagappan A <anagappan@novell.com> 
-
-       * OdbcTransaction.cs: AutoCommit and BeginTransaction fix. Thanks to
-         Mads Bondo Dydensborg <mbd@dbc.dk> and Amc <amc1999@gmail.com> for
-         providing this patch.
-
-2007-09-25  Nagappan A  <anagappan@novell.com>
-
-       * OdbcParameter.cs (ResetOdbcType, ResetDbType): Implemented
-       missing methods. 2.0 attribute fixes.
-
-       * OdbcInfoMessageEventArgs.cs (Message, Errors, ToString):
-       Implemented missing properties and methods. 2.0 attribute fixes.
-
-       * OdbcConnection.cs (InfoMessage): Added public event and relevant
-       private APIs. 2.0 attribute fixes.
-
-       * OdbcConnectionStringBuilder.cs: 2.0 attribute fixes.
-
-       * OdbcParameterCollection.cs (GetParameter, SetParameter):
-       Implemented missing 2.0 APIs and 2.0 attribute fixes.
-
-       * OdbcDataReader.cs (finalize): 2.0 compatibility fixes.
-
-       * OdbcPermission.cs (Add): 2.0 compatibility fixes.
-
-       * OdbcCommandBuilder.cs: 2.0 attribute fixes.
-
-       * OdbcRowUpdatingEventArgs.cs (BaseCommand): Added 2.0 property.
-
-       * OdbcCommand.cs: 2.0 attribute fixes.
-
-       * OdbcException.cs: 2.0 attribute fixes.
-
-2007-09-11  AMC  <amc1999@gmail.com>
-
-       * OdbcDataReader.cs (GetPrimaryKeys): ODBC data reader can now
-       properly handle "no-primary-keys" situation. Fixes bug # 82560.
-
-2007-09-11  Nagappan A  <anagappan@novell.com>
-
-       * OdbcConnectionStringBuilder.cs: Fixed Dsn DisplayName attribute.
-
-2007-08-13  Nagappan A  <anagappan@novell.com>
-
-       * OdbcMetaDataColumnNames.cs: Added new class.
-
-       * OdbcMetaDataCollectionNames.cs: Added new class.
-
-       * OdbcParameter.cs: 2.0 compatibility changes.
-
-       * OdbcFactory.cs (CreateConnectionStringBuilder)
-       (CreatePermission): Implemented new methods.
-
-       * OdbcInfoMessageEventHandler.cs: 2.0 compatibility changes.
-
-       * OdbcConnection.cs: 2.0 compatibility changes.
-       (GetSchema): Added new overloaded methods.
-
-       * OdbcConnectionStringBuilder.cs (Driver, Dsn): Added attributes
-       as per 2.0 requirement.
-
-       * OdbcDataReader.cs: 2.0 compatibility changes.
-
-       * OdbcCommandBuilder.cs: 2.0 compatibility changes.
-
-       * OdbcCommand.cs: 2.0 compatibility changes.
-
-       * OdbcErrorCollection.cs (CopyTo): Implemented new overloaded
-       method.
-
-       * OdbcException.cs: In 2.0 DbException should be inherited instead
-       of SystemException.
-
-2007-07-31  Nagappan A  <anagappan@novell.com>
-
-       * OdbcCommand.cs (ExecSQL): Thanks to amc1999@gmail.com (amc) for
-         providing the patch, Fixes bug # 82135. ODBC SQLExecDirect
-         error. Delete where no-data-found fails.
-
-       * OdbcCommandBuilder.cs: Removed bogus TODO.
-         Fixed 2.0 missing attributes
-
-       * libodbc.cs: Added new libodbc global constant SQL_NTS.
-
-       * OdbcCommand.cs (ExecSQL): Thanks to amc1999@gmail.com (amc) for
-         providing the patch, Fixes bug # 82191. ODBC command UTF8
-         error. SQL failed with UTF8 symbols in query.
-         Removed bogus TODO.
-         Fixed 2.0 missing attributes
-
-2007-07-22  Nagappan A  <anagappan@novell.com>
-
-       * OdbcDataAdapter.cs: Fixed compilation warning.
-
-       * OdbcTransaction.cs: Fixed compilation warning.
-
-2007-06-30  Gert Driesen  <drieseng@users.sourceforge.net>
-
-       * OdbcDataAdapter.cs: Only override Dispose on 1.0 profile. Added
-       stub for ICloneable.Clone.
-       * OdbcTransaction.cs: Dispose should be explicit interface impl., not
-       public. Connection is also public on 2.0 profile.
-
-2007-06-21  Nagappan A  <anagappan@novell.com>
-
-       * OdbcConnectionStringBuilder.cs: Added new file with the basic
-       work of Nidhi Rawal (rawalnidhi_rawal@yahoo.com).
-
-       * OdbcDataReader.cs (GetValue): Patch for varchar longer than 255
-       characters, by Mads Bondo Dydensborg <mbd@dbc.dk>.
-
-       * OdbcConnection.cs: Fixed compiler warning.
-
-2007-06-06  Amit Biswas <amit@amitbiswas.com>
-
-       * OdbcParameter.cs (OdbcParameter ()): Changed default values in the constructor
-       
-       * OdbcParameterCollection.cs (AddRange (Array values)): Implemented missing method
-       (Add): Corrected bug related to default parameter names
-       (Insert): Added check for valid index values
-       (Contains): Corrected bug for case sensitivity
-       (IndexOf): Corrected bug for case sensitivity
-       (IndexOf): Corrected bug in comparing parameter names
-       (Remove): Added check for non existing parameters
-       (AddRange (OdbcParameter): Implemented missing method
-       (AddRange (Array values): Implemented missing method
-       (Insert (int index, OdbcParameter value)): Implemented missing method
-       (Insert (int index, object value)): Implemented missing method
-       (AddWithValue (string parameterName, Object value)): Implemented missing method
-       (Remove (OdbcParameter value)): Implemented missing method
-       (Contains (OdbcParameter value)): Implemented missing method
-       (CopyTo (OdbcParameter [] array, int index)): Implemented missing method
-
-2007-05-30  Nagappan A  <anagappan@novell.com>
-
-       * OdbcDataReader.cs (GetValue): Adds nano seconds as tickcs from
-       the received buffer.
-
-2007-05-25  Nagappan A  <anagappan@novell.com>
-
-       * OdbcDataReader.cs (GetValue): Sybase returns the fraction values
-       in nano seconds, but DateTime expects the value in milliseconds,
-       so the conversion.
-
-2007-05-04  Nagappan A  <anagappan@novell.com>
-
-       * libodbc.cs: Wrong ODBC API definitions (using ints instead of
-       shorts) - Fixes bug 81306. Thanks to will.mooar@tait.co.nz and
-       tausq@debian.org.
-
-       * OdbcDataReader.cs: Wrong ODBC API definitions (using ints
-       instead of shorts) - Fixes bug 81306. Thanks to
-       will.mooar@tait.co.nz and tausq@debian.org.
-
-2007-02-09  Nagappan A  <anagappan@novell.com>
-
-       * OdbcDataReader.cs (GetDecimal): Implemented new API.
-
-2007-01-08  Nagappan A  <anagappan@novell.com>
-
-       * OdbcFactory.cs: Fixed compilation warning.
-
-       * OdbcCategoryAttribute.cs (Category): Implemented missing
-       property.
-
-       * OdbcParameterCollection.cs: Fixed compilation warning.
-
-       * OdbcCommandBuilder.cs (GetInsertCommand, GetUpdateCommand)
-       (GetDeleteCommand): Implemented overloaded method.
-
-       * OdbcTransaction.cs: Modified partial content of DOS format file
-       to UNIX format.
-
-2006-07-13  Senganal T  <tsenganal@novell.com>
-
-       * OdbcTransaction.cs OdbcCommand.cs OdbcConnectionFactory.cs 
-       OdbcPermission.cs OdbcDataReader.cs OdbcParameterCollection.cs 
-       OdbcConnection.cs OdbcFactory.cs OdbcParameter.cs :
-               2.0 Api fixes
-
-2006-05-31  Gert Driesen  <drieseng@users.sourceforge.net>
-
-       * OdbcErrorCollection.cs: Removed explicit interface implementation 
-       of IEnumerable.GetEnumerator ().
-       * OdbcCommand.cs: Removed destructor as the destructor in
-       System.ComponentModel.Component already calls the Dispose method.
-       Removed explicit interface implemenation of members that are 
-       implement by public members.
-       * OdbcDataReader.cs: Removed explicit interface implemenation of
-       IDataRecord.GetData.
-
-2006-05-24  Senganal T <tsenganal@novell.com>
-       
-       * OdbcColumn.cs :
-               - Added IsVariableSizeType : Handle types with variable datasize
-       * OdbcTypeConverter.cs : map LongVarBinary to Image
-       * OdbcDataReader.cs :
-               - GetValue () : Handle Text,Image datatypes differently. Only allocate
-               storage for the data contained and not for MaxLength. Fixes #78234
-
-2006-05-09  Senganal T  <tsenganal@novell.com>
-
-       * OdbcConnection.cs : Implemented ChangeDatabase Method
-       * libodbc.cs : Added value for CurrentCatalog in OdbcConnectionAttribute 
-
-2006-02-17  Chris Toshok  <toshok@ximian.com>
-
-       * OdbcDataReader.cs: remove VisibleFieldCount property.
-
-2005-11-21  Senganal T <tsenganal@novell.com>
-
-       * OdbcTransaction.cs
-       * OdbcCommandBuilder.cs
-       * OdbcParameterCollection.cs
-       * OdbcDataReader.cs
-       * OdbcFactory.cs
-       * OdbcDataAdapter.cs
-       * OdbcParameter.cs
-       
-       Added stubs and other changes for ADO.NET 2.0 compatibility
-
-2005-10-14  Senganal T <tsenganal@novell.com>
-
-       * OdbcColumn.cs : Changed the mapping of OdbcType.Char to string
-       instead of char. Fixes bug #67269
-
-2005-10-14  Senganal T <tsenganal@novell.com>
-
-       * OdbcDataReader.cs: Added Text and NText datatypes to the list
-       of datatypes checked by GetValue () method. Fixes bug #75032
-
-2005-10-14  Sureshkumar T  <tsureshkumar@novell.com>
-
-       * OdbcDataReader.cs (GetValue): Use SQL_CHAR for Numeric as
-       temporary fix.
-
-       * OdbcParameter.cs (CopyValue): Add support for Numeric & Decimal
-       parameters.
-
-2005-10-08  Sureshkumar T  <tsureshkumar@novell.com>
-
-       * OdbcCommand.cs (BindParameters): Copy the parameter Value after
-       binding.
-
-       * OdbcParameter.cs: re-implemented the native buffer handling and
-       odbc type handling.
-
-       * NativeBuffer.cs: A native buffer class to hold pointer to native
-       memory.
-
-       * OdbcTypeMap.cs (OdbcTypeMap): structure to hold different odbc
-       types and the default mapping.
-
-       * OdbcTypeConverter.cs: Simplified mapping between different odbc
-       types using switch-case.
-
-       * libodbc.cs (SQLBindParameter): use only one entry point and use
-       IntPtr instead of ref.
-
-2005-08-20  Gert Driesen  <drieseng@users.sourceforge.net>
-
-       * OdbcDataReader.cs: Marked GetPrimaryKeysBySQLStatistics unsafe.
-       This fixes the build on Windows (using csc).
-
-2005-08-09  Sureshkumar T  <tsureshkumar@novell.com>
-
-       * OdbcDataReader.cs: GetSchemaTable (): set values for the column
-       attributes using SQLColAttribute. If SQLPrimaryKeys does not
-       yeild, try SQLStatistics. Optimized primary key logic.
-
-       * libodbc.cs: Added api SQLStatistics and constants.
-
-       * OdbcParameter.cs: setBuffer (): allocate a short int buffer for
-       OdbcType.SmallInt. fixes bug #75600.
-
-2005-08-08  Gert Driesen  <drieseng@users.sourceforge.net>
-
-       * OdbcConnection.cs: Marked Init helper method private.
-       * OdbcCommand.cs: Marked BindParameters helper method private.
-
-2005-08-08  Sureshkumar T  <tsureshkumar@novell.com>
-
-       * OdbcDataReader.cs: Implemented Dispose pattern. Cache
-       schematable for same result set. don't free command's statements
-       if the command is prepared.
-
-       * OdbcConnection.cs: Open (): set disposed to false so that close
-       will be called in Dispose.
-
-       * OdbcCommand.cs:
-       - Prepare (): Split SQLPrepare and SQLBind so that
-       already prepared statements can be reused with new parameter
-       values.
-       - ExecSQL (): create new statement handle, if not prepared
-       and there are no parameters. if there are parameters, prepare and
-       use.
-       - Implemented Dispose pattern
-       - Streamlined the allocation and de-allocation of statement
-       handles.
-
-2005-08-05  Sureshkumar T  <tsureshkumar@novell.com>
-
-       * OdbcDataReader.cs: RecordsAffected: get value from command.
-       GetSchemaTable (): set IsExpression based on BaseTableName. set
-       AllowDBNull to false if the column is PK.
-
-       * OdbcCommand.cs: correct UpdatedRowSource is returned. whitespace
-       changes to conform to standard.
-
-       * OdbcCommandBuilder.cs: Implemented.
-
-       * OdbcParameter.cs: Direction is set to Input by default.
-
-2005-07-22  Sureshkumar T  <tsureshkumar@novell.com>
-
-       * OdbcParameter.cs: updated attributes & attribute descriptions to
-       match with masterinfos.
-
-       * OdbcDataReader.cs: NextRow (): made private.
-
-2005-07-21  Sureshkumar T  <tsureshkumar@novell.com>
-
-       * OdbcDataReader.cs: GetValue (): added case for OdbcType.Bit. and
-       Formatting corrections. Fixes bug #75574.
-
-2005-07-07  Sureshkumar T  <tsureshkumar@novell.com>
-
-       * OdbcTypeConverter.cs: ConvertToSqlType & ConvertToSqlCType: map
-       VarChar to SQL_C_CHAR and SQL_VARCHAR respective instead of WCHAR
-       and WVARCHAR as temporary fix.
-
-       * OdbcParameter.cs: setBuffer: string types need not be quoted.
-
-2005-06-28  Sureshkumar T  <tsureshkumar@novell.com>
-
-       * OdbcDataReader.cs: GetPrimaryKeys (): use the length indicator
-       for GetString, otherwise, it creates a string of length 255. Use
-       ArrayList for keys as the columns are different from the selected
-       columns. fixes bug #75263.
-
-2005-06-09  Sureshkumar T  <tsureshkumar@novell.com>
-
-       * OdbcDataReader.cs: GetValue (): return decimal in case of odbc
-       type Numeric. Move the temp buffer logic inside.
-
-       * OdbcTypeConverter.cs: map SQL_TYPE.NUMERIC to SQL_C_TYPE.CHAR by
-       now, since PgSql driver seems not to accept NUMERIC c type. Other
-       database anyway, provides NUMERIC datatype as DECIMAL.
-
-2005-05-31  Sureshkumar T  <tsureshkumar@novell.com>
-
-       * OdbcParameter.cs: setBuffer (): for numeric type, the buffer
-       parameter should be a packed decimal struct. fixes bug #75041.
-
-2005-04-05  Sureshkumar T  <tsureshkumar@novell.com>
-
-       * OdbcParameter.cs: SqlBindParameter requires the last parameter
-       to be a ref.
-       * libodbc.cs: API change for above.
-
-2005-04-04  Sureshkumar T  <tsureshkumar@novell.com>
-
-       * OdbcDataReader.cs: Ignore BaseTableName & BaseColumnName
-       properties while building Schema information as most drivers
-       ignores these properties. e.g. PostgreSQL.
-
-2005-03-24  Sureshkumar T  <tsureshkumar@novell.com>
-           Appasamy <appasamy@rediffmail.com>
-
-       * OdbcColumn.cs: IsStringType: OdbcType.Char is also of type
-       String.
-       * OdbcDataReader.cs: GetSchemaTable: Get Additional info using
-       SQLColAttribute. Don't pad with spaces in GetColAttributeStr.
-
-2005-03-24  Sureshkumar T  <tsureshkumar@novell.com>
-
-       * OdbcDataReader.cs:
-       - GetValue: Decode only outsize length for SQL_C_TYPE.CHAR type in
-       SQLGetData.
-       - GetOrdinal: Perform case insensitive lookup if sensitive lookup
-       fails.
-
-2005-03-22  Sureshkumar T  <tsureshkumar@novell.com>
-            Appsamy <appasamy@rediffmail.com>
-
-       * libodbc.cs (System.Data.Odbc): Added enum FieldIdentifier. Added
-       library functions SQLPrimaryKeys, SQLBindCol and SQLColAttribute.
-
-       * OdbcDataReader.cs: Implemented GetPrimaryKeys to get the primary
-       keys associated with resultset using SQLPrimaryKeys.
-
-2005-03-15  Sureshkumar T  <tsureshkumar@novell.com>
-
-       * OdbcConnection.cs: re-throw error on exception in Open method.
-
-2005-03-11  Sureshkumar T  <tsureshkumar@novell.com>
-
-       * OdbcConnection.cs : notify state change through event. clean up
-       handles in case any exception while opening a connection. NET_2_0
-       uses base class's OnStateChange handler.
-
-2005-03-10  Sureshkumar T  <tsureshkumar@novell.com>
-
-       Migrated core classes to derive from ProviderBase instead of
-       implementing IDb* interfaces. Most part of these files have been
-       branched with #if NET_2_0/ONLY_1_1. Make sure any changes works
-       with both the profiles.
-
-       * OdbcFactory.cs: Concrete Factory for DbProviderFactory. Factory
-       to generate Connection,Command,etc.
-
-       * OdbcConnectionFactory.cs: Concrete factory for DbConnectionFactory.
-
-       * OdbcTransaction.cs: migration and overrides.
-       * OdbcCommandBuilder.cs: migration and overrides.
-       * OdbcDataReader.cs: --do--. no command behavior member as it will
-       be maintained in base provider class.
-       * OdbcParameterCollection.cs: --do--. Now, local ArrayList is not
-       maintained here, instead it is in base class. Most of the methods
-       which operated on this list are not needed in NET_2_0.
-       * OdbcConnection.cs: Migration. connectionString is maintained in
-       DbConnectionBase class.
-       * OdbcParameter.cs: Migration. Many of the local members like
-       value,sourceColumn are maintained in DbParameterBase.
-       * OdbcCommand.cs: Migration. commandText,timeout and
-       commandTimeOut are maintained in DbCommandBase class.
-
-2005-03-10  Sureshkumar T  <tsureshkumar@novell.com>
-
-       * OdbcType.cs: Added enums for SQL_TYPE & SQL_C_TYPE.
-       
-       * libodbc.cs: Accept SQL_C_TYPE for driver
-       parameters. SQLBindParameter takes two parameters SQL_TYPE and
-       SQL_C_TYPE. This caused the whole lot of changes done in this
-       revision.
-       
-       * OdbcParameter.cs: Set default values of OdbcType & DbType. Pass
-       mapped SQL_TYPE and SQL_C_TYPE to SQLBindParameter. Increase
-       buffer size by 2 for additional ' chars.
-       
-       * OdbcTypeConverter.cs: Added class to convert between OdbcType,
-       SQL_TYPE, SQL_C_TYPE.
-       
-       * OdbcColumn.cs: Added private members for SQL_TYPE and
-       SQL_C_TYPE. conversion from/to odbctype to/from SQL_TYPE is done
-       through OdbcTypeConverter class.
-       
-       * OdbcDataReader.cs: use OdbcColumn's SQL_C_TYPE member. It keeps
-       track of default mapping between odbctype, SQL_TYPE and
-       SQL_C_TYPE. Move dataTableSchema.AcceptChanges inside if condition
-       to avoid null reference exception.
-
-2005-02-04  Sureshkumar T  <tsureshkumar@novell.com>
-           Appasamy <appasamy@rediffmail.com>
-
-       * OdbcConnection.cs: Implemented properties database, datasource,
-       serverversion and driver.
-       * libodbc.cs: Added type OdbcInfo and native call SQLGetInfo.
-
-2005-01-20  Sureshkumar T  <tsureshkumar@novell.com>
-
-       * OdbcDataReader.cs: case for type OdbcType.Double added in
-       GetValue.  fixes bug #71173.
-
-       Thanks to patch given by "Appasamy T" <appasamy@rediffmail.com>
-
-2005-01-19  Sureshkumar T  <tsureshkumar@novell.com>
-
-       * OdbcType.cs: Change enum values for compatiability with MS.NET.
-       * libodbc.cs: Change enum values for compatiability with
-       MS.NET. Change calls into driver with native type.
-       * OdbcDataReader.cs: Change enum values for compatiability with
-       MS.NET. Change calls from/into driver with native type.
-
-2005-01-18  Sureshkumar T  <tsureshkumar@novell.com>
-
-       * OdbcDataReader.cs: GetOrdinal need not check for
-       currentRow. Return -1 if column name is not found.
-
-       fixes bug #71261. Thanks to patch given by "Appasamy T"
-       <appasamy@rediffmail.com>.
-
-2005-01-13  Sureshkumar T  <tsureshkumar@novell.com>
-
-       * OdbcDataReader.cs: Implement NextResultSet for multiple result
-       set queries. 
-       
-       * OdbcDataReader.cs: build column schema once creating reader and
-       then for each Next result set. Thanks to
-       sebastien.robitaille@croesus.com (Sebastien Robitaille) for
-       pointing out this optimization (bugzilla #70530).
-
-       * libodbc.cs: Added library calls SQLFreeStmt and SQLMoreResults
-       for mutiple resultsets.
-
-2005-01-10  Sureshkumar T  <tsureshkumar@novell.com>
-
-       * OdbcDataReader.cs: Connection has to be closed only after
-       Statement handle is freed. fixes bug #70048.
-
-2005-01-07  Sureshkumar T  <tsureshkumar@novell.com>
-
-       * OdbcDataReader.cs: Pass OdbcCType.SignedBigInt for accessing big
-       int columns.
-
-       * OdbcType.cs: Added a new enum for Odbc C DataTypes. This should
-       essentially be passed to drivers, since the public OdbcType types
-       differs from types expected in drivers in some cases.
-
-       * libodbc.cs : Added a ODBC method which takes OdbcCType
-       enumeration for SQLGetData for BigInt fields.
-
-       fixes bug #65342.
-
-2004-12-28  Duncan Mak  <duncan@ximian.com>
-
-       * libodbc.cs: Change all the DllImport attributes to point to
-       "odbc32.dll" instead of "odbc32", because /etc/mono/config lists
-       "odbc32.dll" (all other entries in the file have the .dll suffix
-       as well, for consistency's sake, let's rename it here.)
-
-       This fixes #70727.
-       
-2004-12-03  Sureshkumar T  <tsureshkumar@novell.com>
-
-       * OdbcParameter.cs: Fixed a null reference exception when a
-       parameter is created and its value is not set. #68750.
-
-2004-11-26  Sureshkumar T  <tsureshkumar@novell.com>
-
-       * OdbcParameter.cs: Fixed Parameter Size property as well as
-       insufficient buffer errors. bug #68749.
-
-2004-09-14  Sebastien Pouliot  <sebastien@ximian.com>
-
-       * OdbcPermission.cs: Added internal constructor accepting an Odbc
-       PermissionAttribute parameter (using base class protected ctor).
-       * OdbcPermissionAttribute.cs: Copy now use the new OdbcPermission
-       constructor.
-
-2004-09-13  Sebastien Pouliot  <sebastien@ximian.com>
-
-       * OdbcPermission.cs: Mostly completed (needs tests).
-       * OdbcPermissionAttribute.cs: Completed.
-
-2004-08-31 Umadevi S (sumadevi@novell.com)
-       * OdbcDataReader.cs - Fixed Decimal parsing
-
-2004-08-30 Umadevi S (sumadevi@novell.com)
-       * OdbcType.cs - removed inheritance from short.
-
-2004-08-27 Sureshkumar T (tsureshkumar@novell.com)
-       * OdbcDataReader.cs - fixed bug #63539 - TINYINT ODBC datatype is converted into System.Byte
-
-2004-08-26 Sureshkumar T (tsureshkumar@novell.com)
-       * OdbcDataReader.cs - Date & DateTime GetValue fixed. 
-                             GetBytes ordinal parameter passing fixed for BINARY in GetValue.
-
-2004-08-20 Sureshkumar T (tsureshkumar@novell.com)
-       * OdbcConnection.cs - correct handles are passed to OdbcError exception to trap the correct error
-
-2004-08-04 Umadevi S (sumadevi@novell.com)
-        * OdbcDataReader.cs - Fixed bug 61832 - Column names were not filled, due to which name based lookup of columns failed.
-                                                                                                  
-
-2004-08-04 Umadevi S (sumadevi@novell.com)
-        * OdbcDataReader.cs - Fixed bug 61405 - Handling smallint column type.
-
-2004-07-30  Sureshkumar T (tsureshkumar@novell.com)
-        * OdbcCommand.cs: ExecuteNonQuery Closed statement handle to fix memory leak
-        * OdbcDataReader.cs: Closed statement handle to fix memory leak
-                            Removed SQLState login in GetBytes coz OdbcError provides the same.
-                                   
-2004-07-29 Umadevi S (sumadevi@novell.com)
-        * OdbcCommand.cs - Fixed bug 62046. ExecuteNonQuery implemented correctly
-                                                                                                    
-
-2004-07-28 Umadevi S (sumadevi@novell.com)
-        * OdbcParameter.cs - fixed bug 61968. String values passed with quotes
-                                                                                                 
-
-2004-07-07 Umadevi S (sumadevi@novell.com)
-        * OdbcConnection.cs - Allowed Close to be called multiple times
-                            - Implementation of Dispose method
-
-2004-07-07 Umadevi S (sumadevi@novell.com)
-        * OdbcCommand.cs : fixed set method for Transaction
-                                                          
-2004-07-01  Sureshkumar T (tsureshkumar@novell.com)
-       * OdbcCommand.cs   : fixed reader problem with ExecuteScalar
-
-2004-06-23  Sureshkumar T (tsureshkumar@novell.com)
-        * OdbcConnection.cs: Fix: Moved env allocation to Open method. 
-                            Disconnection & freeing handles are done in Close 
-                            method to avoid simultaneous connections.
-       * libodbc.cs       : Added constants for odbc version.
-                                   
-2004-06-16  Gert Driesen <drieseng@users.sourceforge.net>
-
-       * OdbcError.cs: fixed serialization compatibility with MS.NET
-       * OdbcErrorCollection.cs: fixed serialization compatibility with
-       MS.NET
-       * OdbcException.cs: fixed serialization compatibility with MS.NET
-
-2004-06-16  Sureshkumar T (tsureshkumar@novell.com)
-       * OdbcDataReader.cs: Added GetValue support for Sql Binary type to return byte array.
-                            Implemented GetBytes method.
-       * libodbc.cs       : Added enums, constants & imports for above fix.
-
-2004-06-13  Gert Driesen <drieseng@users.sourceforge.net>
-
-       * OdbcDataReader.cs: changed GetData method to return IDataReader
-       to match MS.NET
-
-2004-06-09  Sureshkumar T (tsureshkumar@novell.com)
-        * OdbcDataReader.cs: Removed checking of currentRow in GetName
-          method
-
-2004-06-04  Gert Driesen <drieseng@users.sourceforge.net>
-
-       * OdbcPermission.cs: moved Obsolete attribute to correct
-       ctor
-
-2004-06-02  Sureshkumar T (tsureshkumar@novell.com)
-       
-       * OdbcDataReader.cs: Implemented GetByte method. Fixed bug #58820
-
-2004-06-02  Gert Driesen <drieseng@users.sourceforge.net>
-
-        * OdbcParameter.cs: added missing attributes
-        * OdbcPermission.cs: added missing attributes
-        * OdbcConnection.cs: fixes attribute, added missing attributes
-        * OdbcInfoMessageEventArgs.cs: removed extra properties, fixed
-        API compatibility with MS.NET
-        * OdbcCommandBuilder.cs: use correct attributes
-
-2004-05-20  Gert Driesen (drieseng@users.sourceforge.net)
-
-        *  OdbcPermissionAttribute.cs: change AllowMultiple and
-        Inherited to match .NET
-
-2004-05-17 Umadevi S (sumadevi@novell.com)
-       * OdbcPermissionAttribute, OdbcPermission.cs - fixed missing methods
-
-2004-05-17 Gert Driesen (drieseng@users.sourceforge.net)
-       * OdbcCategoryAttribute.cs: fixed namespace
-       * OdbcDataAdapter.cs: removed extra attributes
-       * OdbcDescriptionAttribute.cs: fixed namespace
-
-2004-05-14 Umadevi S (sumadevi@novell.com)
-        * OdbcParameterConverter.cs -Added 
-       * OdbcParameter.cs - Added some attributes      
-
-2004-05-14 Umadevi S (sumadevi@novell.com)
-        * OdbcDataAdapter.cs - Added Attributes
-
-2004-05-14 Umadevi S (sumadevi@novell.com)
-        * OdbcConnection.cs - Added Attributes
-
-2004-05-14 Umadevi S (sumadevi@novell.com)
-        * OdbcCommand.cs - Added Attributes
-
-2004-05-14 Umadevi S (sumadevi@novell.com)
-        * OdbcDataReader.cs - Added Attributes
-
-2004-05-14 Umadevi S (sumadevi@novell.com)
-        * Added Classes OdbcCategoryAttribute.cs, OdbcDescriptionAttribute.cs
-
-2004-05-14 Umadevi S (sumadevi@novell.com)
-       * Added Class OdbcCommandBuilder.cs
-
-2004-05-14 Umadevi S (sumadevi@novell.com)
-        * Added classes OdbcInfoMessageEventArgs.cs - with stubs
-       * Added classes OdbcInfoMessageEventInfo.cs     
-
-2004-05-14 Umadevi S (sumadevi@novell.com)
-       * Added classes OdbcPermission.cs, OdbcPermissionAttribute.cs - with stubs
-
-2004-05-09  Gert Driesen (drieseng@users.sourceforge.net)
-       * OdbcException.cs : removed ErrorCode property, fixing signature
-       * OdbcErrorCollection.cs : added internal ctor, reduced 
-       accessibility of Add method to internal
-       * OdbcCommand.cs: marked hstmt field private, remove setters for
-       Parameters property
-       * OdbcDataReader.cs: Added GetDate method, renamed GetTimeSpan to
-       GetTime to match MS.NET, added HasRows stub
-
-2004-05-09  Gert Driesen (drieseng@users.sourceforge.net)
-       * OdbcError.cs: 
-       * OdbcErrorCollection.cs:
-       * OdbcException.cs: fixed linefeeds to DOS to match other
-       sources in System.Data.Odbc
-
-2004-05-09  Gert Driesen (drieseng@users.sourceforge.net)
-       * OdbcCommand.cs: No longer use OdbcConnection.Datareader, in order 
-       to fix signature of OdbcConnection
-       * OdbcDataReader.cs: No longer use ODbcConnection.Datareader, in 
-       order to fix signature of OdbcConnection
-       * OdbcConnection.cs: Signature fixes: removed DataReader property, 
-       added setter for ConnectionTimeout, made transaction internal
-       * OdbcParameter.cs: reduced accessibility of Bind method to 
-       internal, added setter for IsNullable
-       * OdbcParameterCollection.cs: made default ctor and Bind method
-       internal
-
-2004-05-09  Gert Driesen (drieseng@users.sourceforge.net)
-       * OdbcCommand.cs: fixed linefeeds to DOS to match other sources
-       in System.Data.Odbc
-
-2004-05-09  Gert Driesen (drieseng@users.sourceforge.net)
-       * OdbcTransaction.cs: fixed signature to match MS.NET
-
-2004-05-09  Gert Driesen (drieseng@users.sourceforge.net)
-       * OdbcType.cs: fixed typo UniqueIndetifier
-       * OdbcColumn.cs : fixed typo UniqueIndetifier
-
-2004-05-09  Gert Driesen (drieseng@users.sourceforge.net)
-       * OdbcType.cs: fixed linefeeds to DOS to match other sources
-       in System.Data.Odbc
-
-2003-12-01  Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
-       * OdbcTransaction.cs: applied patch from Jeff Seifert that makes
-       this class implement IDbTransaction interface.
-
-2002-11-01  Daniel Morgan <danmorg@sc.rr.com>
-
-       * OdbcDataReader.cs: - uncommented code, but I put a FIXME:
-       according to Brian, this does not work on MS .NET however, we need it
-       for Mono for now. schemaRow.AcceptChanges(),
-       - implement IEnumerable.GetEnumerator()
-    
-       * libodbc.cs: changed the DllImport from "odbc32.dll" to "odbc32"
-    
-2002-10-21  Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
-       * ChangeLog: added.
-       * OdbcError.cs:
-       * OdbcException.cs: added dummy implementation for these missing
-       classes.
-
diff --git a/mcs/class/System.Data/System.Data.Odbc/NativeBuffer.cs b/mcs/class/System.Data/System.Data.Odbc/NativeBuffer.cs
deleted file mode 100644 (file)
index 15d74bd..0000000
+++ /dev/null
@@ -1,114 +0,0 @@
-//
-// NativeBuffer.cs: class for handling native pointers.
-//
-// Authors:
-//   Brian Ritchie (brianlritchie@hotmail.com)
-//   Sureshkumar T <tsureshkumar@novell.com>  2004.
-//
-// Copyright (C) Brian Ritchie, 2002
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Text;
-using System.Data;
-using System.Data.Common;
-
-using System.Runtime.InteropServices;
-
-namespace System.Data.Odbc
-{
-        sealed class NativeBuffer : IDisposable
-       {
-               private IntPtr _ptr;
-               private int _length;
-               private bool disposed;
-
-               public NativeBuffer ()
-               {
-               }
-
-               public IntPtr Handle
-               {
-                       get { return _ptr; }
-                       set { _ptr = value; }
-               }
-
-               public int Size
-               {
-                       get { return _length; }
-               }
-
-               public void AllocBuffer (int length)
-               {
-                       FreeBuffer ();
-                       _ptr = Marshal.AllocCoTaskMem (length);
-                       _length = length;
-               }
-
-               public void FreeBuffer ()
-               {
-                       if (_ptr == IntPtr.Zero)
-                               return;
-
-                       Marshal.FreeCoTaskMem (_ptr);
-                       _length = 0;
-                       _ptr = IntPtr.Zero;
-               }
-
-               public void EnsureAlloc (int length)
-               {
-                       if (Size == length && _ptr != IntPtr.Zero)
-                               return;
-                       
-                       AllocBuffer (length);
-               }
-
-               public void Dispose (bool disposing)
-               {
-                       if (disposed)
-                               return;
-                       FreeBuffer ();
-                       _ptr = IntPtr.Zero;
-                       disposed = true;
-               }
-
-               public void Dispose ()
-               {
-                       Dispose (true);
-                       GC.SuppressFinalize (this);
-               }
-
-               ~NativeBuffer ()
-               {
-                       Dispose (false);
-               }
-
-               public static implicit operator IntPtr (NativeBuffer buf)
-               {
-                       return buf.Handle;
-               }
-       }
-}
diff --git a/mcs/class/System.Data/System.Data.Odbc/OdbcCategoryAttribute.cs b/mcs/class/System.Data/System.Data.Odbc/OdbcCategoryAttribute.cs
deleted file mode 100644 (file)
index 5c8a84a..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-// 
-// System.Data.Odbc/OdbcCategoryAttribute.cs
-//
-// Author:
-//   Umadevi S (sumadevi@novell.com)
-//
-// Copyright (C) Novell Inc, 2004
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.ComponentModel;
-
-namespace System.Data.Odbc {
-       [AttributeUsage (AttributeTargets.All)]
-       internal sealed class OdbcCategoryAttribute : CategoryAttribute
-       {
-               #region Fields
-
-               string category;
-
-               #endregion // Fields
-
-               #region Constructors
-
-               public OdbcCategoryAttribute (string category)
-               {
-                       this.category = category; 
-               }
-
-               #endregion // Constructors
-
-               #region Properties
-
-               public new string Category {
-                       get { return category; }
-               }
-
-               #endregion
-
-               #region Methods
-
-               [MonoTODO]
-               protected override string GetLocalizedString (string value)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               #endregion // Methods
-       }
-}
diff --git a/mcs/class/System.Data/System.Data.Odbc/OdbcColumn.cs b/mcs/class/System.Data/System.Data.Odbc/OdbcColumn.cs
deleted file mode 100644 (file)
index a7160d8..0000000
+++ /dev/null
@@ -1,194 +0,0 @@
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-
-namespace System.Data.Odbc
-{
-       /// <summary>
-       /// Summary description for OdbcColumn.
-       /// </summary>
-       internal class OdbcColumn
-       {
-               internal string ColumnName;
-               internal OdbcType OdbcType;
-                private SQL_TYPE _sqlType = SQL_TYPE.UNASSIGNED;
-                private SQL_C_TYPE _sqlCType = SQL_C_TYPE.UNASSIGNED;
-               internal bool AllowDBNull;
-               internal int MaxLength;
-               internal int Digits;
-               internal object Value;
-
-               internal OdbcColumn (string Name, OdbcType Type)
-               {
-                       this.ColumnName = Name;
-                       this.OdbcType = Type;           
-                       AllowDBNull = false;
-                       MaxLength = 0;
-                       Digits = 0;
-                       Value = null;
-               }
-
-                internal OdbcColumn (string Name, SQL_TYPE type)
-               {
-                        this.ColumnName = Name;
-                       AllowDBNull = false;
-                       MaxLength = 0;
-                       Digits = 0;
-                       Value = null;
-                        UpdateTypes (type);
-
-               }
-
-
-               internal Type DataType
-               {
-                       get
-                       {
-                               switch (OdbcType)
-                               {
-                                       case OdbcType.TinyInt:
-                                               return typeof (System.Byte);
-                                       case OdbcType.BigInt: 
-                                               return typeof (System.Int64);
-                                       case OdbcType.Image:
-                                       case OdbcType.VarBinary:
-                                       case OdbcType.Binary:
-                                               return typeof (byte[]);
-                                       case OdbcType.Bit:
-                                               return typeof (bool);
-                                       case OdbcType.NChar:
-                                       case OdbcType.Char:
-                                               return typeof (string);
-                                       case OdbcType.Time:
-                                               return typeof (TimeSpan);
-                                       case OdbcType.Timestamp:
-                                       case OdbcType.DateTime:
-                                       case OdbcType.Date:
-                                       case OdbcType.SmallDateTime:
-                                               return typeof (DateTime);
-                                       case OdbcType.Decimal:
-                                       case OdbcType.Numeric:
-                                               return typeof (Decimal);
-                                       case OdbcType.Double:
-                                               return typeof (Double);
-                                       case OdbcType.Int:
-                                               return typeof (System.Int32);
-                                       case OdbcType.Text:
-                                       case OdbcType.NText:
-                                       case OdbcType.NVarChar:
-                                       case OdbcType.VarChar:
-                                               return typeof (string);
-                                       case OdbcType.Real:
-                                               return typeof (float);
-                                       case OdbcType.SmallInt:
-                                               return typeof (System.Int16);
-                                       case OdbcType.UniqueIdentifier:
-                                               return typeof (Guid);
-                               }
-                               throw new InvalidCastException();
-                       }
-               }
-
-               internal bool IsDateType
-               {
-                       get
-                       {
-                               switch (OdbcType)
-                               {
-                                       case OdbcType.Time:
-                                       case OdbcType.Timestamp:
-                                       case OdbcType.DateTime:
-                                       case OdbcType.Date:
-                                       case OdbcType.SmallDateTime:
-                                               return true;
-                                       default:
-                                               return false;
-                               }
-                       }
-               }
-
-               internal bool IsStringType
-               {
-                       get
-                       {
-                               switch (OdbcType)
-                               {
-                                       case OdbcType.Char:
-                                       case OdbcType.Text:
-                                       case OdbcType.NText:
-                                       case OdbcType.NVarChar:
-                                       case OdbcType.VarChar:
-                                               return true;
-                                       default:
-                                               return false;
-                               }
-                       }
-               }
-
-               internal bool IsVariableSizeType {
-                       get {
-                               if (IsStringType)
-                                       return true;
-                               switch (OdbcType) {
-                               case OdbcType.Binary :
-                               case OdbcType.VarBinary :
-                               case OdbcType.Image :
-                                       return true;
-                               default : 
-                                       return false;
-                               }
-                       }
-               }
-
-                internal SQL_TYPE SqlType
-                {
-                        get {
-                                if ( _sqlType == SQL_TYPE.UNASSIGNED)
-                                        _sqlType = OdbcTypeConverter.GetTypeMap (OdbcType).SqlType;
-                                return _sqlType;
-                        }
-
-                        set {_sqlType = value;}
-                }
-
-                internal SQL_C_TYPE SqlCType
-                {
-                        get {
-                                
-                                if ( _sqlCType == SQL_C_TYPE.UNASSIGNED)
-                                        _sqlCType = OdbcTypeConverter.GetTypeMap (OdbcType).NativeType;
-                                return _sqlCType;
-                        }
-                        set {_sqlCType = value;}
-                }
-
-                internal void UpdateTypes (SQL_TYPE sqlType)
-                {
-                        SqlType = sqlType;
-                        OdbcTypeMap map = OdbcTypeConverter.GetTypeMap (SqlType);
-                        OdbcType = map.OdbcType;
-                        SqlCType = map.NativeType;
-                }
-       }
-}
diff --git a/mcs/class/System.Data/System.Data.Odbc/OdbcCommand.cs b/mcs/class/System.Data/System.Data.Odbc/OdbcCommand.cs
deleted file mode 100644 (file)
index 9d13b84..0000000
+++ /dev/null
@@ -1,477 +0,0 @@
-//
-// System.Data.Odbc.OdbcCommand
-//
-// Authors:
-//   Brian Ritchie (brianlritchie@hotmail.com)
-//
-// Copyright (C) Brian Ritchie, 2002
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.ComponentModel;
-using System.Data;
-using System.Data.Common;
-using System.Collections;
-using System.Runtime.InteropServices;
-
-namespace System.Data.Odbc
-{
-       /// <summary>
-       /// Represents an SQL statement or stored procedure to execute against a data source.
-       /// </summary>
-       [DesignerAttribute ("Microsoft.VSDesigner.Data.VS.OdbcCommandDesigner, "+ Consts.AssemblyMicrosoft_VSDesigner, "System.ComponentModel.Design.IDesigner")]
-       [ToolboxItemAttribute ("System.Drawing.Design.ToolboxItem, "+ Consts.AssemblySystem_Drawing)]
-       [DefaultEvent ("RecordsAffected")]
-       public sealed class OdbcCommand : DbCommand, ICloneable
-       {
-               #region Fields
-
-               const int DEFAULT_COMMAND_TIMEOUT = 30;
-
-               string commandText;
-               int timeout;
-               CommandType commandType;
-               UpdateRowSource updateRowSource;
-
-               OdbcConnection connection;
-               OdbcTransaction transaction;
-               OdbcParameterCollection _parameters;
-
-               bool designTimeVisible;
-               bool prepared;
-               IntPtr hstmt = IntPtr.Zero;
-               object generation = null; // validity of hstmt
-
-               bool disposed;
-               
-               #endregion // Fields
-
-               #region Constructors
-
-               public OdbcCommand ()
-               {
-                       timeout = DEFAULT_COMMAND_TIMEOUT;
-                       commandType = CommandType.Text;
-                       _parameters = new OdbcParameterCollection ();
-                       designTimeVisible = true;
-                       updateRowSource = UpdateRowSource.Both;
-               }
-
-               public OdbcCommand (string cmdText) : this ()
-               {
-                       commandText = cmdText;
-               }
-
-               public OdbcCommand (string cmdText, OdbcConnection connection)
-                       : this (cmdText)
-               {
-                       Connection = connection;
-               }
-
-               public OdbcCommand (string cmdText, OdbcConnection connection,
-                                   OdbcTransaction transaction) : this (cmdText, connection)
-               {
-                       this.Transaction = transaction;
-               }
-
-               #endregion // Constructors
-
-               #region Properties
-
-               internal IntPtr hStmt {
-                       get { return hstmt; }
-               }
-
-               [OdbcCategory ("Data")]
-               [DefaultValue ("")]
-               [OdbcDescriptionAttribute ("Command text to execute")]
-               [EditorAttribute ("Microsoft.VSDesigner.Data.Odbc.Design.OdbcCommandTextEditor, "+ Consts.AssemblyMicrosoft_VSDesigner, "System.Drawing.Design.UITypeEditor, "+ Consts.AssemblySystem_Drawing )]
-               [RefreshPropertiesAttribute (RefreshProperties.All)]
-               public
-               override
-               string CommandText {
-                       get {
-                               if (commandText == null)
-                                       return string.Empty;
-                               return commandText;
-                       }
-                       set {
-                               prepared = false;
-                               commandText = value;
-                       }
-               }
-
-               [OdbcDescriptionAttribute ("Time to wait for command to execute")]
-               public override
-               int CommandTimeout {
-                       get { return timeout; }
-                       set {
-                               if (value < 0)
-                                       throw new ArgumentException ("The property value assigned is less than 0.",
-                                               "CommandTimeout");
-                               timeout = value;
-                       }
-               }
-
-               [OdbcCategory ("Data")]
-               [DefaultValue ("Text")]
-               [OdbcDescriptionAttribute ("How to interpret the CommandText")]
-               [RefreshPropertiesAttribute (RefreshProperties.All)]
-               public
-               override
-               CommandType CommandType {
-                       get { return commandType; }
-                       set {
-                               ExceptionHelper.CheckEnumValue (typeof (CommandType), value);
-                               commandType = value;
-                       }
-               }
-
-
-               [DefaultValue (null)]
-               [EditorAttribute ("Microsoft.VSDesigner.Data.Design.DbConnectionEditor, "+ Consts.AssemblyMicrosoft_VSDesigner, "System.Drawing.Design.UITypeEditor, "+ Consts.AssemblySystem_Drawing )]
-               public new OdbcConnection Connection {
-                       get { return DbConnection as OdbcConnection; }
-                       set { DbConnection = value; }
-               }
-
-               [BrowsableAttribute (false)]
-               [DesignOnlyAttribute (true)]
-               [DefaultValue (true)]
-               [EditorBrowsable (EditorBrowsableState.Never)]
-               public
-               override
-               bool DesignTimeVisible {
-                       get { return designTimeVisible; }
-                       set { designTimeVisible = value; }
-               }
-
-               [OdbcCategory ("Data")]
-               [OdbcDescriptionAttribute ("The parameters collection")]
-               [DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Content)]
-               public
-               new
-               OdbcParameterCollection Parameters {
-                       get {
-                               return base.Parameters as OdbcParameterCollection;
-                       }
-               }
-               
-               [BrowsableAttribute (false)]
-               [OdbcDescriptionAttribute ("The transaction used by the command")]
-               [DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Hidden)]
-               public
-               new
-               OdbcTransaction Transaction {
-                       get { return transaction; }
-                       set { transaction = value; }
-               }
-
-               [OdbcCategory ("Behavior")]
-               [DefaultValue (UpdateRowSource.Both)]
-               [OdbcDescriptionAttribute ("When used by a DataAdapter.Update, how command results are applied to the current DataRow")]
-               public
-               override
-               UpdateRowSource UpdatedRowSource {
-                       get { return updateRowSource; }
-                       set {
-                               ExceptionHelper.CheckEnumValue (typeof (UpdateRowSource), value);
-                               updateRowSource = value;
-                       }
-               }
-
-               protected override DbConnection DbConnection {
-                       get { return connection; }
-                       set { connection = (OdbcConnection) value;}
-               }
-
-
-               protected override DbParameterCollection DbParameterCollection {
-                       get { return _parameters as DbParameterCollection;}
-               }
-
-               protected override DbTransaction DbTransaction {
-                       get { return transaction; }
-                       set { transaction = (OdbcTransaction) value; }
-               }
-
-               #endregion // Properties
-
-               #region Methods
-
-               public
-               override
-               void Cancel ()
-               {
-                       if (hstmt != IntPtr.Zero) {
-                               OdbcReturn Ret = libodbc.SQLCancel (hstmt);
-                               if (Ret != OdbcReturn.Success && Ret != OdbcReturn.SuccessWithInfo)
-                                       throw connection.CreateOdbcException (OdbcHandleType.Stmt, hstmt);
-                       } else
-                               throw new InvalidOperationException ();
-               }
-
-               protected override DbParameter CreateDbParameter ()
-               {
-                       return CreateParameter ();
-               }
-
-               public new OdbcParameter CreateParameter ()
-               {
-                       return new OdbcParameter ();
-               }
-
-               internal void Unlink ()
-               {
-                       if (disposed)
-                               return;
-
-                       FreeStatement (false);
-               }
-
-               protected override void Dispose (bool disposing)
-               {
-                       if (disposed)
-                               return;
-
-                       FreeStatement (); // free handles
-                       CommandText = null;
-                       Connection = null;
-                       Transaction = null;
-                       Parameters.Clear ();
-                       disposed = true;
-               }
-
-               private IntPtr ReAllocStatment ()
-               {
-                       OdbcReturn ret;
-
-                       if (hstmt != IntPtr.Zero)
-                               // Free the existing hstmt.  Also unlinks from the connection.
-                               FreeStatement ();
-                       // Link this command to the connection.  The hstmt created below
-                       // only remains valid while generation == Connection.generation.
-                       generation = Connection.Link (this);
-                       ret = libodbc.SQLAllocHandle (OdbcHandleType.Stmt, Connection.hDbc, ref hstmt);
-                       if (ret != OdbcReturn.Success && ret != OdbcReturn.SuccessWithInfo)
-                               throw connection.CreateOdbcException (OdbcHandleType.Dbc, Connection.hDbc);
-                       disposed = false;
-                       return hstmt;
-               }
-
-               void FreeStatement ()
-               {
-                       FreeStatement (true);
-               }
-
-               private void FreeStatement (bool unlink)
-               {
-                       prepared = false;
-
-                       if (hstmt == IntPtr.Zero)
-                               return;
-
-                       // Normally the command is unlinked from the connection, but during
-                       // OdbcConnection.Close() this would be pointless and (quadratically)
-                       // slow.
-                       if (unlink)
-                               Connection.Unlink (this);
-
-                       // Serialize with respect to the connection's own destruction
-                       lock(Connection) {
-                               // If the connection has already called SQLDisconnect then hstmt
-                               // may have already been freed, in which case it is not safe to
-                               // use.  Thus the generation check.
-                               if(Connection.Generation == generation) {
-                                       // free previously allocated handle.
-                                       OdbcReturn ret = libodbc.SQLFreeStmt (hstmt, libodbc.SQLFreeStmtOptions.Close);
-                                       if ((ret!=OdbcReturn.Success) && (ret!=OdbcReturn.SuccessWithInfo))
-                                               throw connection.CreateOdbcException (OdbcHandleType.Stmt, hstmt);
-                       
-                                       ret = libodbc.SQLFreeHandle ((ushort) OdbcHandleType.Stmt, hstmt);
-                                       if (ret != OdbcReturn.Success && ret != OdbcReturn.SuccessWithInfo)
-                                               throw connection.CreateOdbcException (OdbcHandleType.Stmt, hstmt);
-                               }
-                               hstmt = IntPtr.Zero;
-                       }
-               }
-               
-               private void ExecSQL (CommandBehavior behavior, bool createReader, string sql)
-               {
-                       OdbcReturn ret;
-
-                       if (!prepared && Parameters.Count == 0) {
-                               ReAllocStatment ();
-
-                               ret = libodbc.SQLExecDirect (hstmt, sql, libodbc.SQL_NTS);
-                               if (ret != OdbcReturn.Success && ret != OdbcReturn.SuccessWithInfo && ret != OdbcReturn.NoData)
-                                       throw connection.CreateOdbcException (OdbcHandleType.Stmt, hstmt);
-                               return;
-                       }
-
-                       if (!prepared)
-                               Prepare();
-
-                       BindParameters ();
-                       ret = libodbc.SQLExecute (hstmt);
-                       if (ret != OdbcReturn.Success && ret != OdbcReturn.SuccessWithInfo && ret != OdbcReturn.NoData)
-                               throw connection.CreateOdbcException (OdbcHandleType.Stmt, hstmt);
-               }
-
-               internal void FreeIfNotPrepared ()
-               {
-                       if (! prepared)
-                               FreeStatement ();
-               }
-
-               public
-               override
-               int ExecuteNonQuery ()
-               {
-                       return ExecuteNonQuery ("ExecuteNonQuery", CommandBehavior.Default, false);
-               }
-
-               private int ExecuteNonQuery (string method, CommandBehavior behavior, bool createReader)
-               {
-                       int records = 0;
-                       if (Connection == null)
-                               throw new InvalidOperationException (string.Format (
-                                       "{0}: Connection is not set.", method));
-                       if (Connection.State == ConnectionState.Closed)
-                               throw new InvalidOperationException (string.Format (
-                                       "{0}: Connection state is closed", method));
-                       if (CommandText.Length == 0)
-                               throw new InvalidOperationException (string.Format (
-                                       "{0}: CommandText is not set.", method));
-
-                       ExecSQL (behavior, createReader, CommandText);
-
-                       // .NET documentation says that except for INSERT, UPDATE and
-                       // DELETE  where the return value is the number of rows affected
-                       // for the rest of the commands the return value is -1.
-                       if ((CommandText.ToUpper().IndexOf("UPDATE")!=-1) ||
-                           (CommandText.ToUpper().IndexOf("INSERT")!=-1) ||
-                           (CommandText.ToUpper().IndexOf("DELETE")!=-1)) {
-                               int numrows = 0;
-                               libodbc.SQLRowCount (hstmt, ref numrows);
-                               records = numrows;
-                       } else
-                               records = -1;
-
-                       if (!createReader && !prepared)
-                               FreeStatement ();
-                       
-                       return records;
-               }
-
-               public
-               override
-               void Prepare()
-               {
-                       ReAllocStatment ();
-                       
-                       OdbcReturn ret;
-                       ret = libodbc.SQLPrepare(hstmt, CommandText, CommandText.Length);
-                       if ((ret!=OdbcReturn.Success) && (ret!=OdbcReturn.SuccessWithInfo))
-                               throw connection.CreateOdbcException (OdbcHandleType.Stmt, hstmt);
-                       prepared = true;
-               }
-
-               private void BindParameters ()
-               {
-                       int i = 1;
-                       foreach (OdbcParameter p in Parameters) {
-                               p.Bind (this, hstmt, i);
-                               p.CopyValue ();
-                               i++;
-                       }
-               }
-
-               public
-               new
-               OdbcDataReader ExecuteReader ()
-               {
-                       return ExecuteReader (CommandBehavior.Default);
-               }
-
-               protected override DbDataReader ExecuteDbDataReader (CommandBehavior behavior)
-               {
-                       return ExecuteReader (behavior);
-               }
-
-               public
-               new
-               OdbcDataReader ExecuteReader (CommandBehavior behavior)
-               {
-                       return ExecuteReader ("ExecuteReader", behavior);
-               }
-
-               OdbcDataReader ExecuteReader (string method, CommandBehavior behavior)
-               {
-                       int recordsAffected = ExecuteNonQuery (method, behavior, true);
-                       OdbcDataReader dataReader = new OdbcDataReader (this, behavior, recordsAffected);
-                       return dataReader;
-               }
-
-
-               public
-               override
-               object ExecuteScalar ()
-               {
-                       object val = null;
-                       OdbcDataReader reader = ExecuteReader ("ExecuteScalar",
-                               CommandBehavior.Default);
-                       try {
-                               if (reader.Read ())
-                                       val = reader [0];
-                       } finally {
-                               reader.Close ();
-                       }
-                       return val;
-               }
-
-               object ICloneable.Clone ()
-               {
-                       OdbcCommand command = new OdbcCommand ();
-                       command.CommandText = this.CommandText;
-                       command.CommandTimeout = this.CommandTimeout;
-                       command.CommandType = this.CommandType;
-                       command.Connection = this.Connection;
-                       command.DesignTimeVisible = this.DesignTimeVisible;
-                       foreach (OdbcParameter parameter in this.Parameters)
-                               command.Parameters.Add (parameter);
-                       command.Transaction = this.Transaction;
-                       return command;
-               }
-
-               public void ResetCommandTimeout ()
-               {
-                       CommandTimeout = DEFAULT_COMMAND_TIMEOUT;
-               }
-
-               #endregion
-       }
-}
diff --git a/mcs/class/System.Data/System.Data.Odbc/OdbcCommandBuilder.cs b/mcs/class/System.Data/System.Data.Odbc/OdbcCommandBuilder.cs
deleted file mode 100644 (file)
index 7f5fb30..0000000
+++ /dev/null
@@ -1,612 +0,0 @@
-//
-// System.Data.Odbc.OdbcCommandBuilder
-//
-// Author:
-//   Umadevi S (sumadevi@novell.com)
-//   Sureshkumar T (tsureshkumar@novell.com)
-//
-// Copyright (C) Novell Inc, 2004
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Text;
-using System.Data;
-using System.Data.Common;
-using System.ComponentModel;
-
-namespace System.Data.Odbc
-{
-       /// <summary>
-       /// Provides a means of automatically generating single-table commands used to reconcile changes made to a DataSet with the associated database. This class cannot be inherited.
-       /// </summary>
-
-       public sealed class OdbcCommandBuilder : DbCommandBuilder
-       {
-               #region Fields
-
-               private OdbcDataAdapter _adapter;
-
-               private DataTable               _schema;
-               private string                  _tableName;
-               private OdbcCommand             _insertCommand;
-               private OdbcCommand             _updateCommand;
-               private OdbcCommand             _deleteCommand;
-
-               bool _disposed;
-
-               private OdbcRowUpdatingEventHandler rowUpdatingHandler;
-               
-               #endregion // Fields
-
-               #region Constructors
-               
-               public OdbcCommandBuilder ()
-               {
-               }
-
-               public OdbcCommandBuilder (OdbcDataAdapter adapter)
-                       : this ()
-               {
-                       DataAdapter = adapter;
-               }
-
-               #endregion // Constructors
-
-               #region Properties
-
-               [OdbcDescriptionAttribute ("The DataAdapter for which to automatically generate OdbcCommands")]
-               [DefaultValue (null)]
-               public
-               new
-               OdbcDataAdapter DataAdapter {
-                       get {
-                               return _adapter;
-                       }
-                       set {
-                               if (_adapter == value)
-                                       return;
-
-                               if (rowUpdatingHandler != null)
-                                       rowUpdatingHandler = new OdbcRowUpdatingEventHandler (OnRowUpdating);
-                               
-                               if (_adapter != null)
-                                       _adapter.RowUpdating -= rowUpdatingHandler;
-                               _adapter = value;
-                               if (_adapter != null)
-                                       _adapter.RowUpdating += rowUpdatingHandler;
-                       }
-               }
-
-               private OdbcCommand SelectCommand {
-                       get {
-                               if (DataAdapter == null)
-                                       return null;
-                               return DataAdapter.SelectCommand;
-                       }
-               }
-
-               private DataTable Schema {
-                       get {
-                               if (_schema == null)
-                                       RefreshSchema ();
-                               return _schema;
-                       }
-               }
-               
-               private string TableName {
-                       get {
-                               if (_tableName != string.Empty)
-                                       return _tableName;
-
-                               DataRow [] schemaRows = Schema.Select ("BaseTableName is not null and BaseTableName <> ''");
-                               if (schemaRows.Length > 1) {
-                                       string tableName = (string) schemaRows [0] ["BaseTableName"];
-                                       foreach (DataRow schemaRow in schemaRows) {
-                                               if ( (string) schemaRow ["BaseTableName"] != tableName)
-                                                       throw new InvalidOperationException ("Dynamic SQL generation is not supported against multiple base tables.");
-                                       }
-                               }
-                               if (schemaRows.Length == 0)
-                                       throw new InvalidOperationException ("Cannot determine the base table name. Cannot proceed");
-                               _tableName = schemaRows [0] ["BaseTableName"].ToString ();
-                               return _tableName;
-                       }
-               }
-
-
-               #endregion // Properties
-
-               #region Methods
-
-               [MonoTODO]
-               public static void DeriveParameters (OdbcCommand command)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               new
-               void Dispose (bool disposing)
-               {
-                       if (_disposed)
-                               return;
-                       
-                       if (disposing) {
-                               // dispose managed resource
-                               if (_insertCommand != null)
-                                       _insertCommand.Dispose ();
-                               if (_updateCommand != null)
-                                       _updateCommand.Dispose ();
-                               if (_deleteCommand != null)
-                                       _deleteCommand.Dispose ();
-                               if (_schema != null)
-                                       _schema.Dispose ();
-
-                               _insertCommand = null;
-                               _updateCommand = null;
-                               _deleteCommand = null;
-                               _schema = null;
-                       }
-                       _disposed = true;
-               }
-
-               private bool IsUpdatable (DataRow schemaRow)
-               {
-                       if ( (! schemaRow.IsNull ("IsAutoIncrement") && (bool) schemaRow ["IsAutoIncrement"])
-                            || (! schemaRow.IsNull ("IsRowVersion") && (bool) schemaRow ["IsRowVersion"])
-                            || (! schemaRow.IsNull ("IsReadOnly") && (bool) schemaRow ["IsReadOnly"])
-                            || (schemaRow.IsNull ("BaseTableName") || ((string) schemaRow ["BaseTableName"]).Length == 0)
-                            )
-                               return false;
-                       return true;
-               }
-               
-               private string GetColumnName (DataRow schemaRow)
-               {
-                       string columnName = schemaRow.IsNull ("BaseColumnName") ? String.Empty : (string) schemaRow ["BaseColumnName"];
-                       if (columnName == String.Empty)
-                               columnName = schemaRow.IsNull ("ColumnName") ? String.Empty : (string) schemaRow ["ColumnName"];
-                       return columnName;
-               }
-               
-               private OdbcParameter AddParameter (OdbcCommand cmd, string paramName, OdbcType odbcType,
-                                                   int length, string sourceColumnName, DataRowVersion rowVersion)
-               {
-                       OdbcParameter param;
-                       if (length >= 0 && sourceColumnName != String.Empty)
-                               param = cmd.Parameters.Add (paramName, odbcType, length, sourceColumnName);
-                       else
-                               param = cmd.Parameters.Add (paramName, odbcType);
-                       param.SourceVersion = rowVersion;
-                       return param;
-               }
-
-               /*
-                * creates where clause for optimistic concurrency
-                */
-               private string CreateOptWhereClause (OdbcCommand command, int paramCount)
-               {
-                       string [] whereClause = new string [Schema.Rows.Count];
-
-                       int partCount = 0;
-
-                       foreach (DataRow schemaRow in Schema.Rows) {
-                               // exclude non updatable columns
-                               if (! IsUpdatable (schemaRow))
-                                       continue;
-
-                               string columnName = GetColumnName (schemaRow);
-                               if (columnName == String.Empty)
-                                       throw new InvalidOperationException ("Cannot form delete command. Column name is missing!");
-
-                               bool    allowNull  = schemaRow.IsNull ("AllowDBNull") || (bool) schemaRow ["AllowDBNull"];
-                               OdbcType sqlDbType = schemaRow.IsNull ("ProviderType") ? OdbcType.VarChar : (OdbcType) schemaRow ["ProviderType"];
-                               int     length     = schemaRow.IsNull ("ColumnSize") ? -1 : (int) schemaRow ["ColumnSize"];
-
-                               if (allowNull) {
-                                       whereClause [partCount++] = String.Format ("((? = 1 AND {0} IS NULL) OR ({0} = ?))",
-                                               GetQuotedString (columnName));
-                                       OdbcParameter nullParam = AddParameter (
-                                               command,
-                                               GetParameterName (++paramCount),
-                                               OdbcType.Int,
-                                               length,
-                                               columnName,
-                                               DataRowVersion.Original);
-                                       nullParam.Value = 1;
-                                       AddParameter (command, GetParameterName (++paramCount),
-                                               sqlDbType, length, columnName,
-                                               DataRowVersion.Original);
-                               } else {
-                                       whereClause [partCount++] = String.Format ("({0} = ?)",
-                                               GetQuotedString (columnName));
-                                       AddParameter (command, GetParameterName (++paramCount),
-                                               sqlDbType, length, columnName,
-                                               DataRowVersion.Original);
-                               }
-                       }
-
-                       return String.Join (" AND ", whereClause, 0, partCount);
-               }
-
-               private void CreateNewCommand (ref OdbcCommand command)
-               {
-                       OdbcCommand sourceCommand = SelectCommand;
-                       if (command == null) {
-                               command = new OdbcCommand ();
-                               command.Connection = sourceCommand.Connection;
-                               command.CommandTimeout = sourceCommand.CommandTimeout;
-                               command.Transaction = sourceCommand.Transaction;
-                       }
-                       command.CommandType = CommandType.Text;
-                       command.UpdatedRowSource = UpdateRowSource.None;
-                       command.Parameters.Clear ();
-               }
-               
-               private OdbcCommand CreateInsertCommand (bool option)
-               {
-                       CreateNewCommand (ref _insertCommand);
-
-                       string query = String.Format ("INSERT INTO {0}", GetQuotedString (TableName));
-                       string [] columns = new string [Schema.Rows.Count];
-                       string [] values  = new string [Schema.Rows.Count];
-
-                       int count = 0;
-
-                       foreach (DataRow schemaRow in Schema.Rows) {
-                               // exclude non updatable columns
-                               if (! IsUpdatable (schemaRow))
-                                       continue;
-
-                               string columnName = GetColumnName (schemaRow);
-                               if (columnName == String.Empty)
-                                       throw new InvalidOperationException ("Cannot form insert command. Column name is missing!");
-
-                               // create column string & value string
-                               columns [count] = GetQuotedString (columnName);
-                               values [count++] = "?";
-
-                               // create parameter and add
-                               OdbcType sqlDbType = schemaRow.IsNull ("ProviderType") ? OdbcType.VarChar : (OdbcType) schemaRow ["ProviderType"];
-                               int length = schemaRow.IsNull ("ColumnSize") ? -1 : (int) schemaRow ["ColumnSize"];
-
-                               AddParameter (_insertCommand, GetParameterName (count),
-                                       sqlDbType, length, columnName, DataRowVersion.Current);
-                       }
-
-                       query = String.Format (
-                               "{0} ({1}) VALUES ({2})", 
-                               query, 
-                               String.Join (", ", columns, 0, count),
-                               String.Join (", ", values, 0, count));
-                       _insertCommand.CommandText = query;
-                       return _insertCommand;
-               }
-
-               public
-               new
-               OdbcCommand GetInsertCommand ()
-               {
-                       // FIXME: check validity of adapter
-                       if (_insertCommand != null)
-                               return _insertCommand;
-
-                       if (_schema == null)
-                               RefreshSchema ();
-
-                       return CreateInsertCommand (false);
-               }
-
-               public new OdbcCommand GetInsertCommand (bool useColumnsForParameterNames)
-               {
-                       // FIXME: check validity of adapter
-                       if (_insertCommand != null)
-                               return _insertCommand;
-
-                       if (_schema == null)
-                               RefreshSchema ();
-
-                       return CreateInsertCommand (useColumnsForParameterNames);
-               }
-
-               private OdbcCommand CreateUpdateCommand (bool option)
-               {
-                       CreateNewCommand (ref _updateCommand);
-
-                       string query = String.Format ("UPDATE {0} SET", GetQuotedString (TableName));
-                       string [] setClause = new string [Schema.Rows.Count];
-
-                       int count = 0;
-
-                       foreach (DataRow schemaRow in Schema.Rows) {
-                               // exclude non updatable columns
-                               if (! IsUpdatable (schemaRow))
-                                       continue;
-
-                               string columnName = GetColumnName (schemaRow);
-                               if (columnName == String.Empty)
-                                       throw new InvalidOperationException ("Cannot form update command. Column name is missing!");
-
-                               OdbcType sqlDbType = schemaRow.IsNull ("ProviderType") ? OdbcType.VarChar : (OdbcType) schemaRow ["ProviderType"];
-                               int length = schemaRow.IsNull ("ColumnSize") ? -1 : (int) schemaRow ["ColumnSize"];
-
-                               // create column = value string
-                               setClause [count++] = String.Format ("{0} = ?", GetQuotedString (columnName));
-                               AddParameter (_updateCommand, GetParameterName (count),
-                                       sqlDbType, length, columnName, DataRowVersion.Current);
-                       }
-
-                       // create where clause. odbc uses positional parameters. so where class
-                       // is created seperate from the above loop.
-                       string whereClause = CreateOptWhereClause (_updateCommand, count);
-                       
-                       query = String.Format (
-                               "{0} {1} WHERE ({2})",
-                               query,
-                               String.Join (", ", setClause, 0, count),
-                               whereClause);
-                       _updateCommand.CommandText = query;
-                       return _updateCommand;
-               }
-               
-               public
-               new
-               OdbcCommand GetUpdateCommand ()
-               {
-                       // FIXME: check validity of adapter
-                       if (_updateCommand != null)
-                               return _updateCommand;
-
-                       if (_schema == null)
-                               RefreshSchema ();
-
-                       return CreateUpdateCommand (false);
-               }
-
-               public new OdbcCommand GetUpdateCommand (bool useColumnsForParameterNames)
-               {
-                       // FIXME: check validity of adapter
-                       if (_updateCommand != null)
-                               return _updateCommand;
-
-                       if (_schema == null)
-                               RefreshSchema ();
-
-                       return CreateUpdateCommand (useColumnsForParameterNames);
-               }
-
-               private OdbcCommand CreateDeleteCommand (bool option)
-               {
-                       CreateNewCommand (ref _deleteCommand);
-
-                       string query = String.Format (
-                               "DELETE FROM {0}",
-                               GetQuotedString (TableName));
-                       string whereClause = CreateOptWhereClause (_deleteCommand, 0);
-                       
-                       query = String.Format (
-                               "{0} WHERE ({1})",
-                               query,
-                               whereClause);
-                       _deleteCommand.CommandText = query;
-                       return _deleteCommand;
-               }
-
-               public
-               new
-               OdbcCommand GetDeleteCommand ()
-               {
-                       // FIXME: check validity of adapter
-                       if (_deleteCommand != null)
-                               return _deleteCommand;
-
-                       if (_schema == null)
-                               RefreshSchema ();
-                       
-                       return CreateDeleteCommand (false);
-               }
-
-               public new OdbcCommand GetDeleteCommand (bool useColumnsForParameterNames)
-               {
-                       // FIXME: check validity of adapter
-                       if (_deleteCommand != null)
-                               return _deleteCommand;
-
-                       if (_schema == null)
-                               RefreshSchema ();
-
-                       return CreateDeleteCommand (useColumnsForParameterNames);
-               }
-
-               new
-               void RefreshSchema ()
-               {
-                       // creates metadata
-                       if (SelectCommand == null)
-                               throw new InvalidOperationException ("SelectCommand should be valid");
-                       if (SelectCommand.Connection == null)
-                               throw new InvalidOperationException ("SelectCommand's Connection should be valid");
-                       
-                       CommandBehavior behavior = CommandBehavior.SchemaOnly | CommandBehavior.KeyInfo;
-                       if (SelectCommand.Connection.State != ConnectionState.Open) {
-                               SelectCommand.Connection.Open ();
-                               behavior |= CommandBehavior.CloseConnection;
-                       }
-                       
-                       OdbcDataReader reader = SelectCommand.ExecuteReader (behavior);
-                       _schema = reader.GetSchemaTable ();
-                       reader.Close ();
-                       
-                       // force creation of commands
-                       _insertCommand  = null;
-                       _updateCommand  = null;
-                       _deleteCommand  = null;
-                       _tableName      = String.Empty;
-               }
-
-               protected override
-               string GetParameterName (int parameterOrdinal)
-               {
-                       return String.Format ("p{0}", parameterOrdinal);
-               }
-
-
-               protected override void ApplyParameterInfo (DbParameter parameter,
-                                                           DataRow datarow,
-                                                           StatementType statementType,
-                                                           bool whereClause)
-               {
-                       OdbcParameter odbcParam = (OdbcParameter) parameter;
-                       odbcParam.Size = int.Parse (datarow ["ColumnSize"].ToString ());
-                       if (datarow ["NumericPrecision"] != DBNull.Value)
-                               odbcParam.Precision = byte.Parse (datarow ["NumericPrecision"].ToString ());
-                       if (datarow ["NumericScale"] != DBNull.Value)
-                               odbcParam.Scale = byte.Parse (datarow ["NumericScale"].ToString ());
-                       odbcParam.DbType = (DbType) datarow ["ProviderType"];
-               }
-
-               protected override string GetParameterName (string parameterName)
-               {
-                       return String.Format("@{0}", parameterName);
-               }
-
-               protected override string GetParameterPlaceholder (int parameterOrdinal)
-               {
-                       return GetParameterName (parameterOrdinal);
-               }
-
-               // FIXME: According to MSDN - "if this method is called again with
-               // the same DbDataAdapter, the DbCommandBuilder is unregistered for 
-               // that DbDataAdapter's RowUpdating event" - this behaviour is yet
-               // to be verified
-               protected override void SetRowUpdatingHandler (DbDataAdapter adapter)
-               {
-                       if (!(adapter is OdbcDataAdapter))
-                               throw new InvalidOperationException ("Adapter needs to be a SqlDataAdapter");
-                       if (rowUpdatingHandler == null)
-                               rowUpdatingHandler = new OdbcRowUpdatingEventHandler (OnRowUpdating);
-
-                       ((OdbcDataAdapter) adapter).RowUpdating += rowUpdatingHandler;
-               }
-
-               public override string QuoteIdentifier (string unquotedIdentifier)
-               {
-                       return QuoteIdentifier (unquotedIdentifier, null);
-               }
-
-               public string QuoteIdentifier (string unquotedIdentifier, OdbcConnection connection)
-               {
-                       if (unquotedIdentifier == null)
-                               throw new ArgumentNullException ("unquotedIdentifier");
-
-                       string prefix = QuotePrefix;
-                       string suffix = QuoteSuffix;
-
-                       if (QuotePrefix.Length == 0) {
-                               if (connection == null)
-                                       throw new InvalidOperationException (
-                                               "An open connection is required if "
-                                               + "QuotePrefix is not set.");
-                               prefix = suffix = GetQuoteCharacter (connection);
-                       }
-
-                       if (prefix.Length > 0 && prefix != " ") {
-                               string escaped;
-                               if (suffix.Length > 0)
-                                       escaped = unquotedIdentifier.Replace (
-                                               suffix, suffix + suffix);
-                               else
-                                       escaped = unquotedIdentifier;
-                               return string.Concat (prefix, escaped, suffix);
-                       }
-                       return unquotedIdentifier;
-               }
-
-               public string UnquoteIdentifier (string quotedIdentifier, OdbcConnection connection)
-               {
-                       return UnquoteIdentifier (quotedIdentifier);
-               }
-
-               public override string UnquoteIdentifier (string quotedIdentifier)
-               {
-                       if (quotedIdentifier == null || quotedIdentifier.Length == 0)
-                               return quotedIdentifier;
-                       
-                       StringBuilder sb = new StringBuilder (quotedIdentifier.Length);
-                       sb.Append (quotedIdentifier);
-                       if (quotedIdentifier.StartsWith (QuotePrefix))
-                               sb.Remove (0,QuotePrefix.Length);
-                       if (quotedIdentifier.EndsWith (QuoteSuffix))
-                               sb.Remove (sb.Length - QuoteSuffix.Length, QuoteSuffix.Length );
-                       return sb.ToString ();
-               }
-
-               private void OnRowUpdating (object sender, OdbcRowUpdatingEventArgs args)
-               {
-                       if (args.Command != null)
-                               return;
-                       try {
-                               switch (args.StatementType) {
-                               case StatementType.Insert:
-                                       args.Command = GetInsertCommand ();
-                                       break;
-                               case StatementType.Update:
-                                       args.Command = GetUpdateCommand ();
-                                       break;
-                               case StatementType.Delete:
-                                       args.Command = GetDeleteCommand ();
-                                       break;
-                               }
-                       } catch (Exception e) {
-                               args.Errors = e;
-                               args.Status = UpdateStatus.ErrorsOccurred;
-                       }
-               }
-
-               string GetQuotedString (string unquotedIdentifier)
-               {
-                       string prefix = QuotePrefix;
-                       string suffix = QuoteSuffix;
-
-                       if (prefix.Length == 0 && suffix.Length == 0)
-                               return unquotedIdentifier;
-
-                       return String.Format ("{0}{1}{2}", prefix,
-                               unquotedIdentifier, suffix);
-               }
-
-               bool IsCommandGenerated {
-                       get {
-                               return (_insertCommand != null || _updateCommand != null || _deleteCommand != null);
-                       }
-               }
-
-               string GetQuoteCharacter (OdbcConnection conn)
-               {
-                       return conn.GetInfo (OdbcInfo.IdentifierQuoteChar);
-               }
-
-               #endregion // Methods
-       }
-}
diff --git a/mcs/class/System.Data/System.Data.Odbc/OdbcConnection.cs b/mcs/class/System.Data/System.Data.Odbc/OdbcConnection.cs
deleted file mode 100644 (file)
index 05b52b7..0000000
+++ /dev/null
@@ -1,582 +0,0 @@
-//
-// System.Data.Odbc.OdbcConnection
-//
-// Authors:
-//  Brian Ritchie (brianlritchie@hotmail.com) 
-//
-// Copyright (C) Brian Ritchie, 2002
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Collections;
-using System.ComponentModel;
-using System.Data;
-using System.Data.Common;
-using System.EnterpriseServices;
-using System.Runtime.InteropServices;
-using System.Text;
-using System.Transactions;
-
-namespace System.Data.Odbc
-{
-       [DefaultEvent ("InfoMessage")]
-       public sealed class OdbcConnection : DbConnection, ICloneable
-       {
-               #region Fields
-
-               string connectionString;
-               int connectionTimeout;
-               internal OdbcTransaction transaction;
-               IntPtr henv = IntPtr.Zero;
-               IntPtr hdbc = IntPtr.Zero;
-               bool disposed;
-               ArrayList linkedCommands;
-
-               #endregion
-
-               #region Constructors
-               
-               public OdbcConnection () : this (String.Empty)
-               {
-               }
-
-               public OdbcConnection (string connectionString)
-               {
-                       connectionTimeout = 15;
-                       ConnectionString = connectionString;
-               }
-
-               #endregion // Constructors
-
-               #region Properties
-
-               internal IntPtr hDbc {
-                       get { return hdbc; }
-               }
-
-               internal object Generation {
-                       // We use the linkedCommands array as a generation indicator for statement
-                       // handles allocated in our subsiduary OdbcCommands.  The rule is that the
-                       // statement handles are only valid if the generation matches the one
-                       // returned when the command was linked to the connection.
-                       get { return linkedCommands; }
-               }
-
-               [OdbcCategoryAttribute ("DataCategory_Data")]
-               [DefaultValue ("")]
-               [OdbcDescriptionAttribute ("Information used to connect to a Data Source")]
-               [RefreshPropertiesAttribute (RefreshProperties.All)]
-               [EditorAttribute ("Microsoft.VSDesigner.Data.Odbc.Design.OdbcConnectionStringEditor, "+ Consts.AssemblyMicrosoft_VSDesigner, "System.Drawing.Design.UITypeEditor, "+ Consts.AssemblySystem_Drawing )]
-               [RecommendedAsConfigurableAttribute (true)]
-               public
-               override
-               string ConnectionString {
-                       get {
-                               if (connectionString == null)
-                                       return string.Empty;
-                               return connectionString;
-                       }
-                       set { connectionString = value; }
-               }
-               
-               [OdbcDescriptionAttribute ("Current connection timeout value, not settable  in the ConnectionString")]
-               [DefaultValue (15)]
-               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
-               public
-               new
-               int ConnectionTimeout {
-                       get {
-                               return connectionTimeout;
-                       }
-                       set {
-                               if (value < 0)
-                                       throw new ArgumentException("Timout should not be less than zero.");
-                               connectionTimeout = value;
-                       }
-               }
-
-               [DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Hidden)]
-               [OdbcDescriptionAttribute ("Current data source Catlog value, 'Database=X' in the ConnectionString")]
-               public
-               override
-               string Database {
-                       get {
-                               if (State == ConnectionState.Closed)
-                                       return string.Empty;
-                               return GetInfo (OdbcInfo.DatabaseName);
-                       }
-               }
-
-               [DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Hidden)]
-               [OdbcDescriptionAttribute ("The ConnectionState indicating whether the connection is open or closed")]
-               [BrowsableAttribute (false)]
-               public
-               override
-               ConnectionState State {
-                       get {
-                               if (hdbc != IntPtr.Zero)
-                                       return ConnectionState.Open;
-                               return ConnectionState.Closed;
-                       }
-               }
-
-               [DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Hidden)]
-               [OdbcDescriptionAttribute ("Current data source, 'Server=X' in the ConnectionString")]
-               [Browsable (false)]
-               public
-               override
-               string DataSource {
-                       get {
-                               if (State == ConnectionState.Closed)
-                                       return string.Empty;
-                               return GetInfo (OdbcInfo.DataSourceName);
-                       }
-               }
-
-               [Browsable (false)]
-               [DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Hidden)]
-               [OdbcDescriptionAttribute ("Current ODBC Driver")]
-               public string Driver {
-                       get {
-                               if (State == ConnectionState.Closed)
-                                       return string.Empty;
-
-                               return GetInfo (OdbcInfo.DriverName);
-                       }
-               }
-               
-               [DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Hidden)]
-               [OdbcDescriptionAttribute ("Version of the product accessed by the ODBC Driver")]
-               [BrowsableAttribute (false)]
-               public
-               override
-               string ServerVersion {
-                       get {
-                               return GetInfo (OdbcInfo.DbmsVersion);
-                       }
-               }
-
-               internal string SafeDriver {
-                       get {
-                               string driver_name = GetSafeInfo (OdbcInfo.DriverName);
-                               if (driver_name == null)
-                                       return string.Empty;
-                               return driver_name;
-                       }
-               }
-
-               #endregion // Properties
-       
-               #region Methods
-       
-               public
-               new
-               OdbcTransaction BeginTransaction ()
-               {
-                       return BeginTransaction (IsolationLevel.Unspecified);
-               }
-
-
-               protected override DbTransaction BeginDbTransaction (IsolationLevel isolationLevel)
-               {
-                       return BeginTransaction (isolationLevel);
-               }
-
-               public
-               new
-               OdbcTransaction BeginTransaction (IsolationLevel isolevel)
-               {
-                       if (State == ConnectionState.Closed)
-                               throw ExceptionHelper.ConnectionClosed ();
-
-                       if (transaction == null) {
-                               transaction = new OdbcTransaction (this, isolevel);
-                               return transaction;
-                       } else
-                               throw new InvalidOperationException ();
-               }
-
-
-               public
-               override
-               void Close ()
-               {
-                       OdbcReturn ret = OdbcReturn.Error;
-                       if (State == ConnectionState.Open) {
-                               lock(this) {
-                                       // close any associated commands
-                                       // NOTE: we may 'miss' some if the garbage collector has
-                                       // already started to destroy them.
-                                       if (linkedCommands != null) {
-                                               for (int i = 0; i < linkedCommands.Count; i++) {
-                                                       WeakReference wr = (WeakReference) linkedCommands [i];
-                                                       if (wr == null)
-                                                               continue;
-                                                       OdbcCommand c = (OdbcCommand) wr.Target;
-                                                       if (c != null)
-                                                               c.Unlink ();
-                                               }
-                                               linkedCommands = null;
-                                       }
-
-                                       // disconnect
-                                       ret = libodbc.SQLDisconnect (hdbc);
-
-                               }
-                               // There could be OdbcCommands outstanding (see NOTE above); their
-                               // hstmts will have been freed and therefore will be invalid.
-                               // However, they will find that their definition of Generation
-                               // does not match the connection's, so they won't try and free
-                               // those hstmt.
-                               if ((ret != OdbcReturn.Success) && (ret != OdbcReturn.SuccessWithInfo))
-                                       throw CreateOdbcException (OdbcHandleType.Dbc, hdbc);
-
-                               FreeHandles ();
-                               transaction = null;
-                               RaiseStateChange (ConnectionState.Open, ConnectionState.Closed);
-                       }
-               }
-
-               public
-               new
-               OdbcCommand CreateCommand ()
-               {
-                       return new OdbcCommand (string.Empty, this, transaction);
-               }
-
-               public
-               override
-               void ChangeDatabase (string value)
-               {
-                       IntPtr ptr = IntPtr.Zero;
-                       OdbcReturn ret = OdbcReturn.Error;
-
-                       try {
-                               ptr = Marshal.StringToHGlobalUni (value);
-                               ret = libodbc.SQLSetConnectAttr (hdbc, OdbcConnectionAttribute.CurrentCatalog, ptr, value.Length * 2);
-
-                               if (ret != OdbcReturn.Success && ret != OdbcReturn.SuccessWithInfo)
-                                       throw CreateOdbcException (OdbcHandleType.Dbc, hdbc);
-                       } finally {
-                               if (ptr != IntPtr.Zero)
-                                       Marshal.FreeCoTaskMem (ptr);
-                       }
-               }
-
-               protected override void Dispose (bool disposing)
-               {
-                       if (!this.disposed) {
-                               try {
-                                       // release the native unmananged resources
-                                       this.Close ();
-                                       this.disposed = true;
-                               } finally {
-                                       // call Dispose on the base class
-                                       base.Dispose (disposing);
-                               }
-                       }
-               }
-
-               [MonoTODO]
-               object ICloneable.Clone ()
-               {
-                       throw new NotImplementedException ();
-               }
-
-
-               protected override DbCommand CreateDbCommand ()
-               {
-                       return CreateCommand ();
-               }
-
-               public
-               override
-               void Open ()
-               {
-                       if (State == ConnectionState.Open)
-                               throw new InvalidOperationException ();
-
-                       OdbcReturn ret = OdbcReturn.Error;
-                       OdbcException e = null;
-               
-                       try {
-                               // allocate Environment handle
-                               ret = libodbc.SQLAllocHandle (OdbcHandleType.Env, IntPtr.Zero, ref henv);
-                               if ((ret != OdbcReturn.Success) && (ret != OdbcReturn.SuccessWithInfo)) {
-                                       OdbcErrorCollection errors = new OdbcErrorCollection ();
-                                       errors.Add (new OdbcError (SafeDriver, "Error in " + SafeDriver, "", 1));
-                                       e = new OdbcException (errors);
-                                       MessageHandler (e);
-                                       throw e;
-                               }
-
-                               ret = libodbc.SQLSetEnvAttr (henv, OdbcEnv.OdbcVersion, (IntPtr) libodbc.SQL_OV_ODBC3 , 0); 
-                               if ((ret != OdbcReturn.Success) && (ret != OdbcReturn.SuccessWithInfo))
-                                       throw CreateOdbcException (OdbcHandleType.Env, henv);
-
-                               // allocate connection handle
-                               ret = libodbc.SQLAllocHandle (OdbcHandleType.Dbc, henv, ref hdbc);
-                               if ((ret != OdbcReturn.Success) && (ret != OdbcReturn.SuccessWithInfo))
-                                       throw CreateOdbcException (OdbcHandleType.Env, henv);
-
-                               // DSN connection
-                               if (ConnectionString.ToLower ().IndexOf ("dsn=") >= 0) {
-                                       string _uid = string.Empty, _pwd = string.Empty, _dsn = string.Empty;
-                                       string [] items = ConnectionString.Split (new char[1] {';'});
-                                       foreach (string item in items)
-                                       {
-                                               string [] parts = item.Split (new char[1] {'='});
-                                               switch (parts [0].Trim ().ToLower ()) {
-                                               case "dsn":
-                                                       _dsn = parts [1].Trim ();
-                                                       break;
-                                               case "uid":
-                                                       _uid = parts [1].Trim ();
-                                                       break;
-                                               case "pwd":
-                                                       _pwd = parts [1].Trim ();
-                                                       break;
-                                               }
-                                       }
-                                       ret = libodbc.SQLConnect(hdbc, _dsn, -3, _uid, -3, _pwd, -3);
-                                       if ((ret != OdbcReturn.Success) && (ret != OdbcReturn.SuccessWithInfo))
-                                               throw CreateOdbcException (OdbcHandleType.Dbc, hdbc);
-                               } else {
-                                       // DSN-less Connection
-                                       string OutConnectionString = new String (' ',1024);
-                                       short OutLen = 0;
-                                       ret = libodbc.SQLDriverConnect (hdbc, IntPtr.Zero, ConnectionString, -3, 
-                                               OutConnectionString, (short) OutConnectionString.Length, ref OutLen, 0);
-                                       if ((ret != OdbcReturn.Success) && (ret != OdbcReturn.SuccessWithInfo))
-                                               throw CreateOdbcException (OdbcHandleType.Dbc, hdbc);
-                               }
-
-                               RaiseStateChange (ConnectionState.Closed, ConnectionState.Open);
-                       } catch {
-                               // free handles if any.
-                               FreeHandles ();
-                               throw;
-                       }
-                       disposed = false;
-               }
-
-               [MonoTODO]
-               public static void ReleaseObjectPool ()
-               {
-                       throw new NotImplementedException ();
-               }
-
-               private void FreeHandles ()
-               {
-                       OdbcReturn ret = OdbcReturn.Error;
-                       if (hdbc != IntPtr.Zero) {
-                               ret = libodbc.SQLFreeHandle ((ushort) OdbcHandleType.Dbc, hdbc);
-                               if ( (ret != OdbcReturn.Success) && (ret != OdbcReturn.SuccessWithInfo))
-                                       throw CreateOdbcException (OdbcHandleType.Dbc, hdbc);
-                       }
-                       hdbc = IntPtr.Zero;
-
-                       if (henv != IntPtr.Zero) {
-                               ret = libodbc.SQLFreeHandle ((ushort) OdbcHandleType.Env, henv);
-                               if ( (ret != OdbcReturn.Success) && (ret != OdbcReturn.SuccessWithInfo))
-                                       throw CreateOdbcException (OdbcHandleType.Env, henv);
-                       }
-                       henv = IntPtr.Zero;
-               }
-
-               public override DataTable GetSchema ()
-               {
-                       if (State == ConnectionState.Closed)
-                               throw ExceptionHelper.ConnectionClosed ();
-                       return MetaDataCollections.Instance;
-               }
-
-               public override DataTable GetSchema (string collectionName)
-               {
-                       return GetSchema (collectionName, null);
-               }
-
-               public override DataTable GetSchema (string collectionName, string [] restrictionValues)
-               {
-                       if (State == ConnectionState.Closed)
-                               throw ExceptionHelper.ConnectionClosed ();
-                       return GetSchema (collectionName, null);
-               }
-
-               [MonoTODO]
-               public override void EnlistTransaction (Transaction transaction)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               public void EnlistDistributedTransaction (ITransaction transaction)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               internal string GetInfo (OdbcInfo info)
-               {
-                       if (State == ConnectionState.Closed)
-                               throw new InvalidOperationException ("The connection is closed.");
-
-                       OdbcReturn ret = OdbcReturn.Error;
-                       short max_length = 512;
-                       byte [] buffer = new byte [512];
-                       short actualLength = 0;
-
-                       ret = libodbc.SQLGetInfo (hdbc, info, buffer, max_length, ref actualLength);
-                       if (ret != OdbcReturn.Success && ret != OdbcReturn.SuccessWithInfo)
-                               throw CreateOdbcException (OdbcHandleType.Dbc, hdbc);
-                       return Encoding.Unicode.GetString (buffer, 0, actualLength);
-               }
-
-               string GetSafeInfo (OdbcInfo info)
-               {
-                       if (State == ConnectionState.Closed)
-                               return null;
-
-                       OdbcReturn ret = OdbcReturn.Error;
-                       short max_length = 512;
-                       byte [] buffer = new byte [512];
-                       short actualLength = 0;
-
-                       ret = libodbc.SQLGetInfo (hdbc, info, buffer, max_length, ref actualLength);
-                       if (ret != OdbcReturn.Success && ret != OdbcReturn.SuccessWithInfo)
-                               return null;
-                       return Encoding.Unicode.GetString (buffer, 0, actualLength);
-               }
-
-               private void RaiseStateChange (ConnectionState from, ConnectionState to)
-               {
-                       base.OnStateChange (new StateChangeEventArgs (from, to));
-               }
-
-               private OdbcInfoMessageEventArgs CreateOdbcInfoMessageEvent (OdbcErrorCollection errors)
-               {
-                       return new OdbcInfoMessageEventArgs (errors);
-               }
-
-               private void OnOdbcInfoMessage (OdbcInfoMessageEventArgs e)
-               {
-                       if (InfoMessage != null)
-                               InfoMessage (this, e);
-               }
-
-               internal OdbcException CreateOdbcException (OdbcHandleType HandleType, IntPtr Handle)
-               {
-                       short buflen = 256;
-                       short txtlen = 0;
-                       int nativeerror = 0;
-                       OdbcReturn ret = OdbcReturn.Success;
-
-                       OdbcErrorCollection errors = new OdbcErrorCollection ();
-
-                       while (true) {
-                               byte [] buf_MsgText = new byte [buflen * 2];
-                               byte [] buf_SqlState = new byte [buflen * 2];
-
-                               switch (HandleType) {
-                               case OdbcHandleType.Dbc:
-                                       ret = libodbc.SQLError (IntPtr.Zero, Handle, IntPtr.Zero, buf_SqlState,
-                                               ref nativeerror, buf_MsgText, buflen, ref txtlen);
-                                       break;
-                               case OdbcHandleType.Stmt:
-                                       ret = libodbc.SQLError (IntPtr.Zero, IntPtr.Zero, Handle, buf_SqlState,
-                                               ref nativeerror, buf_MsgText, buflen, ref txtlen);
-                                       break;
-                               case OdbcHandleType.Env:
-                                       ret = libodbc.SQLError (Handle, IntPtr.Zero, IntPtr.Zero, buf_SqlState,
-                                               ref nativeerror, buf_MsgText, buflen, ref txtlen);
-                                       break;
-                               }
-
-                               if (ret != OdbcReturn.Success)
-                                       break;
-
-                               string state = RemoveTrailingNullChar (Encoding.Unicode.GetString (buf_SqlState));
-                               string message = Encoding.Unicode.GetString (buf_MsgText, 0, txtlen * 2);
-
-                               errors.Add (new OdbcError (SafeDriver, message, state, nativeerror));
-                       }
-
-                       string source = SafeDriver;
-                       foreach (OdbcError error in errors)
-                               error.SetSource (source);
-                       return new OdbcException (errors);
-               }
-
-               static string RemoveTrailingNullChar (string value)
-               {
-                       return value.TrimEnd ('\0');
-               }
-
-               internal object Link (OdbcCommand cmd)
-               {
-                       lock(this) {
-                               if (linkedCommands == null)
-                                       linkedCommands = new ArrayList ();
-                               linkedCommands.Add (new WeakReference (cmd));
-                               return linkedCommands;
-                       }
-               }
-
-               internal object Unlink (OdbcCommand cmd)
-               {
-                       lock(this) {
-                               if (linkedCommands == null)
-                                       return null;
-
-                               for (int i = 0; i < linkedCommands.Count; i++) {
-                                       WeakReference wr = (WeakReference) linkedCommands [i];
-                                       if (wr == null)
-                                               continue;
-                                       OdbcCommand c = (OdbcCommand) wr.Target;
-                                       if (c == cmd) {
-                                               linkedCommands [i] = null;
-                                               break;
-                                       }
-                               }
-                               return linkedCommands;
-                       }
-               }
-
-               #endregion
-
-               #region Events and Delegates
-
-
-               [OdbcDescription ("DbConnection_InfoMessage")]
-               [OdbcCategory ("DataCategory_InfoMessage")]
-               public event OdbcInfoMessageEventHandler InfoMessage;
-
-               private void MessageHandler (OdbcException e)
-               {
-                       OnOdbcInfoMessage (CreateOdbcInfoMessageEvent (e.Errors));
-               }
-
-               #endregion
-       }
-}
diff --git a/mcs/class/System.Data/System.Data.Odbc/OdbcConnectionFactory.cs b/mcs/class/System.Data/System.Data.Odbc/OdbcConnectionFactory.cs
deleted file mode 100644 (file)
index 36d9553..0000000
+++ /dev/null
@@ -1,140 +0,0 @@
-//
-// System.Data.Odbc.OdbcConnectionFactory
-//
-// Author:
-//   Sureshkumar T <tsureshkumar@novell.com>
-//
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-using System.Data;
-using System.Data.Common;
-
-namespace System.Data.Odbc {
-       internal class OdbcConnectionFactory : DbConnectionFactory
-       {
-               #region Fields
-               internal static OdbcConnectionFactory Instance; // singleton
-                private static DbProviderFactory _providerFactory;
-               static readonly object lockobj = new object ();
-               #endregion // Fields
-
-               #region Constructors
-
-               private OdbcConnectionFactory (DbProviderFactory pvdrfactory)
-               {
-                        _providerFactory = pvdrfactory;
-               }
-
-               #endregion // Constructors
-
-               #region Properties
-
-               public override DbProviderFactory ProviderFactory { get { return _providerFactory; }}
-
-               #endregion // Properties
-
-               #region Methods
-
-                // create singleton connection factory.
-                internal static OdbcConnectionFactory GetSingleton (OdbcFactory pvdrFactory)
-                {
-                        lock (lockobj) 
-                                {
-                                        if (Instance == null)
-                                                Instance = new OdbcConnectionFactory (pvdrFactory);
-                                        return Instance;
-                                }
-                }
-
-               [MonoTODO]
-                protected override IAsyncResult BeginCreateConnection (DbConnectionBase owningObject, DbConnectionString connectionOptions, DbConnectionInternal connection, AsyncCallback callback, object asyncStateObject)
-                {
-                        throw new NotImplementedException ();
-                }
-
-               [MonoTODO]
-                public new void ClearAllPools ()
-                {
-                        throw new NotImplementedException ();
-                }
-
-               [MonoTODO]
-                public new void ClearPool (DbConnectionBase connection)
-                {
-                        throw new NotImplementedException ();
-                }
-
-                [MonoTODO]
-               protected override DbConnectionInternal CreateConnection (DbConnectionString options, DbConnectionBase owningObject)
-                {
-                        throw new NotImplementedException ();
-                }
-                
-                [MonoTODO]
-               protected override DbConnectionString CreateConnectionOptions (string connectionString)
-                {
-                        throw new NotImplementedException ();
-                }
-
-                [MonoTODO]
-               protected override DbConnectionPoolOptions CreateConnectionPoolOptions (DbConnectionString options)
-                {
-                        throw new NotImplementedException ();
-                }
-
-
-               [MonoTODO]
-                protected override DbMetaDataFactory CreateMetaDataFactory (DbConnectionInternal internalConnection)
-                {
-                        throw new NotImplementedException ();
-                }
-
-               [MonoTODO]
-                protected override DbConnectionInternal EndCreateConnection (IAsyncResult asyncResult)
-                {
-                        throw new NotImplementedException ();
-                }
-
-               [MonoTODO]
-                protected internal new DbMetaDataFactory GetMetaDataFactory (DbConnectionString connectionOptions, DbConnectionInternal internalConnection)
-                {
-                        throw new NotImplementedException ();
-                }
-
-               internal new DbConnectionString CreateConnectionOptionsInternal (string connectionString)
-                {
-                        return CreateConnectionOptions (connectionString);
-                }
-
-               [MonoTODO]
-                public new void SetConnectionPoolOptions (string connectionString, DbConnectionPoolOptions poolOptions)
-                {
-                        throw new NotImplementedException ();
-                }
-
-               #endregion // Methods
-        }
-}
-
diff --git a/mcs/class/System.Data/System.Data.Odbc/OdbcDataAdapter.cs b/mcs/class/System.Data/System.Data.Odbc/OdbcDataAdapter.cs
deleted file mode 100644 (file)
index b48170d..0000000
+++ /dev/null
@@ -1,181 +0,0 @@
-//
-// System.Data.Odbc.OdbcDataAdapter.cs
-//
-// Author:
-//   Rodrigo Moya (rodrigo@ximian.com)
-//   Daniel Morgan (danmorg@sc.rr.com)
-//   Tim Coleman (tim@timcoleman.com)
-//
-// (C) Ximian, Inc 2002
-// Copyright (C) 2002 Tim Coleman
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.ComponentModel;
-using System.Data;
-using System.Data.Common;
-
-namespace System.Data.Odbc
-{
-       [DefaultEvent ("RowUpdated")]
-       [DesignerAttribute ("Microsoft.VSDesigner.Data.VS.OdbcDataAdapterDesigner, "+ Consts.AssemblyMicrosoft_VSDesigner, "System.ComponentModel.Design.IDesigner")]
-       [ToolboxItemAttribute ("Microsoft.VSDesigner.Data.VS.OdbcDataAdapterToolboxItem, "+ Consts.AssemblyMicrosoft_VSDesigner)]
-       public sealed class OdbcDataAdapter : DbDataAdapter, IDbDataAdapter, ICloneable
-       {
-               #region Fields
-
-               OdbcCommand deleteCommand;
-               OdbcCommand insertCommand;
-               OdbcCommand selectCommand;
-               OdbcCommand updateCommand;
-
-               #endregion
-
-               #region Constructors
-               
-               public OdbcDataAdapter () : this ((OdbcCommand) null)
-               {
-               }
-
-               public OdbcDataAdapter (OdbcCommand selectCommand) 
-               {
-                       SelectCommand = selectCommand;
-               }
-
-               public OdbcDataAdapter (string selectCommandText, OdbcConnection selectConnection) 
-                       : this (new OdbcCommand (selectCommandText, selectConnection))
-               { 
-               }
-
-               public OdbcDataAdapter (string selectCommandText, string selectConnectionString)
-                       : this (selectCommandText, new OdbcConnection (selectConnectionString))
-               {
-               }
-
-               #endregion
-
-               #region Properties
-
-               [OdbcCategory ("Update")]
-               [OdbcDescription ("Used during Update for deleted rows in DataSet.")]
-               [DefaultValue (null)]
-               [EditorAttribute ("Microsoft.VSDesigner.Data.Design.DBCommandEditor, "+ Consts.AssemblyMicrosoft_VSDesigner, "System.Drawing.Design.UITypeEditor, "+ Consts.AssemblySystem_Drawing )]
-               public new OdbcCommand DeleteCommand {
-                       get { return deleteCommand; }
-                       set { deleteCommand = value; }
-               }
-
-               [OdbcCategory ("Update")]
-               [OdbcDescription ("Used during Update for new rows in DataSet.")]
-               [DefaultValue (null)]
-               [EditorAttribute ("Microsoft.VSDesigner.Data.Design.DBCommandEditor, "+ Consts.AssemblyMicrosoft_VSDesigner, "System.Drawing.Design.UITypeEditor, "+ Consts.AssemblySystem_Drawing )]
-               public new OdbcCommand InsertCommand {
-                       get { return insertCommand; }
-                       set { insertCommand = value; }
-               }
-
-               [OdbcCategory ("Fill")]
-               [OdbcDescription ("Used during Fill/FillSchema.")]
-               [DefaultValue (null)]
-               [EditorAttribute ("Microsoft.VSDesigner.Data.Design.DBCommandEditor, "+ Consts.AssemblyMicrosoft_VSDesigner, "System.Drawing.Design.UITypeEditor, "+ Consts.AssemblySystem_Drawing )]
-               public new OdbcCommand SelectCommand {
-                       get { return selectCommand; }
-                       set { selectCommand = value; }
-               }
-
-               [OdbcCategory ("Update")]
-               [OdbcDescription ("Used during Update for modified rows in DataSet.")]
-               [DefaultValue (null)]
-               [EditorAttribute ("Microsoft.VSDesigner.Data.Design.DBCommandEditor, "+ Consts.AssemblyMicrosoft_VSDesigner, "System.Drawing.Design.UITypeEditor, "+ Consts.AssemblySystem_Drawing )]
-               public new OdbcCommand UpdateCommand {
-                       get { return updateCommand; }
-                       set { updateCommand = value; }
-               }
-
-               IDbCommand IDbDataAdapter.DeleteCommand {
-                       get { return DeleteCommand; }
-                       set { DeleteCommand = (OdbcCommand) value; }
-               }
-
-               IDbCommand IDbDataAdapter.InsertCommand {
-                       get { return InsertCommand; }
-                       set { InsertCommand = (OdbcCommand) value; }
-               }
-
-               IDbCommand IDbDataAdapter.SelectCommand {
-                       get { return SelectCommand; }
-                       set { SelectCommand = (OdbcCommand) value; }
-               }
-
-               IDbCommand IDbDataAdapter.UpdateCommand {
-                       get { return UpdateCommand; }
-                       set { UpdateCommand = (OdbcCommand) value; }
-               }
-
-               #endregion // Properties
-
-               #region Methods
-
-               protected override RowUpdatedEventArgs CreateRowUpdatedEvent (DataRow dataRow, IDbCommand command, StatementType statementType, DataTableMapping tableMapping) 
-               {
-                       return new OdbcRowUpdatedEventArgs (dataRow, command, statementType, tableMapping);
-               }
-
-
-               protected override RowUpdatingEventArgs CreateRowUpdatingEvent (DataRow dataRow, IDbCommand command, StatementType statementType, DataTableMapping tableMapping) 
-               {
-                       return new OdbcRowUpdatingEventArgs (dataRow, command, statementType, tableMapping);
-               }
-
-
-               protected override void OnRowUpdated (RowUpdatedEventArgs value)
-               {
-                       if (RowUpdated != null)
-                               RowUpdated (this, (OdbcRowUpdatedEventArgs) value);
-               }
-
-               protected override void OnRowUpdating (RowUpdatingEventArgs value)
-               {
-                       if (RowUpdating != null)
-                               RowUpdating (this, (OdbcRowUpdatingEventArgs) value);
-               }
-
-               [MonoTODO]
-               object ICloneable.Clone ()
-               {
-                       throw new NotImplementedException ();
-               }
-
-               #endregion // Methods
-
-               #region Events and Delegates
-
-               public event OdbcRowUpdatedEventHandler RowUpdated;
-               public event OdbcRowUpdatingEventHandler RowUpdating;
-
-               #endregion // Events and Delegates
-       }
-}
diff --git a/mcs/class/System.Data/System.Data.Odbc/OdbcDataReader.cs b/mcs/class/System.Data/System.Data.Odbc/OdbcDataReader.cs
deleted file mode 100644 (file)
index 301d082..0000000
+++ /dev/null
@@ -1,1061 +0,0 @@
-//
-// System.Data.Odbc.OdbcDataReader
-//
-// Author:
-//   Brian Ritchie (brianlritchie@hotmail.com) 
-//   Daniel Morgan <danmorg@sc.rr.com>
-//   Sureshkumar T <tsureshkumar@novell.com> (2004)
-//
-// Copyright (C) Brian Ritchie, 2002
-// Copyright (C) Daniel Morgan, 2002
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Collections;
-using System.ComponentModel;
-using System.Data;
-using System.Data.Common;
-using System.Globalization;
-using System.Text;
-
-namespace System.Data.Odbc
-{
-       public sealed class OdbcDataReader : DbDataReader
-       {
-               #region Fields
-               
-               private OdbcCommand command;
-               private bool open;
-               private int currentRow;
-               private OdbcColumn[] cols;
-               private IntPtr hstmt;
-               private int _recordsAffected = -1;
-               bool disposed;
-               private DataTable _dataTableSchema;
-               private CommandBehavior behavior;
-
-               #endregion
-
-               #region Constructors
-
-               internal OdbcDataReader (OdbcCommand command, CommandBehavior behavior)
-               {
-                       this.command = command;
-                       this.CommandBehavior = behavior;
-                       open = true;
-                       currentRow = -1;
-                       hstmt = command.hStmt;
-                       // Init columns array;
-                       short colcount = 0;
-                       libodbc.SQLNumResultCols (hstmt, ref colcount);
-                       cols = new OdbcColumn [colcount];
-                       GetColumns ();
-               }
-
-               internal OdbcDataReader (OdbcCommand command, CommandBehavior behavior,
-                                        int recordAffected) : this (command, behavior)
-               {
-                       _recordsAffected = recordAffected;
-               }
-               
-
-               #endregion
-
-               #region Properties
-
-               private CommandBehavior CommandBehavior {
-                       get { return behavior; }
-                       set { behavior = value; }
-               }
-
-               public
-               override
-               int Depth {
-                       get {
-                               return 0; // no nested selects supported
-                       }
-               }
-
-               public
-               override
-               int FieldCount {
-                       get {
-                               if (IsClosed)
-                                       throw new InvalidOperationException ("The reader is closed.");
-                               return cols.Length;
-                       }
-               }
-
-               public
-               override
-               bool IsClosed {
-                       get {
-                               return !open;
-                       }
-               }
-
-               public
-               override
-               object this [string value] {
-                       get {
-                               int pos = GetOrdinal (value);
-                               return this [pos];
-                       }
-               }
-
-               public
-               override
-               object this [int i] {
-                       get {
-                               return GetValue (i);
-                       }
-               }
-
-               public
-               override
-               int RecordsAffected {
-                       get {
-                               return _recordsAffected;
-                       }
-               }
-
-               [MonoTODO]
-               public
-               override
-               bool HasRows {
-                       get { throw new NotImplementedException(); }
-               }
-
-               private OdbcConnection Connection {
-                       get {
-                               if (command != null)
-                                       return command.Connection;
-                               return null;
-                       }
-               }
-
-               #endregion
-
-               #region Methods
-               
-               private int ColIndex (string colname)
-               {
-                       int i = 0;
-                       foreach (OdbcColumn col in cols) {
-                               if (col != null) {
-                                       if (col.ColumnName == colname)
-                                               return i;
-                                       if (String.Compare (col.ColumnName, colname, true) == 0)
-                                               return i;
-                               }
-                               i++;
-                       }
-                       return -1;
-               }
-
-               // Dynamically load column descriptions as needed.
-               private OdbcColumn GetColumn (int ordinal)
-               {
-                       if (cols [ordinal] == null) {
-                               short bufsize = 255;
-                               byte [] colname_buffer = new byte [bufsize];
-                               string colname;
-                               short colname_size = 0;
-                               uint ColSize = 0;
-                               short DecDigits = 0, Nullable = 0, dt = 0;
-                               OdbcReturn ret = libodbc.SQLDescribeCol (hstmt, Convert.ToUInt16 (ordinal + 1), 
-                                                                        colname_buffer, bufsize, ref colname_size, ref dt, ref ColSize, 
-                                                                        ref DecDigits, ref Nullable);
-                               if ((ret != OdbcReturn.Success) && (ret != OdbcReturn.SuccessWithInfo))
-                                       throw Connection.CreateOdbcException (OdbcHandleType.Stmt, hstmt);
-                               colname = RemoveTrailingNullChar (Encoding.Unicode.GetString (colname_buffer));
-                               OdbcColumn c = new OdbcColumn (colname, (SQL_TYPE) dt);
-                               c.AllowDBNull = (Nullable != 0);
-                               c.Digits = DecDigits;
-                               if (c.IsVariableSizeType)
-                                       c.MaxLength = (int) ColSize;
-                               cols [ordinal] = c;
-                       }
-                       return cols [ordinal];
-               }
-               
-               // Load all column descriptions
-               private void GetColumns ()
-               {
-                       for(int i = 0; i < cols.Length; i++)
-                               GetColumn (i);
-               }
-
-               public
-               override
-               void Close ()
-               {
-                       // FIXME : have to implement output parameter binding
-                       open = false;
-                       currentRow = -1;
-
-                       this.command.FreeIfNotPrepared ();
-
-                       if ((this.CommandBehavior & CommandBehavior.CloseConnection) == CommandBehavior.CloseConnection)
-                               this.command.Connection.Close ();
-               }
-
-
-               public 
-               override
-               bool GetBoolean (int i)
-               {
-                       return (bool) GetValue (i);
-               }
-
-               public 
-               override
-               byte GetByte (int i)
-               {
-                       return Convert.ToByte (GetValue (i));
-               }
-
-               public 
-               override
-               long GetBytes (int i, long dataIndex, byte[] buffer, int bufferIndex, int length)
-               {
-                       if (IsClosed)
-                               throw new InvalidOperationException ("Reader is not open.");
-                       if (currentRow == -1)
-                               throw new InvalidOperationException ("No data available.");
-
-                       OdbcReturn ret = OdbcReturn.Error;
-                       bool copyBuffer = false;
-                       int returnVal = 0, outsize = 0;
-                       byte [] tbuff = new byte [length+1];
-
-                       if (buffer == null)
-                               length = 0;
-                       ret=libodbc.SQLGetData (hstmt, (ushort) (i + 1), SQL_C_TYPE.BINARY, tbuff, length, 
-                                               ref outsize);
-
-                       if (ret == OdbcReturn.NoData)
-                               return 0;
-
-                       if ( (ret != OdbcReturn.Success) && (ret != OdbcReturn.SuccessWithInfo))
-                               throw Connection.CreateOdbcException (OdbcHandleType.Stmt, hstmt);
-
-                       OdbcException odbcException = null;
-                       if ( (ret == OdbcReturn.SuccessWithInfo))
-                               odbcException = Connection.CreateOdbcException (
-                                       OdbcHandleType.Stmt, hstmt);
-
-                       if (buffer == null)
-                               return outsize; //if buffer is null,return length of the field
-
-                       if (ret == OdbcReturn.SuccessWithInfo) {
-                               if (outsize == (int) OdbcLengthIndicator.NoTotal)
-                                       copyBuffer = true;
-                               else if (outsize == (int) OdbcLengthIndicator.NullData) {
-                                       copyBuffer = false;
-                                       returnVal = -1;
-                               } else {
-                                       string sqlstate = odbcException.Errors [0].SQLState;
-                                       //SQLState: String Data, Right truncated
-                                       if (sqlstate != libodbc.SQLSTATE_RIGHT_TRUNC)
-                                               throw odbcException;
-                                       copyBuffer = true;
-                               }
-                       } else {
-                               copyBuffer = outsize == -1 ? false : true;
-                               returnVal = outsize;
-                       }
-
-                       if (copyBuffer) {
-                               if (outsize == (int) OdbcLengthIndicator.NoTotal) {
-                                       int j = 0;
-                                       while (tbuff [j] != libodbc.C_NULL) {
-                                               buffer [bufferIndex + j] = tbuff [j];
-                                               j++;
-                                       }
-                                       returnVal = j;
-                               } else {
-                                       int read_bytes = Math.Min (outsize, length);
-                                       for (int j = 0; j < read_bytes; j++)
-                                               buffer [bufferIndex + j] = tbuff [j];
-                                       returnVal = read_bytes;
-                               }
-                       }
-                       return returnVal;
-               }
-               
-               [MonoTODO]
-               public 
-               override
-               char GetChar (int i)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               public 
-               override
-               long GetChars (int i, long dataIndex, char[] buffer, int bufferIndex, int length)
-               {
-                       if (IsClosed)
-                               throw new InvalidOperationException ("The reader is closed.");
-                       if (currentRow == -1)
-                               throw new InvalidOperationException ("No data available.");
-                       if (i < 0 || i >= FieldCount)
-                               throw new IndexOutOfRangeException ();
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               [EditorBrowsableAttribute (EditorBrowsableState.Never)]
-               new
-               IDataReader GetData (int i)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public
-               override
-               string GetDataTypeName (int i)
-               {
-                       if (IsClosed)
-                               throw new InvalidOperationException ("The reader is closed.");
-                       if (i < 0 || i >= FieldCount)
-                               throw new IndexOutOfRangeException ();
-                       return GetColumnAttributeStr (i + 1, FieldIdentifier.TypeName);
-               }
-
-               public DateTime GetDate (int i)
-               {
-                       return GetDateTime (i);
-               }
-
-               public
-               override
-               DateTime GetDateTime (int i)
-               {
-                       return (DateTime) GetValue (i);
-               }
-
-               public
-               override
-               decimal GetDecimal (int i)
-               {
-                       return (decimal) GetValue (i);
-               }
-
-               public
-               override
-               double GetDouble (int i)
-               {
-                       return (double) GetValue (i);
-               }
-
-               public
-               override
-               Type GetFieldType (int i)
-               {
-                       if (IsClosed)
-                               throw new InvalidOperationException ("The reader is closed.");
-                       return GetColumn (i).DataType;
-               }
-
-               public
-               override
-               float GetFloat (int i)
-               {
-                       return (float) GetValue (i);
-               }
-
-               [MonoTODO]
-               public
-               override
-               Guid GetGuid (int i)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public
-               override
-               short GetInt16 (int i)
-               {
-                       return (short) GetValue (i);
-               }
-
-               public
-               override
-               int GetInt32 (int i)
-               {
-                       return (int) GetValue (i);
-               }
-
-               public
-               override
-               long GetInt64 (int i)
-               {
-                       return (long) GetValue (i);
-               }
-
-               public
-               override
-               string GetName (int i)
-               {
-                       if (IsClosed)
-                               throw new InvalidOperationException ("The reader is closed.");
-                       return GetColumn (i).ColumnName;
-               }
-
-               public
-               override
-               int GetOrdinal (string value)
-               {
-                       if (IsClosed)
-                               throw new InvalidOperationException ("The reader is closed.");
-                       if (value == null)
-                               throw new ArgumentNullException ("fieldName");
-
-                       int i = ColIndex (value);
-                       if (i == -1)
-                               throw new IndexOutOfRangeException ();
-                       return i;
-               }
-
-               [MonoTODO]
-               public
-               override
-               DataTable GetSchemaTable ()
-               {
-                       if (IsClosed)
-                               throw new InvalidOperationException ("The reader is closed.");
-
-                       // FIXME : 
-                       // * Map OdbcType to System.Type and assign to DataType.
-                       //   This will eliminate the need for IsStringType in
-                       //   OdbcColumn
-
-                       if (_dataTableSchema != null)
-                               return _dataTableSchema;
-                       
-                       DataTable dataTableSchema = null;
-                       // Only Results from SQL SELECT Queries 
-                       // get a DataTable for schema of the result
-                       // otherwise, DataTable is null reference
-                       if (cols.Length > 0) {
-                               dataTableSchema = new DataTable ();
-                               
-                               dataTableSchema.Columns.Add ("ColumnName", typeof (string));
-                               dataTableSchema.Columns.Add ("ColumnOrdinal", typeof (int));
-                               dataTableSchema.Columns.Add ("ColumnSize", typeof (int));
-                               dataTableSchema.Columns.Add ("NumericPrecision", typeof (int));
-                               dataTableSchema.Columns.Add ("NumericScale", typeof (int));
-                               dataTableSchema.Columns.Add ("IsUnique", typeof (bool));
-                               dataTableSchema.Columns.Add ("IsKey", typeof (bool));
-                               DataColumn dc = dataTableSchema.Columns["IsKey"];
-                               dc.AllowDBNull = true; // IsKey can have a DBNull
-                               dataTableSchema.Columns.Add ("BaseCatalogName", typeof (string));
-                               dataTableSchema.Columns.Add ("BaseColumnName", typeof (string));
-                               dataTableSchema.Columns.Add ("BaseSchemaName", typeof (string));
-                               dataTableSchema.Columns.Add ("BaseTableName", typeof (string));
-                               dataTableSchema.Columns.Add ("DataType", typeof(Type));
-                               dataTableSchema.Columns.Add ("AllowDBNull", typeof (bool));
-                               dataTableSchema.Columns.Add ("ProviderType", typeof (int));
-                               dataTableSchema.Columns.Add ("IsAliased", typeof (bool));
-                               dataTableSchema.Columns.Add ("IsExpression", typeof (bool));
-                               dataTableSchema.Columns.Add ("IsIdentity", typeof (bool));
-                               dataTableSchema.Columns.Add ("IsAutoIncrement", typeof (bool));
-                               dataTableSchema.Columns.Add ("IsRowVersion", typeof (bool));
-                               dataTableSchema.Columns.Add ("IsHidden", typeof (bool));
-                               dataTableSchema.Columns.Add ("IsLong", typeof (bool));
-                               dataTableSchema.Columns.Add ("IsReadOnly", typeof (bool));
-
-                               DataRow schemaRow;
-
-                               for (int i = 0; i < cols.Length; i += 1 ) {
-                                       OdbcColumn col=GetColumn(i);
-
-                                       schemaRow = dataTableSchema.NewRow ();
-                                       dataTableSchema.Rows.Add (schemaRow);
-
-                                       schemaRow ["ColumnName"]        = col.ColumnName;
-                                       schemaRow ["ColumnOrdinal"]     = i;
-                                       schemaRow ["ColumnSize"]        = col.MaxLength;
-                                       schemaRow ["NumericPrecision"]  = GetColumnAttribute (i+1, FieldIdentifier.Precision);
-                                       schemaRow ["NumericScale"]      = GetColumnAttribute (i+1, FieldIdentifier.Scale);
-                                       schemaRow ["BaseTableName"]     = GetColumnAttributeStr (i+1, FieldIdentifier.TableName);
-                                       schemaRow ["BaseSchemaName"]    = GetColumnAttributeStr (i+1, FieldIdentifier.SchemaName);
-                                       schemaRow ["BaseCatalogName"]   = GetColumnAttributeStr (i+1, FieldIdentifier.CatelogName);
-                                       schemaRow ["BaseColumnName"]    = GetColumnAttributeStr (i+1, FieldIdentifier.BaseColumnName);
-                                       schemaRow ["DataType"]          = col.DataType;
-                                       schemaRow ["IsUnique"]          = false;
-                                       schemaRow ["IsKey"]             = DBNull.Value;
-                                       schemaRow ["AllowDBNull"]       = GetColumnAttribute (i+1, FieldIdentifier.Nullable) != libodbc.SQL_NO_NULLS;
-                                       schemaRow ["ProviderType"]      = (int) col.OdbcType;
-                                       schemaRow ["IsAutoIncrement"]   = GetColumnAttribute (i+1, FieldIdentifier.AutoUniqueValue) == libodbc.SQL_TRUE;
-                                       schemaRow ["IsExpression"]      = schemaRow.IsNull ("BaseTableName") || (string) schemaRow ["BaseTableName"] == String.Empty;
-                                       schemaRow ["IsAliased"]         = (string) schemaRow ["BaseColumnName"] != (string) schemaRow ["ColumnName"];
-                                       schemaRow ["IsReadOnly"]        = ((bool) schemaRow ["IsExpression"]
-                                                                          || GetColumnAttribute (i+1, FieldIdentifier.Updatable) == libodbc.SQL_ATTR_READONLY);
-
-                                       // FIXME: all of these
-                                       schemaRow ["IsIdentity"]        = false;
-                                       schemaRow ["IsRowVersion"]      = false;
-                                       schemaRow ["IsHidden"]          = false;
-                                       schemaRow ["IsLong"]            = false;
-
-                                       // FIXME: according to Brian, 
-                                       // this does not work on MS .NET
-                                       // however, we need it for Mono 
-                                       // for now
-                                       // schemaRow.AcceptChanges();
-                               }
-
-                               // set primary keys
-                               DataRow [] rows = dataTableSchema.Select ("BaseTableName <> ''",
-                                                                         "BaseCatalogName, BaseSchemaName, BaseTableName ASC");
-
-                               string lastTableName = String.Empty,
-                                       lastSchemaName = String.Empty,
-                                       lastCatalogName = String.Empty;
-                               string [] keys = null; // assumed to be sorted.
-                               foreach (DataRow row in rows) {
-                                       string tableName = (string) row ["BaseTableName"];
-                                       string schemaName = (string) row ["BaseSchemaName"];
-                                       string catalogName = (string) row ["BaseCatalogName"];
-
-                                       if (tableName != lastTableName || schemaName != lastSchemaName
-                                           || catalogName != lastCatalogName)
-                                               keys = GetPrimaryKeys (catalogName, schemaName, tableName);
-                               
-                                       if (keys != null &&
-                                           Array.BinarySearch (keys, (string) row ["BaseColumnName"]) >= 0) {
-                                               row ["IsKey"] = true;
-                                               row ["IsUnique"] = true;
-                                               row ["AllowDBNull"] = false;
-                                               GetColumn ( ColIndex ( (string) row ["ColumnName"])).AllowDBNull = false;
-                                       }
-                                       lastTableName = tableName;
-                                       lastSchemaName = schemaName;
-                                       lastCatalogName = catalogName;
-                               }
-                               dataTableSchema.AcceptChanges ();
-                       }
-                       return (_dataTableSchema = dataTableSchema);
-               }
-
-               public
-               override
-               string GetString (int i)
-               {
-                       object ret = GetValue (i);
-
-                       if (ret != null && ret.GetType () != typeof (string))
-                               return Convert.ToString (ret);
-                       else
-                               return (string) GetValue (i);
-               }
-
-               [MonoTODO]
-               public TimeSpan GetTime (int i)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public
-               override
-               object GetValue (int i)
-               {
-                       if (IsClosed)
-                               throw new InvalidOperationException ("The reader is closed.");
-                       if (currentRow == -1)
-                               throw new InvalidOperationException ("No data available.");
-                       if (i > cols.Length-1 || i < 0)
-                               throw new IndexOutOfRangeException ();
-
-                       OdbcReturn ret;
-                       int outsize = 0, bufsize;
-                       byte[] buffer;
-                       OdbcColumn col = GetColumn (i);
-                       object DataValue = null;
-                       ushort ColIndex = Convert.ToUInt16 (i + 1);
-
-                       // Check cached values
-                       if (col.Value == null) {
-                               // odbc help file
-                               // mk:@MSITStore:C:\program%20files\Microsoft%20Data%20Access%20SDK\Docs\odbc.chm::/htm/odbcc_data_types.htm
-                               switch (col.OdbcType) {
-                               case OdbcType.Bit:
-                                       short bit_data = 0;
-                                       ret = libodbc.SQLGetData (hstmt, ColIndex, col.SqlCType, ref bit_data, 0, ref outsize);
-                                       if (outsize != (int) OdbcLengthIndicator.NullData)
-                                               DataValue = bit_data == 0 ? "False" : "True";
-                                       break;
-                               case OdbcType.Numeric:
-                               case OdbcType.Decimal:
-                                       bufsize = 50;
-                                       buffer = new byte [bufsize];  // According to sqlext.h, use SQL_CHAR for decimal.
-                                       // FIXME : use Numeric.
-                                       ret = libodbc.SQLGetData (hstmt, ColIndex, SQL_C_TYPE.CHAR, buffer, bufsize, ref outsize);
-                                       if (outsize!=-1) {
-                                               byte [] temp = new byte [outsize];
-                                               for (int j = 0; j < outsize; j++)
-                                                       temp [j] = buffer [j];
-                                               DataValue = Decimal.Parse (Encoding.Default.GetString (temp),
-                                                       CultureInfo.InvariantCulture);
-                                       }
-                                       break;
-                               case OdbcType.TinyInt:
-                                       short short_data = 0;
-                                       ret = libodbc.SQLGetData (hstmt, ColIndex, col.SqlCType, ref short_data, 0, ref outsize);
-                                       DataValue = Convert.ToByte (short_data);
-                                       break;
-                               case OdbcType.Int:
-                                       int int_data = 0;
-                                       ret = libodbc.SQLGetData (hstmt, ColIndex, col.SqlCType, ref int_data, 0, ref outsize);
-                                       DataValue = int_data;
-                                       break;
-
-                               case OdbcType.SmallInt:
-                                       short sint_data = 0;
-                                       ret = libodbc.SQLGetData (hstmt, ColIndex, col.SqlCType, ref sint_data, 0, ref outsize);
-                                       DataValue = sint_data;
-                                       break;
-
-                               case OdbcType.BigInt:
-                                       long long_data = 0;
-                                       ret = libodbc.SQLGetData (hstmt, ColIndex, col.SqlCType, ref long_data, 0, ref outsize);
-                                       DataValue = long_data;
-                                       break;
-                               case OdbcType.NChar:
-                                       bufsize = 255;
-                                       buffer = new byte [bufsize];
-                                       ret = libodbc.SQLGetData (hstmt, ColIndex, SQL_C_TYPE.WCHAR, buffer, bufsize, ref outsize);
-                                       if (outsize != (int) OdbcLengthIndicator.NullData)
-                                               if (!(ret == OdbcReturn.SuccessWithInfo
-                                                      && outsize == (int) OdbcLengthIndicator.NoTotal))
-                                                       DataValue = Encoding.Unicode.GetString (buffer, 0, outsize);
-                                       break;
-                               case OdbcType.NText:
-                               case OdbcType.NVarChar:
-                                       bufsize = (col.MaxLength < 127 ? (col.MaxLength*2+1) : 255);
-                                       buffer = new byte[bufsize];  // According to sqlext.h, use SQL_CHAR for both char and varchar
-                                       StringBuilder sb = new StringBuilder ();
-                                       char[] charBuffer = new char[bufsize];
-                                       Decoder unicodeDecoder = Encoding.Unicode.GetDecoder ();
-                                       do {
-                                               ret = libodbc.SQLGetData (hstmt, ColIndex, col.SqlCType, buffer, bufsize, ref outsize);
-                                               if (ret == OdbcReturn.Error)
-                                                       break;
-                                               // Fix for strance ODBC drivers (like psqlODBC)
-                                               if (ret == OdbcReturn.Success && outsize==-1)
-                                                       ret = OdbcReturn.NoData;
-
-                                               if (ret == OdbcReturn.Success || ret == OdbcReturn.SuccessWithInfo) {
-                                                       if (outsize >= bufsize || outsize == (int)OdbcLengthIndicator.NoTotal)
-                                                               outsize = bufsize;
-                                                       int charCount = unicodeDecoder.GetChars (buffer, 0, outsize, charBuffer, 0);
-                                                       string strValue = new String (charBuffer, 0, charCount);
-                                                       sb.Append (RemoveTrailingNullChar (strValue));
-                                               }
-                                       } while (ret != OdbcReturn.NoData);
-                                       DataValue = sb.ToString ();
-                                       charBuffer = null;
-                                       break;
-                               case OdbcType.Text:
-                               case OdbcType.VarChar:
-                                       bufsize = (col.MaxLength < 255 ? (col.MaxLength+1) : 255);
-                                       buffer = new byte[bufsize];  // According to sqlext.h, use SQL_CHAR for both char and varchar
-                                       StringBuilder sb1 = new StringBuilder ();
-                                       charBuffer = new char[bufsize];
-                                       Decoder defaultDecoder = Encoding.Default.GetDecoder();
-                                       do { 
-                                               ret = libodbc.SQLGetData (hstmt, ColIndex, col.SqlCType, buffer, bufsize, ref outsize);
-                                               if (ret == OdbcReturn.Error)
-                                                       break;
-                                               // Fix for strance ODBC drivers (like psqlODBC)
-                                               if (ret == OdbcReturn.Success && outsize==-1)
-                                                       ret = OdbcReturn.NoData;
-                                               if (ret == OdbcReturn.Success || ret == OdbcReturn.SuccessWithInfo) {
-                                                       if (outsize >= bufsize || outsize == (int)OdbcLengthIndicator.NoTotal)
-                                                               outsize = bufsize - 1;
-                                                       int charCount = defaultDecoder.GetChars(buffer, 0, outsize, charBuffer, 0);
-                                                       sb1.Append(charBuffer, 0, charCount);
-                                               }
-                                       } while (ret != OdbcReturn.NoData);
-                                       DataValue = sb1.ToString ();
-                                       break;
-                               case OdbcType.Real:
-                                       float float_data = 0;
-                                       ret = libodbc.SQLGetData (hstmt, ColIndex, col.SqlCType, ref float_data, 0, ref outsize);
-                                       DataValue = float_data;
-                                       break;
-                               case OdbcType.Double:
-                                       double double_data = 0;
-                                       ret = libodbc.SQLGetData (hstmt, ColIndex, col.SqlCType, ref double_data, 0, ref outsize);
-                                       DataValue = double_data;
-                                       break;
-                               case OdbcType.Timestamp:
-                               case OdbcType.DateTime:
-                               case OdbcType.Date:
-                               case OdbcType.Time:
-                                       OdbcTimestamp ts_data = new OdbcTimestamp();
-                                       ret = libodbc.SQLGetData (hstmt, ColIndex, col.SqlCType, ref ts_data, 0, ref outsize);
-                                       if (outsize != -1) {// This means SQL_NULL_DATA
-                                               if (col.OdbcType == OdbcType.Time) {
-                                                       // libodbc returns value in first three fields for OdbcType.Time 
-                                                       DataValue = new System.TimeSpan (ts_data.year, ts_data.month, ts_data.day);
-                                               } else {
-                                                       DataValue = new DateTime(ts_data.year, ts_data.month,
-                                                                                ts_data.day, ts_data.hour, ts_data.minute,
-                                                                                ts_data.second);
-                                                       if (ts_data.fraction != 0)
-                                                               DataValue = ((DateTime) DataValue).AddTicks ((long)ts_data.fraction / 100);
-                                               }
-                                       }
-                                       break;
-                               case OdbcType.VarBinary :
-                               case OdbcType.Image :
-                                       bufsize = (col.MaxLength < 255 && col.MaxLength > 0 ? col.MaxLength : 255);
-                                       buffer= new byte [bufsize];
-                                       ArrayList al = new ArrayList ();
-                                       //get the size of data to be returned.
-                                       ret = libodbc.SQLGetData (hstmt, ColIndex, SQL_C_TYPE.BINARY, buffer, 0, ref outsize);
-                                       if (outsize != (int) OdbcLengthIndicator.NullData) {
-                                               do {
-                                                       ret = libodbc.SQLGetData (hstmt, ColIndex, SQL_C_TYPE.BINARY, buffer, bufsize, ref outsize);
-                                                       if (ret == OdbcReturn.Error)
-                                                               break;
-                                                       if (ret != OdbcReturn.NoData && outsize != -1) {
-                                                               if (outsize < bufsize) {
-                                                                       byte [] tmparr = new byte [outsize];
-                                                                       Array.Copy (buffer, 0, tmparr, 0, outsize);
-                                                                       al.AddRange (tmparr);
-                                                               } else
-                                                                       al.AddRange (buffer);
-                                                       } else {
-                                                               break;
-                                                       }
-                                               } while (ret != OdbcReturn.NoData);
-                                       }
-                                       DataValue = al.ToArray (typeof (byte));
-                                       break;
-                               case OdbcType.Binary :
-                                       bufsize = col.MaxLength;
-                                       buffer = new byte [bufsize];
-                                       GetBytes (i, 0, buffer, 0, bufsize);
-                                       ret = OdbcReturn.Success;
-                                       DataValue = buffer;
-                                       break;
-                               default:
-                                       bufsize = 255;
-                                       buffer = new byte[bufsize];
-                                       ret = libodbc.SQLGetData (hstmt, ColIndex, SQL_C_TYPE.CHAR, buffer, bufsize, ref outsize);
-                                       if (outsize != (int) OdbcLengthIndicator.NullData)
-                                               if (! (ret == OdbcReturn.SuccessWithInfo
-                                                      && outsize == (int) OdbcLengthIndicator.NoTotal))
-                                                       DataValue = Encoding.Default.GetString (buffer, 0, outsize);
-                                       break;
-                               }
-
-                               if ((ret!=OdbcReturn.Success) && (ret!=OdbcReturn.SuccessWithInfo) && (ret!=OdbcReturn.NoData))
-                                       throw Connection.CreateOdbcException (OdbcHandleType.Stmt, hstmt);
-
-                               if (outsize == -1) // This means SQL_NULL_DATA 
-                                       col.Value = DBNull.Value;
-                               else
-                                       col.Value = DataValue;
-                       }
-                       return col.Value;
-               }
-               
-               public 
-               override
-               int GetValues (object [] values)
-               {
-                       int numValues = 0;
-
-                       if (IsClosed)
-                               throw new InvalidOperationException ("The reader is closed.");
-                       if (currentRow == -1)
-                               throw new InvalidOperationException ("No data available.");
-
-                       // copy values
-                       for (int i = 0; i < values.Length; i++) {
-                               if (i < FieldCount) {
-                                       values [i] = GetValue (i);
-                               } else {
-                                       values [i] = null;
-                               }
-                       }
-
-                       // get number of object instances in array
-                       if (values.Length < FieldCount)
-                               numValues = values.Length;
-                       else if (values.Length == FieldCount)
-                               numValues = FieldCount;
-                       else
-                               numValues = FieldCount;
-
-                       return numValues;
-               }
-
-
-               public override IEnumerator GetEnumerator ()
-               {
-                       return new DbEnumerator (this);
-               }
-
-               protected override
-               void Dispose (bool disposing)
-               {
-                       if (disposed)
-                               return;
-
-                       if (disposing) {
-                               // dispose managed resources
-                               Close ();
-                       }
-
-                       command = null;
-                       cols = null;
-                       _dataTableSchema = null;
-                       disposed = true;
-               }
-
-               public
-               override
-               bool IsDBNull (int i)
-               {
-                       return (GetValue (i) is DBNull);
-               }
-
-               /// <remarks>
-               /// Move to the next result set.
-               /// </remarks>
-               public
-               override
-               bool NextResult ()
-               {
-                       OdbcReturn ret = OdbcReturn.Success;
-                       ret = libodbc.SQLMoreResults (hstmt);
-                       if (ret == OdbcReturn.Success) {
-                               short colcount = 0;
-                               libodbc.SQLNumResultCols (hstmt, ref colcount);
-                               cols = new OdbcColumn [colcount];
-                               _dataTableSchema = null; // force fresh creation
-                               GetColumns ();
-                       }
-                       return (ret == OdbcReturn.Success);
-               }
-
-               /// <remarks>
-               /// Load the next row in the current result set.
-               /// </remarks>
-               private bool NextRow ()
-               {
-                       OdbcReturn ret = libodbc.SQLFetch (hstmt);
-                       if (ret != OdbcReturn.Success)
-                               currentRow = -1;
-                       else
-                               currentRow++;
-
-                       // Clear cached values from last record
-                       foreach (OdbcColumn col in cols) {
-                               if (col != null)
-                                       col.Value = null;
-                       }
-                       return (ret == OdbcReturn.Success);
-               }
-
-               private int GetColumnAttribute (int column, FieldIdentifier fieldId)
-               {
-                       OdbcReturn ret = OdbcReturn.Error;
-                       byte [] buffer = new byte [255];
-                       short outsize = 0;
-                       int val = 0;
-                       ret = libodbc.SQLColAttribute (hstmt, (short)column, fieldId, 
-                                                       buffer, (short)buffer.Length, 
-                                                       ref outsize, ref val);
-                       if (ret != OdbcReturn.Success && ret != OdbcReturn.SuccessWithInfo)
-                               throw Connection.CreateOdbcException (
-                                       OdbcHandleType.Stmt, hstmt);
-                       return val;
-               }
-
-               private string GetColumnAttributeStr (int column, FieldIdentifier fieldId)
-               {
-                       OdbcReturn ret = OdbcReturn.Error;
-                       byte [] buffer = new byte [255];
-                       short outsize = 0;
-                       int val = 0;
-                       ret = libodbc.SQLColAttribute (hstmt, (short)column, fieldId,
-                                                       buffer, (short)buffer.Length,
-                                                       ref outsize, ref val);
-                       if (ret != OdbcReturn.Success && ret != OdbcReturn.SuccessWithInfo)
-                               throw Connection.CreateOdbcException (
-                                       OdbcHandleType.Stmt, hstmt);
-                       string value = string.Empty;
-                       if (outsize > 0)
-                               value = Encoding.Unicode.GetString (buffer, 0, outsize);
-                       return value;
-               }
-
-               private string [] GetPrimaryKeys (string catalog, string schema, string table)
-               {
-                       if (cols.Length <= 0)
-                               return new string [0];
-
-                       ArrayList keys = null;
-                       try {
-                               keys = GetPrimaryKeysBySQLPrimaryKey (catalog, schema, table);
-                       } catch (OdbcException) {
-                               try {
-                                       keys = GetPrimaryKeysBySQLStatistics (catalog, schema, table);
-                               } catch (OdbcException) {
-                               }
-                       }
-                       if (keys == null)
-                               return null;
-                       keys.Sort ();
-                       return (string []) keys.ToArray (typeof (string));
-               }
-
-               private ArrayList GetPrimaryKeysBySQLPrimaryKey (string catalog, string schema, string table)
-               {
-                       ArrayList keys = new ArrayList ();
-                       IntPtr handle = IntPtr.Zero;
-                       OdbcReturn ret;
-                       try {
-                               ret=libodbc.SQLAllocHandle(OdbcHandleType.Stmt, 
-                                                          command.Connection.hDbc, ref handle);
-                               if ((ret!=OdbcReturn.Success) && (ret!=OdbcReturn.SuccessWithInfo))
-                                       throw Connection.CreateOdbcException (
-                                               OdbcHandleType.Dbc, Connection.hDbc);
-
-                               ret = libodbc.SQLPrimaryKeys (handle, catalog, -3,
-                                       schema, -3, table, -3);
-                               if (ret != OdbcReturn.Success && ret != OdbcReturn.SuccessWithInfo)
-                                       throw Connection.CreateOdbcException (OdbcHandleType.Stmt, handle);
-
-                               int length = 0;
-                               byte [] primaryKey = new byte [255];
-
-                               ret = libodbc.SQLBindCol (handle, 4, SQL_C_TYPE.CHAR, primaryKey, primaryKey.Length, ref length);
-                               if (ret != OdbcReturn.Success && ret != OdbcReturn.SuccessWithInfo)
-                                       throw Connection.CreateOdbcException (OdbcHandleType.Stmt, handle);
-
-                               while (true) {
-                                       ret = libodbc.SQLFetch (handle);
-                                       if (ret != OdbcReturn.Success && ret != OdbcReturn.SuccessWithInfo)
-                                               break;
-                                       string pkey = Encoding.Default.GetString (primaryKey, 0, length);
-                                       keys.Add (pkey);
-                               }
-                       } finally {
-                               if (handle != IntPtr.Zero) {
-                                       ret = libodbc.SQLFreeStmt (handle, libodbc.SQLFreeStmtOptions.Close);
-                                       if ((ret!=OdbcReturn.Success) && (ret!=OdbcReturn.SuccessWithInfo))
-                                               throw Connection.CreateOdbcException (OdbcHandleType.Stmt, handle);
-
-                                       ret = libodbc.SQLFreeHandle( (ushort) OdbcHandleType.Stmt, handle);
-                                       if ((ret!=OdbcReturn.Success) && (ret!=OdbcReturn.SuccessWithInfo))
-                                               throw Connection.CreateOdbcException (OdbcHandleType.Stmt, handle);
-                               }
-                       }
-                       return keys;
-               }
-               
-               private unsafe ArrayList GetPrimaryKeysBySQLStatistics (string catalog, string schema, string table)
-               {
-                       ArrayList keys = new ArrayList ();
-                       IntPtr handle = IntPtr.Zero;
-                       OdbcReturn ret;
-                       try {
-                               ret=libodbc.SQLAllocHandle(OdbcHandleType.Stmt, 
-                                                          command.Connection.hDbc, ref handle);
-                               if ((ret!=OdbcReturn.Success) && (ret!=OdbcReturn.SuccessWithInfo))
-                                       throw Connection.CreateOdbcException (
-                                               OdbcHandleType.Dbc, Connection.hDbc);
-
-                               ret = libodbc.SQLStatistics (handle, catalog, -3,  
-                                                            schema, -3, 
-                                                            table, -3,
-                                                            libodbc.SQL_INDEX_UNIQUE,
-                                                            libodbc.SQL_QUICK);
-                               if (ret != OdbcReturn.Success && ret != OdbcReturn.SuccessWithInfo)
-                                       throw Connection.CreateOdbcException (OdbcHandleType.Stmt, handle);
-
-                               // NON_UNIQUE
-                               int  nonUniqueLength = 0;
-                               short nonUnique = libodbc.SQL_FALSE;
-                               ret = libodbc.SQLBindCol (handle, 4, SQL_C_TYPE.SHORT, ref nonUnique, sizeof (short), ref nonUniqueLength);
-                               if (ret != OdbcReturn.Success && ret != OdbcReturn.SuccessWithInfo)
-                                       throw Connection.CreateOdbcException (OdbcHandleType.Stmt, handle);
-
-                               // COLUMN_NAME
-                               int length = 0;
-                               byte [] colName = new byte [255];
-                               ret = libodbc.SQLBindCol (handle, 9, SQL_C_TYPE.CHAR, colName, colName.Length, ref length);
-                               if (ret != OdbcReturn.Success && ret != OdbcReturn.SuccessWithInfo)
-                                       throw Connection.CreateOdbcException (OdbcHandleType.Stmt, handle);
-                       
-                               while (true) {
-                                       ret = libodbc.SQLFetch (handle);
-                                       if (ret != OdbcReturn.Success && ret != OdbcReturn.SuccessWithInfo)
-                                               break;
-                                       if (nonUnique == libodbc.SQL_TRUE) {
-                                               string pkey = Encoding.Default.GetString (colName, 0, length);
-                                               keys.Add (pkey);
-                                               break;
-                                       }
-                               }
-                       } finally {
-                               if (handle != IntPtr.Zero) {
-                                       ret = libodbc.SQLFreeStmt (handle, libodbc.SQLFreeStmtOptions.Close);
-                                       if ((ret!=OdbcReturn.Success) && (ret!=OdbcReturn.SuccessWithInfo))
-                                               throw Connection.CreateOdbcException (OdbcHandleType.Stmt, handle);
-
-                                       ret = libodbc.SQLFreeHandle ((ushort) OdbcHandleType.Stmt, handle);
-                                       if ((ret!=OdbcReturn.Success) && (ret!=OdbcReturn.SuccessWithInfo))
-                                               throw Connection.CreateOdbcException (OdbcHandleType.Stmt, handle);
-                               }
-                       }
-                       return keys;
-               }
-               
-               public
-               override
-               bool Read ()
-               {
-                       return NextRow ();
-               }
-
-               static string RemoveTrailingNullChar (string value)
-               {
-                       return value.TrimEnd ('\0');
-               }
-
-               #endregion
-       }
-}
diff --git a/mcs/class/System.Data/System.Data.Odbc/OdbcDescriptionAttribute.cs b/mcs/class/System.Data/System.Data.Odbc/OdbcDescriptionAttribute.cs
deleted file mode 100644 (file)
index 0e679fc..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-// 
-// System.Data.Odbc/OdbcDescriptionAttribute.cs
-//
-// Author:
-//   Umadevi S (sumadevi@novell.com)
-//
-// Copyright (C) Novell Inc, 2004
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.ComponentModel;
-
-namespace System.Data.Odbc {
-       [AttributeUsage (AttributeTargets.All)]
-       internal sealed class OdbcDescriptionAttribute : DescriptionAttribute
-       {
-               #region Fields
-
-               string description;
-
-               #endregion // Fields
-
-               #region Constructors
-
-               public OdbcDescriptionAttribute (string description)
-                       : base (description)
-               {
-                       this.description = description; 
-               }
-
-               #endregion // Constructors
-
-               #region Properties
-
-               public override string Description {
-                       get { return description; }
-               }
-
-               #endregion // Properties
-       }
-}
diff --git a/mcs/class/System.Data/System.Data.Odbc/OdbcErrorCollection.cs b/mcs/class/System.Data/System.Data.Odbc/OdbcErrorCollection.cs
deleted file mode 100644 (file)
index 8ceda97..0000000
+++ /dev/null
@@ -1,124 +0,0 @@
-//
-// System.Data.Odbc.OdbcErrorCollection
-//
-// Author:
-//   Brian Ritchie (brianlritchie@hotmail.com) 
-//
-// Copyright (C) Brian Ritchie, 2002
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Collections;
-using System.ComponentModel;
-using System.Data;
-using System.Data.Common;
-
-namespace System.Data.Odbc
-{
-       [Serializable]
-       public sealed class OdbcErrorCollection : ICollection, IEnumerable
-       {
-               #region Fields
-
-               readonly ArrayList _items = new ArrayList ();
-       
-               #endregion // Fields
-
-               #region Constructors
-
-               internal OdbcErrorCollection ()
-               {
-               }
-
-               #endregion Constructors
-
-               #region Properties 
-
-               public int Count {
-                       get {
-                               return _items.Count;
-                       }
-               }
-
-               public OdbcError this[int i] {
-                       get {
-                               return (OdbcError) _items [i];
-                       }
-               }
-
-               object ICollection.SyncRoot {
-                       get {
-                               return _items.SyncRoot;
-                       }
-               }
-
-               bool ICollection.IsSynchronized {
-                       get {
-                               return _items.IsSynchronized;
-                       }
-               }
-
-               #endregion // Properties
-
-               #region Methods
-
-               internal void Add (OdbcError error)
-               {
-                       _items.Add ((object) error);
-               }
-               
-               public void CopyTo (Array array, int i)
-               {
-                       if (array == null)
-                               throw new ArgumentNullException("array");
-
-                       if ((i < array.GetLowerBound (0)) || (i > array.GetUpperBound (0)))
-                               throw new ArgumentOutOfRangeException("index");
-               
-                       // is the check for IsFixedSize required?
-                       if ((array.IsFixedSize) || (i + this.Count > array.GetUpperBound (0)))
-                               throw new ArgumentException("array");
-
-                       ((OdbcError[]) (_items.ToArray ())).CopyTo (array, i);
-               }
-
-               public IEnumerator GetEnumerator ()
-               {
-                       return _items.GetEnumerator ();
-               }
-
-               public void CopyTo (OdbcError [] array, int i)
-               {
-                       if (array == null)
-                               throw new ArgumentNullException ("array");
-
-                       if ((i < array.GetLowerBound (0)) || (i > array.GetUpperBound (0)))
-                               throw new ArgumentOutOfRangeException ("index");
-                       ((OdbcError[]) (_items.ToArray ())).CopyTo (array, i);
-               }
-
-               #endregion // Methods
-       }
-}
diff --git a/mcs/class/System.Data/System.Data.Odbc/OdbcException.cs b/mcs/class/System.Data/System.Data.Odbc/OdbcException.cs
deleted file mode 100644 (file)
index 93b44d6..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-//
-// System.Data.Odbc.OdbcException
-//
-// Author:
-//   Brian Ritchie (brianlritchie@hotmail.com)
-//
-// Copyright (C) Brian Ritchie, 2002
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Collections;
-using System.ComponentModel;
-using System.Data;
-using System.Data.Common;
-using System.Globalization;
-using System.Runtime.InteropServices;
-using System.Runtime.Serialization;
-using System.Text;
-
-namespace System.Data.Odbc
-{
-       [Serializable]
-       public sealed class OdbcException : DbException
-       {
-               OdbcErrorCollection odbcErrors;
-
-               internal OdbcException (OdbcErrorCollection errors)
-                       : base (CreateMessage (errors))
-               {
-                       odbcErrors = errors;
-               }
-
-               public OdbcErrorCollection Errors {
-                       get {
-                               return odbcErrors;
-                       }
-               }
-
-               public override string Source {
-                       get {
-                               return odbcErrors [0].Source;
-                       }
-               }
-
-
-               private OdbcException (SerializationInfo si, StreamingContext sc) : base(si, sc)
-               {
-                       odbcErrors = new OdbcErrorCollection ();
-                       odbcErrors = ((OdbcErrorCollection) si.GetValue (
-                               "odbcErrors", typeof (OdbcErrorCollection)));
-               }
-
-               #region Methods
-
-               public override void GetObjectData (SerializationInfo si, StreamingContext context)
-               {
-                       if (si == null)
-                               throw new ArgumentNullException ("si");
-
-                       si.AddValue ("odbcErrors", odbcErrors, typeof(OdbcErrorCollection));
-                       base.GetObjectData (si, context);
-               }
-
-               static string CreateMessage (OdbcErrorCollection errors)
-               {
-                       StringBuilder sb = new StringBuilder ();
-                       for (int i = 0; i < errors.Count; i++) {
-                               if (i > 0)
-                                       sb.Append (Environment.NewLine);
-                               OdbcError error = errors [i];
-                               sb.AppendFormat ("ERROR [{0}] {1}", error.SQLState,
-                                       error.Message);
-                       }
-                       return sb.ToString ();
-               }
-
-               #endregion // Methods
-       }
-}
diff --git a/mcs/class/System.Data/System.Data.Odbc/OdbcFactory.cs b/mcs/class/System.Data/System.Data.Odbc/OdbcFactory.cs
deleted file mode 100644 (file)
index 43bcf5e..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-//
-// System.Data.Odbc.OdbcFactory
-//
-// Author:
-//   Sureshkumar T <tsureshkumar@novell.com>
-//
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-#region Using Directives
-using System;
-using System.Data;
-using System.Data.Common;
-using System.Security;
-using System.Security.Permissions;
-#endregion // Using Directives
-
-namespace System.Data.Odbc 
-{
-        
-        public sealed class OdbcFactory : DbProviderFactory
-        {
-                #region Fields
-                public static readonly OdbcFactory Instance;
-               static readonly object lockStatic = new object ();
-                #endregion //Fields
-
-                #region Constructors
-               /// <remarks>
-               /// public static variable Instance should hold the the singleton instance 
-               /// based on the knowledge that custom factories without this instance variable
-               /// ms.net  throws exception 
-               /// <pre>
-               /// System.InvalidOperationException: The requested .Net Framework Data 
-               ///             Provider's implementation does not have an Instance field 
-               ///             of a System.Data.Common.DbProviderFactory derived type.
-               ///     at System.Data.Common.DbProviderFactories.GetFactory(DataRow providerRow)
-               ///     at System.Data.Common.DbProviderFactories.GetFactory(String providerInvariantName)
-               /// </pre>
-               /// </remarks>
-               static OdbcFactory() 
-               {
-                        lock (lockStatic) 
-                        {
-                               if (Instance == null)
-                                       Instance = new OdbcFactory ();
-                       }
-               }
-                
-                private OdbcFactory()
-                {
-                        
-                }
-                
-                #endregion //Constructors
-
-                #region Methods
-                public override DbConnection CreateConnection()
-                {
-                        return  new OdbcConnection () as DbConnection;
-                }
-                
-                public override DbCommand CreateCommand()
-                {
-                        return new OdbcCommand () as DbCommand;
-                }
-                
-                public override DbCommandBuilder CreateCommandBuilder()
-                {
-                        return new OdbcCommandBuilder () as DbCommandBuilder;
-                }
-                
-                
-               public override DbConnectionStringBuilder CreateConnectionStringBuilder ()
-               {
-                       return new OdbcConnectionStringBuilder () as DbConnectionStringBuilder;
-               }
-                
-                public override DbDataAdapter CreateDataAdapter()
-                {
-                        return new OdbcDataAdapter () as DbDataAdapter;
-                }
-                
-                public override DbParameter CreateParameter()
-                {
-                        return new OdbcParameter () as DbParameter;
-                }
-
-               public override CodeAccessPermission CreatePermission (PermissionState state)
-               {
-                       return new OdbcPermission (state);
-               }
-
-                #endregion //Methods
-        }
-}
diff --git a/mcs/class/System.Data/System.Data.Odbc/OdbcInfoMessageEventArgs.cs b/mcs/class/System.Data/System.Data.Odbc/OdbcInfoMessageEventArgs.cs
deleted file mode 100644 (file)
index b2ce7c2..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-//
-// System.Data.Odbc.OdbcInfoMessageEventArgs
-//
-// Author:
-//   Umadevi S (sumadevi@novell.com)
-//
-// Copyright (C) Novell Inc, 2004
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Data;
-using System.Data.Common;
-
-namespace System.Data.Odbc
-{
-       public sealed class OdbcInfoMessageEventArgs : EventArgs
-       {
-               OdbcErrorCollection errors = new OdbcErrorCollection ();
-
-               #region Constructors
-
-               internal OdbcInfoMessageEventArgs (OdbcErrorCollection errors) {
-                       foreach (OdbcError e in errors) 
-                               this.errors.Add (e);
-               }
-
-               #endregion Constructors
-
-               #region Properties
-
-
-               public OdbcErrorCollection Errors {
-                       get { return errors; }
-               }
-
-               public string Message {
-                       get { return errors [0].Message; }
-               }       
-
-               #endregion // Properties
-
-               #region Methods
-
-               public override string ToString ()
-               {
-                       return Message;
-               }
-
-               #endregion // Methods
-       }
-}
diff --git a/mcs/class/System.Data/System.Data.Odbc/OdbcInfoMessageEventHandler.cs b/mcs/class/System.Data/System.Data.Odbc/OdbcInfoMessageEventHandler.cs
deleted file mode 100644 (file)
index 4849969..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-//
-// System.Data.Odbc.OdbcInfoMessageEventHandler
-//
-// Author:
-//   Umadevi S (sumadevi@novell.com)
-//
-// Copyright (C) Novell Inc, 2004
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Data;
-using System.Data.Common;
-
-namespace System.Data.Odbc
-{
-       public delegate void OdbcInfoMessageEventHandler (object sender, OdbcInfoMessageEventArgs e);
-}
diff --git a/mcs/class/System.Data/System.Data.Odbc/OdbcMetaDataCollectionNames.cs b/mcs/class/System.Data/System.Data.Odbc/OdbcMetaDataCollectionNames.cs
deleted file mode 100644 (file)
index 9d424c5..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-//
-// System.Data.Odbc.OdbcMetaDataCollectionNames.cs
-//
-// Author:
-//   Nagappan A <anagappan@novell.com>
-//
-//
-// Copyright (C) 2007 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-namespace System.Data.Odbc
-{
-       /// <summary>
-       /// Collection names
-       /// </summary>
-       public static class OdbcMetaDataCollectionNames {
-               public static readonly string Columns = "Columns";
-               public static readonly string Indexes = "Indexes";
-               public static readonly string ProcedureColumns = "ProcedureColumns";
-               public static readonly string ProcedureParameters = "ProcedureParameters";
-               public static readonly string Procedures = "Procedures";
-               public static readonly string Tables = "Tables";
-               public static readonly string Views = "Views";
-       }
-}
-
diff --git a/mcs/class/System.Data/System.Data.Odbc/OdbcMetaDataColumnNames.cs b/mcs/class/System.Data/System.Data.Odbc/OdbcMetaDataColumnNames.cs
deleted file mode 100644 (file)
index 54d89de..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-//
-// System.Data.Odbc.OdbcMetaDataColumnNames.cs
-//
-// Author:
-//   Nagappan A <anagappan@novell.com>
-//
-//
-// Copyright (C) 2007 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-namespace System.Data.Odbc
-{
-       /// <summary>
-       /// Collection names
-       /// </summary>
-       public static class OdbcMetaDataColumnNames {
-               public static readonly string BooleanFalseLiteral;
-               public static readonly string BooleanTrueLiteral;
-               public static readonly string SQLType;
-       }
-}
-
diff --git a/mcs/class/System.Data/System.Data.Odbc/OdbcParameter.cs b/mcs/class/System.Data/System.Data.Odbc/OdbcParameter.cs
deleted file mode 100644 (file)
index 9b80f9b..0000000
+++ /dev/null
@@ -1,491 +0,0 @@
-//
-// System.Data.Odbc.OdbcParameter
-//
-// Authors:
-//   Brian Ritchie (brianlritchie@hotmail.com)
-//   Sureshkumar T <tsureshkumar@novell.com>  2004.
-//
-// Copyright (C) Brian Ritchie, 2002
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Text;
-using System.Data;
-using System.Data.Common;
-using System.Runtime.InteropServices;
-using System.Globalization;
-using System.ComponentModel;
-
-namespace System.Data.Odbc
-{
-       [TypeConverterAttribute ("System.Data.Odbc.OdbcParameter+OdbcParameterConverter, " + Consts.AssemblySystem_Data)]
-       public sealed class OdbcParameter :
-       DbParameter,
-       ICloneable, IDbDataParameter, IDataParameter
-       {
-               #region Fields
-
-               string name;
-               ParameterDirection direction;
-               bool isNullable;
-               int size;
-               DataRowVersion sourceVersion;
-               string sourceColumn;
-               byte _precision;
-               byte _scale;
-               object _value;
-
-               private OdbcTypeMap _typeMap;
-               private NativeBuffer _nativeBuffer = new NativeBuffer ();
-               private NativeBuffer _cbLengthInd;
-               private OdbcParameterCollection container;
-               
-               #endregion
-
-               #region Constructors
-               
-               public OdbcParameter ()
-               {
-                       _cbLengthInd = new NativeBuffer ();
-                       ParameterName = String.Empty;
-                       IsNullable = false;
-                       SourceColumn = String.Empty;
-                       Direction = ParameterDirection.Input;
-                       _typeMap = OdbcTypeConverter.GetTypeMap (OdbcType.NVarChar);
-               }
-
-               public OdbcParameter (string name, object value)
-                       : this ()
-               {
-                       this.ParameterName = name;
-                       Value = value;
-                       //FIXME: MS.net does not infer OdbcType from value unless a type is provided
-                       _typeMap = OdbcTypeConverter.InferFromValue (value);
-                       if (value != null && !value.GetType ().IsValueType) {
-                               Type type = value.GetType ();
-                               if (type.IsArray)
-                                       Size = type.GetElementType () == typeof (byte) ?
-                                               ((Array) value).Length : 0;
-                               else
-                                       Size = value.ToString ().Length;
-                       }
-               }
-
-               public OdbcParameter (string name, OdbcType type)
-                       : this ()
-               {
-                       this.ParameterName = name;
-                       _typeMap = (OdbcTypeMap) OdbcTypeConverter.GetTypeMap (type);
-               }
-
-               public OdbcParameter (string name, OdbcType type, int size)
-                       : this (name, type)
-               {
-                       this.Size = size;
-               }
-
-               public OdbcParameter (string name, OdbcType type, int size, string sourcecolumn)
-                       : this (name, type, size)
-               {
-                       this.SourceColumn = sourcecolumn;
-               }
-
-               [EditorBrowsable (EditorBrowsableState.Advanced)]
-               public OdbcParameter (string parameterName, OdbcType odbcType, int size,
-                                    ParameterDirection parameterDirection, bool isNullable, 
-                                    byte precision, byte scale, string srcColumn, 
-                                    DataRowVersion srcVersion, object value)
-                       : this (parameterName, odbcType, size, srcColumn)
-               {
-                       this.Direction = parameterDirection;
-                       this.IsNullable = isNullable;
-                       this.SourceVersion = srcVersion;
-               }
-
-               #endregion
-
-               #region Properties
-
-               // Used to ensure that only one collection can contain this
-               // parameter
-               internal OdbcParameterCollection Container {
-                       get { return container; }
-                       set { container = value; }
-               }
-
-               [OdbcCategory ("Data")]
-               [OdbcDescriptionAttribute ("The parameter generic type")]
-               public
-               override
-               DbType DbType {
-                       get { return _typeMap.DbType; }
-                       set { 
-                               if (value == _typeMap.DbType)
-                                       return;
-                               
-                               _typeMap = OdbcTypeConverter.GetTypeMap (value);
-                       }
-               }
-
-               [OdbcCategory ("Data")]
-               [OdbcDescriptionAttribute ("Input, output, or bidirectional parameter")]  
-               [RefreshPropertiesAttribute (RefreshProperties.All)]
-               public
-               override
-               ParameterDirection Direction {
-                       get { return direction; }
-                       set { direction = value; }
-               }
-
-               [OdbcDescriptionAttribute ("A design-time property used for strongly typed code generation")]
-               public
-               override
-               bool IsNullable {
-                       get { return isNullable; }
-                       set { isNullable = value; }
-               }
-
-               [DefaultValue (OdbcType.NChar)]
-               [OdbcDescriptionAttribute ("The parameter native type")]
-               [RefreshPropertiesAttribute (RefreshProperties.All)]
-               [OdbcCategory ("Data")]
-               [DbProviderSpecificTypeProperty (true)]
-               public OdbcType OdbcType {
-                       get { return _typeMap.OdbcType; }
-                       set {
-                               if (value == _typeMap.OdbcType)
-                                       return;
-
-                               _typeMap = OdbcTypeConverter.GetTypeMap (value);
-                       }
-               }
-
-               [OdbcDescription ("DataParameter_ParameterName")]
-               public 
-               override
-               string ParameterName {
-                       get { return name; }
-                       set { name = value; }
-               }
-
-               [OdbcDescription ("DbDataParameter_Precision")]
-               [OdbcCategory ("DataCategory_Data")]
-               [DefaultValue (0)]
-               public byte Precision {
-                       get { return _precision; }
-                       set { _precision = value; }
-               }
-
-               [OdbcDescription ("DbDataParameter_Scale")]
-               [OdbcCategory ("DataCategory_Data")]
-               [DefaultValue (0)]
-               public byte Scale {
-                       get { return _scale; }
-                       set { _scale = value; }
-               }
-               
-               [OdbcDescription ("DbDataParameter_Size")]
-               [OdbcCategory ("DataCategory_Data")]
-               public
-               override
-               int Size {
-                       get { return size; }
-                       set { size = value; }
-               }
-
-               [OdbcDescription ("DataParameter_SourceColumn")]
-               [OdbcCategory ("DataCategory_Data")]
-               public
-               override
-               string SourceColumn {
-                       get { return sourceColumn; }
-                       set { sourceColumn = value; }
-               }
-               
-               [OdbcDescription ("DataParameter_SourceVersion")]
-               [OdbcCategory ("DataCategory_Data")]
-               public
-               override
-               DataRowVersion SourceVersion {
-                       get { return sourceVersion; }
-                       set { sourceVersion = value; }
-               }
-
-               [TypeConverter (typeof(StringConverter))]
-               [OdbcDescription ("DataParameter_Value")]
-               [OdbcCategory ("DataCategory_Data")]
-               [RefreshPropertiesAttribute (RefreshProperties.All)]
-               public
-               override
-               object Value {
-                       get { return _value; }
-                       set { _value = value; }
-               }
-
-               #endregion // Properties
-
-               #region Methods
-
-               internal void Bind (OdbcCommand command, IntPtr hstmt, int ParamNum)
-               {
-                       OdbcReturn ret;
-                       int len;
-                       
-                       // Convert System.Data.ParameterDirection into odbc enum
-                       OdbcInputOutputDirection paramdir = libodbc.ConvertParameterDirection (this.Direction);
-
-                       _cbLengthInd.EnsureAlloc (Marshal.SizeOf (typeof (int)));
-                       if (Value is DBNull)
-                               len = (int)OdbcLengthIndicator.NullData;
-                       else {
-                               len = GetNativeSize ();
-                               AllocateBuffer ();
-                       }
-                       
-                       Marshal.WriteInt32 (_cbLengthInd, len);
-                       ret = libodbc.SQLBindParameter (hstmt, (ushort) ParamNum, (short) paramdir,
-                               _typeMap.NativeType, _typeMap.SqlType, Convert.ToUInt32 (Size),
-                               0, (IntPtr) _nativeBuffer, 0, _cbLengthInd);
-
-                       // Check for error condition
-                       if ((ret != OdbcReturn.Success) && (ret != OdbcReturn.SuccessWithInfo))
-                               throw command.Connection.CreateOdbcException (OdbcHandleType.Stmt, hstmt);
-               }
-
-               [MonoTODO]
-               object ICloneable.Clone ()
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public override string ToString ()
-               {
-                       return ParameterName;
-               }
-               
-               private int GetNativeSize ()
-               {
-                       TextInfo ti = CultureInfo.InvariantCulture.TextInfo;
-                       Encoding enc = Encoding.GetEncoding (ti.ANSICodePage);
-
-                       switch (_typeMap.OdbcType) {
-                       case OdbcType.Binary:
-                               if (Value.GetType ().IsArray &&
-                                   Value.GetType ().GetElementType () == typeof (byte))
-                                       return ( (Array) Value).Length;
-                               else
-                                       return Value.ToString ().Length;
-                       case OdbcType.Bit:
-                               return Marshal.SizeOf (typeof (byte));
-                       case OdbcType.Double:
-                               return Marshal.SizeOf (typeof (double));
-                       case OdbcType.Real:
-                               return Marshal.SizeOf (typeof (float));
-                       case OdbcType.Int:
-                               return Marshal.SizeOf (typeof (int));
-                       case OdbcType.BigInt:
-                               return Marshal.SizeOf (typeof (long));
-                       case OdbcType.Decimal:
-                       case OdbcType.Numeric:
-                               return 19;
-                       case OdbcType.SmallInt:
-                               return Marshal.SizeOf (typeof (Int16));
-                       case OdbcType.TinyInt:
-                               return Marshal.SizeOf (typeof (byte));
-                       case OdbcType.Char:
-                       case OdbcType.Text:
-                       case OdbcType.VarChar:
-                               return enc.GetByteCount (Convert.ToString (Value)) + 1;
-                       case OdbcType.NChar:
-                       case OdbcType.NText:
-                       case OdbcType.NVarChar:
-                               // FIXME: Change to unicode
-                               return enc.GetByteCount (Convert.ToString (Value)) + 1;
-                       case OdbcType.VarBinary:
-                       case OdbcType.Image:
-                               if (Value.GetType ().IsArray &&
-                                   Value.GetType ().GetElementType () == typeof (byte))
-                                       return ((Array) Value).Length;
-                               throw new ArgumentException ("Unsupported Native Type!");
-                       case OdbcType.Date:
-                       case OdbcType.DateTime:
-                       case OdbcType.SmallDateTime:
-                       case OdbcType.Time:
-                       case OdbcType.Timestamp:
-                               return 18;
-                       case OdbcType.UniqueIdentifier:
-                               return Marshal.SizeOf (typeof (Guid));
-                       }
-
-                       if (Value.GetType ().IsArray &&
-                           Value.GetType ().GetElementType () == typeof (byte))
-                               return ((Array) Value).Length;
-                       
-                       return Value.ToString ().Length;
-               }
-
-               private void AllocateBuffer ()
-               {
-                       int size = GetNativeSize ();
-
-                       if (_nativeBuffer.Size == size)
-                               return;
-
-                       _nativeBuffer.AllocBuffer (size);
-               }
-
-               internal void CopyValue ()
-               {
-                       if (_nativeBuffer.Handle == IntPtr.Zero)
-                               return;
-
-                       if (Value is DBNull)
-                               return;
-                       
-                       DateTime dt;
-                       TextInfo ti = CultureInfo.InvariantCulture.TextInfo;
-                       Encoding enc = Encoding.GetEncoding (ti.ANSICodePage);
-                       byte [] nativeBytes, buffer;
-
-                       switch (_typeMap.OdbcType) {
-                       case OdbcType.Bit:
-                               Marshal.WriteByte (_nativeBuffer, Convert.ToByte (Value));
-                               return;
-                       case OdbcType.Double:
-                               Marshal.StructureToPtr (Convert.ToDouble (Value), _nativeBuffer, false);
-                               return;
-                       case OdbcType.Real:
-                               Marshal.StructureToPtr (Convert.ToSingle (Value), _nativeBuffer, false);
-                               return;
-                       case OdbcType.Int:
-                               Marshal.WriteInt32 (_nativeBuffer, Convert.ToInt32 (Value));
-                               return;
-                       case OdbcType.BigInt:
-                               Marshal.WriteInt64 (_nativeBuffer, Convert.ToInt64 (Value));
-                               return;
-                       case OdbcType.Decimal:
-                       case OdbcType.Numeric:
-                               // for numeric, the buffer is a packed decimal struct.
-                               // ref http://www.it-faq.pl/mskb/181/254.HTM
-                               int [] bits = Decimal.GetBits (Convert.ToDecimal (Value));
-                               buffer = new byte [19]; // ref sqltypes.h
-                               buffer [0] = Precision;
-                               buffer [1] = (byte) ((bits [3] & 0x00FF0000) >> 16); // scale
-                               buffer [2] = (byte) ((bits [3] & 0x80000000) > 0 ? 2 : 1); //sign
-                               Buffer.BlockCopy (bits, 0, buffer, 3, 12); // copy data
-                               for (int j = 16; j < 19; j++) // pad with 0
-                                       buffer [j] = 0;
-                               Marshal.Copy (buffer, 0, _nativeBuffer, 19); 
-                               return; 
-                       case OdbcType.SmallInt:
-                               Marshal.WriteInt16 (_nativeBuffer, Convert.ToInt16 (Value));
-                               return;
-                       case OdbcType.TinyInt:
-                               Marshal.WriteByte (_nativeBuffer, Convert.ToByte (Value));
-                               return;
-                       case OdbcType.Char:
-                       case OdbcType.Text:
-                       case OdbcType.VarChar:
-                               buffer = new byte [GetNativeSize ()];
-                               nativeBytes = enc.GetBytes (Convert.ToString (Value));
-                               Array.Copy (nativeBytes, 0, buffer, 0, nativeBytes.Length);
-                               buffer [buffer.Length-1] = (byte) 0;
-                               Marshal.Copy (buffer, 0, _nativeBuffer, buffer.Length);
-                               Marshal.WriteInt32 (_cbLengthInd, -3);
-                               return;
-                       case OdbcType.NChar:
-                       case OdbcType.NText:
-                       case OdbcType.NVarChar:
-                               // FIXME : change to unicode
-                               buffer = new byte [GetNativeSize ()];
-                               nativeBytes = enc.GetBytes (Convert.ToString (Value));
-                               Array.Copy (nativeBytes, 0, buffer, 0, nativeBytes.Length);
-                               buffer [buffer.Length-1] = (byte) 0;
-                               Marshal.Copy (buffer, 0, _nativeBuffer, buffer.Length);
-                               Marshal.WriteInt32 (_cbLengthInd, -3);
-                               return;
-                       case OdbcType.VarBinary:
-                       case OdbcType.Image:
-                       case OdbcType.Binary:
-                               if (Value.GetType ().IsArray &&
-                                   Value.GetType ().GetElementType () == typeof (byte)) {
-                                       Marshal.Copy ( (byte []) Value, 0, _nativeBuffer, ((byte []) Value).Length);
-                               }else
-                                       throw new ArgumentException ("Unsupported Native Type!");
-                               return;
-                       case OdbcType.Date:
-                               dt = (DateTime) Value;
-                               Marshal.WriteInt16 (_nativeBuffer, 0, (short) dt.Year);
-                               Marshal.WriteInt16 (_nativeBuffer, 2, (short) dt.Month);
-                               Marshal.WriteInt16 (_nativeBuffer, 4, (short) dt.Day);
-                               return;
-                       case OdbcType.Time:
-                               dt = (DateTime) Value;
-                               Marshal.WriteInt16 (_nativeBuffer, 0, (short) dt.Hour);
-                               Marshal.WriteInt16 (_nativeBuffer, 2, (short) dt.Minute);
-                               Marshal.WriteInt16 (_nativeBuffer, 4, (short) dt.Second);
-                               return;
-                       case OdbcType.SmallDateTime:
-                       case OdbcType.Timestamp:
-                       case OdbcType.DateTime:
-                               dt = (DateTime) Value;
-                               Marshal.WriteInt16 (_nativeBuffer, 0, (short) dt.Year);
-                               Marshal.WriteInt16 (_nativeBuffer, 2, (short) dt.Month);
-                               Marshal.WriteInt16 (_nativeBuffer, 4, (short) dt.Day);
-                               Marshal.WriteInt16 (_nativeBuffer, 6, (short) dt.Hour);
-                               Marshal.WriteInt16 (_nativeBuffer, 8, (short) dt.Minute);
-                               Marshal.WriteInt16 (_nativeBuffer, 10, (short) dt.Second);
-                               Marshal.WriteInt32 (_nativeBuffer, 12, (int) (dt.Ticks % 10000000) * 100);
-                               return;
-                       case OdbcType.UniqueIdentifier:
-                               throw new NotImplementedException ();
-                       }
-
-                       if (Value.GetType ().IsArray &&
-                           Value.GetType ().GetElementType () == typeof (byte)) {
-                               Marshal.Copy ( (byte []) Value, 0, _nativeBuffer, ((byte []) Value).Length);
-                       }else
-                               throw new ArgumentException ("Unsupported Native Type!");
-               }
-
-               public override bool SourceColumnNullMapping {
-                       get { return false; }
-                       set { }
-               }
-
-               public override void ResetDbType ()
-               {
-                       _typeMap = OdbcTypeConverter.GetTypeMap (OdbcType.NVarChar);
-               }
-
-               public void ResetOdbcType ()
-               {
-                       _typeMap = OdbcTypeConverter.GetTypeMap (OdbcType.NVarChar);
-               }
-
-               #endregion
-       }
-}
diff --git a/mcs/class/System.Data/System.Data.Odbc/OdbcParameterCollection.cs b/mcs/class/System.Data/System.Data.Odbc/OdbcParameterCollection.cs
deleted file mode 100644 (file)
index 529a272..0000000
+++ /dev/null
@@ -1,372 +0,0 @@
-//
-// System.Data.Odbc.OdbcParameterCollection
-//
-// Authors:
-//   Brian Ritchie (brianlritchie@hotmail.com) 
-//   Umadevi S (sumadevi@novell.com)
-//   Amit Biswas (amit@amitbiswas.com)
-//
-// Copyright (C) Brian Ritchie, 2002
-// Copyright (C) Novell,Inc 
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Collections;
-using System.ComponentModel;
-using System.Data;
-using System.Data.Common;
-
-namespace System.Data.Odbc
-{
-       [ListBindable (false)]
-       [EditorAttribute ("Microsoft.VSDesigner.Data.Design.DBParametersEditor, "+ Consts.AssemblyMicrosoft_VSDesigner, "System.Drawing.Design.UITypeEditor, "+ Consts.AssemblySystem_Drawing )]
-       public sealed class OdbcParameterCollection : DbParameterCollection
-       {
-               #region Fields
-
-               readonly ArrayList list = new ArrayList ();
-               int nullParamCount = 1;
-
-               #endregion // Fields
-       
-               #region Constructors
-
-               internal OdbcParameterCollection ()
-               {
-               }
-
-               #endregion // Constructors
-       
-               #region Properties
-
-               public
-               override
-               int Count {
-                       get { return list.Count; }
-               }
-
-               [Browsable (false)]
-               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
-               public new OdbcParameter this [int index] {
-                       get { return (OdbcParameter) list [index]; }
-                       set { list [index] = value; }
-               }
-
-               [Browsable (false)]
-               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
-               public new OdbcParameter this [string parameterName] {
-                       get {
-                               foreach (OdbcParameter p in list)
-                                       if (p.ParameterName.Equals (parameterName))
-                                               return p;
-                               throw new IndexOutOfRangeException ("The specified name does not exist: " + parameterName);
-                       }
-                       set {
-                               if (!Contains (parameterName))
-                                       throw new IndexOutOfRangeException("The specified name does not exist: " + parameterName);
-                               this [IndexOf (parameterName)] = value;
-                       }
-               }
-
-               public override bool IsFixedSize {
-                       get { return false; }
-               }
-
-               public override bool IsReadOnly {
-                       get { return false; }
-               }
-
-               public override bool IsSynchronized {
-                       get { return list.IsSynchronized; }
-               }
-
-               public override object SyncRoot {
-                       get { return list.SyncRoot; }
-               }
-               
-
-               #endregion // Properties
-
-               #region Methods
-
-               [EditorBrowsableAttribute (EditorBrowsableState.Never)]
-               public
-               override
-               int Add (object value)
-               {
-                       if (!(value is OdbcParameter))
-                               throw new InvalidCastException ("The parameter was not an OdbcParameter.");
-                       Add ((OdbcParameter) value);
-                       return IndexOf (value);
-               }
-
-               public OdbcParameter Add (OdbcParameter value)
-               {
-                       if (value.Container != null)
-                               throw new ArgumentException ("The OdbcParameter specified in " +
-                                                            "the value parameter is already " +
-                                                            "added to this or another OdbcParameterCollection.");
-                       if (value.ParameterName == null || value.ParameterName.Length == 0) {
-                               value.ParameterName = "Parameter" + nullParamCount;
-                               nullParamCount++;
-                       }
-                       value.Container = this;
-                       list.Add (value);
-                       return value;
-               }
-
-               [EditorBrowsableAttribute (EditorBrowsableState.Never)]
-               [Obsolete ("Add(String parameterName, Object value) has been deprecated.  Use AddWithValue(String parameterName, Object value).")]
-               public OdbcParameter Add (string parameterName, object value)
-               {
-                       return Add (new OdbcParameter (parameterName, value));
-               }
-
-               public OdbcParameter Add (string parameterName, OdbcType odbcType)
-               {
-                       return Add (new OdbcParameter (parameterName, odbcType));
-               }
-
-               public OdbcParameter Add (string parameterName, OdbcType odbcType, int size)
-               {
-                       return Add (new OdbcParameter (parameterName, odbcType, size));
-               }
-
-               public OdbcParameter Add (string parameterName, OdbcType odbcType,
-                                          int size, string sourceColumn)
-               {
-                       return Add (new OdbcParameter (parameterName, odbcType,
-                               size, sourceColumn));
-               }
-
-               public
-               override
-               void Clear()
-               {
-                       foreach (OdbcParameter p in list)
-                               p.Container = null;
-                       list.Clear ();
-               }
-
-               public
-               override
-               bool Contains (object value)
-               {
-                       if (value == null)
-                               //should not throw ArgumentNullException
-                               return false;
-                       if (!(value is OdbcParameter))
-                               throw new InvalidCastException ("The parameter was not an OdbcParameter.");
-                       return Contains (((OdbcParameter) value).ParameterName);
-               }
-
-               public
-               override
-               bool Contains (string value)
-               {
-                       if (value == null || value.Length == 0)
-                               //should not throw ArgumentNullException
-                               return false;
-                       string value_upper = value.ToUpper ();
-                       foreach (OdbcParameter p in this)
-                               if (p.ParameterName.ToUpper ().Equals (value_upper))
-                                       return true;
-                       return false;
-               }
-
-               public
-               override
-               void CopyTo (Array array, int index)
-               {
-                       list.CopyTo (array, index);
-               }
-
-               public
-               override
-               IEnumerator GetEnumerator()
-               {
-                       return list.GetEnumerator ();
-               }
-
-               public
-               override
-               int IndexOf (object value)
-               {
-                       if (value == null)
-                               return -1;
-                       if (!(value is OdbcParameter))
-                               throw new InvalidCastException ("The parameter was not an OdbcParameter.");
-                       return list.IndexOf (value);
-               }
-
-               public
-               override
-               int IndexOf (string parameterName)
-               {
-                       if (parameterName == null || parameterName.Length == 0)
-                               return -1;
-                       string parameterName_upper = parameterName.ToUpper ();
-                       for (int i = 0; i < Count; i += 1)
-                               if (this [i].ParameterName.ToUpper ().Equals (parameterName_upper))
-                                       return i;
-                       return -1;
-               }
-
-               public
-               override
-               void Insert (int index, object value)
-               {
-                       if (value == null)
-                               throw new ArgumentNullException ("value");
-                       if (!(value is OdbcParameter))
-                               throw new InvalidCastException ("The parameter was not an OdbcParameter.");
-                       Insert (index, (OdbcParameter) value);
-               }
-
-               public
-               override
-               void Remove (object value)
-               {
-                       if (value == null)
-                               throw new ArgumentNullException ("value");
-                       if (!(value is OdbcParameter))
-                               throw new InvalidCastException ("The parameter was not an OdbcParameter.");
-                       Remove ((OdbcParameter) value);
-               }
-
-               public
-               override
-               void RemoveAt (int index)
-               {
-                       if (index >= list.Count || index < 0)
-                               throw new IndexOutOfRangeException (String.Format ("Invalid index {0} for this OdbcParameterCollection with count = {1}", index, list.Count));
-                       this [index].Container = null;
-                       list.RemoveAt (index);
-               }
-
-               public
-               override
-               void RemoveAt (string parameterName)
-               {
-                       RemoveAt (IndexOf (parameterName));
-               }
-
-               protected override DbParameter GetParameter (string parameterName)
-               {
-                       return this [parameterName];
-               }
-
-               protected override DbParameter GetParameter (int index)
-               {
-                       return this [index];
-               }
-
-               protected override void SetParameter (string parameterName, DbParameter value)
-               {
-                       this [parameterName] = (OdbcParameter) value;
-               }
-
-               protected override void SetParameter (int index, DbParameter value)
-               {
-                       this [index] = (OdbcParameter) value;
-               }
-
-
-               public override void AddRange (Array values)
-               {
-                       if (values == null)
-                               throw new ArgumentNullException ("values");
-                       foreach (OdbcParameter p in values)
-                               if (p == null)
-                                       throw new ArgumentNullException ("values", "The OdbcParameterCollection only accepts non-null OdbcParameter type objects");
-                       // no need to check if parameter is already contained
-                       foreach (OdbcParameter p in values)
-                               Add (p);
-               }
-
-               public void AddRange (OdbcParameter [] values)
-               {
-                       AddRange ((Array) values);
-               }
-
-               public void Insert (int index, OdbcParameter value)
-               {
-                       if (index > list.Count || index < 0)
-                               throw new ArgumentOutOfRangeException ("index", "The index must be non-negative and less than or equal to size of the collection");
-                       if (value == null)
-                               throw new ArgumentNullException ("value");
-                       if (value.Container != null)
-                               throw new ArgumentException ("The OdbcParameter is already contained by another collection");
-                       if (String.IsNullOrEmpty (value.ParameterName)) {
-                               value.ParameterName = "Parameter" + nullParamCount;
-                               nullParamCount++;
-                       }
-                       value.Container = this;
-                       list.Insert (index, value);
-               }
-
-               public OdbcParameter AddWithValue (string parameterName, Object value)
-               {
-                       if (value == null)
-                               return Add (new OdbcParameter (parameterName, OdbcType.NVarChar));
-                       return Add (new OdbcParameter (parameterName, value));
-               }
-
-               public void Remove (OdbcParameter value)
-               {
-                       if (value == null)
-                               throw new ArgumentNullException ("value");
-                       if (value.Container != this)
-                               throw new ArgumentException ("values", "Attempted to remove an OdbcParameter that is not contained in this OdbcParameterCollection");
-                       value.Container = null;
-                       list.Remove (value);
-               }
-
-               public bool Contains (OdbcParameter value)
-               {
-                       if (value == null)
-                               //should not throw ArgumentNullException
-                               return false;
-                       if (value.Container != this)
-                               return false;
-                       return Contains (value.ParameterName);
-               }
-
-               public int IndexOf (OdbcParameter value)
-               {
-                       if (value == null)
-                               //should not throw ArgumentNullException
-                               return -1;
-                       return IndexOf ((Object) value);
-               }
-
-               public void CopyTo (OdbcParameter [] array, int index)
-               {
-                       list.CopyTo (array, index);
-               }
-
-               #endregion // Methods
-       }
-}
diff --git a/mcs/class/System.Data/System.Data.Odbc/OdbcParameterConverter.cs b/mcs/class/System.Data/System.Data.Odbc/OdbcParameterConverter.cs
deleted file mode 100644 (file)
index fba9c51..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-//
-// System.Data.Odbc.OdbcParameterConverter.cs
-//
-// Author:
-//   Umadevi S (sumadevi@novell.com)
-//
-// Copyright (C) Novell Inc, 2004
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.ComponentModel;
-using System.Globalization;
-
-namespace System.Data.Odbc {
-       internal sealed class OdbcParameterConverter : ExpandableObjectConverter
-       {
-               #region Constructors
-
-               [MonoTODO]
-               public OdbcParameterConverter ()
-               {
-                       throw new NotImplementedException ();
-               }
-
-               #endregion // Constructors
-
-               #region Methods
-       
-               [MonoTODO]
-               public override object ConvertTo (ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               public override bool CanConvertTo (ITypeDescriptorContext context, Type destinationType)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               #endregion // Methods
-       }
-}
diff --git a/mcs/class/System.Data/System.Data.Odbc/OdbcRowUpdatedEventArgs.cs b/mcs/class/System.Data/System.Data.Odbc/OdbcRowUpdatedEventArgs.cs
deleted file mode 100644 (file)
index 0c2c999..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// System.Data.Odbc.OdbcRowUpdatedEventArgs.cs
-//
-// Author:
-//   Rodrigo Moya (rodrigo@ximian.com)
-//   Daniel Morgan (danmorg@sc.rr.com)
-//   Tim Coleman (tim@timcoleman.com)
-//
-// (C) Ximian, Inc 2002
-// Copyright (C) Tim Coleman, 2002
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Data;
-using System.Data.Common;
-
-namespace System.Data.Odbc {
-       public sealed class OdbcRowUpdatedEventArgs : RowUpdatedEventArgs 
-       {
-               #region Constructors
-
-               public OdbcRowUpdatedEventArgs (DataRow row, IDbCommand command, StatementType statementType, DataTableMapping tableMapping) 
-                       : base (row, command, statementType, tableMapping)
-               {
-               }
-
-               #endregion // Constructors
-
-               #region Properties
-
-               public new OdbcCommand Command {
-                       get { return (OdbcCommand) base.Command; }
-               }
-
-               #endregion // Properties
-       }
-}
diff --git a/mcs/class/System.Data/System.Data.Odbc/OdbcRowUpdatedEventHandler.cs b/mcs/class/System.Data/System.Data.Odbc/OdbcRowUpdatedEventHandler.cs
deleted file mode 100644 (file)
index 49a704e..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-// System.Data.Odbc.OdbcRowUpdatedEventHandler.cs
-//
-// Author:
-//   Rodrigo Moya (rodrigo@ximian.com)
-//   Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Ximian, Inc 2002
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace System.Data.Odbc {
-       public delegate void OdbcRowUpdatedEventHandler (object sender, OdbcRowUpdatedEventArgs e);
-}
diff --git a/mcs/class/System.Data/System.Data.Odbc/OdbcRowUpdatingEventArgs.cs b/mcs/class/System.Data/System.Data.Odbc/OdbcRowUpdatingEventArgs.cs
deleted file mode 100644 (file)
index 96ca40c..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-//
-// System.Data.Odbc.OdbcRowUpdatingEventArgs.cs
-//
-// Author:
-//   Rodrigo Moya (rodrigo@ximian.com)
-//   Daniel Morgan (danmorg@sc.rr.com)
-//   Tim Coleman (tim@timcoleman.com)
-//
-// (C) Ximian, Inc 2002
-// Copyright (C) Tim Coleman, 2002
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Data;
-using System.Data.Common;
-
-namespace System.Data.Odbc {
-       public sealed class OdbcRowUpdatingEventArgs : RowUpdatingEventArgs
-       {
-               #region Constructors
-
-               public OdbcRowUpdatingEventArgs (DataRow row, IDbCommand command, StatementType statementType, DataTableMapping tableMapping) 
-                       : base (row, command, statementType, tableMapping)
-               {
-               }
-
-               #endregion // Constructors
-
-               #region Properties
-
-               public new OdbcCommand Command {
-                       get { return (OdbcCommand) base.Command; }
-                       set { base.Command = value; }
-               }
-
-               protected override IDbCommand BaseCommand {
-                       get { return base.Command; }    
-                       set { base.Command = value; }
-               }
-
-
-               #endregion // Properties
-       }
-}
diff --git a/mcs/class/System.Data/System.Data.Odbc/OdbcRowUpdatingEventHandler.cs b/mcs/class/System.Data/System.Data.Odbc/OdbcRowUpdatingEventHandler.cs
deleted file mode 100644 (file)
index 4c38050..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-// System.Data.Odbc.OdbcRowUpdatingEventHandler.cs
-//
-// Author:
-//   Rodrigo Moya (rodrigo@ximian.com)
-//   Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Ximian, Inc 2002
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace System.Data.Odbc {
-       public delegate void OdbcRowUpdatingEventHandler(object sender, OdbcRowUpdatingEventArgs e);
-}
diff --git a/mcs/class/System.Data/System.Data.Odbc/OdbcTransaction.cs b/mcs/class/System.Data/System.Data.Odbc/OdbcTransaction.cs
deleted file mode 100644 (file)
index 13b28a6..0000000
+++ /dev/null
@@ -1,249 +0,0 @@
-//
-// System.Data.Odbc.OdbcTransaction
-//
-// Authors:
-//  Brian Ritchie (brianlritchie@hotmail.com) 
-//
-// Copyright (C) Brian Ritchie, 2002
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.Data;
-using System.Data.Common;
-using System.Globalization;
-
-namespace System.Data.Odbc
-{
-       public sealed class OdbcTransaction : DbTransaction, IDisposable
-       {
-               private bool disposed;
-               private OdbcConnection connection;
-               private IsolationLevel isolationlevel;
-               private bool isOpen;
-
-               internal OdbcTransaction (OdbcConnection conn, IsolationLevel isolationlevel)
-               {
-                       // Set Auto-commit (102) to false
-                       SetAutoCommit (conn, false);
-                       // Handle isolation level
-                       OdbcIsolationLevel lev = OdbcIsolationLevel.ReadCommitted;
-                       OdbcConnectionAttribute attr = OdbcConnectionAttribute.TransactionIsolation;
-                       switch (isolationlevel) {
-                       case IsolationLevel.ReadUncommitted:
-                               lev = OdbcIsolationLevel.ReadUncommitted;
-                               break;
-                       case IsolationLevel.ReadCommitted:
-                               lev = OdbcIsolationLevel.ReadCommitted;
-                               break;
-                       case IsolationLevel.RepeatableRead:
-                               lev = OdbcIsolationLevel.RepeatableRead;
-                               break;
-                       case IsolationLevel.Serializable:
-                               lev = OdbcIsolationLevel.Serializable;
-                               break;
-                       case IsolationLevel.Snapshot:
-                               // badly broken on MS:
-                               // https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=305736
-                               lev = OdbcIsolationLevel.Snapshot;
-
-                               // SQL_ATTR_TXN_ISOLATION can be used to set all other isolation
-                               // levels except for SQL_TXN_SS_SNAPSHOT. If you want to use snapshot
-                               // isolation, you must set SQL_TXN_SS_SNAPSHOT through
-                               // SQL_COPT_SS_TXN_ISOLATION. However, you can retrieve the
-                               // isolation level by using either SQL_ATTR_TXN_ISOLATION or
-                               // SQL_COPT_SS_TXN_ISOLATION.
-                               // Source:
-                               // http://msdn2.microsoft.com/en-us/library/ms131709.aspx
-                               attr = OdbcConnectionAttribute.CoptTransactionIsolation;
-                               break;
-                       case IsolationLevel.Unspecified:
-                               // when isolationlevel is not specified, then use
-                               // default isolation level of the driver and
-                               // lazy initialize it in the IsolationLevel property
-                               break;
-                       case IsolationLevel.Chaos:
-                               throw new ArgumentOutOfRangeException ("IsolationLevel",
-                                       string.Format (CultureInfo.CurrentCulture,
-                                               "The IsolationLevel enumeration " +
-                                               "value, {0}, is not supported by " +
-                                               "the .Net Framework Odbc Data " +
-                                               "Provider.", (int) isolationlevel));
-                       default:
-                               throw new ArgumentOutOfRangeException ("IsolationLevel",
-                                       string.Format (CultureInfo.CurrentCulture,
-                                               "The IsolationLevel enumeration value, {0}, is invalid.",
-                                               (int) isolationlevel));
-                       }
-
-                       // only change isolation level if it was explictly set
-                       if (isolationlevel != IsolationLevel.Unspecified) {
-                               // mbd: Getting the return code of the second call to SQLSetConnectAttr is missing from original code!
-                               OdbcReturn ret = libodbc.SQLSetConnectAttr (conn.hDbc,
-                                       attr, (IntPtr) lev, 0);
-                               if (ret != OdbcReturn.Success && ret != OdbcReturn.SuccessWithInfo)
-                                       throw conn.CreateOdbcException (OdbcHandleType.Dbc, conn.hDbc);
-                       }
-                       this.isolationlevel = isolationlevel;
-                       connection = conn;
-                       isOpen = true;
-               }
-
-               // Set Auto-commit (102) connection attribute
-               // [MonoTODO]: nice to have before svn: define libodbc.SQL_IS_UINTEGER = -5
-               private static void SetAutoCommit (OdbcConnection conn, bool isAuto)
-               {
-                       OdbcReturn ret = libodbc.SQLSetConnectAttr (conn.hDbc,
-                               OdbcConnectionAttribute.AutoCommit,
-                               (IntPtr) (isAuto ? 1 : 0), -5);
-                       if (ret != OdbcReturn.Success && ret != OdbcReturn.SuccessWithInfo)
-                               throw conn.CreateOdbcException (OdbcHandleType.Dbc, conn.hDbc);
-               }
-
-               private static IsolationLevel GetIsolationLevel (OdbcConnection conn)
-               {
-                       int lev;
-                       int length;
-                       OdbcReturn ret = libodbc.SQLGetConnectAttr (conn.hDbc,
-                               OdbcConnectionAttribute.TransactionIsolation,
-                               out lev, 0, out length);
-                       if (ret != OdbcReturn.Success && ret != OdbcReturn.SuccessWithInfo)
-                               throw conn.CreateOdbcException (OdbcHandleType.Dbc, conn.hDbc);
-                       return MapOdbcIsolationLevel ((OdbcIsolationLevel) lev);
-               }
-
-               private static IsolationLevel MapOdbcIsolationLevel (OdbcIsolationLevel odbcLevel)
-               {
-                       IsolationLevel isoLevel = IsolationLevel.Unspecified;
-
-                       switch (odbcLevel) {
-                       case OdbcIsolationLevel.ReadUncommitted:
-                               isoLevel = IsolationLevel.ReadUncommitted;
-                               break;
-                       case OdbcIsolationLevel.ReadCommitted:
-                               isoLevel = IsolationLevel.ReadCommitted;
-                               break;
-                       case OdbcIsolationLevel.RepeatableRead:
-                               isoLevel = IsolationLevel.RepeatableRead;
-                               break;
-                       case OdbcIsolationLevel.Serializable:
-                               isoLevel = IsolationLevel.Serializable;
-                               break;
-                       case OdbcIsolationLevel.Snapshot:
-                               isoLevel = IsolationLevel.Snapshot;
-                               break;
-                       }
-                       return isoLevel;
-               }
-
-               #region Implementation of IDisposable
-
-               protected override
-               void Dispose (bool disposing)
-               {
-                       if (!disposed) {
-                               if (disposing && isOpen)
-                                       Rollback ();
-                               disposed = true;
-                       }
-               }
-
-               void IDisposable.Dispose ()
-               {
-                       Dispose (true);
-                       GC.SuppressFinalize (this);
-               }
-
-               #endregion Implementation of IDisposable
-
-               #region Implementation of IDbTransaction
-
-               public
-               override
-               void Commit ()
-               {
-                       if (!isOpen)
-                               throw ExceptionHelper.TransactionNotUsable (GetType ());
-
-                       if (connection.transaction == this) {
-                               OdbcReturn ret = libodbc.SQLEndTran ((short) OdbcHandleType.Dbc, connection.hDbc, 0);
-                               if (ret != OdbcReturn.Success && ret != OdbcReturn.SuccessWithInfo)
-                                       throw connection.CreateOdbcException (OdbcHandleType.Dbc, connection.hDbc);
-                               SetAutoCommit (connection, true); // restore default auto-commit
-                               connection.transaction = null;
-                               connection = null;
-                               isOpen = false;
-                       } else
-                               throw new InvalidOperationException ();
-               }
-
-               public
-               override
-               void Rollback()
-               {
-                       if (!isOpen)
-                               throw ExceptionHelper.TransactionNotUsable (GetType ());
-
-                       if (connection.transaction == this) {
-                               OdbcReturn ret = libodbc.SQLEndTran ((short) OdbcHandleType.Dbc, connection.hDbc, 1);
-                               if (ret != OdbcReturn.Success && ret != OdbcReturn.SuccessWithInfo)
-                                       throw connection.CreateOdbcException (OdbcHandleType.Dbc, connection.hDbc);
-                               SetAutoCommit (connection, true);    // restore default auto-commit
-                               connection.transaction = null;
-                               connection = null;
-                               isOpen = false;
-                       } else
-                               throw new InvalidOperationException ();
-               }
-
-               protected override DbConnection DbConnection {
-                       get {
-                               return Connection;
-                       }
-               }
-
-               public
-               override
-               IsolationLevel IsolationLevel {
-                       get {
-                               if (!isOpen)
-                                       throw ExceptionHelper.TransactionNotUsable (GetType ());
-
-                               if (isolationlevel == IsolationLevel.Unspecified)
-                                       isolationlevel = GetIsolationLevel (Connection);
-                               return isolationlevel;
-                       }
-               }
-
-               #endregion Implementation of IDbTransaction
-
-               #region Public Instance Properties
-
-               public new OdbcConnection Connection {
-                       get {
-                               return connection;
-                       }
-               }
-
-               #endregion Public Instance Properties
-       }
-}
diff --git a/mcs/class/System.Data/System.Data.Odbc/OdbcType.cs b/mcs/class/System.Data/System.Data.Odbc/OdbcType.cs
deleted file mode 100644 (file)
index 36cc0e8..0000000
+++ /dev/null
@@ -1,167 +0,0 @@
-//
-// System.Data.Odbc.OdbcType
-//
-// Author:
-//   Sureshkumar T <tsureshkumar@novell.com> 2005.
-//   Brian Ritchie
-//
-// Copyright (C) Brian Ritchie, 2002
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Data;
-using System.Data.Common;
-
-namespace System.Data.Odbc
-{ 
-
-        public enum OdbcType
-        {
-                BigInt = 1,
-                Binary = 2,
-                Bit = 3,
-                Char = 4,
-                Date = 0x17,
-                DateTime = 5,
-                Decimal = 6,
-                Double = 8,
-                Image = 9,
-                Int = 10,
-                NChar = 11,
-                NText = 12,
-                Numeric = 7,
-                NVarChar = 13,
-                Real = 14,
-                SmallDateTime = 0x10,
-                SmallInt = 0x11,
-                Text = 0x12,
-                Time = 0x18,
-                Timestamp = 0x13,
-                TinyInt = 20,
-                UniqueIdentifier = 15,
-                VarBinary = 0x15,
-                VarChar = 0x16
-        }
-
-        // From the ODBC documentation:
-        //
-        //     In ODBC 3.x, the identifiers for date, time, and timestamp SQL data types 
-        //  have changed from SQL_DATE, SQL_TIME, and SQL_TIMESTAMP (with instances of 
-        //  #define in the header file of 9, 10, and 11) to SQL_TYPE_DATE, SQL_TYPE_TIME,
-        //  and SQL_TYPE_TIMESTAMP (with instances of #define in the header file of 91, 92, and 93), 
-        //  respectively.
-        
-        // This internal enum is used as mapping types into database drivers.
-        // This is essentially a map between public OdbcType to C types for 
-        // Odbc to call into driver. These values are taken from sql.h & sqlext.h.
-        internal enum SQL_TYPE : short
-        {
-                BIGINT                         = (-5),
-                BINARY                         = (-2),
-                BIT                            = (-7),
-                CHAR                           = 1,
-                DATE                           = 9,
-                DECIMAL                         = 3,
-                DOUBLE                         = 8,
-                GUID                           = (-11),
-                INTEGER                                = 4,
-                INTERVAL_DAY                   = (100 + 3),
-                INTERVAL_DAY_TO_HOUR           = (100 + 8),
-                INTERVAL_DAY_TO_MINUTE         = (100 + 9),
-                INTERVAL_DAY_TO_SECOND         = (100 + 10),
-                INTERVAL_HOUR                  = (100 + 4),
-                INTERVAL_HOUR_TO_MINUTE                = (100 + 11),
-                INTERVAL_HOUR_TO_SECOND                = (100 + 12),
-                INTERVAL_MINUTE                        = (100 + 5),
-                INTERVAL_MINUTE_TO_SECOND      = (100 + 13),
-                INTERVAL_MONTH                 = (100 + 2),
-                INTERVAL_SECOND                        = (100 + 6),
-                INTERVAL_YEAR                  = (100 + 1),
-                INTERVAL_YEAR_TO_MONTH         = (100 + 7),
-                LONGVARBINARY                   = (-4),
-                LONGVARCHAR                     = (-1),
-                NUMERIC                         = 2,
-                REAL                           = 7,
-                SMALLINT                       = 5,
-                TIME                           = 10,
-                TIMESTAMP                      = 11,
-                TINYINT                                = (-6),
-                TYPE_DATE                      = 91,
-                TYPE_TIME                      = 92,
-                TYPE_TIMESTAMP                 = 93,
-                VARBINARY                       = (-3),
-                VARCHAR                         = 12,
-                WCHAR                          = (-8),
-                WLONGVARCHAR                    = (-10),
-                WVARCHAR                        = (-9),
-                UNASSIGNED                      = Int16.MaxValue
-        }
-
-        internal enum SQL_C_TYPE : short
-        {
-                BINARY                         = (-2),
-                BIT                            = (-7),
-                BOOKMARK                       = (4 +(-22)),
-                CHAR                           = 1,
-                DATE                           = 9,
-                DEFAULT                                = 99,
-                DOUBLE                         = 8,
-                FLOAT                          = 7,
-                GUID                           = (-11),
-                INTERVAL_DAY                   = (100 + 3),
-                INTERVAL_DAY_TO_HOUR           = (100 + 8),
-                INTERVAL_DAY_TO_MINUTE         = (100 + 9),
-                INTERVAL_DAY_TO_SECOND         = (100 + 10),
-                INTERVAL_HOUR                  = (100 + 4),
-                INTERVAL_HOUR_TO_MINUTE                = (100 + 11),
-                INTERVAL_HOUR_TO_SECOND                = (100 + 12),
-                INTERVAL_MINUTE                        = (100 + 5),
-                INTERVAL_MINUTE_TO_SECOND      = (100 + 13),
-                INTERVAL_MONTH                 = (100 + 2),
-                INTERVAL_SECOND                        = (100 + 6),
-                INTERVAL_YEAR                  = (100 + 1),
-                INTERVAL_YEAR_TO_MONTH         = (100 + 7),
-                LONG                           = 4,
-                NUMERIC                                = 2,
-                SBIGINT                                = ((-5)+(-20)),
-                SHORT                          = 5,
-                SLONG                          = (4 +(-20)),
-                SSHORT                         = (5 +(-20)),
-                STINYINT                       = ((-6)+(-20)),
-                TCHAR                          = 1,
-                TIME                           = 10,
-                TIMESTAMP                      = 11,
-                TINYINT                                = (-6),
-                TYPE_DATE                      = 91,
-                TYPE_TIME                      = 92,
-                TYPE_TIMESTAMP                 = 93,
-                UBIGINT                                = ((-5)+(-22)),
-                ULONG                          = (4 +(-22)),
-                USHORT                         = (5 +(-22)),
-                UTINYINT                       = ((-6)+(-22)),
-                WCHAR                          = (-8),
-                UNASSIGNED                      = Int16.MaxValue
-        }
-}
diff --git a/mcs/class/System.Data/System.Data.Odbc/OdbcTypeConverter.cs b/mcs/class/System.Data/System.Data.Odbc/OdbcTypeConverter.cs
deleted file mode 100644 (file)
index aeaecdf..0000000
+++ /dev/null
@@ -1,229 +0,0 @@
-//
-// OdbcTypeConvert.cs : helps conversion between various odbc types.
-//
-// Author:
-//   Sureshkumar T <tsureshkumar@novell.com>
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-//
-//
-// For mapping between types, refer OdbcTypeMap.cs
-//
-//
-
-
-using System.Data;
-using System.Collections;
-using System.Data.Common;
-
-namespace System.Data.Odbc
-{ 
-       internal class OdbcTypeConverter  
-       {
-               public static OdbcTypeMap GetTypeMap (OdbcType odbcType)
-               {
-                       return (OdbcTypeMap) OdbcTypeMap.Maps [odbcType];
-               }
-
-               public static OdbcTypeMap InferFromValue (object value)
-               {
-
-                       if (value.GetType ().IsArray)
-                               if (value.GetType ().GetElementType () == typeof (byte))
-                                       return (OdbcTypeMap) OdbcTypeMap.Maps [OdbcType.Binary];
-                               else
-                                       return (OdbcTypeMap) OdbcTypeMap.Maps [OdbcType.VarChar]; // change
-
-                       switch (Type.GetTypeCode (value.GetType ())) {
-                       case TypeCode.Empty:
-                       case TypeCode.Object:
-                       case TypeCode.DBNull:
-                               return (OdbcTypeMap) OdbcTypeMap.Maps [OdbcType.NVarChar];  //Default to NVarChar as in MS.net. OdbcParameter.Bind() will take care.
-                       case TypeCode.Boolean:
-                               return (OdbcTypeMap) OdbcTypeMap.Maps [OdbcType.Bit];
-                       case TypeCode.Char:
-                               return (OdbcTypeMap) OdbcTypeMap.Maps [OdbcType.Char];
-                       case TypeCode.SByte:
-                               throw new ArgumentException ("infering OdbcType from SByte is not supported");
-                       case TypeCode.Byte:
-                               return (OdbcTypeMap) OdbcTypeMap.Maps [OdbcType.TinyInt];
-                       case TypeCode.Int16:
-                               return (OdbcTypeMap) OdbcTypeMap.Maps [OdbcType.SmallInt];
-                       case TypeCode.UInt16:
-                       case TypeCode.Int32:
-                               return (OdbcTypeMap) OdbcTypeMap.Maps [OdbcType.Int];
-                       case TypeCode.UInt32:
-                       case TypeCode.Int64:
-                               return (OdbcTypeMap) OdbcTypeMap.Maps [OdbcType.BigInt];
-                       case TypeCode.UInt64:
-                               return (OdbcTypeMap) OdbcTypeMap.Maps [OdbcType.Numeric];
-                       case TypeCode.Single:
-                               return (OdbcTypeMap) OdbcTypeMap.Maps [OdbcType.Real];
-                       case TypeCode.Double:
-                               return (OdbcTypeMap) OdbcTypeMap.Maps [OdbcType.Double];
-                       case TypeCode.Decimal:
-                               return (OdbcTypeMap) OdbcTypeMap.Maps [OdbcType.Numeric];
-                       case TypeCode.DateTime:
-                               return (OdbcTypeMap) OdbcTypeMap.Maps [OdbcType.DateTime];
-                       case TypeCode.String:
-                               return (OdbcTypeMap) OdbcTypeMap.Maps [OdbcType.NVarChar];
-                       }
-
-                       // FIXME : Guid
-                       // FIXME : TimeSpan
-                       // FIXME : DateTime
-
-                       return (OdbcTypeMap) OdbcTypeMap.Maps [OdbcType.VarChar];
-               }
-
-               public static OdbcTypeMap GetTypeMap (SQL_TYPE sqlType) 
-               {
-                       switch (sqlType) {
-                       case SQL_TYPE.BINARY:
-                               return (OdbcTypeMap)  OdbcTypeMap.Maps [OdbcType.Binary];
-                       case SQL_TYPE.BIT:
-                               return (OdbcTypeMap)  OdbcTypeMap.Maps [OdbcType.Bit];
-                       case SQL_TYPE.CHAR:
-                               return (OdbcTypeMap)  OdbcTypeMap.Maps [OdbcType.Char];
-                       case SQL_TYPE.DATE:
-                               return (OdbcTypeMap)  OdbcTypeMap.Maps [OdbcType.Date];
-                       case SQL_TYPE.DECIMAL:
-                               return (OdbcTypeMap)  OdbcTypeMap.Maps [OdbcType.Decimal];
-                       case SQL_TYPE.DOUBLE:
-                               return (OdbcTypeMap)  OdbcTypeMap.Maps [OdbcType.Double];
-                       case SQL_TYPE.GUID:
-                               return (OdbcTypeMap)  OdbcTypeMap.Maps [OdbcType.UniqueIdentifier];
-                       case SQL_TYPE.INTEGER:
-                               return (OdbcTypeMap)  OdbcTypeMap.Maps [OdbcType.Int];
-                       case SQL_TYPE.INTERVAL_DAY:
-                       case SQL_TYPE.INTERVAL_DAY_TO_HOUR:
-                       case SQL_TYPE.INTERVAL_DAY_TO_MINUTE:
-                       case SQL_TYPE.INTERVAL_DAY_TO_SECOND:
-                       case SQL_TYPE.INTERVAL_HOUR:
-                       case SQL_TYPE.INTERVAL_HOUR_TO_MINUTE:
-                       case SQL_TYPE.INTERVAL_HOUR_TO_SECOND:
-                       case SQL_TYPE.INTERVAL_MINUTE:
-                       case SQL_TYPE.INTERVAL_MINUTE_TO_SECOND:
-                       case SQL_TYPE.INTERVAL_MONTH:
-                       case SQL_TYPE.INTERVAL_SECOND:
-                       case SQL_TYPE.INTERVAL_YEAR:
-                       case SQL_TYPE.INTERVAL_YEAR_TO_MONTH:
-                               return (OdbcTypeMap)  OdbcTypeMap.Maps [OdbcType.DateTime];
-                       case SQL_TYPE.LONGVARBINARY:
-                               return (OdbcTypeMap)  OdbcTypeMap.Maps [OdbcType.Image];
-                       case SQL_TYPE.LONGVARCHAR:
-                               return (OdbcTypeMap)  OdbcTypeMap.Maps [OdbcType.Text];
-                       case SQL_TYPE.NUMERIC:
-                               return (OdbcTypeMap)  OdbcTypeMap.Maps [OdbcType.Numeric];
-                       case SQL_TYPE.REAL:
-                               return (OdbcTypeMap)  OdbcTypeMap.Maps [OdbcType.Real];
-                       case SQL_TYPE.SMALLINT:
-                               return (OdbcTypeMap)  OdbcTypeMap.Maps [OdbcType.SmallInt];
-                       case SQL_TYPE.TYPE_TIME:
-                       case SQL_TYPE.TIME:
-                               return (OdbcTypeMap)  OdbcTypeMap.Maps [OdbcType.Time];
-                       case SQL_TYPE.TIMESTAMP:
-                               return (OdbcTypeMap)  OdbcTypeMap.Maps [OdbcType.DateTime];
-                       case SQL_TYPE.TINYINT:
-                               return (OdbcTypeMap)  OdbcTypeMap.Maps [OdbcType.TinyInt];
-                       case SQL_TYPE.TYPE_DATE:
-                       case SQL_TYPE.TYPE_TIMESTAMP:
-                               return (OdbcTypeMap)  OdbcTypeMap.Maps [OdbcType.DateTime];
-                       case SQL_TYPE.VARBINARY:
-                               return (OdbcTypeMap)  OdbcTypeMap.Maps [OdbcType.VarBinary];
-                       case SQL_TYPE.VARCHAR:
-                               return (OdbcTypeMap)  OdbcTypeMap.Maps [OdbcType.VarChar];
-                       case SQL_TYPE.WCHAR:
-                               return (OdbcTypeMap)  OdbcTypeMap.Maps [OdbcType.NChar];
-                       case SQL_TYPE.WLONGVARCHAR:
-                               return (OdbcTypeMap)  OdbcTypeMap.Maps [OdbcType.NText];
-                       case SQL_TYPE.WVARCHAR:
-                               return (OdbcTypeMap)  OdbcTypeMap.Maps [OdbcType.NVarChar];
-                       case SQL_TYPE.UNASSIGNED:
-                               return (OdbcTypeMap)  OdbcTypeMap.Maps [OdbcType.VarChar];
-                       }
-                       return (OdbcTypeMap) OdbcTypeMap.Maps [OdbcType.VarChar];
-               }
-
-               public static OdbcTypeMap GetTypeMap (DbType dbType) 
-               {
-                       switch (dbType) {
-                       case DbType.AnsiString:
-                               return (OdbcTypeMap) OdbcTypeMap.Maps [OdbcType.VarChar];
-                       case DbType.Binary:
-                               return (OdbcTypeMap) OdbcTypeMap.Maps [OdbcType.Binary];
-                       case DbType.Byte:
-                               return (OdbcTypeMap) OdbcTypeMap.Maps [OdbcType.TinyInt];
-                       case DbType.Boolean:
-                               return (OdbcTypeMap) OdbcTypeMap.Maps [OdbcType.Bit];
-                       case DbType.Currency:
-                               throw new NotSupportedException ("Infering OdbcType from DbType.Currency is not" +
-                                                                " supported");
-                       case DbType.Date:
-                               return (OdbcTypeMap) OdbcTypeMap.Maps [OdbcType.Date];
-                       case DbType.DateTime:
-                               return (OdbcTypeMap) OdbcTypeMap.Maps [OdbcType.DateTime];
-                       case DbType.Decimal:
-                               return (OdbcTypeMap) OdbcTypeMap.Maps [OdbcType.Numeric];
-                       case DbType.Double:
-                               return (OdbcTypeMap) OdbcTypeMap.Maps [OdbcType.Double];
-                       case DbType.Guid:
-                               return (OdbcTypeMap) OdbcTypeMap.Maps [OdbcType.UniqueIdentifier];
-                       case DbType.Int16:
-                               return (OdbcTypeMap) OdbcTypeMap.Maps [OdbcType.SmallInt];
-                       case DbType.Int32:
-                               return (OdbcTypeMap) OdbcTypeMap.Maps [OdbcType.Int];
-                       case DbType.Int64:
-                               return (OdbcTypeMap) OdbcTypeMap.Maps [OdbcType.BigInt];
-                       case DbType.Object:
-                               throw new NotSupportedException ("Infering OdbcType from DbType.Object is not" +
-                                                                " supported");
-                       case DbType.SByte:
-                               throw new NotSupportedException ("Infering OdbcType from DbType.SByte is not" +
-                                                                " supported");
-                       case DbType.Single:
-                               return (OdbcTypeMap) OdbcTypeMap.Maps [OdbcType.Real];
-                       case DbType.String:
-                               return (OdbcTypeMap) OdbcTypeMap.Maps [OdbcType.NVarChar];
-                       case DbType.Time:
-                               return (OdbcTypeMap) OdbcTypeMap.Maps [OdbcType.Time];
-                       case DbType.UInt16:
-                               return (OdbcTypeMap) OdbcTypeMap.Maps [OdbcType.Int];
-                       case DbType.UInt32:
-                               return (OdbcTypeMap) OdbcTypeMap.Maps [OdbcType.BigInt];
-                       case DbType.UInt64:
-                               return (OdbcTypeMap) OdbcTypeMap.Maps [OdbcType.Numeric];
-                       case DbType.VarNumeric:
-                               throw new NotSupportedException ("Infering OdbcType from DbType.VarNumeric is not" +
-                                                                " supported");
-                       case DbType.AnsiStringFixedLength:
-                               return (OdbcTypeMap) OdbcTypeMap.Maps [OdbcType.Char];
-                       case DbType.StringFixedLength:
-                               return (OdbcTypeMap) OdbcTypeMap.Maps [OdbcType.NChar];
-                       }
-                       return (OdbcTypeMap) OdbcTypeMap.Maps [OdbcType.VarChar];
-               }
-       }
-}
diff --git a/mcs/class/System.Data/System.Data.Odbc/OdbcTypeMap.cs b/mcs/class/System.Data/System.Data.Odbc/OdbcTypeMap.cs
deleted file mode 100644 (file)
index daaa48b..0000000
+++ /dev/null
@@ -1,209 +0,0 @@
-//
-// OdbcTypeMap.cs : Mapping between different odbc types
-//
-// Author:
-//   Sureshkumar T <tsureshkumar@novell.com>
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-//
-//
-// * Type mapping between various odbc driver types.
-// For further infomartion between these mapping visit following msdn site
-//
-//      * http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odbc/htm/
-//        odbcc_data_types.asp
-//      * http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odbc/htm/
-//        odbcconverting_data_from_c_to_sql_data_types.asp
-//      * http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odbc/htm/
-//        odbcconverting_data_from_sql_to_c_data_types.asp
-//      * http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odbc/htm/
-//        odbcparameter_data_types.asp
-//      * http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/
-//        html/frlrfsystemdataodbcodbctypeclasstopic.asp
-//
-//
-// OdbcType             SQL_C_TYPE              SQL_TYPE
-// ===================================================================
-// BigInt              SQL_C_TYPE.SBIGINT      SQL_TYPE.BIGINT     
-// Binary              SQL_C_TYPE.BINARY       SQL_TYPE.BINARY     
-// Bit                 SQL_C_TYPE.BIT          SQL_TYPE.BIT        
-// Char                        SQL_C_TYPE.CHAR         SQL_TYPE.CHAR       
-// Date                        SQL_C_TYPE.TYPE_DATE    SQL_TYPE.TYPE_DATE  
-// DateTime            SQL_C_TYPE.TIMESTAMP    SQL_TYPE.TIMESTAMP  
-// Decimal             SQL_C_TYPE.NUMERIC      SQL_TYPE.NUMERIC    
-// Double              SQL_C_TYPE.DOUBLE       SQL_TYPE.DOUBLE     
-// Image               SQL_C_TYPE.BINARY       SQL_TYPE.BINARY     
-// Int                 SQL_C_TYPE.LONG         SQL_TYPE.INTEGER    
-// NChar               SQL_C_TYPE.WCHAR        SQL_TYPE.WCHAR      
-// NText               SQL_C_TYPE.WCHAR        SQL_TYPE.WLONGVARCHAR
-// Numeric             SQL_C_TYPE.NUMERIC      SQL_TYPE.NUMERIC    
-// NVarChar            SQL_C_TYPE.WCHAR        SQL_TYPE.WVARCHAR   
-// Real                        SQL_C_TYPE.FLOAT        SQL_TYPE.REAL       
-// SignedBigInt                SQL_C_TYPE.SBIGINT      SQL_TYPE.BIGINT     
-// SmallDateTime       SQL_C_TYPE.TIMESTAMP    SQL_TYPE.TIMESTAMP  
-// SmallInt            SQL_C_TYPE.SHORT        SQL_TYPE.SMALLINT   
-// Text                        SQL_C_TYPE.WCHAR        SQL_TYPE.LONGVARCHAR
-// Time                        SQL_C_TYPE.TYPE_TIME    SQL_TYPE.TYPE_TIME  
-// Timestamp           SQL_C_TYPE.BINARY       SQL_TYPE.BINARY     
-// TinyInt             SQL_C_TYPE.UTINYINT     SQL_TYPE.TINYINT    
-// UniqueIdentifier    SQL_C_TYPE.GUID         SQL_TYPE.GUID       
-// VarBinary           SQL_C_TYPE.BINARY       SQL_TYPE.VARBINARY  
-// VarChar             SQL_C_TYPE.WCHAR        SQL_TYPE.WVARCHAR   
-//====================================================================
-
-
-using System.Data;
-using System.Collections;
-using System.Data.Common;
-
-namespace System.Data.Odbc
-{ 
-       internal struct OdbcTypeMap
-       {
-               public DbType         DbType;
-               public OdbcType       OdbcType;
-               public SQL_C_TYPE     NativeType;
-               public SQL_TYPE       SqlType;
-
-               private static Hashtable maps = new Hashtable ();
-
-               public OdbcTypeMap (DbType dbType, OdbcType odbcType, 
-                               SQL_C_TYPE nativeType, SQL_TYPE sqlType)
-               {
-                       DbType          = dbType;
-                       OdbcType        = odbcType;
-                       SqlType         = sqlType;
-                       NativeType      = nativeType;
-               }
-
-
-               public static Hashtable Maps {
-                       get { return maps; }
-               }
-
-               static OdbcTypeMap ()
-               {
-                       maps [OdbcType.BigInt]    = new OdbcTypeMap (DbType.Int64,
-                                                                OdbcType.BigInt,
-                                                                SQL_C_TYPE.SBIGINT,
-                                                                SQL_TYPE.BIGINT);
-                       maps [OdbcType.Binary]    = new OdbcTypeMap (DbType.Binary,
-                                                                OdbcType.Binary,
-                                                                SQL_C_TYPE.BINARY,
-                                                                SQL_TYPE.BINARY);
-                       maps [OdbcType.Bit]       = new OdbcTypeMap (DbType.Boolean, 
-                                                                OdbcType.Bit,
-                                                                SQL_C_TYPE.BIT,
-                                                                SQL_TYPE.BIT);
-                       maps [OdbcType.Char]      = new OdbcTypeMap (DbType.String, 
-                                                                OdbcType.Char,
-                                                                SQL_C_TYPE.CHAR,
-                                                                SQL_TYPE.CHAR);
-                       maps [OdbcType.Date]      = new OdbcTypeMap (DbType.Date, 
-                                                                OdbcType.Date,
-                                                                SQL_C_TYPE.DATE,
-                                                                SQL_TYPE.DATE);
-                       maps [OdbcType.DateTime]  = new OdbcTypeMap (DbType.DateTime, 
-                                                                OdbcType.DateTime,
-                                                                SQL_C_TYPE.TIMESTAMP,
-                                                                SQL_TYPE.TIMESTAMP);
-                       maps [OdbcType.Decimal]   = new OdbcTypeMap (DbType.Decimal, 
-                                                                OdbcType.Decimal,
-                                                                SQL_C_TYPE.NUMERIC,
-                                                                SQL_TYPE.NUMERIC);
-                       maps [OdbcType.Double]    = new OdbcTypeMap (DbType.Double, 
-                                                                OdbcType.Double,
-                                                                SQL_C_TYPE.DOUBLE,
-                                                                SQL_TYPE.DOUBLE);
-                       maps [OdbcType.Image]     = new OdbcTypeMap (DbType.Binary, 
-                                                                OdbcType.Image,
-                                                                SQL_C_TYPE.BINARY,
-                                                                SQL_TYPE.BINARY);
-                       maps [OdbcType.Int]       = new OdbcTypeMap (DbType.Int32, 
-                                                                OdbcType.Int,
-                                                                SQL_C_TYPE.LONG,
-                                                                SQL_TYPE.INTEGER);
-                       maps [OdbcType.NChar]     = new OdbcTypeMap (DbType.String, 
-                                                                OdbcType.NChar,
-                                                                    SQL_C_TYPE.WCHAR,
-                                                                    SQL_TYPE.WCHAR);
-                       maps [OdbcType.NText]     = new OdbcTypeMap (DbType.String, 
-                                                                OdbcType.NText,
-                                                                    SQL_C_TYPE.WCHAR, // change
-                                                                    SQL_TYPE.WLONGVARCHAR); //change
-                       // Currently, NUMERIC types works only with NUMERIC SQL Type to CHAR C Type mapping (pgsql). Other databases return 
-                       // SQL_TYPE.DECIMAL in place of numeric types.
-                       maps [OdbcType.Numeric]   = new OdbcTypeMap (DbType.Decimal, 
-                                                                OdbcType.Numeric,
-                                                                SQL_C_TYPE.CHAR,
-                                                                SQL_TYPE.NUMERIC);
-                       maps [OdbcType.NVarChar]  = new OdbcTypeMap (DbType.String, 
-                                                                OdbcType.NVarChar,
-                                                                    SQL_C_TYPE.WCHAR,
-                                                                    SQL_TYPE.WVARCHAR);
-                       maps [OdbcType.Real]      = new OdbcTypeMap (DbType.Single, 
-                                                                OdbcType.Real,
-                                                                SQL_C_TYPE.FLOAT,
-                                                                SQL_TYPE.REAL);
-                       maps [OdbcType.SmallDateTime] = new OdbcTypeMap (DbType.DateTime, 
-                                                                    OdbcType.SmallDateTime,
-                                                                    SQL_C_TYPE.TIMESTAMP,
-                                                                    SQL_TYPE.TIMESTAMP);
-                       maps [OdbcType.SmallInt]  = new OdbcTypeMap (DbType.Int16, 
-                                                                OdbcType.SmallInt,
-                                                                SQL_C_TYPE.SHORT,
-                                                                SQL_TYPE.SMALLINT);
-                       maps [OdbcType.Text]      = new OdbcTypeMap (DbType.String, 
-                                                                OdbcType.Text,
-                                                                    SQL_C_TYPE.CHAR, //change
-                                                                SQL_TYPE.LONGVARCHAR);
-                       maps [OdbcType.Time]      = new OdbcTypeMap (DbType.DateTime, 
-                                                                OdbcType.Time,
-                                                                SQL_C_TYPE.TIME,
-                                                                SQL_TYPE.TIME);
-                       maps [OdbcType.Timestamp] = new OdbcTypeMap (DbType.DateTime, 
-                                                                OdbcType.Timestamp,
-                                                                SQL_C_TYPE.BINARY,
-                                                                SQL_TYPE.BINARY);
-                       maps [OdbcType.TinyInt]   = new OdbcTypeMap (DbType.SByte, 
-                                                                OdbcType.TinyInt,
-                                                                SQL_C_TYPE.UTINYINT,
-                                                                SQL_TYPE.TINYINT);
-                       maps [OdbcType.UniqueIdentifier] = new OdbcTypeMap (DbType.Guid, 
-                                                                       OdbcType.UniqueIdentifier,
-                                                                       SQL_C_TYPE.GUID,
-                                                                       SQL_TYPE.GUID);
-                       maps [OdbcType.VarBinary] = new OdbcTypeMap (DbType.Binary, 
-                                                                OdbcType.VarBinary,
-                                                                SQL_C_TYPE.BINARY,
-                                                                SQL_TYPE.VARBINARY);
-                       maps [OdbcType.VarChar]   = new OdbcTypeMap (DbType.String, 
-                                                                OdbcType.VarChar,
-                                                                SQL_C_TYPE.CHAR,
-                                                                SQL_TYPE.VARCHAR);
-               }
-
-       }
-}
\ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data.Odbc/libodbc.cs b/mcs/class/System.Data/System.Data.Odbc/libodbc.cs
deleted file mode 100644 (file)
index 583c2ac..0000000
+++ /dev/null
@@ -1,508 +0,0 @@
-//
-// System.Data.Odbc.libodbc
-//
-// Authors:
-//   Brian Ritchie (brianlritchie@hotmail.com) 
-//   Sureshkumar T (tsureshkumar@novell.com)
-//
-// Copyright (C) Brian Ritchie, 2002
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Data;
-using System.Data.Common;
-using System.Runtime.InteropServices;
-
-namespace System.Data.Odbc
-{
-       internal enum OdbcHandleType : short
-       {
-               Env = 1,
-               Dbc = 2,
-               Stmt = 3,
-               Desc = 4
-       }
-
-       internal enum OdbcReturn : short
-       {
-               Error = -1,
-               InvalidHandle = -2,
-               StillExecuting = 2,
-               NeedData = 99,
-               Success = 0,
-               SuccessWithInfo = 1,
-               NoData = 100
-       }
-
-       internal enum OdbcEnv : ushort
-       {
-               OdbcVersion = 200,
-               ConnectionPooling = 201,
-               CPMatch = 202
-       }
-
-       internal enum OdbcConnectionAttribute : int 
-       {
-               AutoCommit = 102,
-               TransactionIsolation = 108,
-               CurrentCatalog = 109,
-               CoptTransactionIsolation = 1227         /* SQL_COPT_SS_TXN_ISOLATION */
-       }
-
-       internal enum OdbcInfo : ushort
-       {
-               DataSourceName = 2,
-               DriverName = 6,
-               DriverVersion = 7,
-               DatabaseName = 16,
-               DbmsVersion = 18,
-               IdentifierQuoteChar = 29
-       }
-
-       internal enum OdbcInputOutputDirection : short
-       {
-               Input = 1,
-               InputOutput = 2,
-               ResultCol = 3,
-               Output = 4,
-               ReturnValue = 5
-       }
-
-       internal enum OdbcIsolationLevel
-       {
-               ReadUncommitted = 1,
-               ReadCommitted = 2,
-               RepeatableRead = 4,
-               Serializable = 8,
-               Snapshot = 32           /* SQL_TXN_SS_SNAPSHOT */
-       }
-
-       internal enum OdbcLengthIndicator : short
-       {
-               NoTotal = -4,
-               NullData = -1
-       }
-
-       // Keep this sorted.
-       internal enum FieldIdentifier : short
-       {
-               AutoUniqueValue = 11,   /* SQL_DESC_AUTO_UNIQUE_VALUE */
-               BaseColumnName = 22,    /* SQL_DESC_BASE_COLUMN_NAME */
-               BaseTableName = 23,     /* SQL_DESC_BASE_TABLE_NAME */
-               CaseSensitive = 12,     /* SQL_DESC_CASE_SENSITIVE */
-               CatelogName = 17,       /* SQL_DESC_CATALOG_NAME */
-               ConsiseType = 2,        /* SQL_DESC_CONCISE_TYPE */
-               Count = 1001,           /* SQL_DESC_COUNT */
-               DisplaySize = 6,        /* SQL_DESC_DISPLAY_SIZE */
-               FixedPrecScale = 9,     /* SQL_DESC_FIXED_PREC_SCALE */
-               Label = 18,             /* SQL_DESC_LABEL */
-               Length = 1003,          /* SQL_DESC_LENGTH */
-               LiteralPrefix = 27,     /* SQL_DESC_LITERAL_PREFIX */
-               LiteralSuffix = 28,     /* SQL_DESC_LITERAL_SUFFIX */
-               LocalTypeName = 29,     /* SQL_DESC_LOCAL_TYPE_NAME */
-               Name = 1011,            /* SQL_DESC_NAME */
-               Nullable = 1008,        /* SQL_DESC_NULLABLE */
-               NumPrecRadix = 32,      /* SQL_DESC_NUM_PREC_RADIX */
-               OctetLength = 1013,     /* SQL_DESC_OCTET_LENGTH */
-               Precision = 1005,       /* SQL_DESC_PRECISION */
-               Scale = 1006,           /* SQL_DESC_SCALE */
-               SchemaName = 16,        /* SQL_DESC_SCHEMA_NAME */
-               Searchable = 13,        /* SQL_DESC_SEARCHABLE */
-               TableName = 15,         /* SQL_DESC_TABLE_NAME */
-               Type = 1002,            /* SQL_DESC_TYPE */
-               TypeName = 14,          /* SQL_DESC_TYPE_NAME */
-               Unnamed = 1012,         /* SQL_DESC_UNNAMED */
-               Unsigned = 8,           /* SQL_DESC_UNSIGNED */
-               Updatable = 10          /* SQL_DESC_UPDATABLE */
-       }
-
-       [StructLayout(LayoutKind.Sequential)]
-       internal struct OdbcTimestamp
-       {
-               internal short year;
-               internal ushort month;
-               internal ushort day;
-               internal ushort hour;
-               internal ushort minute;
-               internal ushort second;
-               internal ulong fraction;
-       }
-
-       internal class libodbc
-       {
-               #region global constants
-               internal const int              SQL_OV_ODBC2            = 2;
-               internal const int              SQL_OV_ODBC3            = 3;
-
-               internal const string           SQLSTATE_RIGHT_TRUNC    = "01004";
-               internal const char             C_NULL                  = '\0';
-               internal const int              SQL_NTS                 = -3;
-
-               internal const short            SQL_TRUE                = 1;
-               internal const short            SQL_FALSE               = 0;
-
-               // SQLStatistics
-               internal const short            SQL_INDEX_UNIQUE        = 0;
-               internal const short            SQL_INDEX_ALL           = 1;
-               internal const short            SQL_QUICK               = 0;
-               internal const short            SQL_ENSURE              = 1;
-
-               // SQLColumnAttribute
-               internal const short            SQL_NO_NULLS            = 0;
-               internal const short            SQL_NULLABLE            = 1;
-               internal const short            SQL_NULLABLE_UNKNOWN    = 2;
-               internal const short            SQL_ATTR_READONLY       = 0;
-               internal const short            SQL_ATTR_WRITE          = 1;
-               internal const short            SQL_ATTR_READWRITE_UNKNOWN = 2;
-               #endregion
-
-               internal static OdbcInputOutputDirection ConvertParameterDirection(
-                       ParameterDirection dir)
-               {
-                       switch (dir) {
-                       case ParameterDirection.Input:
-                               return OdbcInputOutputDirection.Input;
-                       case ParameterDirection.InputOutput:
-                               return OdbcInputOutputDirection.InputOutput;
-                       case ParameterDirection.Output:
-                               return OdbcInputOutputDirection.Output;
-                       case ParameterDirection.ReturnValue:
-                               return OdbcInputOutputDirection.ReturnValue;
-                       default:
-                               return OdbcInputOutputDirection.Input;
-                       }
-               }
-
-               [DllImport ("odbc32.dll", CharSet = CharSet.Unicode)]
-               internal static extern OdbcReturn SQLAllocHandle (
-                       OdbcHandleType HandleType,
-                       IntPtr InputHandle,
-                       ref IntPtr OutputHandlePtr);
-
-               [DllImport ("odbc32.dll", CharSet = CharSet.Unicode)]
-               internal static extern OdbcReturn SQLSetEnvAttr (
-                       IntPtr EnvHandle,
-                       OdbcEnv Attribute,
-                       IntPtr Value,
-                       int StringLength);
-
-               [DllImport ("odbc32.dll", CharSet = CharSet.Unicode)]
-               internal static extern OdbcReturn SQLConnect (
-                       IntPtr ConnectionHandle,
-                       string ServerName,
-                       short NameLength1,
-                       string UserName,
-                       short NameLength2,
-                       string Authentication,
-                       short NameLength3);
-
-               [DllImport ("odbc32.dll", CharSet = CharSet.Unicode)]
-               internal static extern OdbcReturn SQLDriverConnect (
-                       IntPtr ConnectionHandle,
-                       IntPtr WindowHandle,
-                       string InConnectionString,
-                       short StringLength1,
-                       string OutConnectionString,
-                       short BufferLength,
-                       ref short StringLength2Ptr,
-                       ushort DriverCompletion);
-
-               [DllImport ("odbc32.dll", CharSet = CharSet.Unicode)]
-               internal static extern OdbcReturn SQLExecDirect (
-                       IntPtr StatementHandle,
-                       string StatementText,
-                       int TextLength);
-
-               [DllImport ("odbc32.dll", CharSet = CharSet.Unicode)]
-               internal static extern OdbcReturn SQLRowCount (
-                       IntPtr StatementHandle,
-                       ref int RowCount);
-
-               [DllImport ("odbc32.dll", CharSet = CharSet.Unicode)]
-               internal static extern OdbcReturn SQLNumResultCols (
-                       IntPtr StatementHandle,
-                       ref short ColumnCount);
-
-               [DllImport ("odbc32.dll", CharSet = CharSet.Unicode)]
-               internal static extern OdbcReturn SQLFetch (
-                       IntPtr StatementHandle);
-
-               [DllImport ("odbc32.dll", CharSet = CharSet.Unicode)]
-               internal static extern OdbcReturn SQLGetData (
-                       IntPtr StatementHandle,
-                       ushort ColumnNumber,
-                       SQL_C_TYPE TargetType,
-                       ref bool TargetPtr,
-                       int BufferLen,
-                       ref int Len);
-
-               [DllImport ("odbc32.dll", CharSet = CharSet.Unicode)]
-               internal static extern OdbcReturn SQLGetData (
-                       IntPtr StatementHandle,
-                       ushort ColumnNumber,
-                       SQL_C_TYPE TargetType,
-                       ref double TargetPtr,
-                       int BufferLen,
-                       ref int Len);
-
-               [DllImport ("odbc32.dll", CharSet = CharSet.Unicode)]
-               internal static extern OdbcReturn SQLGetData (
-                       IntPtr StatementHandle,
-                       ushort ColumnNumber,
-                       SQL_C_TYPE TargetType,
-                       ref long TargetPtr,
-                       int BufferLen,
-                       ref int Len);
-
-               [DllImport ("odbc32.dll", CharSet = CharSet.Unicode)]
-               internal static extern OdbcReturn SQLGetData (
-                       IntPtr StatementHandle,
-                       ushort ColumnNumber,
-                       SQL_C_TYPE TargetType,
-                       ref short TargetPtr,
-                       int BufferLen,
-                       ref int Len);
-
-               [DllImport ("odbc32.dll", CharSet = CharSet.Unicode)]
-               internal static extern OdbcReturn SQLGetData (
-                       IntPtr StatementHandle,
-                       ushort ColumnNumber,
-                       SQL_C_TYPE TargetType,
-                       ref float TargetPtr,
-                       int BufferLen,
-                       ref int Len);
-
-               [DllImport ("odbc32.dll", CharSet = CharSet.Unicode)]
-               internal static extern OdbcReturn SQLGetData (
-                       IntPtr StatementHandle,
-                       ushort ColumnNumber,
-                       SQL_C_TYPE TargetType,
-                       ref OdbcTimestamp TargetPtr,
-                       int BufferLen,
-                       ref int Len);
-
-               [DllImport ("odbc32.dll", CharSet = CharSet.Unicode)]
-               internal static extern OdbcReturn SQLGetData (
-                       IntPtr StatementHandle,
-                       ushort ColumnNumber,
-                       SQL_C_TYPE TargetType,
-                       ref int TargetPtr,
-                       int BufferLen,
-                       ref int Len);
-
-               [DllImport ("odbc32.dll", CharSet = CharSet.Unicode)]
-               internal static extern OdbcReturn SQLGetData (
-                       IntPtr StatementHandle,
-                       ushort ColumnNumber,
-                       SQL_C_TYPE TargetType,
-                       byte[] TargetPtr,
-                       int BufferLen,
-                       ref int Len);
-
-               [DllImport ("odbc32.dll", CharSet = CharSet.Unicode)]
-               internal static extern OdbcReturn SQLDescribeCol (
-                       IntPtr StatementHandle,
-                       ushort ColumnNumber,
-                       byte[] ColumnName,
-                       short BufferLength,
-                       ref short NameLength,
-                       ref short DataType,
-                       ref uint ColumnSize,
-                       ref short DecimalDigits,
-                       ref short Nullable);
-
-               [DllImport ("odbc32.dll", CharSet = CharSet.Unicode)]
-               internal static extern OdbcReturn SQLFreeHandle (
-                       ushort HandleType,
-                       IntPtr SqlHandle);
-
-               [DllImport ("odbc32.dll", CharSet = CharSet.Unicode)]
-               internal static extern OdbcReturn SQLDisconnect (
-                       IntPtr ConnectionHandle);
-
-               [DllImport ("odbc32.dll", CharSet = CharSet.Unicode)]
-               internal static extern OdbcReturn SQLPrepare (
-                       IntPtr StatementHandle,
-                       string Statement,
-                       int TextLength);
-
-               [DllImport ("odbc32.dll", CharSet = CharSet.Unicode)]
-               internal static extern OdbcReturn SQLExecute (
-                       IntPtr StatementHandle);
-
-               [DllImport ("odbc32.dll", CharSet = CharSet.Unicode)]
-               internal static extern OdbcReturn SQLGetConnectAttr (
-                       IntPtr ConnectionHandle,
-                       OdbcConnectionAttribute Attribute,
-                       out int value,
-                       int BufferLength,
-                       out int StringLength);
-
-               [DllImport ("odbc32.dll", CharSet = CharSet.Unicode)]
-               internal static extern OdbcReturn SQLSetConnectAttr (
-                       IntPtr ConnectionHandle,
-                       OdbcConnectionAttribute Attribute,
-                       IntPtr Value,
-                       int Length);
-
-               [DllImport ("odbc32.dll", CharSet = CharSet.Unicode)]
-               internal static extern OdbcReturn SQLEndTran (
-                       int HandleType,
-                       IntPtr Handle,
-                       short CompletionType);
-
-               [DllImport ("odbc32.dll", CharSet = CharSet.Unicode)]
-               internal static extern OdbcReturn SQLBindParameter (
-                       IntPtr StatementHandle,
-                       ushort ParamNum,
-                       short InputOutputType,
-                       SQL_C_TYPE ValueType,
-                       SQL_TYPE ParamType,
-                       uint ColSize,
-                       short DecimalDigits,
-                       IntPtr ParamValue,
-                       int BufLen,
-                       IntPtr StrLen);
-
-               [DllImport ("odbc32.dll", CharSet = CharSet.Unicode)]
-               internal static extern OdbcReturn SQLCancel (
-                       IntPtr StatementHandle);
-
-               [DllImport ("odbc32.dll", CharSet = CharSet.Unicode)]
-               internal static extern OdbcReturn SQLCloseCursor (
-                       IntPtr StatementHandle);
-
-               [DllImport ("odbc32.dll", CharSet = CharSet.Unicode)]
-               internal static extern OdbcReturn SQLError (
-                       IntPtr EnvironmentHandle,
-                       IntPtr ConnectionHandle,
-                       IntPtr StatementHandle,
-                       byte[] Sqlstate,
-                       ref int NativeError,
-                       byte[] MessageText,
-                       short BufferLength,
-                       ref short TextLength);
-
-               [DllImport ("odbc32.dll", CharSet = CharSet.Unicode)]
-               internal static extern OdbcReturn SQLGetStmtAttr (
-                       IntPtr StatementHandle,
-                       int Attribute,
-                       ref IntPtr Value,
-                       int BufLen,
-                       int StrLen);
-
-               [DllImport ("odbc32.dll", CharSet = CharSet.Unicode)]
-               internal static extern OdbcReturn SQLSetDescField (
-                       IntPtr DescriptorHandle,
-                       short RecNumber,
-                       short FieldIdentifier,
-                       byte[] Value,
-                       int BufLen);
-
-               [DllImport ("odbc32.dll", CharSet = CharSet.Unicode)]
-               internal static extern OdbcReturn SQLGetDiagRec (
-                       OdbcHandleType HandleType,
-                       IntPtr Handle,
-                       ushort RecordNumber,
-                       byte [] Sqlstate,
-                       ref int NativeError,
-                       byte [] MessageText,
-                       short BufferLength,
-                       ref short TextLength);
-
-               [DllImport ("odbc32.dll", CharSet = CharSet.Unicode)]
-               internal static extern OdbcReturn SQLMoreResults (
-                       IntPtr Handle);
-
-               internal enum SQLFreeStmtOptions : short
-               {
-                       Close = 0,
-                       Drop,
-                       Unbind,
-                       ResetParams
-               }
-
-               [DllImport ("odbc32.dll", CharSet = CharSet.Unicode)]
-               internal static extern OdbcReturn SQLFreeStmt (
-                       IntPtr Handle,
-                       SQLFreeStmtOptions option);
-
-               [DllImport ("odbc32.dll", CharSet = CharSet.Unicode)]
-               internal static extern OdbcReturn SQLGetInfo (
-                       IntPtr connHandle,
-                       OdbcInfo info,
-                       byte [] buffer,
-                       short buffLength,
-                       ref short remainingStrLen);
-
-               [DllImport ("odbc32.dll", CharSet = CharSet.Unicode)]
-               internal static extern OdbcReturn SQLColAttribute (
-                       IntPtr StmtHandle,
-                       short column,
-                       FieldIdentifier fieldId,
-                       byte [] charAttributePtr,
-                       short bufferLength,
-                       ref short strLengthPtr,
-                       ref int numericAttributePtr);
-
-               [DllImport ("odbc32.dll", CharSet = CharSet.Unicode)]
-               internal static extern OdbcReturn SQLPrimaryKeys (
-                       IntPtr StmtHandle,
-                       string catalog,
-                       short catalogLength,
-                       string schema,
-                       short schemaLength,
-                       string tableName,
-                       short tableLength);
-
-               [DllImport ("odbc32.dll", CharSet = CharSet.Unicode)]
-               internal static extern OdbcReturn SQLStatistics (
-                       IntPtr StmtHandle,
-                       string catalog,
-                       short catalogLength,
-                       string schema,
-                       short schemaLength,
-                       string tableName,
-                       short tableLength,
-                       short unique,
-                       short Reserved);
-
-               [DllImport ("odbc32.dll", CharSet = CharSet.Unicode)]
-               internal static extern OdbcReturn SQLBindCol (
-                       IntPtr StmtHandle,
-                       short column,
-                       SQL_C_TYPE targetType,
-                       byte [] buffer,
-                       int bufferLength,
-                       ref int indicator);
-
-               [DllImport ("odbc32.dll", CharSet = CharSet.Unicode)]
-               internal static extern OdbcReturn SQLBindCol (
-                       IntPtr StmtHandle,
-                       short column,
-                       SQL_C_TYPE targetType,
-                       ref short value,
-                       int bufferLength,
-                       ref int indicator);
-       }
-}
diff --git a/mcs/class/System.Data/System.Data.OleDb.jvm/.gitattributes b/mcs/class/System.Data/System.Data.OleDb.jvm/.gitattributes
deleted file mode 100644 (file)
index d628d3a..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-/OleDbCommand.cs -crlf
-/OleDbConvert.cs -crlf
-/OleDbDataAdapter.cs -crlf
-/OleDbException.cs -crlf
-/OleDbInfoMessageEventArgs.cs -crlf
-/OleDbInfoMessageEventHandler.cs -crlf
-/OleDbLiteral.cs -crlf
-/OleDbPermission.cs -crlf
-/OleDbPermissionAttribute.cs -crlf
-/OleDbRowUpdatedEventArgs.cs -crlf
-/OleDbRowUpdatedEventHandler.cs -crlf
-/OleDbRowUpdatingEventArgs.cs -crlf
-/OleDbRowUpdatingEventHandler.cs -crlf
-/OleDbSchemaGuid.cs -crlf
-/OleDbTransaction.cs -crlf
-/OleDbType.cs -crlf
diff --git a/mcs/class/System.Data/System.Data.OleDb.jvm/ChangeLog b/mcs/class/System.Data/System.Data.OleDb.jvm/ChangeLog
deleted file mode 100644 (file)
index 6daabb8..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-2007-05-08 Adar Wesley <adarw@mainsoft.com>
-
-       * OleDbCommandBuilder.cs: added missing methods QuoteIdentifier,
-       UnquoteIdentifier.
-
-       * OleDbConnection.cs: added missing method ResetState.
-
-       * OleDbDataReader.cs: added missing method GetData.
-
-       * OleDbError.cs: added missing method ToString.
-
-       * OleDbErrorCollection.cs: added missing method strongly typed
-       CopyTo.
-
-       * OleDbFactory.cs: added missing method CreatePermission.
-
-       * OleDbParameter.cs: added missing methods ResetOleDbType,
-       ResetDbType.
-
-       * OleDbParameterCollection.cs: added missing methods strongly
-       typed AddRange, IndexOf.
-
-2007-05-01 Adar Wesley <adarw@mainsoft.com>
-
-       * OleDbCommandBuilder.cs: Fixed typo and called base implementation
-       in Get[Insert|Updata|Delete]Command methods.
-
-2006-11-05 Vladimir Krasnov  <vladimirk@mainsoft.com>
-
-       * added: OleDbFactory.cs
-
-2006-05-23 Boris Kirzner <borisk@mainsoft.com>
-       * OleDbConnection.cs: add MonoTODO to GetOleDbSchemaTable.
-
-2006-05-09  Konstantin Triger <kostat@mainsoft.com>
-
-       * OleDbConnection.cs: fix GetOleDbSchemaTable for OleDbSchemaGuid.Tables.
-
-2006-04-26  Konstantin Triger <kostat@mainsoft.com>
-
-        * OleDbParameter.cs: map NCHAR to VARCHAR type.
-
-2006-03-21     Boris Kirzner <borisk@mainsoft.com>
-       * OleDbConnection.cs: resolve ambiguity.
-
-2006-03-06  Konstantin Triger <kostat@mainsoft.com>
-
-       * OleDbConnection.cs: compare up to the provider name length.
-
-2005-16-11 Boris Kirzner <borisk@mainsoft.com>
-       * OleDbConnection.cs: Added override for CreateException().
-
-2005-11-07 Konstantin Triger <kostat@mainsoft.com>
-
-       * OleDbConnection.cs: retrieve the StringManager from AppDomain
-               to workaround lack of correct AppDomain management in GH
-
-2005-09-05 Boris Kirzner <borisk@mainsoft.com>
-       * OleDbConvert.cs: return underlined value type in case of enum value.
-       * OleDbParameter.cs:
-               - Update of DbType should also update OleDbType property. 
-               - Do not update parameter type is the value set is DbNull.
-
-2005-06-21  Konstantin  Triger <kostat@mainsoft.com>
-
-       * OleDbConvert.cs: mapping OleDbType.Guid to Types.CHAR
diff --git a/mcs/class/System.Data/System.Data.OleDb.jvm/OleDbCommandBuilder.cs b/mcs/class/System.Data/System.Data.OleDb.jvm/OleDbCommandBuilder.cs
deleted file mode 100644 (file)
index 5496e5c..0000000
+++ /dev/null
@@ -1,153 +0,0 @@
-//
-// System.Data.OleDb.OleDbCommandBuilder
-//
-// Author:
-//   Rodrigo Moya (rodrigo@ximian.com)
-//   Tim Coleman (tim@timcoleman.com)
-//     Konstantin Triger <kostat@mainsoft.com>
-//     Boris Kirzner <borisk@mainsoft.com>
-//
-// Copyright (C) Rodrigo Moya, 2002
-// Copyright (C) Tim Coleman, 2002     
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-using System.ComponentModel;
-using System.Data;
-using System.Data.Common;
-using System.Data.ProviderBase;
-
-namespace System.Data.OleDb
-{
-       /// <summary>
-       /// Provides a means of automatically generating single-table commands used to reconcile changes made to a DataSet with the associated database. This class cannot be inherited.
-       /// </summary>
-       public sealed class OleDbCommandBuilder : AbstractDbCommandBuilder
-       {
-               #region Fields
-
-               OleDbDataAdapter adapter;
-               string quotePrefix;
-               string quoteSuffix;
-
-               #endregion // Fields
-
-               #region Constructors
-               
-               public OleDbCommandBuilder ()
-               {
-                       adapter = null;
-                       quotePrefix = String.Empty;
-                       quoteSuffix = String.Empty;
-               }
-
-               public OleDbCommandBuilder (OleDbDataAdapter adapter) 
-                       : this ()
-               {
-                       this.adapter = adapter;
-               }
-
-               #endregion // Constructors
-
-               #region Properties
-
-               public OleDbDataAdapter DataAdapter {
-                       get {
-                               return adapter;
-                       }
-                       set {
-                               adapter = value;
-                       }
-               }
-
-               public string QuotePrefix {
-                       get {
-                               return quotePrefix;
-                       }
-                       set {
-                               quotePrefix = value;
-                       }
-               }
-
-               public string QuoteSuffix {
-                       get {
-                               return quoteSuffix;
-                       }
-                       set {
-                               quoteSuffix = value;
-                       }
-               }
-
-               #endregion // Properties
-
-               #region Methods
-
-               public static void DeriveParameters (OleDbCommand command) 
-               {
-                       DeriveParameters((AbstractDbCommand)command);
-               }
-
-               protected override void Dispose (bool disposing) 
-               {
-                       base.Dispose ();        
-               }
-
-               public new OleDbCommand GetDeleteCommand ()
-               {
-                       return (OleDbCommand) base.GetDeleteCommand ();
-               }
-
-               public new OleDbCommand GetInsertCommand ()
-               {
-                       return (OleDbCommand) base.GetInsertCommand ();
-               }
-
-               public new OleDbCommand GetUpdateCommand ()
-               {
-                       return (OleDbCommand) base.GetUpdateCommand ();
-               }
-
-               [MonoTODO]
-               public void RefreshSchema ()
-               {
-                       throw new NotImplementedException ();
-               }
-
-
-               [MonoNotSupported("")]
-               public string QuoteIdentifier (string unquotedIdentifier, OleDbConnection connection) 
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoNotSupported ("")]
-               public string UnquoteIdentifier (string quotedIdentifier, OleDbConnection connection)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               #endregion // Methods
-       }
-}
diff --git a/mcs/class/System.Data/System.Data.OleDb.jvm/OleDbDataAdapter.cs b/mcs/class/System.Data/System.Data.OleDb.jvm/OleDbDataAdapter.cs
deleted file mode 100644 (file)
index 2b112e4..0000000
+++ /dev/null
@@ -1,214 +0,0 @@
-//\r
-// System.Data.OleDb.OleDbDataAdapter\r
-//\r
-// Authors:\r
-//   Rodrigo Moya (rodrigo@ximian.com)\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//     Konstantin Triger <kostat@mainsoft.com>\r
-//     Boris Kirzner <borisk@mainsoft.com>\r
-//\r
-// Copyright (C) Rodrigo Moya, 2002\r
-// Copyright (C) Tim Coleman, 2002\r
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)\r
-//\r
-\r
-//\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-// \r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-// \r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
-//\r
-\r
-\r
-using System;\r
-using System.ComponentModel;\r
-using System.Data;\r
-using System.Data.Common;\r
-\r
-namespace System.Data.OleDb\r
-{\r
-       public sealed class OleDbDataAdapter : DbDataAdapter, IDbDataAdapter\r
-       {\r
-               #region Fields\r
-\r
-               OleDbCommand deleteCommand;\r
-               OleDbCommand insertCommand;\r
-               OleDbCommand selectCommand;\r
-               OleDbCommand updateCommand;\r
-\r
-               #endregion\r
-\r
-               #region Constructors\r
-\r
-               public OleDbDataAdapter ()\r
-                       : this (new OleDbCommand ())\r
-               {\r
-               }\r
-\r
-               public OleDbDataAdapter (OleDbCommand selectCommand)\r
-               {\r
-                       DeleteCommand = new OleDbCommand ();\r
-                       InsertCommand = new OleDbCommand ();\r
-                       SelectCommand = selectCommand;\r
-                       UpdateCommand = new OleDbCommand ();\r
-               }\r
-\r
-               public OleDbDataAdapter (string selectCommandText, OleDbConnection selectConnection)\r
-                       : this (new OleDbCommand (selectCommandText, selectConnection))\r
-               {\r
-               }\r
-\r
-               public OleDbDataAdapter (string selectCommandText, string selectConnectionString)\r
-                       : this (selectCommandText, new OleDbConnection (selectConnectionString))\r
-               {\r
-               }\r
-\r
-               #endregion // Fields\r
-\r
-               #region Properties\r
-\r
-               public OleDbCommand DeleteCommand {\r
-                       get {\r
-                               return deleteCommand;\r
-                       }\r
-                       set {\r
-                               deleteCommand = value;\r
-                       }\r
-               }\r
-\r
-               public OleDbCommand InsertCommand {\r
-                       get {\r
-                               return insertCommand;\r
-                       }\r
-                       set {\r
-                               insertCommand = value;\r
-                       }\r
-               }\r
-\r
-               public OleDbCommand SelectCommand {\r
-                       get {\r
-                               return selectCommand;\r
-                       }\r
-                       set {\r
-                               selectCommand = value;\r
-                       }\r
-               }\r
-\r
-               public OleDbCommand UpdateCommand {\r
-                       get {\r
-                               return updateCommand;\r
-                       }\r
-                       set {\r
-                               updateCommand = value;\r
-                       }\r
-               }\r
-\r
-               IDbCommand IDbDataAdapter.DeleteCommand {\r
-                       get {\r
-                               return DeleteCommand;\r
-                       }\r
-                       set { \r
-                               if (value != null && !(value is OleDbCommand))\r
-                                       throw new ArgumentException ("DeleteCommand is not of Type OleDbCommand");\r
-                               DeleteCommand = (OleDbCommand)value;\r
-                       }\r
-               }\r
-\r
-               IDbCommand IDbDataAdapter.InsertCommand {\r
-                       get {\r
-                               return InsertCommand;\r
-                       }\r
-                       set { \r
-                               if (value != null && !(value is OleDbCommand))\r
-                                       throw new ArgumentException ("InsertCommand is not of Type OleDbCommand");\r
-                               InsertCommand = (OleDbCommand)value;\r
-                       }\r
-               }\r
-\r
-               IDbCommand IDbDataAdapter.SelectCommand {\r
-                       get {\r
-                               return SelectCommand;\r
-                       }\r
-                       set { \r
-                               if (value != null && !(value is OleDbCommand))\r
-                                       throw new ArgumentException ("SelectCommand is not of Type OleDbCommand");\r
-                               SelectCommand = (OleDbCommand)value;\r
-                       }\r
-               }\r
-\r
-               \r
-               IDbCommand IDbDataAdapter.UpdateCommand {\r
-                       get {\r
-                               return UpdateCommand;\r
-                       }\r
-                       set { \r
-                               if (value != null && !(value is OleDbCommand))\r
-                                       throw new ArgumentException ("UpdateCommand is not of Type OleDbCommand");\r
-                               UpdateCommand = (OleDbCommand)value;\r
-                       }\r
-               }\r
-\r
-               ITableMappingCollection IDataAdapter.TableMappings {\r
-                       get {\r
-                               return TableMappings;\r
-                       }\r
-               }\r
-\r
-               #endregion // Properties\r
-\r
-               #region Methods\r
-\r
-               protected override RowUpdatedEventArgs CreateRowUpdatedEvent (DataRow dataRow,\r
-                                                                             IDbCommand command,\r
-                                                                             StatementType statementType,\r
-                                                                             DataTableMapping tableMapping) \r
-               {\r
-                       return new OleDbRowUpdatedEventArgs (dataRow, command, statementType, tableMapping);\r
-               }\r
-\r
-\r
-               protected override RowUpdatingEventArgs CreateRowUpdatingEvent (DataRow dataRow,\r
-                                                                               IDbCommand command,\r
-                                                                               StatementType statementType,\r
-                                                                               DataTableMapping tableMapping) \r
-               {\r
-                       return new OleDbRowUpdatingEventArgs (dataRow, command, statementType, tableMapping);\r
-               }\r
-\r
-               protected override void OnRowUpdated (RowUpdatedEventArgs value) \r
-               {\r
-                       if (RowUpdated != null)\r
-                               RowUpdated (this, (OleDbRowUpdatedEventArgs) value);\r
-               }\r
-\r
-               protected override void OnRowUpdating (RowUpdatingEventArgs value) \r
-               {\r
-                       if (RowUpdating != null)\r
-                               RowUpdating (this, (OleDbRowUpdatingEventArgs) value);\r
-               }\r
-               \r
-               #endregion // Methods\r
-\r
-               #region Events and Delegates\r
-\r
-               public event OleDbRowUpdatedEventHandler RowUpdated;\r
-               public event OleDbRowUpdatingEventHandler RowUpdating;\r
-\r
-               #endregion // Events and Delegates\r
-\r
-       }\r
-}\r
diff --git a/mcs/class/System.Data/System.Data.OleDb.jvm/OleDbFactory.cs b/mcs/class/System.Data/System.Data.OleDb.jvm/OleDbFactory.cs
deleted file mode 100644 (file)
index 18e8853..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-//
-// System.Data.OleDb.OleDbFactory.cs
-//
-// Author:
-//   Sureshkumar T (tsureshkumar@novell.com)
-//
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System.Data.OleDb
-{
-       using System.Data;
-       using System.Data.Common;
-       using System.Security;
-       using System.Security.Permissions;
-
-       public sealed class OleDbFactory : DbProviderFactory
-       {
-               #region Fields
-               public static readonly OleDbFactory Instance = new OleDbFactory ();
-               #endregion //Fields
-
-               #region Constructors
-
-               private OleDbFactory ()
-               {
-
-               }
-
-               #endregion //Constructors
-
-               public override bool CanCreateDataSourceEnumerator
-               {
-                       get { return false; }
-               }
-
-               #region public overrides
-               public override DbCommand CreateCommand ()
-               {
-                       return (DbCommand) new OleDbCommand ();
-               }
-
-               public override DbCommandBuilder CreateCommandBuilder ()
-               {
-                       return (DbCommandBuilder) new OleDbCommandBuilder ();
-               }
-
-               public override DbConnection CreateConnection ()
-               {
-                       return (DbConnection) new OleDbConnection ();
-               }
-
-               public override DbDataAdapter CreateDataAdapter ()
-               {
-                       return (DbDataAdapter) new OleDbDataAdapter ();
-               }
-
-               [MonoLimitation("Code Access Security is not supported")]
-               public override CodeAccessPermission CreatePermission (PermissionState state) 
-               {
-                       return new OleDbPermission (state);
-               }
-
-               [MonoTODO]
-               public override DbDataSourceEnumerator CreateDataSourceEnumerator ()
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public override DbParameter CreateParameter ()
-               {
-                       return (DbParameter) new OleDbParameter ();
-               }
-
-               #endregion // public overrides
-       }
-}
diff --git a/mcs/class/System.Data/System.Data.OleDb.jvm/OleDbInfoMessageEventArgs.cs b/mcs/class/System.Data/System.Data.OleDb.jvm/OleDbInfoMessageEventArgs.cs
deleted file mode 100644 (file)
index 91e74ef..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-//\r
-// System.Data.OleDb.OleDbInfoMessageEventArgs\r
-//\r
-// Authors:\r
-//   Rodrigo Moya (rodrigo@ximian.com)\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Rodrigo Moya, 2002\r
-// Copyright (C) Tim Coleman, 2002     
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//\r
-\r
-\r
-using System.Data;\r
-using System.Data.Common;\r
-\r
-namespace System.Data.OleDb\r
-{\r
-       public sealed class OleDbInfoMessageEventArgs : EventArgs\r
-       {\r
-               private OleDbErrorCollection errors;\r
-               internal OleDbInfoMessageEventArgs(OleDbErrorCollection errors)\r
-               {\r
-                       this.errors = errors;\r
-               }\r
-               #region Properties\r
-\r
-               public int ErrorCode {\r
-                       [MonoTODO]\r
-                       get { return errors[0].NativeError; }\r
-               }\r
-\r
-               public OleDbErrorCollection Errors {\r
-                       [MonoTODO]\r
-                       get { return errors; }\r
-               }\r
-\r
-               public string Message {\r
-                       [MonoTODO]\r
-                       get { return errors[0].Message; }\r
-               }\r
-\r
-               public string Source {\r
-                       [MonoTODO]\r
-                       get { return errors[0].Source;}\r
-               }\r
-\r
-               #endregion // Properties\r
-\r
-               #region Methods\r
-\r
-               [MonoTODO]\r
-               public override string ToString ()\r
-               {\r
-                       return errors[0].Message;\r
-               }\r
-\r
-               #endregion // Methods\r
-       }\r
-}\r
diff --git a/mcs/class/System.Data/System.Data.OleDb.jvm/OleDbInfoMessageEventHandler.cs b/mcs/class/System.Data/System.Data.OleDb.jvm/OleDbInfoMessageEventHandler.cs
deleted file mode 100644 (file)
index f36ac7a..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-//\r
-// System.Data.OleDb.OleDbInfoMessageEventHandler\r
-//\r
-// Author:\r
-//   Rodrigo Moya (rodrigo@ximian.com)\r
-//\r
-// Copyright (C) Rodrigo Moya, 2002    
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//\r
-\r
-\r
-using System.Data;\r
-using System.Data.Common;\r
-\r
-namespace System.Data.OleDb\r
-{\r
-       [Serializable]\r
-       public delegate void OleDbInfoMessageEventHandler (object sender, OleDbInfoMessageEventArgs e);\r
-}\r
diff --git a/mcs/class/System.Data/System.Data.OleDb.jvm/OleDbLiteral.cs b/mcs/class/System.Data/System.Data.OleDb.jvm/OleDbLiteral.cs
deleted file mode 100644 (file)
index 9b78ba7..0000000
+++ /dev/null
@@ -1,105 +0,0 @@
-//\r
-// System.Data.OleDb.OleDbLiteral\r
-//
-// Authors:
-//     Konstantin Triger <kostat@mainsoft.com>
-//     Boris Kirzner <borisk@mainsoft.com>
-//     
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//\r
-\r
-namespace System.Data.OleDb\r
-{\r
-\r
-    using System;\r
-    /**\r
-     *\r
-     */\r
-    public enum OleDbLiteral\r
-                                     {\r
-\r
-        Invalid = 0,\r
-        Binary_Literal = 1,\r
-\r
-        Catalog_Name = 2,\r
-\r
-        Catalog_Separator = 3,\r
-\r
-        Char_Literal = 4,\r
-\r
-        Column_Alias = 5,\r
-\r
-        Column_Name = 6,\r
-\r
-        Correlation_Name = 7,\r
-\r
-        Cursor_Name = 8,\r
-\r
-        Escape_Percent_Prefix = 9,\r
-\r
-        Escape_Underscore_Prefix = 10,\r
-\r
-        Index_Name = 11,\r
-\r
-        Like_Percent = 12,\r
-\r
-        Like_Underscore = 13,\r
-\r
-        Procedure_Name = 14,\r
-\r
-        Quote_Prefix = 15,\r
-\r
-        Schema_Name = 16,\r
-\r
-        Table_Name = 17,\r
-\r
-        Text_Command = 18,\r
-\r
-        User_Name = 19,\r
-\r
-        View_Name = 20,\r
-\r
-        Cube_Name = 21,\r
-\r
-        Dimension_Name = 22,\r
-\r
-        Hierarchy_Name = 23,\r
-\r
-        Level_Name = 24,\r
-\r
-        Member_Name = 25,\r
-\r
-        Property_Name = 26,\r
-\r
-        Schema_Separator = 27,\r
-\r
-        Quote_Suffix = 28,\r
-\r
-        Escape_Percent_Suffix = 29,\r
-\r
-        Escape_Underscore_Suffix = 30,\r
-\r
-\r
-    }\r
-}
\ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data.OleDb.jvm/OleDbParameterCollection.cs b/mcs/class/System.Data/System.Data.OleDb.jvm/OleDbParameterCollection.cs
deleted file mode 100644 (file)
index 027ffcf..0000000
+++ /dev/null
@@ -1,143 +0,0 @@
-//
-// System.Data.Common.OleDbParameterCollection
-//
-// Authors:
-//     Konstantin Triger <kostat@mainsoft.com>
-//     Boris Kirzner <borisk@mainsoft.com>
-//     
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-using System.Data.ProviderBase;
-
-namespace System.Data.OleDb
-{
-    public sealed class OleDbParameterCollection :  AbstractDbParameterCollection
-    {
-               #region Constructors
-
-        public OleDbParameterCollection(OleDbCommand parent): base(parent)
-        {
-        }
-
-               #endregion // Constructors
-
-               #region Properties
-        
-        public OleDbParameter this[int index]
-        {
-            get { return (OleDbParameter)base[index]; }
-            set { 
-                               OnSchemaChanging();
-                               base[index] = value; 
-                       }
-        }
-
-        public OleDbParameter this[string parameterName]
-        {
-            get { return (OleDbParameter)base[parameterName]; }
-            set { 
-                               OnSchemaChanging();
-                               base[parameterName] = value; 
-                       }
-        }
-
-               protected override Type ItemType { 
-                       get { return typeof(OleDbParameter); }
-               }
-
-               #endregion // Properties
-
-               #region Methods
-
-        public OleDbParameter Add(OleDbParameter value)
-        {
-            base.Add(value);
-            return value;
-        }
-
-        public OleDbParameter Add(string parameterName, object value)
-        {
-            OleDbParameter param = new OleDbParameter(parameterName, value);
-            return Add(param);
-        }
-
-        public OleDbParameter Add(string parameterName, OleDbType sqlDbType)
-        {
-            OleDbParameter param = new OleDbParameter(parameterName, sqlDbType);
-            return Add(param);
-        }
-
-        public OleDbParameter Add(string parameterName, OleDbType sqlDbType, int size)
-        {
-            OleDbParameter param = new OleDbParameter(parameterName, sqlDbType, size);
-            return Add(param);
-        }
-
-        public OleDbParameter Add(string parameterName, OleDbType sqlDbType, int size, string sourceColumn)
-        {
-            OleDbParameter param = new OleDbParameter(parameterName, sqlDbType, size, sourceColumn);
-            return Add(param);
-               }
-
-               public void AddRange (OleDbParameter [] values)
-               {
-                       base.AddRange (values);
-               }
-
-               public OleDbParameter AddWithValue (string parameterName, object value)
-               {
-                       return Add (parameterName, value);
-               }
-
-               public bool Contains (OleDbParameter value)
-               {
-                       return base.Contains (value);
-               }
-
-               public void CopyTo (OleDbParameter [] array, int index)
-               {
-                       base.CopyTo (array, index);
-               }
-
-               public void Insert (int index, OleDbParameter value)
-               {
-                       base.Insert (index, value);
-               }
-
-               public void Remove (OleDbParameter value)
-               {
-                       base.Remove (value);
-               }
-
-               public int IndexOf (OleDbParameter value)
-               {
-                       return base.IndexOf (value);
-               }
-
-               #endregion // Methods        
-        
-    }
-}
\ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data.OleDb.jvm/OleDbPermission.cs b/mcs/class/System.Data/System.Data.OleDb.jvm/OleDbPermission.cs
deleted file mode 100644 (file)
index bc287a9..0000000
+++ /dev/null
@@ -1,114 +0,0 @@
-//\r
-// System.Data.OleDb.OleDbPermission\r
-//\r
-// Author:\r
-//   Rodrigo Moya (rodrigo@ximian.com)\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Rodrigo Moya, 2002\r
-// Copyright (C) Tim Coleman, 2002     \r
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)\r
-//\r
-\r
-//\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-// \r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-// \r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
-//\r
-\r
-\r
-using System.Data;\r
-using System.Data.Common;\r
-using System.Security;\r
-using System.Security.Permissions;\r
-\r
-namespace System.Data.OleDb\r
-{\r
-       [Serializable]\r
-       public sealed class OleDbPermission : DBDataPermission\r
-       {\r
-               #region Constructors\r
-\r
-               [ObsoleteAttribute ("OleDbPermission() has been deprecated.  Use the OleDbPermission(PermissionState.None) constructor.  http://go.microsoft.com/fwlink/?linkid=14202", true)]\r
-               public OleDbPermission ()\r
-               {\r
-               }\r
-\r
-               public OleDbPermission (PermissionState state) : base(state)\r
-               {\r
-               }\r
-\r
-               [ObsoleteAttribute ("OleDbPermission() has been deprecated.  Use the OleDbPermission(PermissionState.None) constructor.  http://go.microsoft.com/fwlink/?linkid=14202", true)]\r
-               public OleDbPermission (PermissionState state, bool allowBlankPassword) : base(state, allowBlankPassword)\r
-               {\r
-               }\r
-\r
-               #endregion\r
-\r
-               #region Properties\r
-\r
-               public string Provider {\r
-                       [MonoTODO]\r
-                       get { throw new NotImplementedException (); }\r
-                       [MonoTODO]\r
-                       set { throw new NotImplementedException (); }\r
-               }\r
-\r
-               #endregion\r
-\r
-               #region Methods\r
-\r
-               [MonoTODO]\r
-               public override IPermission Copy ()\r
-               {\r
-                       throw new NotImplementedException ();\r
-               }\r
-\r
-               [MonoTODO]\r
-               public override void FromXml (SecurityElement securityElement)\r
-               {\r
-                       throw new NotImplementedException ();\r
-               }\r
-\r
-               [MonoTODO]\r
-               public override IPermission Intersect (IPermission target)\r
-               {\r
-                       throw new NotImplementedException ();\r
-               }\r
-\r
-               [MonoTODO]\r
-               public override bool IsSubsetOf (IPermission target)\r
-               {\r
-                       throw new NotImplementedException ();\r
-               }\r
-\r
-               [MonoTODO]\r
-               public override SecurityElement ToXml ()\r
-               {\r
-                       throw new NotImplementedException ();\r
-               }\r
-\r
-               [MonoTODO]\r
-               public override IPermission Union (IPermission target)\r
-               {\r
-                       throw new NotImplementedException ();\r
-               }\r
-\r
-               #endregion\r
-       }\r
-}\r
diff --git a/mcs/class/System.Data/System.Data.OleDb.jvm/OleDbPermissionAttribute.cs b/mcs/class/System.Data/System.Data.OleDb.jvm/OleDbPermissionAttribute.cs
deleted file mode 100644 (file)
index c2d0dbd..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-//\r
-// System.Data.OleDb.OleDbPermissionAttribute\r
-//\r
-// Authors:\r
-//   Rodrigo Moya (rodrigo@ximian.com)\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Rodrigo Moya, 2002\r
-// Copyright (C) Tim Coleman, 2002     
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//\r
-\r
-\r
-using System.Data;\r
-using System.Data.Common;\r
-using System.Security;\r
-using System.Security.Permissions;\r
-\r
-namespace System.Data.OleDb\r
-{\r
-       [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class\r
-                       | AttributeTargets.Struct | AttributeTargets.Constructor |\r
-                       AttributeTargets.Method)]\r
-       [Serializable]\r
-       public sealed class OleDbPermissionAttribute : DBDataPermissionAttribute\r
-       {\r
-\r
-               #region Constructors \r
-\r
-               [MonoTODO]\r
-               OleDbPermissionAttribute (SecurityAction action) \r
-                       : base (action)\r
-               {\r
-               }\r
-\r
-               #endregion\r
-\r
-               #region Properties\r
-\r
-               [MonoTODO]\r
-               public string Provider {\r
-                       [MonoTODO]\r
-                       get {\r
-                               throw new NotImplementedException (); \r
-                       }\r
-                       [MonoTODO]\r
-                       set {\r
-                               throw new NotImplementedException (); \r
-                       }\r
-               }\r
-\r
-               #endregion\r
-\r
-               #region Methods\r
-\r
-               [MonoTODO]\r
-               public override IPermission CreatePermission () \r
-               {\r
-                       throw new NotImplementedException ();\r
-               }\r
-\r
-               #endregion\r
-       }\r
-}\r
diff --git a/mcs/class/System.Data/System.Data.OleDb.jvm/OleDbRowUpdatedEventArgs.cs b/mcs/class/System.Data/System.Data.OleDb.jvm/OleDbRowUpdatedEventArgs.cs
deleted file mode 100644 (file)
index a086519..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-//\r
-// System.Data.OleDb.OleDbRowUpdatedEventArgs\r
-//\r
-// Authors:\r
-//   Rodrigo Moya (rodrigo@ximian.com)\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Rodrigo Moya, 2002\r
-// Copyright (C) Tim Coleman, 2002     
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//\r
-\r
-\r
-using System.Data;\r
-using System.Data.Common;\r
-\r
-namespace System.Data.OleDb\r
-{\r
-       public sealed class OleDbRowUpdatedEventArgs : RowUpdatedEventArgs\r
-       {\r
-               #region Fields\r
-               \r
-               OleDbCommand command;\r
-\r
-               #endregion // Fields\r
-\r
-               #region Constructors\r
-\r
-               [MonoTODO]\r
-               public OleDbRowUpdatedEventArgs (DataRow dataRow, IDbCommand command, StatementType statementType, DataTableMapping tableMapping)\r
-                       : base (dataRow, command, statementType, tableMapping)\r
-\r
-               {\r
-                       this.command = (OleDbCommand) command;\r
-               }\r
-\r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               public new OleDbCommand Command {\r
-                       get { return command; }\r
-               }\r
-\r
-               #endregion // Properties\r
-       }\r
-}\r
diff --git a/mcs/class/System.Data/System.Data.OleDb.jvm/OleDbRowUpdatedEventHandler.cs b/mcs/class/System.Data/System.Data.OleDb.jvm/OleDbRowUpdatedEventHandler.cs
deleted file mode 100644 (file)
index 1c2ca7a..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-//\r
-// System.Data.OleDb.OleDbRowUpdatedEventHandler\r
-//\r
-// Author:\r
-//   Rodrigo Moya (rodrigo@ximian.com)\r
-//\r
-// Copyright (C) Rodrigo Moya, 2002    
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//\r
-\r
-\r
-using System.Data;\r
-using System.Data.Common;\r
-\r
-namespace System.Data.OleDb\r
-{\r
-       [Serializable]\r
-       public delegate void OleDbRowUpdatedEventHandler (\r
-               object sender,\r
-               OleDbRowUpdatedEventArgs e);\r
-}\r
diff --git a/mcs/class/System.Data/System.Data.OleDb.jvm/OleDbRowUpdatingEventArgs.cs b/mcs/class/System.Data/System.Data.OleDb.jvm/OleDbRowUpdatingEventArgs.cs
deleted file mode 100644 (file)
index 67034dd..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-//\r
-// System.Data.OleDb.OleDbRowUpdatingEventArgs\r
-//\r
-// Authors:\r
-//   Rodrigo Moya (rodrigo@ximian.com)\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Rodrigo Moya, 2002\r
-// Copyright (C) Tim Coleman, 2002
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//\r
-\r
-\r
-using System.Data;\r
-using System.Data.Common;\r
-\r
-namespace System.Data.OleDb\r
-{\r
-       public sealed class OleDbRowUpdatingEventArgs : RowUpdatingEventArgs\r
-       {\r
-\r
-               #region Fields\r
-\r
-               OleDbCommand command = null;\r
-\r
-               #endregion\r
-\r
-               #region Constructors\r
-\r
-               [MonoTODO]\r
-               public OleDbRowUpdatingEventArgs (DataRow dataRow, IDbCommand command, StatementType statementType, DataTableMapping tableMapping)\r
-                       : base (dataRow, command, statementType, tableMapping)\r
-\r
-               {\r
-                       this.command = (OleDbCommand) command;\r
-               }\r
-\r
-               #endregion\r
-\r
-               #region Properties\r
-               \r
-               public new OleDbCommand Command {\r
-                       get { return command; }\r
-                       set { command = value; }\r
-               }\r
-\r
-               #endregion\r
-       }\r
-}\r
diff --git a/mcs/class/System.Data/System.Data.OleDb.jvm/OleDbRowUpdatingEventHandler.cs b/mcs/class/System.Data/System.Data.OleDb.jvm/OleDbRowUpdatingEventHandler.cs
deleted file mode 100644 (file)
index 002cd85..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-//\r
-// System.Data.OleDb.OleDbRowUpdatingEventHandler\r
-//\r
-// Author:\r
-//   Rodrigo Moya (rodrigo@ximian.com)\r
-//\r
-// Copyright (C) Rodrigo Moya, 2002    
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//\r
-\r
-\r
-using System.Data;\r
-using System.Data.Common;\r
-\r
-namespace System.Data.OleDb\r
-{\r
-       [Serializable]\r
-       public delegate void OleDbRowUpdatingEventHandler (\r
-               object sender,\r
-               OleDbRowUpdatingEventArgs e);\r
-}\r
diff --git a/mcs/class/System.Data/System.Data.OleDb.jvm/OleDbSchemaGuid.cs b/mcs/class/System.Data/System.Data.OleDb.jvm/OleDbSchemaGuid.cs
deleted file mode 100644 (file)
index 877d4eb..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-//\r
-// System.Data.OleDb.OleDbSchemaGuid\r
-//\r
-// Authors:\r
-//   Rodrigo Moya (rodrigo@ximian.com)\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Rodrigo Moya, 2002\r
-// Copyright (C) Tim Coleman, 2002     
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//\r
-\r
-\r
-using System.Data;\r
-using System.Data.Common;\r
-\r
-namespace System.Data.OleDb\r
-{\r
-       public sealed class OleDbSchemaGuid\r
-       {\r
-               #region Fields\r
-\r
-               public static readonly Guid Assertions = new Guid ("df855bea-fb95-4abc-8932-e57e45c7ddae");\r
-               public static readonly Guid Catalogs = new Guid ("e4a67334-f03c-45af-8b1d-531f99268045");\r
-               public static readonly Guid Character_Sets = new Guid ("e4533bdb-0b55-48ee-986d-17d07143657d");\r
-               public static readonly Guid Check_Constraints = new Guid ("fedf7f5d-cfb4-4635-af02-45eb4bb4e8f3");\r
-               public static readonly Guid Check_Constraints_By_Table = new Guid ("d76547ef-837d-413c-8d76-bab1d7bb014a");\r
-               public static readonly Guid Collations = new Guid ("5145b85c-c448-4b9e-8929-4c2de31ffa30");\r
-               public static readonly Guid Columns = new Guid ("86dcd6e2-9a8c-4c6d-bc1c-e0e334c727c9");\r
-               public static readonly Guid Column_Domain_Usage = new Guid ("058acb5e-eb1d-4b6e-8e98-a7d59a959ff1");\r
-               public static readonly Guid Column_Privileges = new Guid ("43152796-f3b4-4342-9647-008f1060e352");\r
-               public static readonly Guid Constraint_Column_Usage = new Guid ("3a39f999-f481-4293-8b9f-af7e91b4ee7d");\r
-               public static readonly Guid Constraint_Table_Usage = new Guid ("d689719b-24b0-4963-a635-097c480edcd2");\r
-               public static readonly Guid DbInfoLiterals = new Guid ("7a564da6-f3bc-474b-9e66-71cb47bde5b0");\r
-               public static readonly Guid Foreign_Keys = new Guid ("d9e547ce-e62d-4200-b849-566bc3dc29de");\r
-               public static readonly Guid Indexes = new Guid ("69d8523c-96ad-40cb-a89a-ee98d2d6fcec");\r
-               public static readonly Guid Key_Column_Usage = new Guid ("65423211-805e-4822-8eb4-f4f6d540056e");\r
-               public static readonly Guid Primary_Keys = new Guid ("c6e5b174-fbd8-4055-b757-8585040e463f");\r
-               public static readonly Guid Procedures = new Guid ("61f276ad-4f25-4c26-b4ae-8238e06d56db");\r
-               public static readonly Guid Procedure_Columns = new Guid ("7148080d-e053-4ada-b79a-9a2ff614a3d4");\r
-               public static readonly Guid Procedure_Parameters = new Guid ("984af700-8fe7-476f-81c2-4b814df67907");\r
-               public static readonly Guid Provider_Types = new Guid ("0bc2da44-d834-4136-9ff0-3cef477784b9");\r
-               public static readonly Guid Referential_Constraints = new Guid ("d2eab85e-49a7-462d-aa22-1d97c74178ae");\r
-               public static readonly Guid Schemata = new Guid ("2fbd7503-0af3-43d2-92c6-51e78b84dd37");\r
-               public static readonly Guid Sql_Languages = new Guid ("d60a511d-a07f-4e59-aac2-71c25fab5b02");\r
-               public static readonly Guid Statistics = new Guid ("03ed9f7d-35bc-45fe-993f-ee7a5f29fb74");\r
-               public static readonly Guid Tables = new Guid ("ceac88ba-240c-4bb4-821e-4a49fc013371");\r
-               public static readonly Guid Tables_Info = new Guid ("9ff81c59-2b1e-4371-a08b-3a2d373189fa");\r
-               public static readonly Guid Table_Constraints = new Guid ("62883c55-082d-42cb-bb00-747985ca6047");\r
-               public static readonly Guid Table_Privileges = new Guid ("1a73f478-8c8e-4ede-b3ec-22ba13ab55a0");\r
-               public static readonly Guid Table_Statistics = new Guid ("9c944744-cd51-448a-8be4-7095f039d0ef");\r
-               public static readonly Guid Translations = new Guid ("5578b57e-a682-4f1b-bdb4-f8a14ad6f61e");\r
-               public static readonly Guid Trustee = new Guid ("521207e2-3a23-42b6-ac78-810a3fce3271");\r
-               public static readonly Guid Usage_Privileges = new Guid ("f8113a2b-2934-4c67-ab7b-adbe3ab74973");\r
-               public static readonly Guid Views = new Guid ("9a6345b6-61a0-40fd-9b45-402f3c9c9c3e");\r
-               public static readonly Guid View_Column_Usage = new Guid ("2c91ef91-02d8-4d38-ae5a-1e826873d6ea");\r
-               public static readonly Guid View_Table_Usage = new Guid ("7dcb7f53-1045-4fdf-86a1-d3caaf27c7f5");\r
-\r
-               #endregion\r
-\r
-               #region Constructors\r
-\r
-               public OleDbSchemaGuid ()\r
-               {\r
-               }\r
-\r
-               #endregion\r
-       }\r
-}\r
diff --git a/mcs/class/System.Data/System.Data.OleDb.jvm/OleDbTransaction.cs b/mcs/class/System.Data/System.Data.OleDb.jvm/OleDbTransaction.cs
deleted file mode 100644 (file)
index 9699011..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-// 
-// System.Data.OleDb.OleDbTransaction.cs
-//
-// Authors:
-//     Konstantin Triger <kostat@mainsoft.com>
-//     Boris Kirzner <borisk@mainsoft.com>
-//     
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//\r
-\r
-\r
-namespace System.Data.OleDb\r
-{\r
-\r
-    using System.Data.Common;\r
-       using System.Data.ProviderBase;\r
-    using System.Data;\r
-\r
-    public class OleDbTransaction : AbstractTransaction\r
-    {\r
-    \r
-        internal OleDbTransaction(OleDbConnection connection) : base(IsolationLevel.ReadCommitted, connection, null)\r
-        {\r
-        }\r
-\r
-        internal OleDbTransaction(OleDbConnection connection, String transactionName) : base(IsolationLevel.ReadCommitted, connection, transactionName)\r
-        {\r
-        }\r
-\r
-        internal OleDbTransaction(IsolationLevel isolationLevel, OleDbConnection connection) : base(isolationLevel, connection, null)\r
-        {\r
-        }\r
-\r
-           public new OleDbConnection Connection\r
-           {\r
-                   get\r
-                   {\r
-                           return (OleDbConnection)base.Connection;\r
-                   }\r
-           }\r
-\r
-           public OleDbTransaction Begin()\r
-           {\r
-                   return Begin(IsolationLevel.ReadCommitted);\r
-           }\r
-\r
-           public OleDbTransaction Begin(IsolationLevel isolationLevetl)\r
-           {\r
-                       throw new InvalidOperationException("Only one transaction can be active on this session.");\r
-           }\r
-    \r
-    }\r
-}
\ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data.OleDb.jvm/OleDbType.cs b/mcs/class/System.Data/System.Data.OleDb.jvm/OleDbType.cs
deleted file mode 100644 (file)
index 90141e8..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-//\r
-// System.Data.OleDb.OleDbType\r
-//\r
-// Authors:\r
-//     Konstantin Triger <kostat@mainsoft.com>\r
-//     Boris Kirzner <borisk@mainsoft.com>\r
-//     \r
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)\r
-//\r
-\r
-//\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-// \r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-// \r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
-//\r
-\r
-namespace System.Data.OleDb\r
-{\r
-\r
-    \r
-    /**\r
-     *\r
-     */\r
-    public enum OleDbType\r
-    {\r
-\r
-        Empty = 0,\r
-\r
-        SmallInt = 2,\r
-\r
-        Integer = 3,\r
-\r
-        Single = 4,\r
-\r
-        Double = 5,\r
-\r
-        Currency = 6,\r
-\r
-        Date = 7,\r
-\r
-        BSTR = 8,\r
-\r
-        IDispatch = 9,\r
-\r
-        Error = 10,\r
-\r
-        Boolean = 11,\r
-\r
-        Variant = 12,\r
-\r
-        IUnknown = 13,\r
-\r
-        Decimal = 14,\r
-\r
-        TinyInt = 16,\r
-\r
-        UnsignedTinyInt = 17,\r
-\r
-        UnsignedSmallInt = 18,\r
-\r
-        UnsignedInt = 19,\r
-\r
-        BigInt = 20,\r
-\r
-        UnsignedBigInt = 21,\r
-\r
-        Filetime = 64,\r
-\r
-        Guid = 72,\r
-\r
-        Binary = 128,\r
-\r
-        Char = 129,\r
-\r
-        WChar = 130,\r
-\r
-        Numeric = 131,\r
-\r
-        DBDate = 133,\r
-\r
-        DBTime = 134,\r
-\r
-        DBTimeStamp = 135,\r
-\r
-        PropVariant = 138,\r
-\r
-        VarNumeric = 139,\r
-\r
-        VarChar = 200,\r
-\r
-        LongVarChar = 201,\r
-\r
-        VarWChar = 202,\r
-\r
-        LongVarWChar = 203,\r
-\r
-        VarBinary = 204,\r
-\r
-        LongVarBinary = 205,\r
-\r
-        \r
-    }\r
-}
\ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data.OleDb/ChangeLog b/mcs/class/System.Data/System.Data.OleDb/ChangeLog
deleted file mode 100644 (file)
index 769e36f..0000000
+++ /dev/null
@@ -1,321 +0,0 @@
-2009-02-19 Gonzalo Paniagua Javier <gonzalo@novell.com>
-
-       * OleDbFactory.cs: New file.
-
-2008-04-21  Gert Driesen  <drieseng@users.sourceforge.net>
-
-       * OleDbDataAdapter.cs: Changed argument names to match MS. Removed
-       extra explicit interface implementation.
-       * OleDbParameter.cs: Changed argument names to match MS.
-       * OleDbTransaction.cs: Do not include IDbConnection.Connection and
-       IDisposable.Dispose for 2.0 profile.
-       * OleDbParameterCollection.cs: Changed argument names to match MS.
-       Do not include explicit interface implementations on 2.0 profile.
-       * OleDbConnection.cs: Changed argument names to match MS. Code
-       formatting.
-
-2008-03-03  Ankit Jain  <jankit@novell.com>
-
-       * OleDbMetaDataCollectionNames.cs: New.
-
-2007-10-21  Gert Driesen  <drieseng@users.sourceforge.net>
-
-       * OleDbCommand.cs: Use ExceptionHelper.CheckEnumValue for enum checks.
-
-2007-10-20  Gert Driesen  <drieseng@users.sourceforge.net>
-
-       * OleDbDataAdapter.cs: In default ctor, set SelectCommand to null.
-       Only initialize SelectCommand in ctors. Use direct assignment in
-       IDbDataAdapter implementation.
-       * OleDbCommand.cs: Added constant for default CommandTimeout, instead
-       of using a magic number. Avoid unnecessary initialization. Fixed
-       default value for DesignTimeVisible. Return zero-length string if
-       CommandText is null. Added implementation for UpdatedRowSource.
-       * OleDbConnection.cs: Moved initialization of gda to Open ().
-       Avoid unnecessary initialization. Return zero-length string if
-       ConnectionString is null. If getters to Database, DataSource and
-       Provider return zero-length string if the connection is closed.
-       In ServerVersion, BeginTransaction and GetSchema, throw an
-       InvalidOperationException if connection is closed.
-
-2007-10-19  Gert Driesen  <drieseng@users.sourceforge.net>
-
-       * OleDbTransaction.cs: Clear connection in Commit and Rollback. In
-       IsolationLevel and Begin overloads, throw IOE if transaction is no
-       longer open.
-
-2007-10-19  Gert Driesen  <drieseng@users.sourceforge.net>
-
-       * OleDbTransaction.cs: Keep track of whether transaction is open and
-       whether it's disposed. In Commit an Rollback, throw an IOE if the
-       transaction is no longer open. In Dispose (bool), perform a rollback
-       if the transaction is still open.
-
-2007-10-19  Nagappan <anagappan@novell.com> 
-
-       * OleDbCommandBuilder.cs: Implemented ApplyParameterInfo, Dispose,
-         GetParameterName, GetParameterPlaceholder, RefreshSchema methods.
-
-2007-10-19  Nagappan <anagappan@novell.com> 
-
-       * OleDbCommand.cs: Implemented Clone, Dispose methods.
-         Implemented CreateDbParameter, DbConnection, DbParameterCollection,
-         DbTransaction, ExecuteDbDataReader properties.
-
-       * OleDbParameterCollection.cs: Fixed 1.0 API compatibility.
-
-2007-09-27  Nagappan A <anagappan@novell.com> 
-
-       * OleDbDataReader.cs: Removed bogus MonoTODO.
-
-2007-09-26  Nagappan A <anagappan@novell.com> 
-
-       * OleDbTransaction.cs: Removed bogus TODO.
-         Modified Finalize method to exist only in 1.0 profile.
-
-2007-09-25  Nagappan A  <anagappan@novell.com>
-
-       * OleDbConnection.cs: 2.0 attribute changes.
-
-       * OleDbException.cs: 2.0 attribute changes.
-
-       * OleDbDataReader.cs: 2.0 attribute changes.
-
-       * OleDbCommandBuilder.cs: 2.0 attribute changes.
-
-       * OleDbParameter.cs: 2.0 attribute changes.
-
-2007-07-22  Nagappan A  <anagappan@novell.com>
-
-       * OleDbDataReader.cs: Fixed compilation warning.
-
-       * OleDbParameterCollection.cs: Fixed compilation warning.
-
-       * OleDbTransaction.cs: Fixed compilation warning.
-
-       * OleDbCommandBuilder.cs: Fixed compilation warning.
-
-2007-07-02  Gert Driesen  <drieseng@users.sourceforge.net>
-
-       * OleDbConnection.cs: Derive from DbConnection on 2.0 profile, and
-       stubbed out where necessary. Fixed attributes for ConnectionString on
-       2.0 profile. Marked several members as override on 2.0 profile.
-       Do not hide StateChange event. Code formatting.
-       * OleDbCommandBuilder.cs: On 2.0, derive from DbCommandBuilder. Do not
-       include QuotePrefix and QuoteSuffix on 2.0. Stubbed out 2.0 members.
-       * OleDbDataAdapter.cs: On 2.0, derive from DbDataAdapter. Stubbed out
-       2.0 members. Do not not override Dispose on 2.0. Code formatting.
-       * OleDbDataReader.cs: Derive from DbDataReader on 2.0 profile. Marked
-       several members as override. Stubbed VisibleFieldCount. Added
-       EditorBrowsable attribute on GetData. Added GetDbDataReader on 2.0.
-       On 2.0, override GetEnumerator instead of explicit interface
-       implementation.
-       * OleDbErrorCollection.cs: Added 2.0 CopyTo overload.
-       * OleDbInfoMessageEventHandler.cs: Do not mark class serializable on
-       2.0 profile. Fixed API mismatch.
-       * OleDbParameter.cs: On 2.0, derive from DbParameter. Added new 2.0
-       ctor.  Override properties from base class and added
-       SourceColumnNullMapping property on 2.0. Implemented ResetDbType and
-       ResetOleDbType methods on 2.0.
-       * OleDbParameterCollection.cs: Derive from DbParameterCollection on
-       2.0 profile. Marked several members as override. Implemented AddRange,
-       CopyTo, IndexOf, Insert, Remove and RemoveAt methods introduced in
-       2.0 profile. Stubbed out GetParameter and SetParameter overloads.
-       * OleDbPermission.cs: Added missing BrowsableAttribute on Provider.
-       Code formatting.
-       * OleDbPermissionAttribute.cs: Added BrowsableAttribute on Provdider
-       (2.0 only).
-       * OleDbRowUpdatedEventHandler.cs:  Do not mark class serializable on
-       2.0 profile.
-       * OleDbRowUpdatingEventArgs.cs: Removed unused command field. Added
-       BaseCommand property on 2.0
-       * OleDbRowUpdatingEventHandler.cs: Do not mark class serializable on
-       2.0 profile. Fixed API mismatch.
-       * OleDbTransaction.cs: On 2.0, derive from DbTransaction. Added
-       DbConnection property and override Dispose (both 2.0 only). On 2.0,
-       Override Commit and Rollback. Code formatting.
-
-2007-07-01  Gert Driesen  <drieseng@users.sourceforge.net>
-
-       * OleDbCommand.cs: 2.0 API fixes. Build fix.
-
-2007-07-01  Gert Driesen  <drieseng@users.sourceforge.net>
-
-       * OleDbCommand.cs: Code formatting.
-       * OleDbDataReader.cs: Code formatting.
-       * OleDbError.cs: Code formatting.
-       * OleDbErrorCollection.cs: Code formatting.
-       * OleDbException.cs: Code formatting.
-       * OleDbInfoMessageEventArgs.cs: Code formatting.
-       * OleDbParameter.cs: Code formatting.
-       * OleDbParameterCollection.cs: Code formatting.
-
-2007-06-21  Nagappan A  <anagappan@novell.com>
-
-       * OleDbConnection.cs: Fixed compiler warning.
-
-       * OleDbParameterCollection.cs (AddWithValue): Fixed compiler
-       warning.
-
-2007-02-20  Frederik Carlier <frederik.carlier@carlier-online.be>
-
-       * OleDbParameterCollection.cs: Added AddWithValue method.
-
-2007-01-08  Nagappan A  <anagappan@novell.com>
-
-       * OleDbCommand.cs: Fixed compilation warning.
-
-       * OleDbDataAdapter.cs: Fixed compilation warning.
-
-2006-07-13  Senganal T  <tsenganal@novell.com>
-       
-       * OleDbCommand : 2.0 Api fixes
-
-2006-05-31  Gert Driesen  <drieseng@users.sourceforge.net>
-
-       * OleDbErrorCollection.cs: Removed explicit interface implementation
-       of IEnumerable.GetEnumerator ().
-       * OleDbParameterCollection.cs: Removed explicit interface 
-       implementation members that are already implementation by public
-       members.
-
-2006-02-17  Chris Toshok  <toshok@ximian.com>
-
-       * OleDbDataAdapter.cs, OleDbCommand.cs, OleDbParameter.cs,
-       OleDbCommandBuilder.cs, OleDbConnection.cs: remove
-       DataSysDescriptions for >= 2.0.
-
-2006-02-17  Chris Toshok  <toshok@ximian.com>
-
-       * OleDbCommand.cs: remove extra using System.Data.  fixes warning.
-
-2005-10-04  Sebastien Pouliot  <sebastien@ximian.com>
-
-       * OleDbDataReader.cs: Added a call to GC.SuppressFinalize in Dispose
-       method (and avoids calling the destructor if the object was disposed).
-       * OleDbTransaction.cs: Added a call to GC.SuppressFinalize in Dispose
-       method (even if we throw an NotImplementedException afterward). This
-       will remove warnings from gendarme.
-
-2005-09-20  Alexandre Miguel Pedro Gomes  <alexmipego@gmail.com>
-       
-       * OleDbConnection.cs: Verify and throw an exception if the
-       connection isn't valid.
-
-2005-09-13  Sureshkumar T  <tsureshkumar@novell.com>
-
-       * Moved TestGda.cs & TestOleDb.cs to ..\Test.
-       
-2005-08-08  Gert Driesen  <drieseng@users.sourceforge.net>
-
-       * OleDbDataAdapter.cs: Fixed custom attributes to match MS.NET.
-       * OleDbCommand.cs: Fixed custom attributes to match MS.NET.
-       * OleDbParameter.cs: Fixed custom attribute to match MS.NET.
-       * OleDbException.cs: Added ErrorTypeConverter, assigned to ErrorCode
-       property to match MS.NET.
-       * OleDbConnection.cs: Fixed custom attributes to match MS.NET.
-
-2005-02-16  Lluis Sanchez Gual  <lluis@novell.com>
-
-       * OleDbCommand.cs: Make it inherit from the correct base class in 2.0,
-       and added stubs for some interface methods.
-
-2004-09-14  Sebastien Pouliot  <sebastien@ximian.com>
-
-       * OleDbPermission.cs: Added internal constructor accepting an OleDb
-       PermissionAttribute parameter (using base class protected ctor).
-       Re-added the Provider property (removed by error).
-       * OleDbPermission.cs: Copy now use the new OleDbPermission
-       constructor. Re-added the Provider property (removed by error).
-
-2004-09-13  Sebastien Pouliot  <sebastien@ximian.com>
-
-       * OleDbPermission.cs: Mostly completed (needs tests).
-       * OleDbPermissionAttribute.cs: Completed.
-
-2004-06-16  Gert Driesen <drieseng@users.sourceforge.net>
-
-       * OleDbError.cs: fixed serialization compatibility with MS.NET
-       * OleDbErrorCollection.cs: fixed serialization compatibility with
-       MS.NET
-
-2004-06-13  Gert Driesen <drieseng@users.sourceforge.net>
-
-       * OleDbLiteral.cs: changed enum field values to match MS.NET
-       * OleDbType.cs: changed enum field values to match MS.NET
-
-2004-06-04  Gert Driesen <drieseng@users.sourceforge.net>
-
-       * OleDbDataAdapter.cs: added stub for missing 
-       Dispose override
-
-2004-06-02  Gert Driesen <drieseng@users.sourceforge.net>
-
-        * OleDbParameter.cs: added missing attributes
-        * OleDbPermission.cs: added missing attributes
-        * OleDbConnection.cs: added missing attributes
-        * OleDbDataAdapter.cs: added missing attributes
-
-2004-05-27  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * OleDbDataReader.cs : don't output debug message to Console.
-
-2004-05-20  Gert Driesen (drieseng@users.sourceforge.net)
-
-        *  OleDbPermissionAttribute.cs: change AllowMultiple and
-        Inherited to match .NET
-
-2004-05-14 Umadevi S (sumadevi@novell.com)
-        * OleDbAdapter.cs -Implemented attributes, changed method signature for fill
-
-2004-05-14 Umadevi S (sumadevi@novell.com)
-        * OleDbCommand.cs - Completed implementing all the attributes
-
-2004-05-14 Umadevi S (sumadevi@novell.com)
-        * OleDbCommand.cs - Completed implementing all the attribute
-
-2004-05-14 Umadevi S (sumadevi@novell.com)
-        * OleDbConnection.cs - Completed implementing all the attributes
-                           - Stubbed EnlistDistributedTransaction method
-
-2004-05-14 Umadevi S (sumadevi@novell.com)
-        * OleDbDataAdapter.cs - Completed implementing all the attributes
-                          - Stubbed the Fill methods
-
-2004-05-14 Umadevi S (sumadevi@novell.com)
-        * OleDbParameter.cs - Completed implementing all the attributes             
-
-
-2004-05-13 Umadevi S (sumadevi@novell.com)
-       * OleDbDataReader.cs - Stubbed HasRows method
-                       - Implemented EditorBrowsableAttribute
-       * OleDbParameterConverter.cs - Stubbed this class
-       * OleDbParameter.cs - Added a few attributes.
-
-2004-05-09  Gert Driesen (drieseng@users.sourceforge.net)
-       * OleDbCommand.cs: removed setter for Parameters property to
-       match MS.NET
-       * OleDbCommandBuilder.cs: fixed GetUpdatetCommand typo
-       * OleDbErrorCollection: added default internal ctor to match
-       MS.NET
-       * OleDbInfoMessageEventArgs.cs: added default internal ctor
-       to match MS.NET
-       * OleDbParameter.cs: added setter for IsNullable
-       * OleDbParameterCollection: added default internal ctor to
-       match MS.NET
-       * OleDbPermission.cs: removed extra IsSubsetOf method
-
-2004-04-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
-       * OleDbPermissionAttribute.cs: missing bits from Gert's patch for
-       CLS compliance.
-
-2004-01-10  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * OleDbPermission.cs : NET_2_0 fix not to call obsolete .ctor.
-
-2002-11-01  Daniel Morgan <danmorg@sc.rr.com>
-
-       * OleDbDataReader.cs: implemented
-       Dispose() and GetEnumerator()
-       
diff --git a/mcs/class/System.Data/System.Data.OleDb/OleDbCommand.cs b/mcs/class/System.Data/System.Data.OleDb/OleDbCommand.cs
deleted file mode 100644 (file)
index 45109d4..0000000
+++ /dev/null
@@ -1,434 +0,0 @@
-//
-// System.Data.OleDb.OleDbCommand
-//
-// Authors:
-//   Rodrigo Moya (rodrigo@ximian.com)
-//   Tim Coleman (tim@timcoleman.com)
-//
-// Copyright (C) Rodrigo Moya, 2002
-// Copyright (C) Tim Coleman, 2002
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.ComponentModel;
-using System.Data;
-using System.Data.Common;
-using System.Collections;
-using System.Runtime.InteropServices;
-
-namespace System.Data.OleDb
-{
-       /// <summary>
-       /// Represents an SQL statement or stored procedure to execute against a data source.
-       /// </summary>
-       [DesignerAttribute ("Microsoft.VSDesigner.Data.VS.OleDbCommandDesigner, "+ Consts.AssemblyMicrosoft_VSDesigner, "System.ComponentModel.Design.IDesigner")]
-       [ToolboxItemAttribute ("System.Drawing.Design.ToolboxItem, "+ Consts.AssemblySystem_Drawing)]
-       [DefaultEvent( "RecordsAffected")]
-       public sealed class OleDbCommand : 
-       DbCommand
-       , ICloneable, IDbCommand
-       {
-               #region Fields
-
-               const int DEFAULT_COMMAND_TIMEOUT = 30;
-
-               string commandText;
-               int timeout;
-               CommandType commandType;
-               OleDbConnection connection;
-               OleDbParameterCollection parameters;
-               OleDbTransaction transaction;
-               bool designTimeVisible;
-               OleDbDataReader dataReader;
-               CommandBehavior behavior;
-               IntPtr gdaCommand;
-               UpdateRowSource updatedRowSource;
-
-               bool disposed;
-               
-               #endregion // Fields
-
-               #region Constructors
-
-               public OleDbCommand ()
-               {
-                       timeout = DEFAULT_COMMAND_TIMEOUT;
-                       commandType = CommandType.Text;
-                       parameters = new OleDbParameterCollection ();
-                       behavior = CommandBehavior.Default;
-                       gdaCommand = IntPtr.Zero;
-                       designTimeVisible = true;
-                       this.updatedRowSource = UpdateRowSource.Both;
-               }
-
-               public OleDbCommand (string cmdText) : this ()
-               {
-                       CommandText = cmdText;
-               }
-
-               public OleDbCommand (string cmdText, OleDbConnection connection)
-                       : this (cmdText)
-               {
-                       Connection = connection;
-               }
-
-               public OleDbCommand (string cmdText, OleDbConnection connection,
-                       OleDbTransaction transaction) : this (cmdText, connection)
-               {
-                       this.transaction = transaction;
-               }
-
-               #endregion // Constructors
-
-               #region Properties
-       
-               [DataCategory ("Data")]
-               [DefaultValue ("")]
-               [EditorAttribute ("Microsoft.VSDesigner.Data.ADO.Design.OleDbCommandTextEditor, "+ Consts.AssemblyMicrosoft_VSDesigner, "System.Drawing.Design.UITypeEditor, "+ Consts.AssemblySystem_Drawing)]
-               [RefreshPropertiesAttribute (RefreshProperties.All)]
-               public 
-               override
-               string CommandText {
-                       get {
-                               if (commandText == null)
-                                       return string.Empty;
-                               return commandText;
-                       }
-                       set {
-                               commandText = value;
-                       }
-               }
-
-               public
-               override
-               int CommandTimeout {
-                       get {
-                               return timeout;
-                       }
-                       set {
-                               timeout = value;
-                       }
-               }
-
-               [DataCategory ("Data")]
-               [DefaultValue ("Text")]
-               [RefreshPropertiesAttribute (RefreshProperties.All)]
-               public
-               override
-               CommandType CommandType {
-                       get {
-                               return commandType;
-                       }
-                       set {
-                               commandType = value;
-                       }
-               }
-
-               [DataCategory ("Behavior")]
-               [DefaultValue (null)]
-               [EditorAttribute ("Microsoft.VSDesigner.Data.Design.DbConnectionEditor, "+ Consts.AssemblyMicrosoft_VSDesigner, "System.Drawing.Design.UITypeEditor, "+ Consts.AssemblySystem_Drawing )]
-               public new OleDbConnection Connection {
-                       get {
-                               return connection;
-                       }
-                       set {
-                               connection = value;
-                       }
-               }
-               
-               [BrowsableAttribute (false)]
-               [DesignOnlyAttribute (true)]
-               [DefaultValue (true)]
-               [EditorBrowsable(EditorBrowsableState.Never)]
-               public
-               override
-               bool DesignTimeVisible {
-                       get {
-                               return designTimeVisible;
-                       }
-                       set {
-                               designTimeVisible = value;
-                       }
-               }
-
-               [DataCategory ("Data")]
-               [DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Content)]
-               public new OleDbParameterCollection Parameters {
-                       get { return parameters; }
-                       internal set { parameters = value; }
-               }
-
-               [BrowsableAttribute (false)]
-               [DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Hidden)]
-               public new OleDbTransaction Transaction {
-                       get {
-                               return transaction;
-                       }
-                       set {
-                               transaction = value;
-                       }
-               }
-
-               [DataCategory ("Behavior")]
-               [DefaultValue (UpdateRowSource.Both)]
-               [MonoTODO]
-               public
-               override
-               UpdateRowSource UpdatedRowSource {
-                       get { return updatedRowSource; }
-                       set {
-                               ExceptionHelper.CheckEnumValue (typeof (UpdateRowSource), value);
-                               updatedRowSource = value;
-                       }
-               }
-
-               IDbConnection IDbCommand.Connection {
-                       get {
-                               return Connection;
-                       }
-                       set {
-                               Connection = (OleDbConnection) value;
-                       }
-               }
-
-               IDataParameterCollection IDbCommand.Parameters {
-                       get {
-                               return Parameters;
-                       }
-               }
-
-               IDbTransaction IDbCommand.Transaction {
-                       get {
-                               return Transaction;
-                       }
-                       set {
-                               Transaction = (OleDbTransaction) value;
-                       }
-               }
-
-               #endregion // Properties
-
-               #region Methods
-
-               [MonoTODO]
-               public 
-               override 
-               void Cancel () 
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public new OleDbParameter CreateParameter ()
-               {
-                       return new OleDbParameter ();
-               }
-
-               
-               protected override void Dispose (bool disposing)
-               {
-                       if (disposed)
-                               return;
-                       
-                       Connection = null;
-                       Transaction = null;
-                       disposed = true;
-               }
-
-               private void SetupGdaCommand ()
-               {
-                       GdaCommandType type;
-                       
-                       switch (commandType) {
-                       case CommandType.TableDirect :
-                               type = GdaCommandType.Table;
-                               break;
-                       case CommandType.StoredProcedure :
-                               type = GdaCommandType.Procedure;
-                               break;
-                       case CommandType.Text :
-                       default :
-                               type = GdaCommandType.Sql;
-                               break;
-                       }
-                       
-                       if (gdaCommand != IntPtr.Zero) {
-                               libgda.gda_command_set_text (gdaCommand, CommandText);
-                               libgda.gda_command_set_command_type (gdaCommand, type);
-                       } else {
-                               gdaCommand = libgda.gda_command_new (CommandText, type, 0);
-                       }
-
-                       //libgda.gda_command_set_transaction 
-               }
-
-               public 
-               override
-               int ExecuteNonQuery ()
-               {
-                       if (connection == null)
-                               throw new InvalidOperationException ("connection == null");
-                       if (connection.State == ConnectionState.Closed)
-                               throw new InvalidOperationException ("State == Closed");
-                       // FIXME: a third check is mentioned in .NET docs
-
-                       IntPtr gdaConnection = connection.GdaConnection;
-                       IntPtr gdaParameterList = parameters.GdaParameterList;
-
-                       SetupGdaCommand ();
-                       return libgda.gda_connection_execute_non_query (gdaConnection,
-                                                                       (IntPtr) gdaCommand,
-                                                                       gdaParameterList);
-               }
-
-               public new OleDbDataReader ExecuteReader ()
-               {
-                       return ExecuteReader (behavior);
-               }
-
-               IDataReader IDbCommand.ExecuteReader ()
-               {
-                       return ExecuteReader ();
-               }
-
-               public new OleDbDataReader ExecuteReader (CommandBehavior behavior)
-               {
-                       ArrayList results = new ArrayList ();
-                       IntPtr rs_list;
-                       GdaList glist_node;
-
-                       if (connection.State != ConnectionState.Open)
-                               throw new InvalidOperationException ("State != Open");
-
-                       this.behavior = behavior;
-
-                       IntPtr gdaConnection = connection.GdaConnection;
-                       IntPtr gdaParameterList = parameters.GdaParameterList;
-
-                       /* execute the command */
-                       SetupGdaCommand ();
-                       rs_list = libgda.gda_connection_execute_command (
-                               gdaConnection,
-                               gdaCommand,
-                               gdaParameterList);
-                       if (rs_list != IntPtr.Zero) {
-                               glist_node = (GdaList) Marshal.PtrToStructure (rs_list, typeof (GdaList));
-
-                               while (glist_node != null) {
-                                       results.Add (glist_node.data);
-                                       if (glist_node.next == IntPtr.Zero)
-                                               break;
-
-                                       glist_node = (GdaList) Marshal.PtrToStructure (glist_node.next,
-                                               typeof (GdaList));
-                               }
-                               dataReader = new OleDbDataReader (this, results);
-                               dataReader.NextResult ();
-                       }
-
-                       return dataReader;
-               }
-
-               IDataReader IDbCommand.ExecuteReader (CommandBehavior behavior)
-               {
-                       return ExecuteReader (behavior);
-               }
-               
-               public
-               override
-               object ExecuteScalar ()
-               {
-                       SetupGdaCommand ();
-                       OleDbDataReader reader = ExecuteReader ();
-                       if (reader == null) {
-                               return null;
-                       }
-                       if (!reader.Read ()) {
-                               reader.Close ();
-                               return null;
-                       }
-                       object o = reader.GetValue (0);
-                       reader.Close ();
-                       return o;
-               }
-
-               public
-               OleDbCommand Clone ()
-               {
-                       OleDbCommand command = new OleDbCommand ();
-                       command.CommandText = this.CommandText;
-                       command.CommandTimeout = this.CommandTimeout;
-                       command.CommandType = this.CommandType;
-                       command.Connection = this.Connection;
-                       command.DesignTimeVisible = this.DesignTimeVisible;
-                       command.Parameters = this.Parameters;
-                       command.Transaction = this.Transaction;
-                       return command;
-               }
-
-               object ICloneable.Clone ()
-               {
-                       return Clone ();
-               }
-
-               [MonoTODO]
-               public 
-               override
-               void Prepare ()
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public void ResetCommandTimeout ()
-               {
-                       timeout = DEFAULT_COMMAND_TIMEOUT;
-               }
-               
-               protected override DbParameter CreateDbParameter ()
-               {
-                       return (DbParameter) CreateParameter ();
-               }
-               
-               protected override DbDataReader ExecuteDbDataReader (CommandBehavior behavior)
-               {
-                       return (DbDataReader) ExecuteReader (behavior);
-               }
-               
-               protected override DbConnection DbConnection {
-                       get { return Connection; }
-                       set { Connection = (OleDbConnection) value; }
-               }
-               
-               protected override DbParameterCollection DbParameterCollection {
-                       get { return Parameters; }
-               }
-               
-               protected override DbTransaction DbTransaction {
-                       get { return Transaction; }
-                       set { Transaction = (OleDbTransaction) value; }
-               }
-
-               #endregion
-       }
-}
diff --git a/mcs/class/System.Data/System.Data.OleDb/OleDbCommandBuilder.cs b/mcs/class/System.Data/System.Data.OleDb/OleDbCommandBuilder.cs
deleted file mode 100644 (file)
index 779fd35..0000000
+++ /dev/null
@@ -1,196 +0,0 @@
-//
-// System.Data.OleDb.OleDbCommandBuilder
-//
-// Author:
-//   Rodrigo Moya (rodrigo@ximian.com)
-//   Tim Coleman (tim@timcoleman.com)
-//
-// Copyright (C) Rodrigo Moya, 2002
-// Copyright (C) Tim Coleman, 2002
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.ComponentModel;
-using System.Data;
-using System.Data.Common;
-
-namespace System.Data.OleDb
-{
-       /// <summary>
-       /// Provides a means of automatically generating single-table commands used to reconcile changes made to a DataSet with the associated database. This class cannot be inherited.
-       /// </summary>
-       public sealed class OleDbCommandBuilder :
-               DbCommandBuilder
-       {
-               #region Fields
-
-               OleDbDataAdapter adapter;
-               #endregion // Fields
-
-               #region Constructors
-               
-               public OleDbCommandBuilder ()
-               {
-               }
-
-               public OleDbCommandBuilder (OleDbDataAdapter adapter) 
-                       : this ()
-               {
-                       this.adapter = adapter;
-               }
-
-               #endregion // Constructors
-
-               #region Properties
-
-               [DefaultValue (null)]
-               public new OleDbDataAdapter DataAdapter {
-                       get {
-                               return adapter;
-                       }
-                       set {
-                               adapter = value;
-                       }
-               }
-
-
-               #endregion // Properties
-
-               #region Methods
-
-               protected override void ApplyParameterInfo (DbParameter parameter,
-                                                                   DataRow datarow,
-                                                                   StatementType statementType,
-                                                                   bool whereClause)
-               {
-                       OleDbParameter p = (OleDbParameter) parameter;
-                       p.Size = int.Parse (datarow ["ColumnSize"].ToString ());
-                       if (datarow ["NumericPrecision"] != DBNull.Value) {
-                               p.Precision = byte.Parse (datarow ["NumericPrecision"].ToString ());
-                       }
-                       if (datarow ["NumericScale"] != DBNull.Value) {
-                               p.Scale = byte.Parse (datarow ["NumericScale"].ToString ());
-                       }
-                       p.DbType = (DbType) datarow ["ProviderType"];
-               }
-
-               [MonoTODO]
-               public static void DeriveParameters (OleDbCommand command)
-               {
-                       if (command.CommandType != CommandType.StoredProcedure) {
-                               throw new InvalidOperationException ("You can perform this " +
-                                                                            "operation only on CommandTye" + 
-                                                                            " StoredProcedure");
-                       }
-                       // FIXME: Retrive info from server
-                       throw new NotImplementedException ();
-               }
-
-
-               [MonoTODO]
-               public new OleDbCommand GetDeleteCommand ()
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               public new OleDbCommand GetDeleteCommand (bool useColumnsForParameterNames)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               public new OleDbCommand GetInsertCommand ()
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               public new OleDbCommand GetInsertCommand (bool useColumnsForParameterNames)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               protected override string GetParameterName (int parameterOrdinal)
-               {
-                       return String.Format("@p{0}", parameterOrdinal);
-               }
-
-               protected override string GetParameterName (string parameterName)
-               {
-                       return String.Format("@{0}", parameterName);                       
-               }
-                
-               protected override string GetParameterPlaceholder (int parameterOrdinal)
-               {
-                       return GetParameterName (parameterOrdinal);
-               }
-                
-
-               [MonoTODO]
-               public new OleDbCommand GetUpdateCommand ()
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               public new OleDbCommand GetUpdateCommand (bool useColumnsForParameterNames)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               public override string QuoteIdentifier(string unquotedIdentifier)
-               {
-                       return base.QuoteIdentifier (unquotedIdentifier);
-               }
-
-               [MonoTODO]
-               public string QuoteIdentifier(string unquotedIdentifier, OleDbConnection connection)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               protected override void SetRowUpdatingHandler(DbDataAdapter adapter)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               public override string UnquoteIdentifier(string quotedIdentifier)
-               {
-                       return base.UnquoteIdentifier (quotedIdentifier);
-               }
-
-               [MonoTODO]
-               public string UnquoteIdentifier(string quotedIdentifier, OleDbConnection connection)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               #endregion // Methods
-       }
-}
diff --git a/mcs/class/System.Data/System.Data.OleDb/OleDbConnection.cs b/mcs/class/System.Data/System.Data.OleDb/OleDbConnection.cs
deleted file mode 100644 (file)
index eb22eae..0000000
+++ /dev/null
@@ -1,344 +0,0 @@
-//
-// System.Data.OleDb.OleDbConnection
-//
-// Authors:
-//   Rodrigo Moya (rodrigo@ximian.com)
-//   Tim Coleman (tim@timcoleman.com)
-//
-// Copyright (C) Rodrigo Moya, 2002
-// Copyright (C) Tim Coleman, 2002
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.ComponentModel;
-using System.Data;
-using System.Data.Common;
-using System.EnterpriseServices;
-using System.Transactions;
-
-namespace System.Data.OleDb
-{
-       [DefaultEvent ("InfoMessage")]
-       public sealed class OleDbConnection : DbConnection, ICloneable
-       {
-               #region Fields
-
-               string connectionString;
-               int connectionTimeout;
-               IntPtr gdaConnection;
-
-               #endregion
-
-               #region Constructors
-               
-               public OleDbConnection ()
-               {
-                       gdaConnection = IntPtr.Zero;
-                       connectionTimeout = 15;
-               }
-
-               public OleDbConnection (string connectionString) : this ()
-               {
-                       this.connectionString = connectionString;
-               }
-
-               #endregion // Constructors
-
-               #region Properties
-               
-               [DataCategory ("Data")]
-               [DefaultValue ("")]
-               [EditorAttribute ("Microsoft.VSDesigner.Data.ADO.Design.OleDbConnectionStringEditor, "+ Consts.AssemblyMicrosoft_VSDesigner, "System.Drawing.Design.UITypeEditor, "+ Consts.AssemblySystem_Drawing )]
-               [RecommendedAsConfigurable (true)]
-               [RefreshPropertiesAttribute (RefreshProperties.All)]
-               public override string ConnectionString {
-                       get {
-                               if (connectionString == null)
-                                       return string.Empty;
-                               return connectionString;
-                       }
-                       set {
-                               connectionString = value;
-                       }
-               }
-
-               [DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Hidden)]
-               public override int ConnectionTimeout {
-                       get {
-                               return connectionTimeout;
-                       }
-               }
-
-               [DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Hidden)]
-               public override 
-               string Database {
-                       get {
-                               if (gdaConnection != IntPtr.Zero
-                                       && libgda.gda_connection_is_open (gdaConnection)) {
-                                       return libgda.gda_connection_get_database (gdaConnection);
-                               }
-
-                               return string.Empty;
-                       }
-               }
-
-               [BrowsableAttribute (true)]
-               public override string DataSource {
-                       get {
-                               if (gdaConnection != IntPtr.Zero
-                                       && libgda.gda_connection_is_open (gdaConnection)) {
-                                       return libgda.gda_connection_get_dsn (gdaConnection);
-                               }
-
-                               return string.Empty;
-                       }
-               }
-
-               [DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Hidden)]
-               [BrowsableAttribute (true)]
-               public string Provider {
-                       get {
-                               if (gdaConnection != IntPtr.Zero
-                                       && libgda.gda_connection_is_open (gdaConnection)) {
-                                       return libgda.gda_connection_get_provider (gdaConnection);
-                               }
-
-                               return string.Empty;
-                       }
-               }
-
-               public override string ServerVersion {
-                       get {
-                               if (State == ConnectionState.Closed)
-                                       throw ExceptionHelper.ConnectionClosed ();
-                               return libgda.gda_connection_get_server_version (gdaConnection);
-                       }
-               }
-
-               [DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Hidden)]
-               [BrowsableAttribute (false)]
-               public override ConnectionState State {
-                       get {
-                               if (gdaConnection != IntPtr.Zero) {
-                                       if (libgda.gda_connection_is_open (gdaConnection))
-                                               return ConnectionState.Open;
-                               }
-
-                               return ConnectionState.Closed;
-                       }
-               }
-
-               internal IntPtr GdaConnection {
-                       get {
-                               return gdaConnection;
-                       }
-               }
-               
-               #endregion // Properties
-       
-               #region Methods
-       
-               public new OleDbTransaction BeginTransaction ()
-               {
-                       if (State == ConnectionState.Closed)
-                               throw ExceptionHelper.ConnectionClosed ();
-                       return new OleDbTransaction (this);
-               }
-
-               public new OleDbTransaction BeginTransaction (IsolationLevel isolationLevel)
-               {
-                       if (State == ConnectionState.Closed)
-                               throw ExceptionHelper.ConnectionClosed ();
-                       return new OleDbTransaction (this, isolationLevel);
-               }
-
-               protected override DbTransaction BeginDbTransaction(IsolationLevel isolationLevel)
-               {
-                       return BeginTransaction (isolationLevel);
-               }
-
-               protected override DbCommand CreateDbCommand()
-               {
-                       return CreateCommand ();
-               }
-
-               public override void ChangeDatabase (string value)
-               {
-                       if (State != ConnectionState.Open)
-                               throw new InvalidOperationException ();
-
-                       if (!libgda.gda_connection_change_database (gdaConnection, value))
-                               throw new OleDbException (this);
-               }
-
-               public override void Close ()
-               {
-                       if (State == ConnectionState.Open) {
-                               libgda.gda_connection_close (gdaConnection);
-                               gdaConnection = IntPtr.Zero;
-                       }
-               }
-
-               public new OleDbCommand CreateCommand ()
-               {
-                       if (State == ConnectionState.Open)
-                               return new OleDbCommand (null, this);
-
-                       return null;
-               }
-
-               [MonoTODO]
-               protected override void Dispose (bool disposing)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               public DataTable GetOleDbSchemaTable (Guid schema, object[] restrictions)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               object ICloneable.Clone ()
-               {
-                       throw new NotImplementedException();
-               }
-
-               public
-               override
-               void Open ()
-               {
-//                     string provider = "Default";
-//                     string gdaCncStr = string.Empty;
-//                     string[] args;
-//                     int len;
-//                     char [] separator = { ';' };
-                       
-                       if (State == ConnectionState.Open)
-                               throw new InvalidOperationException ();
-
-                       libgda.gda_init ("System.Data.OleDb", "1.0", 0, new string [0]);
-
-                       gdaConnection = libgda.gda_client_open_connection (libgda.GdaClient,
-                               ConnectionString, string.Empty, string.Empty, 0);
-
-                       if (gdaConnection == IntPtr.Zero)
-                               throw new OleDbException (this);
-                       /* convert the connection string to its GDA equivalent */
-                       //args = connectionString.Split (';');
-                       //len = args.Length;
-                       //for (int i = 0; i < len; i++) {
-                       //      string[] values = args[i].Split (separator, 2);
-                       //      if (values[0] == "Provider") {
-                       //              if (values[1] == "SQLOLEDB")
-                       //                      provider = "FreeTDS";
-                       //              else if (values[1] == "MSDAORA")
-                       //                      provider = "Oracle";
-                       //              else if (values[2] == "Microsoft.Jet.OLEDB.4.0")
-                       //                      provider = "MS Access";
-                       //              else
-                       //                      provider = values[2];
-                       //      }
-                       //      else if (values[0] == "Addr" || values[0] == "Address")
-                       //              gdaCncStr = String.Concat (gdaCncStr, "HOST=", values[1], ";");
-                       //      else if (values[0] == "Database")
-                       //              gdaCncStr = String.Concat (gdaCncStr, "DATABASE=", values[1], ";");
-                       //      else if (values[0] == "Connection Lifetime")
-                       //              connectionTimeout = System.Convert.ToInt32 (values[1]);
-                       //      else if (values[0] == "File Name")
-                       //              gdaCncStr = String.Concat (gdaCncStr, "FILENAME=", values[1], ";");
-                       //      else if (values[0] == "Password" || values[0] == "Pwd")
-                       //              gdaCncStr = String.Concat (gdaCncStr, "PASSWORD=", values[1], ";");
-                       //      else if (values[0] == "User ID")
-                       //              gdaCncStr = String.Concat (gdaCncStr, "USERNAME=", values[1], ";");
-                       //}
-
-                       /* open the connection */
-                       //System.Console.WriteLine ("Opening connection for provider " +
-                       //                provider + " with " + gdaCncStr);
-                       //gdaConnection = libgda.gda_client_open_connection_from_string (libgda.GdaClient,
-                       //                                                             provider,
-                       //                                                             gdaCncStr);
-               }
-
-               [MonoTODO]
-               public static void ReleaseObjectPool ()
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               public void EnlistDistributedTransaction (ITransaction transaction)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               public override void EnlistTransaction (Transaction transaction)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               public override DataTable GetSchema ()
-               {
-                       if (State == ConnectionState.Closed)
-                               throw ExceptionHelper.ConnectionClosed ();
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               public override DataTable GetSchema(string collectionName)
-               {
-                       return GetSchema (collectionName, null);
-               }
-
-               [MonoTODO]
-               public override DataTable GetSchema (String collectionName, string [] restrictionValues)
-               {
-                       if (State == ConnectionState.Closed)
-                               throw ExceptionHelper.ConnectionClosed ();
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               [EditorBrowsable (EditorBrowsableState.Advanced)]
-               public void ResetState ()
-               {
-                       throw new NotImplementedException ();
-               }
-
-               #endregion
-
-               #region Events and Delegates
-
-               [DataCategory ("DataCategory_InfoMessage")]
-               public event OleDbInfoMessageEventHandler InfoMessage;
-
-
-               #endregion
-       }
-}
diff --git a/mcs/class/System.Data/System.Data.OleDb/OleDbDataAdapter.cs b/mcs/class/System.Data/System.Data.OleDb/OleDbDataAdapter.cs
deleted file mode 100644 (file)
index 4cbcc58..0000000
+++ /dev/null
@@ -1,213 +0,0 @@
-//
-// System.Data.OleDb.OleDbDataAdapter
-//
-// Authors:
-//   Rodrigo Moya (rodrigo@ximian.com)
-//   Tim Coleman (tim@timcoleman.com)
-//
-// Copyright (C) Rodrigo Moya, 2002
-// Copyright (C) Tim Coleman, 2002
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.ComponentModel;
-using System.Data;
-using System.Data.Common;
-
-namespace System.Data.OleDb
-{
-       [DefaultEvent ("RowUpdated")]
-       [DesignerAttribute ("Microsoft.VSDesigner.Data.VS.OleDbDataAdapterDesigner, "+ Consts.AssemblyMicrosoft_VSDesigner, "System.ComponentModel.Design.IDesigner")]
-       [ToolboxItemAttribute ("Microsoft.VSDesigner.Data.VS.OleDbDataAdapterToolboxItem, "+ Consts.AssemblyMicrosoft_VSDesigner)]
-       public sealed class OleDbDataAdapter : DbDataAdapter, IDbDataAdapter, ICloneable
-       {
-               #region Fields
-
-               OleDbCommand deleteCommand;
-               OleDbCommand insertCommand;
-               OleDbCommand selectCommand;
-               OleDbCommand updateCommand;
-
-               #endregion
-
-               #region Constructors
-
-               public OleDbDataAdapter () : this ((OleDbCommand) null)
-               {
-               }
-
-               public OleDbDataAdapter (OleDbCommand selectCommand)
-               {
-                       SelectCommand = selectCommand;
-               }
-
-               public OleDbDataAdapter (string selectCommandText, OleDbConnection selectConnection)
-                       : this (new OleDbCommand (selectCommandText, selectConnection))
-               {
-               }
-
-               public OleDbDataAdapter (string selectCommandText, string selectConnectionString)
-                       : this (selectCommandText, new OleDbConnection (selectConnectionString))
-               {
-               }
-
-               #endregion // Fields
-
-               #region Properties
-               
-               [DefaultValue (null)]
-               [DataCategory ("Update")]
-               [EditorAttribute ("Microsoft.VSDesigner.Data.Design.DBCommandEditor, "+ Consts.AssemblyMicrosoft_VSDesigner, "System.Drawing.Design.UITypeEditor, "+ Consts.AssemblySystem_Drawing)]
-               public new OleDbCommand DeleteCommand {
-                       get {
-                               return deleteCommand;
-                       }
-                       set {
-                               deleteCommand = value;
-                       }
-               }
-
-               [DefaultValue (null)]
-               [DataCategory ("Update")]
-               [EditorAttribute ("Microsoft.VSDesigner.Data.Design.DBCommandEditor, "+ Consts.AssemblyMicrosoft_VSDesigner, "System.Drawing.Design.UITypeEditor, "+ Consts.AssemblySystem_Drawing)]
-               public new OleDbCommand InsertCommand {
-                       get {
-                               return insertCommand;
-                       }
-                       set {
-                               insertCommand = value;
-                       }
-               }
-
-               [DefaultValue (null)]
-               [DataCategory ("Fill")]
-               [EditorAttribute ("Microsoft.VSDesigner.Data.Design.DBCommandEditor, "+ Consts.AssemblyMicrosoft_VSDesigner, "System.Drawing.Design.UITypeEditor, "+ Consts.AssemblySystem_Drawing)]
-               public new OleDbCommand SelectCommand {
-                       get {
-                               return selectCommand;
-                       }
-                       set {
-                               selectCommand = value;
-                       }
-               }
-
-               [DefaultValue (null)]
-               [DataCategory ("Update")]
-               [EditorAttribute ("Microsoft.VSDesigner.Data.Design.DBCommandEditor, "+ Consts.AssemblyMicrosoft_VSDesigner, "System.Drawing.Design.UITypeEditor, "+ Consts.AssemblySystem_Drawing)]
-               public new OleDbCommand UpdateCommand {
-                       get { return updateCommand; }
-                       set { updateCommand = value; }
-               }
-
-               IDbCommand IDbDataAdapter.DeleteCommand {
-                       get { return DeleteCommand; }
-                       set { DeleteCommand = (OleDbCommand) value; }
-               }
-
-               IDbCommand IDbDataAdapter.InsertCommand {
-                       get { return InsertCommand; }
-                       set { InsertCommand = (OleDbCommand) value; }
-               }
-
-               IDbCommand IDbDataAdapter.SelectCommand {
-                       get {
-                               return SelectCommand;
-                       }
-                       set {
-                               SelectCommand = (OleDbCommand) value;
-                       }
-               }
-
-               IDbCommand IDbDataAdapter.UpdateCommand {
-                       get { return UpdateCommand; }
-                       set { UpdateCommand = (OleDbCommand) value; }
-               }
-
-               #endregion // Properties
-
-               #region Methods
-
-               protected override RowUpdatedEventArgs CreateRowUpdatedEvent (DataRow dataRow,
-                                                                             IDbCommand command,
-                                                                             StatementType statementType,
-                                                                             DataTableMapping tableMapping) 
-               {
-                       return new OleDbRowUpdatedEventArgs (dataRow, command, statementType, tableMapping);
-               }
-
-
-               protected override RowUpdatingEventArgs CreateRowUpdatingEvent (DataRow dataRow,
-                                                                               IDbCommand command,
-                                                                               StatementType statementType,
-                                                                               DataTableMapping tableMapping)
-               {
-                       return new OleDbRowUpdatingEventArgs (dataRow, command, statementType, tableMapping);
-               }
-
-               protected override void OnRowUpdated (RowUpdatedEventArgs value)
-               {
-                       if (RowUpdated != null)
-                               RowUpdated (this, (OleDbRowUpdatedEventArgs) value);
-               }
-
-               protected override void OnRowUpdating (RowUpdatingEventArgs value)
-               {
-                       if (RowUpdating != null)
-                               RowUpdating (this, (OleDbRowUpdatingEventArgs) value);
-               }
-               
-               [MonoTODO]
-               public int Fill (DataTable dataTable, Object ADODBRecordSet)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               public int Fill (DataSet dataSet, Object ADODBRecordSet, String srcTable)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               object ICloneable.Clone ()
-               {
-                       throw new NotImplementedException ();
-               }
-
-
-               #endregion // Methods
-
-               #region Events and Delegates
-
-               [DataCategory ("DataCategory_Update")]
-               public event OleDbRowUpdatedEventHandler RowUpdated;
-
-               [DataCategory ("DataCategory_Update")]
-               public event OleDbRowUpdatingEventHandler RowUpdating;
-
-               #endregion // Events and Delegates
-       }
-}
diff --git a/mcs/class/System.Data/System.Data.OleDb/OleDbDataReader.cs b/mcs/class/System.Data/System.Data.OleDb/OleDbDataReader.cs
deleted file mode 100644 (file)
index 7d4624f..0000000
+++ /dev/null
@@ -1,774 +0,0 @@
-//
-// System.Data.OleDb.OleDbDataReader
-//
-// Author:
-//   Rodrigo Moya (rodrigo@ximian.com)
-//   Tim Coleman (tim@timcoleman.com)
-//
-// Copyright (C) Rodrigo Moya, 2002
-// Copyright (C) Tim Coleman, 2002
-// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Collections;
-using System.ComponentModel;
-using System.Data.Common;
-using System.Runtime.InteropServices;
-
-namespace System.Data.OleDb
-{
-       public sealed class OleDbDataReader : DbDataReader, IDisposable
-       {
-               #region Fields
-               
-               private OleDbCommand command;
-               private bool open;
-               private ArrayList gdaResults;
-               private int currentResult;
-               private int currentRow;
-               private bool disposed;
-
-               #endregion
-
-               #region Constructors
-
-               internal OleDbDataReader (OleDbCommand command, ArrayList results) 
-               {
-                       this.command = command;
-                       open = true;
-                       if (results != null)
-                               gdaResults = results;
-                       else
-                               gdaResults = new ArrayList ();
-                       currentResult = -1;
-                       currentRow = -1;
-               }
-
-               #endregion
-
-               #region Properties
-
-               public
-               override
-               int Depth {
-                       get {
-                               return 0; // no nested selects supported
-                       }
-               }
-
-               public
-               override
-               int FieldCount {
-                       get {
-                               if (currentResult < 0 || currentResult >= gdaResults.Count)
-                                       return 0;
-
-                               return libgda.gda_data_model_get_n_columns (
-                                       (IntPtr) gdaResults[currentResult]);
-                       }
-               }
-
-               public
-               override
-               bool IsClosed {
-                       get {
-                               return !open;
-                       }
-               }
-
-               public
-               override
-               object this[string name] {
-                       get {
-                               int pos;
-
-                               if (currentResult == -1)
-                                       throw new InvalidOperationException ();
-
-                               pos = libgda.gda_data_model_get_column_position (
-                                       (IntPtr) gdaResults[currentResult],
-                                       name);
-                               if (pos == -1)
-                                       throw new IndexOutOfRangeException ();
-
-                               return this[pos];
-                       }
-               }
-
-               public
-               override
-               object this[int index] {
-                       get {
-                               return (object) GetValue (index);
-                       }
-               }
-
-               public
-               override
-               int RecordsAffected {
-                       get {
-                               int total_rows;
-                               
-                               if (currentResult < 0 || currentResult >= gdaResults.Count)
-                                       return 0;
-
-                               total_rows = libgda.gda_data_model_get_n_rows (
-                                       (IntPtr) gdaResults[currentResult]);
-                               if (total_rows > 0) {
-                                       if (FieldCount > 0) {
-                                               // It's a SELECT statement
-                                               return -1;
-                                       }
-                               }
-
-                               return FieldCount > 0 ? -1 : total_rows;
-                       }
-               }
-               
-               [MonoTODO]
-               public
-               override
-               bool HasRows {
-                       get {
-                               throw new NotImplementedException ();
-                       }
-               }
-
-               [MonoTODO]
-               public override int VisibleFieldCount {
-                       get {
-                               throw new NotImplementedException ();
-                       }
-               }
-
-               #endregion
-
-               #region Methods
-
-               public
-               override
-               void Close ()
-               {
-                       for (int i = 0; i < gdaResults.Count; i++) {
-                               IntPtr obj = (IntPtr) gdaResults[i];
-                               libgda.FreeObject (obj);
-                       }
-
-                       gdaResults.Clear ();
-                       gdaResults = null;
-                       
-                       open = false;
-                       currentResult = -1;
-                       currentRow = -1;
-               }
-
-               public
-               override
-               bool GetBoolean (int ordinal)
-               {
-                       IntPtr value;
-
-                       if (currentResult == -1)
-                               throw new InvalidCastException ();
-
-                       value = libgda.gda_data_model_get_value_at ((IntPtr) gdaResults[currentResult],
-                                                                   ordinal, currentRow);
-                       if (value == IntPtr.Zero)
-                               throw new InvalidCastException ();
-                       
-                       if (libgda.gda_value_get_type (value) != GdaValueType.Boolean)
-                               throw new InvalidCastException ();
-                       return libgda.gda_value_get_boolean (value);
-               }
-
-               public
-               override
-               byte GetByte (int ordinal)
-               {
-                       IntPtr value;
-
-                       if (currentResult == -1)
-                               throw new InvalidCastException ();
-
-                       value = libgda.gda_data_model_get_value_at ((IntPtr) gdaResults[currentResult],
-                                                                   ordinal, currentRow);
-                       if (value == IntPtr.Zero)
-                               throw new InvalidCastException ();
-                       
-                       if (libgda.gda_value_get_type (value) != GdaValueType.Tinyint)
-                               throw new InvalidCastException ();
-                       return libgda.gda_value_get_tinyint (value);
-               }
-
-               [MonoTODO]
-               public
-               override
-               long GetBytes (int ordinal, long dataIndex, byte[] buffer, int bufferIndex, int length)
-               {
-                       throw new NotImplementedException ();
-               }
-               
-               [EditorBrowsableAttribute (EditorBrowsableState.Never)]
-               public
-               override
-               char GetChar (int ordinal)
-               {
-                       IntPtr value;
-
-                       if (currentResult == -1)
-                               throw new InvalidCastException ();
-
-                       value = libgda.gda_data_model_get_value_at ((IntPtr) gdaResults[currentResult],
-                               ordinal, currentRow);
-                       if (value == IntPtr.Zero)
-                               throw new InvalidCastException ();
-                       
-                       if (libgda.gda_value_get_type (value) != GdaValueType.Tinyint)
-                               throw new InvalidCastException ();
-                       return (char) libgda.gda_value_get_tinyint (value);
-               }
-
-               [MonoTODO]
-               public
-               override
-               long GetChars (int ordinal, long dataIndex, char[] buffer, int bufferIndex, int length)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               [EditorBrowsable (EditorBrowsableState.Advanced)]
-               public new OleDbDataReader GetData (int ordinal)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               protected override DbDataReader GetDbDataReader (int ordinal)
-               {
-                       return this.GetData (ordinal);
-               }
-
-               public
-               override
-               string GetDataTypeName (int index)
-               {
-                       IntPtr attrs;
-                       GdaValueType type;
-
-                       if (currentResult == -1)
-                               return "unknown";
-
-                       
-                       attrs = libgda.gda_data_model_describe_column ((IntPtr) gdaResults[currentResult],
-                               index);
-                       if (attrs == IntPtr.Zero)
-                               return "unknown";
-
-                       type = libgda.gda_field_attributes_get_gdatype (attrs);
-                       libgda.gda_field_attributes_free (attrs);
-                       
-                       return libgda.gda_type_to_string (type);
-               }
-
-               public
-               override
-               DateTime GetDateTime (int ordinal)
-               {
-                       IntPtr value;
-
-                       if (currentResult == -1)
-                               throw new InvalidCastException ();
-
-                       value = libgda.gda_data_model_get_value_at ((IntPtr) gdaResults[currentResult],
-                               ordinal, currentRow);
-                       if (value == IntPtr.Zero)
-                               throw new InvalidCastException ();
-                       
-                       if (libgda.gda_value_get_type (value) == GdaValueType.Date) {
-                               GdaDate gdt;
-
-                               gdt = (GdaDate) Marshal.PtrToStructure (libgda.gda_value_get_date (value),
-                                                                       typeof (GdaDate));
-                               return new DateTime ((int) gdt.year, (int) gdt.month, (int) gdt.day);
-                       } else if (libgda.gda_value_get_type (value) == GdaValueType.Time) {
-                               GdaTime gdt;
-
-                               gdt = (GdaTime) Marshal.PtrToStructure (libgda.gda_value_get_time (value),
-                                                                       typeof (GdaTime));
-                               return new DateTime (0, 0, 0, (int) gdt.hour, (int) gdt.minute, (int) gdt.second, 0);
-                       } else if (libgda.gda_value_get_type (value) == GdaValueType.Timestamp) {
-                               GdaTimestamp gdt;
-                               
-                               gdt = (GdaTimestamp) Marshal.PtrToStructure (libgda.gda_value_get_timestamp (value),
-                                       typeof (GdaTimestamp));
-
-                               return new DateTime ((int) gdt.year, (int) gdt.month, (int) gdt.day,
-                                       (int) gdt.hour, (int) gdt.minute, (int) gdt.second,
-                                       (int) gdt.fraction);
-                       }
-
-                       throw new InvalidCastException ();
-               }
-
-               [MonoTODO]
-               public
-               override
-               decimal GetDecimal (int ordinal)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public
-               override
-               double GetDouble (int ordinal)
-               {
-                       IntPtr value;
-
-                       if (currentResult == -1)
-                               throw new InvalidCastException ();
-
-                       value = libgda.gda_data_model_get_value_at ((IntPtr) gdaResults[currentResult],
-                                                                   ordinal, currentRow);
-                       if (value == IntPtr.Zero)
-                               throw new InvalidCastException ();
-                       
-                       if (libgda.gda_value_get_type (value) != GdaValueType.Double)
-                               throw new InvalidCastException ();
-                       return libgda.gda_value_get_double (value);
-               }
-
-               public
-               override
-               Type GetFieldType (int index)
-               {
-                       IntPtr value;
-                       GdaValueType type;
-
-                       if (currentResult == -1)
-                               throw new IndexOutOfRangeException ();
-
-                       value = libgda.gda_data_model_get_value_at ((IntPtr) gdaResults[currentResult],
-                               index, currentRow);
-                       if (value == IntPtr.Zero)
-                               throw new IndexOutOfRangeException ();
-
-                       type = libgda.gda_value_get_type (value);
-                       switch (type) {
-                       case GdaValueType.Bigint : return typeof (long);
-                       case GdaValueType.Boolean : return typeof (bool);
-                       case GdaValueType.Date : return typeof (DateTime);
-                       case GdaValueType.Double : return typeof (double);
-                       case GdaValueType.Integer : return typeof (int);
-                       case GdaValueType.Single : return typeof (float);
-                       case GdaValueType.Smallint : return typeof (byte);
-                       case GdaValueType.String : return typeof (string);
-                       case GdaValueType.Time : return typeof (DateTime);
-                       case GdaValueType.Timestamp : return typeof (DateTime);
-                       case GdaValueType.Tinyint : return typeof (byte);
-                       }
-
-                       return typeof(string); // default
-               }
-
-               public
-               override
-               float GetFloat (int ordinal)
-               {
-                       IntPtr value;
-
-                       if (currentResult == -1)
-                               throw new InvalidCastException ();
-
-                       value = libgda.gda_data_model_get_value_at ((IntPtr) gdaResults[currentResult],
-                               ordinal, currentRow);
-                       if (value == IntPtr.Zero)
-                               throw new InvalidCastException ();
-                       
-                       if (libgda.gda_value_get_type (value) != GdaValueType.Single)
-                               throw new InvalidCastException ();
-                       return libgda.gda_value_get_single (value);
-               }
-
-               [MonoTODO]
-               public
-               override
-               Guid GetGuid (int ordinal)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public
-               override
-               short GetInt16 (int ordinal)
-               {
-                       IntPtr value;
-
-                       if (currentResult == -1)
-                               throw new InvalidCastException ();
-
-                       value = libgda.gda_data_model_get_value_at ((IntPtr) gdaResults[currentResult],
-                               ordinal, currentRow);
-                       if (value == IntPtr.Zero)
-                               throw new InvalidCastException ();
-                       
-                       if (libgda.gda_value_get_type (value) != GdaValueType.Smallint)
-                               throw new InvalidCastException ();
-                       return (short) libgda.gda_value_get_smallint (value);
-               }
-
-               public
-               override
-               int GetInt32 (int ordinal)
-               {
-                       IntPtr value;
-
-                       if (currentResult == -1)
-                               throw new InvalidCastException ();
-
-                       value = libgda.gda_data_model_get_value_at ((IntPtr) gdaResults[currentResult],
-                               ordinal, currentRow);
-                       if (value == IntPtr.Zero)
-                               throw new InvalidCastException ();
-                       
-                       if (libgda.gda_value_get_type (value) != GdaValueType.Integer)
-                               throw new InvalidCastException ();
-                       return libgda.gda_value_get_integer (value);
-               }
-
-               public
-               override
-               long GetInt64 (int ordinal)
-               {
-                       IntPtr value;
-
-                       if (currentResult == -1)
-                               throw new InvalidCastException ();
-
-                       value = libgda.gda_data_model_get_value_at ((IntPtr) gdaResults[currentResult],
-                               ordinal, currentRow);
-                       if (value == IntPtr.Zero)
-                               throw new InvalidCastException ();
-                       
-                       if (libgda.gda_value_get_type (value) != GdaValueType.Bigint)
-                               throw new InvalidCastException ();
-                       return libgda.gda_value_get_bigint (value);
-               }
-
-               public
-               override
-               string GetName (int index)
-               {
-                       if (currentResult == -1)
-                               return null;
-
-                       return libgda.gda_data_model_get_column_title (
-                               (IntPtr) gdaResults[currentResult], index);
-               }
-
-               public
-               override
-               int GetOrdinal (string name)
-               {
-                       if (currentResult == -1)
-                               throw new IndexOutOfRangeException ();
-
-                       for (int i = 0; i < FieldCount; i++) {
-                               if (GetName (i) == name)
-                                       return i;
-                       }
-
-                       throw new IndexOutOfRangeException ();
-               }
-
-               public
-               override
-               DataTable GetSchemaTable ()
-               {
-                       DataTable dataTableSchema = null;
-                       // Only Results from SQL SELECT Queries 
-                       // get a DataTable for schema of the result
-                       // otherwise, DataTable is null reference
-                       if(this.FieldCount > 0) {
-
-                               IntPtr attrs;
-                               GdaValueType gdaType;
-                               long columnSize = 0;
-
-                               if (currentResult == -1) {
-                                       // FIXME: throw an exception?
-#if DEBUG_OleDbDataReader
-                                       Console.WriteLine("Error: current result -1");
-#endif
-                                       return null;
-                               }
-                                               
-                               dataTableSchema = new DataTable ();
-                               
-                               dataTableSchema.Columns.Add ("ColumnName", typeof (string));
-                               dataTableSchema.Columns.Add ("ColumnOrdinal", typeof (int));
-                               dataTableSchema.Columns.Add ("ColumnSize", typeof (int));
-                               dataTableSchema.Columns.Add ("NumericPrecision", typeof (int));
-                               dataTableSchema.Columns.Add ("NumericScale", typeof (int));
-                               dataTableSchema.Columns.Add ("IsUnique", typeof (bool));
-                               dataTableSchema.Columns.Add ("IsKey", typeof (bool));
-                               DataColumn dc = dataTableSchema.Columns["IsKey"];
-                               dc.AllowDBNull = true; // IsKey can have a DBNull
-                               dataTableSchema.Columns.Add ("BaseCatalogName", typeof (string));
-                               dataTableSchema.Columns.Add ("BaseColumnName", typeof (string));
-                               dataTableSchema.Columns.Add ("BaseSchemaName", typeof (string));
-                               dataTableSchema.Columns.Add ("BaseTableName", typeof (string));
-                               dataTableSchema.Columns.Add ("DataType", typeof(Type));
-                               dataTableSchema.Columns.Add ("AllowDBNull", typeof (bool));
-                               dataTableSchema.Columns.Add ("ProviderType", typeof (int));
-                               dataTableSchema.Columns.Add ("IsAliased", typeof (bool));
-                               dataTableSchema.Columns.Add ("IsExpression", typeof (bool));
-                               dataTableSchema.Columns.Add ("IsIdentity", typeof (bool));
-                               dataTableSchema.Columns.Add ("IsAutoIncrement", typeof (bool));
-                               dataTableSchema.Columns.Add ("IsRowVersion", typeof (bool));
-                               dataTableSchema.Columns.Add ("IsHidden", typeof (bool));
-                               dataTableSchema.Columns.Add ("IsLong", typeof (bool));
-                               dataTableSchema.Columns.Add ("IsReadOnly", typeof (bool));
-
-                               DataRow schemaRow;
-
-                               for (int i = 0; i < this.FieldCount; i += 1 ) {
-                                       
-                                       schemaRow = dataTableSchema.NewRow ();
-
-                                       attrs = libgda.gda_data_model_describe_column ((IntPtr) gdaResults[currentResult],
-                                               i);
-                                       if (attrs == IntPtr.Zero){
-                                               // FIXME: throw exception
-#if DEBUG_OleDbDataReader
-                                               Console.WriteLine("Error: attrs null");
-#endif
-                                               return null;
-                                       }
-
-                                       gdaType = libgda.gda_field_attributes_get_gdatype (attrs);
-                                       columnSize = libgda.gda_field_attributes_get_defined_size (attrs);
-                                       libgda.gda_field_attributes_free (attrs);
-                                       
-                                       schemaRow["ColumnName"] = this.GetName(i);
-                                       schemaRow["ColumnOrdinal"] = i + 1;
-                                       
-                                       schemaRow["ColumnSize"] = (int) columnSize;
-                                       schemaRow["NumericPrecision"] = 0;
-                                       schemaRow["NumericScale"] = 0;
-                                       // TODO: need to get KeyInfo
-                                       //if((cmdBehavior & CommandBehavior.KeyInfo) == CommandBehavior.KeyInfo) {
-                                               // bool IsUnique, IsKey;
-                                               // GetKeyInfo(field[i].Name, out IsUnique, out IsKey);
-                                       //}
-                                       //else {
-                                               schemaRow["IsUnique"] = false;
-                                               schemaRow["IsKey"] = DBNull.Value;
-                                       //}
-                                       schemaRow["BaseCatalogName"] = "";
-                                       
-                                       schemaRow["BaseColumnName"] = this.GetName(i);
-                                       schemaRow["BaseSchemaName"] = "";
-                                       schemaRow["BaseTableName"] = "";
-
-                                       schemaRow["DataType"] = this.GetFieldType(i);
-
-                                       schemaRow["AllowDBNull"] = false;
-                                       
-                                       schemaRow["ProviderType"] = (int) gdaType;
-                                       schemaRow["IsAliased"] = false;
-                                       schemaRow["IsExpression"] = false;
-                                       schemaRow["IsIdentity"] = false;
-                                       schemaRow["IsAutoIncrement"] = false;
-                                       schemaRow["IsRowVersion"] = false;
-                                       schemaRow["IsHidden"] = false;
-                                       schemaRow["IsLong"] = false;
-                                       schemaRow["IsReadOnly"] = false;
-                                       
-                                       schemaRow.AcceptChanges();
-                                       
-                                       dataTableSchema.Rows.Add (schemaRow);
-                               }
-                               
-#if DEBUG_OleDbDataReader
-                               Console.WriteLine("********** DEBUG Table Schema BEGIN ************");
-                               foreach (DataRow myRow in dataTableSchema.Rows) {
-                                       foreach (DataColumn myCol in dataTableSchema.Columns)
-                                               Console.WriteLine(myCol.ColumnName + " = " + myRow[myCol]);
-                                       Console.WriteLine();
-                               }
-                               Console.WriteLine("********** DEBUG Table Schema END ************");
-#endif // DEBUG_OleDbDataReader
-
-                       }
-                       
-                       return dataTableSchema;
-               }
-
-               public
-               override
-               string GetString (int ordinal)
-               {
-                       IntPtr value;
-
-                       if (currentResult == -1)
-                               throw new InvalidCastException ();
-
-                       value = libgda.gda_data_model_get_value_at ((IntPtr) gdaResults[currentResult],
-                               ordinal, currentRow);
-                       if (value == IntPtr.Zero)
-                               throw new InvalidCastException ();
-                       
-                       if (libgda.gda_value_get_type (value) != GdaValueType.String)
-                               throw new InvalidCastException ();
-                       return libgda.gda_value_get_string (value);
-               }
-
-               [MonoTODO]
-               public TimeSpan GetTimeSpan (int ordinal)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public
-               override
-               object GetValue (int ordinal)
-               {
-                       IntPtr value;
-                       GdaValueType type;
-
-                       if (currentResult == -1)
-                               throw new IndexOutOfRangeException ();
-
-                       value = libgda.gda_data_model_get_value_at ((IntPtr) gdaResults[currentResult],
-                               ordinal, currentRow);
-                       if (value == IntPtr.Zero)
-                               throw new IndexOutOfRangeException ();
-
-                       type = libgda.gda_value_get_type (value);
-                       switch (type) {
-                       case GdaValueType.Bigint : return GetInt64 (ordinal);
-                       case GdaValueType.Boolean : return GetBoolean (ordinal);
-                       case GdaValueType.Date : return GetDateTime (ordinal);
-                       case GdaValueType.Double : return GetDouble (ordinal);
-                       case GdaValueType.Integer : return GetInt32 (ordinal);
-                       case GdaValueType.Single : return GetFloat (ordinal);
-                       case GdaValueType.Smallint : return GetByte (ordinal);
-                       case GdaValueType.String : return GetString (ordinal);
-                       case GdaValueType.Time : return GetDateTime (ordinal);
-                       case GdaValueType.Timestamp : return GetDateTime (ordinal);
-                       case GdaValueType.Tinyint : return GetByte (ordinal);
-                       }
-
-                       return (object) libgda.gda_value_stringify (value);
-               }
-
-               [MonoTODO]
-               public
-               override
-               int GetValues (object[] values)
-               {
-                       throw new NotImplementedException ();
-               }
-
-
-               public override IEnumerator GetEnumerator()
-               {
-                       return new DbEnumerator(this);
-               }
-
-               public
-               override
-               bool IsDBNull (int ordinal)
-               {
-                       IntPtr value;
-
-                       if (currentResult == -1)
-                               throw new IndexOutOfRangeException ();
-
-                       value = libgda.gda_data_model_get_value_at ((IntPtr) gdaResults[currentResult],
-                               ordinal, currentRow);
-                       if (value == IntPtr.Zero)
-                               throw new IndexOutOfRangeException ();
-
-                       return libgda.gda_value_is_null (value);
-               }
-
-               public
-               override
-               bool NextResult ()
-               {
-                       int i = currentResult + 1;
-                       if (i >= 0 && i < gdaResults.Count) {
-                               currentResult++;
-                               return true;
-                       }
-
-                       return false;
-               }
-
-               public
-               override
-               bool Read ()
-               {
-                       if (currentResult < 0 || currentResult >= gdaResults.Count)
-                               return false;
-
-                       currentRow++;
-                       if (currentRow < libgda.gda_data_model_get_n_rows ((IntPtr) gdaResults[currentResult]))
-                               return true;
-
-                       return false;
-               }
-
-               #endregion
-
-               #region Destructors
-
-               private new void Dispose (bool disposing)
-               {
-                       if (!this.disposed) {
-                               if (disposing) {
-                                       // release any managed resources
-                                       command = null;
-                                       GC.SuppressFinalize (this);
-                               }
-                               // release any unmanaged resources
-                               if (gdaResults != null) {
-                                       gdaResults.Clear ();
-                                       gdaResults = null;
-                               }
-
-                               // close any handles
-                               if (open)
-                                       Close ();
-
-                               this.disposed = true;
-                       }
-               }
-
-               void IDisposable.Dispose() {
-                       Dispose (true);
-               }
-
-               #endregion // Destructors
-       }
-}
diff --git a/mcs/class/System.Data/System.Data.OleDb/OleDbError.cs b/mcs/class/System.Data/System.Data.OleDb/OleDbError.cs
deleted file mode 100644 (file)
index 9f2dbdf..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-//
-// System.Data.OleDb.OleDbError
-//
-// Authors:
-//   Rodrigo Moya (rodrigo@ximian.com)
-//   Tim Coleman (tim@timcoleman.com)
-//
-// Copyright (C) Rodrigo Moya, 2002
-// Copyright (C) Tim Coleman, 2002
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Data;
-using System.Data.Common;
-
-namespace System.Data.OleDb
-{
-       [Serializable]
-       public sealed class OleDbError
-       {
-               private string message;
-               private int nativeError;
-               private string source;
-               private string sqlState;
-
-               #region Constructors
-
-               internal OleDbError (string msg, int code, string source, string sql)
-               {
-                       message = msg;
-                       nativeError = code;
-                       this.source = source;
-                       sqlState = sql;
-               }
-               
-               #endregion // Constructors
-               
-               #region Properties
-
-               public string Message {
-                       get {
-                               return message;
-                       }
-               }
-
-               public int NativeError {
-                       get {
-                               return nativeError;
-                       }
-               }
-
-               public string Source {
-                       get {
-                               return source;
-                       }
-               }
-
-               public string SQLState {
-                       get {
-                               return sqlState;
-                       }
-               }
-
-               #endregion
-
-               #region Methods
-               
-               [MonoTODO]
-               public override string ToString ()
-               {
-                       string toStr;
-                       String stackTrace = " <Stack Trace>";
-                       // FIXME: generate the correct SQL error string
-                       toStr = "OleDbError:" + message + stackTrace;
-                       return toStr;
-               }
-
-               #endregion
-       }
-}
diff --git a/mcs/class/System.Data/System.Data.OleDb/OleDbErrorCollection.cs b/mcs/class/System.Data/System.Data.OleDb/OleDbErrorCollection.cs
deleted file mode 100644 (file)
index 1099eb6..0000000
+++ /dev/null
@@ -1,121 +0,0 @@
-//
-// System.Data.OleDb.OleDbErrorCollection
-//
-// Authors:
-//   Rodrigo Moya (rodrigo@ximian.com)
-//   Tim Coleman (tim@timcoleman.com)
-//
-// Copyright (C) Rodrigo Moya, 2002
-// Copyright (C) Tim Coleman, 2002
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Collections;
-using System.ComponentModel;
-using System.Data;
-using System.Data.Common;
-
-namespace System.Data.OleDb
-{
-       [ListBindableAttribute ( false)]
-       [Serializable]
-       public sealed class OleDbErrorCollection : ICollection, IEnumerable
-       {
-               #region Fields
-
-               ArrayList items;
-       
-               #endregion // Fields
-
-               #region Constructors
-
-               internal OleDbErrorCollection() {
-               }
-
-               #endregion Constructors
-
-               #region Properties 
-
-               public int Count {
-                       get {
-                               return items.Count;
-                       }
-               }
-
-               public OleDbError this[int index] {
-                       get {
-                               return (OleDbError) items[index];
-                       }
-               }
-
-               object ICollection.SyncRoot {
-                       get {
-                               return items.SyncRoot;
-                       }
-               }
-
-               bool ICollection.IsSynchronized {
-                       get {
-                               return items.IsSynchronized;
-                       }
-               }
-
-               #endregion // Properties
-
-               #region Methods
-
-               internal void Add (OleDbError error)
-               {
-                       items.Add ((object) error);
-               }
-               
-               public void CopyTo (Array array, int index) 
-               {
-                       if (array == null)
-                               throw new ArgumentNullException("array");
-
-                       if ((index < array.GetLowerBound (0)) || (index > array.GetUpperBound (0)))
-                               throw new ArgumentOutOfRangeException("index");
-
-                       // is the check for IsFixedSize required?
-                       if ((array.IsFixedSize) || (index + this.Count > array.GetUpperBound (0)))
-                               throw new ArgumentException("array");
-
-                       ((OleDbError[]) (items.ToArray ())).CopyTo (array, index);
-               }
-
-               public void CopyTo (OleDbError [] array, int index)
-               {
-                       items.CopyTo (array, index);
-               }
-
-               public IEnumerator GetEnumerator ()
-               {
-                       return items.GetEnumerator ();
-               }
-
-               #endregion // Methods
-       }
-}
diff --git a/mcs/class/System.Data/System.Data.OleDb/OleDbException.cs b/mcs/class/System.Data/System.Data.OleDb/OleDbException.cs
deleted file mode 100644 (file)
index bffd853..0000000
+++ /dev/null
@@ -1,162 +0,0 @@
-//
-// System.Data.OleDb.OleDbException
-//
-// Author:
-//   Rodrigo Moya (rodrigo@ximian.com)
-//   Tim Coleman (tim@timcoleman.com)
-//
-// Copyright (C) Rodrigo Moya, 2002
-// Copyright (C) Tim Coleman, 2002
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.ComponentModel;
-using System.Data;
-using System.Data.Common;
-using System.Globalization;
-using System.Runtime.InteropServices;
-using System.Runtime.Serialization;
-
-namespace System.Data.OleDb
-{
-       [Serializable]
-       public sealed class OleDbException : DbException
-       {
-               private OleDbConnection connection;
-
-               #region Constructors
-
-               internal OleDbException (OleDbConnection cnc)
-               {
-                       connection = cnc;
-               }
-               
-               #endregion // Constructors
-               
-               #region Properties
-
-               [TypeConverterAttribute (typeof (OleDbException.ErrorCodeConverter))]
-               public override int ErrorCode {
-                       get {
-                               GdaList glist;
-                               IntPtr errors;
-
-                               errors = libgda.gda_connection_get_errors (connection.GdaConnection);
-                               if (errors != IntPtr.Zero) {
-                                       glist = (GdaList) Marshal.PtrToStructure (errors, typeof (GdaList));
-                                       return (int) libgda.gda_error_get_number (glist.data);
-                               }
-
-                               return -1;
-                       }
-               }
-               
-               [DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Content)]
-               public OleDbErrorCollection Errors {
-                       get {
-                               GdaList glist;
-                               IntPtr errors;
-                               OleDbErrorCollection col = new OleDbErrorCollection ();
-                               
-                               errors = libgda.gda_connection_get_errors (connection.GdaConnection);
-                               if (errors != IntPtr.Zero) {
-                                       glist = (GdaList) Marshal.PtrToStructure (errors, typeof (GdaList));
-                                       while (glist != null) {
-                                               col.Add (new OleDbError (
-                                                                libgda.gda_error_get_description (glist.data),
-                                                                (int) libgda.gda_error_get_number (glist.data),
-                                                                libgda.gda_error_get_source (glist.data),
-                                                                libgda.gda_error_get_sqlstate (glist.data)));
-                                               glist = (GdaList) Marshal.PtrToStructure (glist.next,
-                                                                                         typeof (GdaList));
-                                       }
-                               }
-
-                               return col;
-                       }
-               }
-
-               new public string Message {
-                       get {
-                               GdaList glist;
-                               IntPtr errors;
-                               string msg = "";
-
-                               errors = libgda.gda_connection_get_errors (connection.GdaConnection);
-                               if (errors != IntPtr.Zero) {
-                                       glist = (GdaList) Marshal.PtrToStructure (errors, typeof (GdaList));
-                                       while (glist != null) {
-                                               msg = msg + ";" +  libgda.gda_error_get_description (glist.data);
-                                               glist = (GdaList) Marshal.PtrToStructure (glist.next,
-                                                                                         typeof (GdaList));
-                                       }
-
-                                       return msg;
-                               }
-
-                               return null;
-                       }
-               }
-
-               new public string Source {
-                       get {
-                               GdaList glist;
-                               IntPtr errors;
-
-                               errors = libgda.gda_connection_get_errors (connection.GdaConnection);
-                               if (errors != IntPtr.Zero) {
-                                       glist = (GdaList) Marshal.PtrToStructure (errors, typeof (GdaList));
-                                       return libgda.gda_error_get_source (glist.data);
-                               }
-
-                               return null;
-                       }
-               }
-
-               #endregion // Properties
-
-               #region Methods
-
-               public override void GetObjectData (SerializationInfo si, StreamingContext context)
-               {
-                       if (si == null)
-                               throw new ArgumentNullException ("si");
-
-                       si.AddValue ("connection", connection);
-                       base.GetObjectData (si, context);
-                       throw new NotImplementedException ();
-               }
-
-               #endregion // Methods
-
-               internal sealed class ErrorCodeConverter : Int32Converter
-               {
-                       [MonoTODO]
-                       public override object ConvertTo (ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) {
-                               return base.ConvertTo (context, culture, value, destinationType);
-                       }
-               }
-       }
-}
diff --git a/mcs/class/System.Data/System.Data.OleDb/OleDbFactory.cs b/mcs/class/System.Data/System.Data.OleDb/OleDbFactory.cs
deleted file mode 100644 (file)
index 07e27d2..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-//
-// System.Data.oleDb.OleDbFactory
-//
-// Author:
-//     Gonzalo Paniagua (gonzalo@novell.com)
-//    
-// Copyright (C) 2009 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System.Data.Common;
-using System.Security;
-using System.Security.Permissions;
-
-namespace System.Data.OleDb {
-       public sealed class OleDbFactory : DbProviderFactory {
-               public static readonly OleDbFactory Instance = new OleDbFactory ();
-
-               private OleDbFactory()
-               {
-               }
-
-               public override DbCommand CreateCommand ()
-               {
-                       return new OleDbCommand ();
-               }
-
-               public override DbCommandBuilder CreateCommandBuilder ()
-               {
-                       return new OleDbCommandBuilder ();
-               }
-
-               public override DbConnection CreateConnection ()
-               {
-                       return new OleDbConnection ();
-               }
-
-               public override DbConnectionStringBuilder CreateConnectionStringBuilder ()
-               {
-                       //TODO: Once we have an OleDbConnectionStringBuilder implementation, comment the next line out
-                       //return new OleDbConnectionStringBuilder ();
-                       return null;
-               }
-
-               public override DbDataAdapter CreateDataAdapter ()
-               {
-                       return new OleDbDataAdapter ();
-               }
-
-               public override DbParameter CreateParameter ()
-               {
-                       return new OleDbParameter ();
-               }
-
-               public override CodeAccessPermission CreatePermission (PermissionState state)
-               {
-                       return new OleDbPermission (state);
-               }
-       }
-}
-
diff --git a/mcs/class/System.Data/System.Data.OleDb/OleDbInfoMessageEventArgs.cs b/mcs/class/System.Data/System.Data.OleDb/OleDbInfoMessageEventArgs.cs
deleted file mode 100644 (file)
index 6eed2eb..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-//
-// System.Data.OleDb.OleDbInfoMessageEventArgs
-//
-// Authors:
-//   Rodrigo Moya (rodrigo@ximian.com)
-//   Tim Coleman (tim@timcoleman.com)
-//
-// Copyright (C) Rodrigo Moya, 2002
-// Copyright (C) Tim Coleman, 2002
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Data;
-using System.Data.Common;
-
-namespace System.Data.OleDb
-{
-       public sealed class OleDbInfoMessageEventArgs : EventArgs
-       {
-               #region Constructors
-
-               internal OleDbInfoMessageEventArgs ()
-               {
-               }
-
-               #endregion Constructors
-
-               #region Properties
-
-               public int ErrorCode {
-                       [MonoTODO]
-                       get { throw new NotImplementedException (); }
-               }
-
-               public OleDbErrorCollection Errors {
-                       [MonoTODO]
-                       get { throw new NotImplementedException (); }
-               }
-
-               public string Message {
-                       [MonoTODO]
-                       get { throw new NotImplementedException (); }
-               }
-
-               public string Source {
-                       [MonoTODO]
-                       get { throw new NotImplementedException (); }
-               }
-
-               #endregion // Properties
-
-               #region Methods
-
-               [MonoTODO]
-               public override string ToString ()
-               {
-                       throw new NotImplementedException ();
-               }
-
-               #endregion // Methods
-       }
-}
diff --git a/mcs/class/System.Data/System.Data.OleDb/OleDbInfoMessageEventHandler.cs b/mcs/class/System.Data/System.Data.OleDb/OleDbInfoMessageEventHandler.cs
deleted file mode 100644 (file)
index c8bec34..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-//
-// System.Data.OleDb.OleDbInfoMessageEventHandler
-//
-// Author:
-//   Rodrigo Moya (rodrigo@ximian.com)
-//
-// Copyright (C) Rodrigo Moya, 2002
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Data;
-using System.Data.Common;
-
-namespace System.Data.OleDb
-{
-       public delegate void OleDbInfoMessageEventHandler (object sender, OleDbInfoMessageEventArgs e);
-}
diff --git a/mcs/class/System.Data/System.Data.OleDb/OleDbLiteral.cs b/mcs/class/System.Data/System.Data.OleDb/OleDbLiteral.cs
deleted file mode 100644 (file)
index 5f6d1db..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-//
-// System.Data.OleDb.OleDbLiteral
-//
-// Author:
-//   Rodrigo Moya (rodrigo@ximian.com)
-//
-// Copyright (C) Rodrigo Moya, 2002
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Data;
-using System.Data.Common;
-
-namespace System.Data.OleDb
-{
-       public enum OleDbLiteral {
-               Binary_Literal = 1,
-               Catalog_Name = 2,
-               Catalog_Separator = 3,
-               Char_Literal = 4,
-               Column_Alias = 5,
-               Column_Name = 6,
-               Correlation_Name = 7,
-               Cube_Name = 21,
-               Cursor_Name = 8,
-               Dimension_Name = 22,
-               Escape_Percent_Prefix = 9,
-               Escape_Percent_Suffix = 29,
-               Escape_Underscore_Prefix = 10,
-               Escape_Underscore_Suffix = 30,
-               Hierarchy_Name = 23,
-               Index_Name = 11,
-               Invalid = 0,
-               Level_Name = 24,
-               Like_Percent = 12,
-               Like_Underscore = 13,
-               Member_Name = 25,
-               Procedure_Name = 14,
-               Property_Name = 26,
-               Quote_Prefix = 15,
-               Quote_Suffix = 28,
-               Schema_Name = 16,
-               Schema_Separator = 27,
-               Table_Name = 17,
-               Text_Command = 18,
-               User_Name = 19,
-               View_Name = 20
-       }
-}
diff --git a/mcs/class/System.Data/System.Data.OleDb/OleDbMetaDataCollectionNames.cs b/mcs/class/System.Data/System.Data.OleDb/OleDbMetaDataCollectionNames.cs
deleted file mode 100644 (file)
index ec18726..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-//
-// System.Data.OleDb.OleDbMetaDataCollectionNames.cs
-//
-// Author:
-//   Ankit Jain <jankit@novell.com>
-//
-//
-// Copyright (C) 2008 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-namespace System.Data.OleDb
-{
-       /// <summary>
-       /// Collection names
-       /// </summary>
-       public static class OleDbMetaDataCollectionNames {
-               public static readonly string Catalogs = "Catalogs";
-               public static readonly string Collations = "Collations";
-               public static readonly string Columns = "Columns";
-               public static readonly string Indexes = "Indexes";
-               public static readonly string ProcedureColumns = "ProcedureColumns";
-               public static readonly string ProcedureParameters = "ProcedureParameters";
-               public static readonly string Procedures = "Procedures";
-               public static readonly string Tables = "Tables";
-               public static readonly string Views = "Views";
-       }
-}
-
diff --git a/mcs/class/System.Data/System.Data.OleDb/OleDbParameter.cs b/mcs/class/System.Data/System.Data.OleDb/OleDbParameter.cs
deleted file mode 100644 (file)
index 1904c4e..0000000
+++ /dev/null
@@ -1,458 +0,0 @@
-//
-// System.Data.OleDb.OleDbParameter
-//
-// Authors:
-//   Rodrigo Moya (rodrigo@ximian.com)
-//   Tim Coleman (tim@timcoleman.com)
-//
-// Copyright (C) Rodrigo Moya, 2002
-// Copyright (C) Tim Coleman, 2002
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Data;
-using System.Data.Common;
-using System.ComponentModel;
-
-namespace System.Data.OleDb
-{
-       [TypeConverterAttribute ("System.Data.OleDb.OleDbParameter+OleDbParameterConverter, " + Consts.AssemblySystem_Data)]
-       public sealed class OleDbParameter : DbParameter, IDbDataParameter, ICloneable
-       {
-               #region Fields
-
-               string name;
-               object value;
-               int size;
-               bool isNullable;
-               byte precision;
-               byte scale;
-               DataRowVersion sourceVersion;
-               string sourceColumn;
-               bool sourceColumnNullMapping;
-               ParameterDirection direction;
-               OleDbType oleDbType;
-               DbType dbType;
-               OleDbParameterCollection container;
-               IntPtr gdaParameter;
-
-               #endregion
-
-               #region Constructors
-               
-               public OleDbParameter ()
-               {
-                       name = string.Empty;
-                       isNullable = true;
-                       sourceColumn = string.Empty;
-                       gdaParameter = IntPtr.Zero;
-               }
-
-               public OleDbParameter (string name, object value) 
-                       : this ()
-               {
-                       this.name = name;
-                       this.value = value;
-                       OleDbType = GetOleDbType (value);
-               }
-
-               public OleDbParameter (string name, OleDbType dataType) 
-                       : this ()
-               {
-                       this.name = name;
-                       OleDbType = dataType;
-               }
-
-               public OleDbParameter (string name, OleDbType dataType, int size)
-                       : this (name, dataType)
-               {
-                       this.size = size;
-               }
-
-               public OleDbParameter (string name, OleDbType dataType, int size, string srcColumn)
-                       : this (name, dataType, size)
-               {
-                       this.sourceColumn = srcColumn;
-               }
-               
-               [EditorBrowsableAttribute (EditorBrowsableState.Advanced)]
-               public OleDbParameter (string parameterName, OleDbType dbType, int size, ParameterDirection direction, bool isNullable, byte precision, byte scale, string srcColumn, DataRowVersion srcVersion, object value)
-                       : this (parameterName, dbType, size, srcColumn)
-               {
-                       this.direction = direction;
-                       this.isNullable = isNullable;
-                       this.precision = precision;
-                       this.scale = scale;
-                       this.sourceVersion = srcVersion;
-                       this.value = value;
-               }
-
-               [EditorBrowsable (EditorBrowsableState.Advanced)]
-               public OleDbParameter (string parameterName, OleDbType dbType, int size, ParameterDirection direction, byte precision, byte scale, string sourceColumn, DataRowVersion sourceVersion, bool sourceColumnNullMapping, object value)
-                       : this (parameterName, dbType, size, sourceColumn)
-               {
-                       this.direction = direction;
-                       this.precision = precision;
-                       this.scale = scale;
-                       this.sourceVersion = sourceVersion;
-                       this.sourceColumnNullMapping = sourceColumnNullMapping;
-                       this.value = value;
-               }
-
-               #endregion
-
-               #region Properties
-
-               [DataCategory ("DataCategory_Data")]
-               public
-               override
-               DbType DbType {
-                       get { return dbType; }
-                       set {
-                               dbType = value;
-                               oleDbType = DbTypeToOleDbType (value);
-                       }
-               }
-
-               [RefreshProperties (RefreshProperties.All)]
-               [DataCategory ("DataCategory_Data")]
-               public
-               override
-               ParameterDirection Direction {
-                       get { return direction; }
-                       set { direction = value; }
-               }
-
-               public
-               override
-               bool IsNullable {
-                       get { return isNullable; }
-                       set { isNullable = value; }
-               }
-
-               [DbProviderSpecificTypeProperty (true)]
-               [RefreshPropertiesAttribute (RefreshProperties.All)]
-               [DataCategory ("DataCategory_Data")]
-               public OleDbType OleDbType {
-                       get { return oleDbType; }
-                       set {
-                               oleDbType = value;
-                               dbType = OleDbTypeToDbType (value);
-                       }
-               }
-
-               public
-               override
-               string ParameterName {
-                       get { return name; }
-                       set { name = value; }
-               }
-
-               [DefaultValue (0)]
-               [DataCategory ("DataCategory_Data")]
-               public byte Precision {
-                       get { return precision; }
-                       set { precision = value; }
-               }
-
-               [DefaultValue (0)]
-               [DataCategory ("DataCategory_Data")]
-               public byte Scale {
-                       get { return scale; }
-                       set { scale = value; }
-               }
-
-               [DataCategory ("DataCategory_Data")]
-               public
-               override
-               int Size {
-                       get { return size; }
-                       set { size = value; }
-               }
-
-               [DataCategory ("DataCategory_Data")]
-               public
-               override
-               string SourceColumn {
-                       get { return sourceColumn; }
-                       set { sourceColumn = value; }
-               }
-
-               public override bool SourceColumnNullMapping {
-                       get {
-                               return sourceColumnNullMapping;
-                       } set {
-                               sourceColumnNullMapping = value;
-                       }
-               }
-
-               [DataCategory ("DataCategory_Data")]
-               public
-               override
-               DataRowVersion SourceVersion {
-                       get { return sourceVersion; }
-                       set { sourceVersion = value; }
-               }
-
-               [RefreshPropertiesAttribute (RefreshProperties.All)]
-               [TypeConverter (typeof (StringConverter))]
-               [DataCategory ("DataCategory_Data")]
-               public
-               override
-               object Value {
-                       get { return value; }
-                       set { this.value = value; }
-               }
-
-               // Used to ensure that only one collection can contain this
-               // parameter
-               internal OleDbParameterCollection Container {
-                       get { return container; }
-                       set { container = value; }
-               }
-
-               #endregion // Properties
-
-               #region Internal Properties
-
-               internal IntPtr GdaParameter {
-                       get { return gdaParameter; }
-               }
-
-               #endregion // Internal Properties
-
-               #region Methods
-
-               [MonoTODO]
-               object ICloneable.Clone ()
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public override void ResetDbType ()
-               {
-                       ResetOleDbType ();
-               }
-
-               public void ResetOleDbType ()
-               {
-                       oleDbType = GetOleDbType (Value);
-                       dbType = OleDbTypeToDbType (oleDbType);
-               }
-
-               public override string ToString ()
-               {
-                       return ParameterName;
-               }
-
-               private OleDbType DbTypeToOleDbType (DbType dbType)
-               {
-                       switch (dbType) {
-                       case DbType.AnsiString :
-                               return OleDbType.VarChar;
-                       case DbType.AnsiStringFixedLength :
-                               return OleDbType.Char;
-                       case DbType.Binary :
-                               return OleDbType.Binary;
-                       case DbType.Boolean :
-                               return OleDbType.Boolean;
-                       case DbType.Byte :
-                               return OleDbType.UnsignedTinyInt;
-                       case DbType.Currency :
-                               return OleDbType.Currency;
-                       case DbType.Date :
-                               return OleDbType.Date;
-                       case DbType.DateTime :
-                               throw new NotImplementedException ();
-                       case DbType.Decimal :
-                               return OleDbType.Decimal;
-                       case DbType.Double :
-                               return OleDbType.Double;
-                       case DbType.Guid :
-                               return OleDbType.Guid;
-                       case DbType.Int16 :
-                               return OleDbType.SmallInt;
-                       case DbType.Int32 :
-                               return OleDbType.Integer;
-                       case DbType.Int64 :
-                               return OleDbType.BigInt;
-                       case DbType.Object :
-                               return OleDbType.Variant;
-                       case DbType.SByte :
-                               return OleDbType.TinyInt;
-                       case DbType.Single :
-                               return OleDbType.Single;
-                       case DbType.String :
-                               return OleDbType.WChar;
-                       case DbType.StringFixedLength :
-                               return OleDbType.VarWChar;
-                       case DbType.Time :
-                               throw new NotImplementedException ();
-                       case DbType.UInt16 :
-                               return OleDbType.UnsignedSmallInt;
-                       case DbType.UInt32 :
-                               return OleDbType.UnsignedInt;
-                       case DbType.UInt64 :
-                               return OleDbType.UnsignedBigInt;
-                       case DbType.VarNumeric :
-                               return OleDbType.VarNumeric;
-                       }
-                       return OleDbType.Variant;
-               }
-
-               private DbType OleDbTypeToDbType (OleDbType oleDbType)
-               {
-                       switch (oleDbType) {
-                       case OleDbType.BigInt :
-                               return DbType.Int64;
-                       case OleDbType.Binary :
-                               return DbType.Binary;
-                       case OleDbType.Boolean :
-                               return DbType.Boolean;
-                       case OleDbType.BSTR :
-                               return DbType.AnsiString;
-                       case OleDbType.Char :
-                               return DbType.AnsiStringFixedLength;
-                       case OleDbType.Currency :
-                               return DbType.Currency;
-                       case OleDbType.Date :
-                               return DbType.DateTime;
-                       case OleDbType.DBDate :
-                               return DbType.DateTime;
-                       case OleDbType.DBTime :
-                               throw new NotImplementedException ();
-                       case OleDbType.DBTimeStamp :
-                               return DbType.DateTime;
-                       case OleDbType.Decimal :
-                               return DbType.Decimal;
-                       case OleDbType.Double :
-                               return DbType.Double;
-                       case OleDbType.Empty :
-                               throw new NotImplementedException ();
-                       case OleDbType.Error :
-                               throw new NotImplementedException ();
-                       case OleDbType.Filetime :
-                               return DbType.DateTime;
-                       case OleDbType.Guid :
-                               return DbType.Guid;
-                       case OleDbType.IDispatch :
-                               return DbType.Object;
-                       case OleDbType.Integer :
-                               return DbType.Int32;
-                       case OleDbType.IUnknown :
-                               return DbType.Object;
-                       case OleDbType.LongVarBinary :
-                               return DbType.Binary;
-                       case OleDbType.LongVarChar :
-                               return DbType.AnsiString;
-                       case OleDbType.LongVarWChar :
-                               return DbType.String;
-                       case OleDbType.Numeric :
-                               return DbType.Decimal;
-                       case OleDbType.PropVariant :
-                               return DbType.Object;
-                       case OleDbType.Single :
-                               return DbType.Single;
-                       case OleDbType.SmallInt :
-                               return DbType.Int16;
-                       case OleDbType.TinyInt :
-                               return DbType.SByte;
-                       case OleDbType.UnsignedBigInt :
-                               return DbType.UInt64;
-                       case OleDbType.UnsignedInt :
-                               return DbType.UInt32;
-                       case OleDbType.UnsignedSmallInt :
-                               return DbType.UInt16;
-                       case OleDbType.UnsignedTinyInt :
-                               return DbType.Byte;
-                       case OleDbType.VarBinary :
-                               return DbType.Binary;
-                       case OleDbType.VarChar :
-                               return DbType.AnsiString;
-                       case OleDbType.Variant :
-                               return DbType.Object;
-                       case OleDbType.VarNumeric :
-                               return DbType.VarNumeric;
-                       case OleDbType.VarWChar :
-                               return DbType.StringFixedLength;
-                       case OleDbType.WChar :
-                               return DbType.String;
-                       }
-                       return DbType.Object;
-               }
-
-               private OleDbType GetOleDbType (object value)
-               {
-                       if (value is Guid) return OleDbType.Guid;
-                       if (value is TimeSpan) return OleDbType.DBTime;
-
-                       switch (Type.GetTypeCode (value.GetType ())) {
-                       case TypeCode.Boolean :
-                               return OleDbType.Boolean;
-                       case TypeCode.Byte :
-                               if (value.GetType().IsArray) 
-                                       return OleDbType.Binary;
-                               else 
-                                       return OleDbType.UnsignedTinyInt;
-                       case TypeCode.Char :
-                               return OleDbType.Char;
-                       case TypeCode.DateTime :
-                               return OleDbType.Date;
-                       case TypeCode.DBNull :
-                               return OleDbType.Empty;
-                       case TypeCode.Decimal :
-                               return OleDbType.Decimal;
-                       case TypeCode.Double :
-                               return OleDbType.Double;
-                       case TypeCode.Empty :
-                               return OleDbType.Empty;
-                       case TypeCode.Int16 :
-                               return OleDbType.SmallInt;
-                       case TypeCode.Int32 :
-                               return OleDbType.Integer;
-                       case TypeCode.Int64 :
-                               return OleDbType.BigInt;
-                       case TypeCode.SByte :
-                               return OleDbType.TinyInt;
-                       case TypeCode.String :
-                               return OleDbType.VarChar;
-                       case TypeCode.Single :
-                               return OleDbType.Single;
-                       case TypeCode.UInt64 :
-                               return OleDbType.UnsignedBigInt;
-                       case TypeCode.UInt32 :
-                               return OleDbType.UnsignedInt;
-                       case TypeCode.UInt16 :
-                               return OleDbType.UnsignedSmallInt;
-                       case TypeCode.Object :
-                               return OleDbType.Variant;
-                       }
-                       return OleDbType.IUnknown;
-               }
-
-               #endregion
-       }
-}
diff --git a/mcs/class/System.Data/System.Data.OleDb/OleDbParameterCollection.cs b/mcs/class/System.Data/System.Data.OleDb/OleDbParameterCollection.cs
deleted file mode 100644 (file)
index 588dc22..0000000
+++ /dev/null
@@ -1,341 +0,0 @@
-//
-// System.Data.OleDb.OleDbParameterCollection
-//
-// Author:
-//   Rodrigo Moya (rodrigo@ximian.com)
-//   Tim Coleman (tim@timcoleman.com)
-//   Umadevi S  (sumadevi@novell.com)
-//
-// Copyright (C) Rodrigo Moya, 2002
-// Copyright (C) Tim Coleman, 2002
-// Copyright (C) Novell Inc.
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Collections;
-using System.Data;
-using System.Data.Common;
-using System.ComponentModel;
-
-namespace System.Data.OleDb
-{
-       [ListBindable (false)]
-       [EditorAttribute ("Microsoft.VSDesigner.Data.Design.DBParametersEditor, "+ Consts.AssemblyMicrosoft_VSDesigner, "System.Drawing.Design.UITypeEditor, "+ Consts.AssemblySystem_Drawing)]
-       public sealed class OleDbParameterCollection :
-               DbParameterCollection, IList, ICollection, IDataParameterCollection
-       {
-               #region Fields
-
-               ArrayList list = new ArrayList ();
-
-               #endregion // Fields
-
-               #region Constructors
-
-               internal OleDbParameterCollection ()
-               {
-               }
-
-               #endregion // Constructors
-       
-               #region Properties
-
-               public
-               override
-               int Count {
-                       get { return list.Count; }
-               }
-               
-               [Browsable (false)]
-               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
-               public new OleDbParameter this[int index] {
-                       get { return (OleDbParameter) list [index]; }
-                       set { list[index] = (OleDbParameter) value; }
-               }
-
-               [Browsable (false)]
-               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
-               public new OleDbParameter this[string parameterName] {
-                       get {
-                               foreach (OleDbParameter p in list)
-                                       if (p.ParameterName.Equals (parameterName))
-                                               return p; 
-                               throw new IndexOutOfRangeException ("The specified name does not exist: " + parameterName);
-                       }
-                       set {
-                               if (!Contains (parameterName))
-                                       throw new IndexOutOfRangeException("The specified name does not exist: " + parameterName);
-                               this [IndexOf (parameterName)] = (OleDbParameter) value;
-                       }
-               }
-
-               public override bool IsFixedSize {
-                       get {
-                               return list.IsFixedSize;
-                       }
-               }
-
-               public override bool IsReadOnly {
-                       get {
-                               return list.IsReadOnly;
-                       }
-               }
-
-               public override bool IsSynchronized {
-                       get {
-                               return list.IsSynchronized;
-                       }
-               }
-
-               public override object SyncRoot {
-                       get {
-                               return list.SyncRoot;
-                       }
-               }
-
-               internal IntPtr GdaParameterList {
-                       [MonoTODO]
-                       get {
-                               IntPtr param_list;
-
-                               param_list = libgda.gda_parameter_list_new ();
-                               // FIXME: add parameters to list
-                               
-                               return param_list;
-                       }
-               }
-
-               #endregion // Properties
-
-               #region Methods
-
-               [EditorBrowsable(EditorBrowsableState.Never)]
-               public
-               override
-               int Add (object value)
-               {
-                       if (!(value is OleDbParameter))
-                               throw new InvalidCastException ("The parameter was not an OleDbParameter.");
-                       Add ((OleDbParameter) value);
-                       return IndexOf (value);
-               }
-
-               public OleDbParameter Add (OleDbParameter value)
-               {
-                       if (value.Container != null)
-                               throw new ArgumentException ("The OleDbParameter specified in the value parameter is already added to this or another OleDbParameterCollection.");
-                       value.Container = this;
-                       list.Add (value);
-                       return value;
-               }
-
-               [Obsolete("OleDbParameterCollection.Add(string, value) is now obsolete. Use OleDbParameterCollection.AddWithValue(string, object) instead.")]
-               [EditorBrowsable(EditorBrowsableState.Never)]
-               public OleDbParameter Add (string parameterName, object value)
-               {
-                       return Add (new OleDbParameter (parameterName, value));
-               }
-
-               public OleDbParameter AddWithValue (string parameterName, object value)
-               {
-                       return Add (new OleDbParameter (parameterName, value));
-               }
-
-               public OleDbParameter Add (string parameterName, OleDbType oleDbType)
-               {
-                       return Add (new OleDbParameter (parameterName, oleDbType));
-               }
-
-               public OleDbParameter Add (string parameterName, OleDbType oleDbType, int size)
-               {
-                       return Add (new OleDbParameter (parameterName, oleDbType, size));
-               }
-
-               public OleDbParameter Add (string parameterName, OleDbType oleDbType, int size, string sourceColumn)
-               {
-                       return Add (new OleDbParameter (parameterName, oleDbType, size, sourceColumn));
-               }
-
-               public override void AddRange(Array values)
-               {
-                       if (values == null)
-                               throw new ArgumentNullException ("values");
-
-                       foreach (object value in values)
-                               Add (value);
-               }
-
-               public void AddRange(OleDbParameter[] values)
-               {
-                       if (values == null)
-                               throw new ArgumentNullException ("values");
-
-                       foreach (OleDbParameter value in values)
-                               Add (value);
-               }
-
-               public
-               override
-               void Clear()
-               {
-                       foreach (OleDbParameter p in list)
-                               p.Container = null;
-                       list.Clear ();
-               }
-
-               public
-               override
-               bool Contains (object value)
-               {
-                       if (!(value is OleDbParameter))
-                               throw new InvalidCastException ("The parameter was not an OleDbParameter.");
-                       return Contains (((OleDbParameter) value).ParameterName);
-               }
-
-               public
-               override
-               bool Contains (string value)
-               {
-                       foreach (OleDbParameter p in list)
-                               if (p.ParameterName.Equals (value))
-                                       return true;
-                       return false;
-               }
-
-               public bool Contains (OleDbParameter value)
-               {
-                       return IndexOf (value) != -1;
-               }
-
-               public
-               override
-               void CopyTo (Array array, int index)
-               {
-                       list.CopyTo (array, index);
-               }
-
-               public void CopyTo(OleDbParameter[] array, int index)
-               {
-                       CopyTo (array, index);
-               }
-
-               public
-               override
-               IEnumerator GetEnumerator()
-               {
-                       return list.GetEnumerator ();
-               }
-
-               [MonoTODO]
-               protected override DbParameter GetParameter (int index)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               protected override DbParameter GetParameter (string parameterName)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public
-               override
-               int IndexOf (object value)
-               {
-                       if (!(value is OleDbParameter))
-                               throw new InvalidCastException ("The parameter was not an OleDbParameter.");
-                       return IndexOf (((OleDbParameter) value).ParameterName);
-               }
-
-               public int IndexOf(OleDbParameter value)
-               {
-                       return IndexOf (value);
-               }
-
-               public
-               override
-               int IndexOf (string parameterName)
-               {
-                       for (int i = 0; i < Count; i += 1)
-                               if (this [i].ParameterName.Equals (parameterName))
-                                       return i;
-                       return -1;
-               }
-
-               public
-               override
-               void Insert (int index, object value)
-               {
-                       list.Insert (index, value);
-               }
-
-               public void Insert (int index, OleDbParameter value)
-               {
-                       Insert (index, value);
-               }
-
-               public
-               override
-               void Remove (object value)
-               {
-                       ((OleDbParameter) value).Container = null;
-                       list.Remove (value);
-               }
-
-               public void Remove (OleDbParameter value)
-               {
-                       Remove (value);
-               }
-
-               public
-               override
-               void RemoveAt (int index)
-               {
-                       this [index].Container = null;
-                       list.RemoveAt (index);
-               }
-
-               public
-               override
-               void RemoveAt (string parameterName)
-               {
-                       RemoveAt (IndexOf (parameterName));
-               }
-
-               [MonoTODO]
-               protected override void SetParameter (int index, DbParameter value)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               protected override void SetParameter (string parameterName, DbParameter value)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               #endregion // Methods
-       }
-}
diff --git a/mcs/class/System.Data/System.Data.OleDb/OleDbParameterConverter.cs b/mcs/class/System.Data/System.Data.OleDb/OleDbParameterConverter.cs
deleted file mode 100644 (file)
index 27224b9..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-//
-// System.Data.OleDb.OleDbParameterConverter.cs
-//
-// Author:
-//   Umadevi S (sumadevi@novell.com)
-//
-// Copyright (C) Novell Inc, 2004
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.ComponentModel;
-using System.Globalization;
-
-namespace System.Data.OleDb {
-       internal sealed class OleDbParameterConverter : ExpandableObjectConverter
-       {
-               #region Constructors
-
-               [MonoTODO]
-               public OleDbParameterConverter ()
-               {
-                       throw new NotImplementedException ();
-               }
-
-               #endregion // Constructors
-
-               #region Methods
-       
-               [MonoTODO]
-               public override object ConvertTo (ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               public override bool CanConvertTo (ITypeDescriptorContext context, Type destinationType)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               #endregion // Methods
-       }
-}
diff --git a/mcs/class/System.Data/System.Data.OleDb/OleDbPermission.cs b/mcs/class/System.Data/System.Data.OleDb/OleDbPermission.cs
deleted file mode 100644 (file)
index af23b58..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-//
-// System.Data.OleDb.OleDbPermission
-//
-// Author:
-//     Rodrigo Moya (rodrigo@ximian.com)
-//     Tim Coleman (tim@timcoleman.com)
-//     Sebastien Pouliot  <sebastien@ximian.com>
-//
-// Copyright (C) Rodrigo Moya, 2002
-// Copyright (C) Tim Coleman, 2002
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.ComponentModel;
-using System.Data.Common;
-using System.Security;
-using System.Security.Permissions;
-
-namespace System.Data.OleDb
-{
-       [Serializable]
-       public sealed class OleDbPermission : DBDataPermission
-       {
-               #region Fields
-
-               private string _provider;
-
-               #endregion // Fields
-
-               #region Constructors
-
-               [Obsolete ("use OleDbPermission(PermissionState.None)", true)]
-               public OleDbPermission ()
-                       : base (PermissionState.None)
-               {
-               }
-
-               public OleDbPermission (PermissionState state)
-                       : base (state)
-               {
-               }
-
-               [Obsolete ("use OleDbPermission(PermissionState.None)", true)]
-               public OleDbPermission (PermissionState state, bool allowBlankPassword)
-                       : base (state)
-               {
-                       AllowBlankPassword = allowBlankPassword;
-               }
-
-               // required for Copy method
-               internal OleDbPermission (DBDataPermission permission)
-                       : base (permission)
-               {
-               }
-
-               // easier (and common) permission creation from attribute class
-               internal OleDbPermission (DBDataPermissionAttribute attribute)
-                       : base (attribute)
-               {
-               }
-
-               #endregion
-
-               #region Properties
-
-               [Obsolete ()]
-               [BrowsableAttribute (false)]
-               [EditorBrowsableAttribute (EditorBrowsableState.Never)]
-               public string Provider {
-                       get {
-                               if (_provider == null)
-                                       return String.Empty;
-                               return _provider;
-                       }
-                       set { _provider = value; }
-               }
-
-               #endregion
-
-               #region Methods
-
-               public override IPermission Copy ()
-               {
-                       return new OleDbPermission (this);
-               }
-               #endregion
-       }
-}
diff --git a/mcs/class/System.Data/System.Data.OleDb/OleDbPermissionAttribute.cs b/mcs/class/System.Data/System.Data.OleDb/OleDbPermissionAttribute.cs
deleted file mode 100644 (file)
index 6abf041..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-//
-// System.Data.OleDb.OleDbPermissionAttribute
-//
-// Authors:
-//     Rodrigo Moya (rodrigo@ximian.com)
-//     Tim Coleman (tim@timcoleman.com)
-//     Sebastien Pouliot  <sebastien@ximian.com>
-//
-// Copyright (C) Rodrigo Moya, 2002
-// Copyright (C) Tim Coleman, 2002
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.ComponentModel;
-using System.Data.Common;
-using System.Security;
-using System.Security.Permissions;
-
-namespace System.Data.OleDb {
-
-       [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class | 
-                       AttributeTargets.Struct | AttributeTargets.Constructor |
-                       AttributeTargets.Method, AllowMultiple=true,
-                       Inherited=false)]
-       [Serializable]
-       public sealed class OleDbPermissionAttribute : DBDataPermissionAttribute {
-
-               #region Fields
-
-               private string _provider;
-
-               #endregion // Fields
-
-               #region Constructors 
-
-               public OleDbPermissionAttribute (SecurityAction action) 
-                       : base (action)
-               {
-               }
-
-               #endregion
-
-               #region Properties
-
-               [Obsolete ()]
-               [BrowsableAttribute (false)]
-               [EditorBrowsableAttribute (EditorBrowsableState.Never)]
-               public string Provider {
-                       get {
-                               if (_provider == null)
-                                       return String.Empty;
-                               return _provider;
-                       }
-                       set { _provider = value; }
-               }
-
-               #endregion
-
-               #region Methods
-
-               public override IPermission CreatePermission () 
-               {
-                       OleDbPermission p = new OleDbPermission (this);
-                       return p;
-               }
-
-               #endregion
-       }
-}
diff --git a/mcs/class/System.Data/System.Data.OleDb/OleDbRowUpdatedEventArgs.cs b/mcs/class/System.Data/System.Data.OleDb/OleDbRowUpdatedEventArgs.cs
deleted file mode 100644 (file)
index 0993b2b..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// System.Data.OleDb.OleDbRowUpdatedEventArgs
-//
-// Authors:
-//   Rodrigo Moya (rodrigo@ximian.com)
-//   Tim Coleman (tim@timcoleman.com)
-//
-// Copyright (C) Rodrigo Moya, 2002
-// Copyright (C) Tim Coleman, 2002
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Data;
-using System.Data.Common;
-
-namespace System.Data.OleDb
-{
-       public sealed class OleDbRowUpdatedEventArgs : RowUpdatedEventArgs
-       {
-               #region Constructors
-
-               public OleDbRowUpdatedEventArgs (DataRow dataRow, IDbCommand command, StatementType statementType, DataTableMapping tableMapping)
-                       : base (dataRow, command, statementType, tableMapping)
-
-               {
-               }
-
-               #endregion // Constructors
-
-               #region Properties
-
-               public new OleDbCommand Command {
-                       get { return (OleDbCommand) base.Command; }
-               }
-
-               #endregion // Properties
-       }
-}
diff --git a/mcs/class/System.Data/System.Data.OleDb/OleDbRowUpdatedEventHandler.cs b/mcs/class/System.Data/System.Data.OleDb/OleDbRowUpdatedEventHandler.cs
deleted file mode 100644 (file)
index 877efb7..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-//
-// System.Data.OleDb.OleDbRowUpdatedEventHandler
-//
-// Author:
-//   Rodrigo Moya (rodrigo@ximian.com)
-//
-// Copyright (C) Rodrigo Moya, 2002
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Data;
-using System.Data.Common;
-
-namespace System.Data.OleDb
-{
-       public delegate void OleDbRowUpdatedEventHandler (
-               object sender,
-               OleDbRowUpdatedEventArgs e);
-}
diff --git a/mcs/class/System.Data/System.Data.OleDb/OleDbRowUpdatingEventArgs.cs b/mcs/class/System.Data/System.Data.OleDb/OleDbRowUpdatingEventArgs.cs
deleted file mode 100644 (file)
index a0dea35..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-//
-// System.Data.OleDb.OleDbRowUpdatingEventArgs
-//
-// Authors:
-//   Rodrigo Moya (rodrigo@ximian.com)
-//   Tim Coleman (tim@timcoleman.com)
-//
-// Copyright (C) Rodrigo Moya, 2002
-// Copyright (C) Tim Coleman, 2002
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Data;
-using System.Data.Common;
-
-namespace System.Data.OleDb
-{
-       public sealed class OleDbRowUpdatingEventArgs : RowUpdatingEventArgs
-       {
-               #region Constructors
-
-               public OleDbRowUpdatingEventArgs (DataRow dataRow, IDbCommand command, StatementType statementType, DataTableMapping tableMapping)
-                       : base (dataRow, command, statementType, tableMapping)
-               {
-               }
-
-               #endregion
-
-               #region Properties
-               
-               public new OleDbCommand Command {
-                       get { return (OleDbCommand) base.Command; }
-                       set { base.Command = value; }
-               }
-
-               protected override IDbCommand BaseCommand {
-                       get {
-                               return base.BaseCommand;
-                       }
-                       set {
-                               base.BaseCommand = value;
-                       }
-               }
-
-               #endregion
-       }
-}
diff --git a/mcs/class/System.Data/System.Data.OleDb/OleDbRowUpdatingEventHandler.cs b/mcs/class/System.Data/System.Data.OleDb/OleDbRowUpdatingEventHandler.cs
deleted file mode 100644 (file)
index 6669d34..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-//
-// System.Data.OleDb.OleDbRowUpdatingEventHandler
-//
-// Author:
-//   Rodrigo Moya (rodrigo@ximian.com)
-//
-// Copyright (C) Rodrigo Moya, 2002
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Data;
-using System.Data.Common;
-
-namespace System.Data.OleDb
-{
-       public delegate void OleDbRowUpdatingEventHandler (
-               object sender,
-               OleDbRowUpdatingEventArgs e);
-}
diff --git a/mcs/class/System.Data/System.Data.OleDb/OleDbSchemaGuid.cs b/mcs/class/System.Data/System.Data.OleDb/OleDbSchemaGuid.cs
deleted file mode 100644 (file)
index 30ae474..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-//
-// System.Data.OleDb.OleDbSchemaGuid
-//
-// Authors:
-//   Rodrigo Moya (rodrigo@ximian.com)
-//   Tim Coleman (tim@timcoleman.com)
-//
-// Copyright (C) Rodrigo Moya, 2002
-// Copyright (C) Tim Coleman, 2002
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Data;
-using System.Data.Common;
-
-namespace System.Data.OleDb
-{
-       public sealed class OleDbSchemaGuid
-       {
-               #region Fields
-
-               public static readonly Guid Assertions = new Guid ("df855bea-fb95-4abc-8932-e57e45c7ddae");
-               public static readonly Guid Catalogs = new Guid ("e4a67334-f03c-45af-8b1d-531f99268045");
-               public static readonly Guid Character_Sets = new Guid ("e4533bdb-0b55-48ee-986d-17d07143657d");
-               public static readonly Guid Check_Constraints = new Guid ("fedf7f5d-cfb4-4635-af02-45eb4bb4e8f3");
-               public static readonly Guid Check_Constraints_By_Table = new Guid ("d76547ef-837d-413c-8d76-bab1d7bb014a");
-               public static readonly Guid Collations = new Guid ("5145b85c-c448-4b9e-8929-4c2de31ffa30");
-               public static readonly Guid Columns = new Guid ("86dcd6e2-9a8c-4c6d-bc1c-e0e334c727c9");
-               public static readonly Guid Column_Domain_Usage = new Guid ("058acb5e-eb1d-4b6e-8e98-a7d59a959ff1");
-               public static readonly Guid Column_Privileges = new Guid ("43152796-f3b4-4342-9647-008f1060e352");
-               public static readonly Guid Constraint_Column_Usage = new Guid ("3a39f999-f481-4293-8b9f-af7e91b4ee7d");
-               public static readonly Guid Constraint_Table_Usage = new Guid ("d689719b-24b0-4963-a635-097c480edcd2");
-               public static readonly Guid DbInfoLiterals = new Guid ("7a564da6-f3bc-474b-9e66-71cb47bde5b0");
-               public static readonly Guid Foreign_Keys = new Guid ("d9e547ce-e62d-4200-b849-566bc3dc29de");
-               public static readonly Guid Indexes = new Guid ("69d8523c-96ad-40cb-a89a-ee98d2d6fcec");
-               public static readonly Guid Key_Column_Usage = new Guid ("65423211-805e-4822-8eb4-f4f6d540056e");
-               public static readonly Guid Primary_Keys = new Guid ("c6e5b174-fbd8-4055-b757-8585040e463f");
-               public static readonly Guid Procedures = new Guid ("61f276ad-4f25-4c26-b4ae-8238e06d56db");
-               public static readonly Guid Procedure_Columns = new Guid ("7148080d-e053-4ada-b79a-9a2ff614a3d4");
-               public static readonly Guid Procedure_Parameters = new Guid ("984af700-8fe7-476f-81c2-4b814df67907");
-               public static readonly Guid Provider_Types = new Guid ("0bc2da44-d834-4136-9ff0-3cef477784b9");
-               public static readonly Guid Referential_Constraints = new Guid ("d2eab85e-49a7-462d-aa22-1d97c74178ae");
-               public static readonly Guid Schemata = new Guid ("2fbd7503-0af3-43d2-92c6-51e78b84dd37");
-               public static readonly Guid Sql_Languages = new Guid ("d60a511d-a07f-4e59-aac2-71c25fab5b02");
-               public static readonly Guid Statistics = new Guid ("03ed9f7d-35bc-45fe-993f-ee7a5f29fb74");
-               public static readonly Guid Tables = new Guid ("ceac88ba-240c-4bb4-821e-4a49fc013371");
-               public static readonly Guid Tables_Info = new Guid ("9ff81c59-2b1e-4371-a08b-3a2d373189fa");
-               public static readonly Guid Table_Constraints = new Guid ("62883c55-082d-42cb-bb00-747985ca6047");
-               public static readonly Guid Table_Privileges = new Guid ("1a73f478-8c8e-4ede-b3ec-22ba13ab55a0");
-               public static readonly Guid Table_Statistics = new Guid ("9c944744-cd51-448a-8be4-7095f039d0ef");
-               public static readonly Guid Translations = new Guid ("5578b57e-a682-4f1b-bdb4-f8a14ad6f61e");
-               public static readonly Guid Trustee = new Guid ("521207e2-3a23-42b6-ac78-810a3fce3271");
-               public static readonly Guid Usage_Privileges = new Guid ("f8113a2b-2934-4c67-ab7b-adbe3ab74973");
-               public static readonly Guid Views = new Guid ("9a6345b6-61a0-40fd-9b45-402f3c9c9c3e");
-               public static readonly Guid View_Column_Usage = new Guid ("2c91ef91-02d8-4d38-ae5a-1e826873d6ea");
-               public static readonly Guid View_Table_Usage = new Guid ("7dcb7f53-1045-4fdf-86a1-d3caaf27c7f5");
-
-               #endregion
-
-               #region Constructors
-
-               public OleDbSchemaGuid ()
-               {
-               }
-
-               #endregion
-       }
-}
diff --git a/mcs/class/System.Data/System.Data.OleDb/OleDbTransaction.cs b/mcs/class/System.Data/System.Data.OleDb/OleDbTransaction.cs
deleted file mode 100644 (file)
index 7bd79b1..0000000
+++ /dev/null
@@ -1,192 +0,0 @@
-//
-// System.Data.OleDb.OleDbTransaction
-//
-// Authors:
-//   Rodrigo Moya (rodrigo@ximian.com)
-//   Tim Coleman (tim@timcoleman.com)
-//
-// Copyright (C) Rodrigo Moya, 2002
-// Copyright (C) Tim Coleman, 2002
-// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Data.Common;
-
-namespace System.Data.OleDb
-{
-       public sealed class OleDbTransaction : DbTransaction, IDbTransaction
-       {
-               #region Fields
-
-               bool disposed;
-               OleDbConnection connection;
-               IntPtr gdaTransaction;
-               int depth;
-               bool isOpen;
-
-               #endregion // Fields
-
-               #region Constructors
-
-               internal OleDbTransaction (OleDbConnection connection, int depth)
-                       : this (connection, depth, IsolationLevel.ReadCommitted)
-               {
-               }
-
-               internal OleDbTransaction (OleDbConnection connection)
-                       : this (connection, 1)
-               {
-               }
-
-               internal OleDbTransaction (OleDbConnection connection, int depth, IsolationLevel isolevel) 
-               {
-                       this.connection = connection;
-
-                       gdaTransaction = libgda.gda_transaction_new (depth.ToString ());
-                       
-                       switch (isolevel) {
-                       case IsolationLevel.ReadCommitted :
-                               libgda.gda_transaction_set_isolation_level (gdaTransaction,
-                                                                           GdaTransactionIsolation.ReadCommitted);
-                               break;
-                       case IsolationLevel.ReadUncommitted :
-                               libgda.gda_transaction_set_isolation_level (gdaTransaction,
-                                                                           GdaTransactionIsolation.ReadUncommitted);
-                               break;
-                       case IsolationLevel.RepeatableRead :
-                               libgda.gda_transaction_set_isolation_level (gdaTransaction,
-                                                                           GdaTransactionIsolation.RepeatableRead);
-                               break;
-                       case IsolationLevel.Serializable :
-                               libgda.gda_transaction_set_isolation_level (gdaTransaction,
-                                                                           GdaTransactionIsolation.Serializable);
-                               break;
-                       }
-                       
-                       libgda.gda_connection_begin_transaction (connection.GdaConnection, gdaTransaction);
-                       isOpen = true;
-               }
-
-               internal OleDbTransaction (OleDbConnection connection, IsolationLevel isolevel) 
-                       : this (connection, 1, isolevel)
-               {
-               }
-
-
-               #endregion // Constructors
-
-               #region Properties
-
-               public new OleDbConnection Connection {
-                       get {
-                               return connection;
-                       }
-               }
-
-               protected override DbConnection DbConnection {
-                       get { return connection; }
-               }
-               
-               public
-               override
-               IsolationLevel IsolationLevel {
-                       get {
-                               if (!isOpen)
-                                       throw ExceptionHelper.TransactionNotUsable (GetType ());
-
-                               switch (libgda.gda_transaction_get_isolation_level (gdaTransaction)) {
-                               case GdaTransactionIsolation.ReadCommitted :
-                                       return IsolationLevel.ReadCommitted;
-                               case GdaTransactionIsolation.ReadUncommitted :
-                                       return IsolationLevel.ReadUncommitted;
-                               case GdaTransactionIsolation.RepeatableRead :
-                                       return IsolationLevel.RepeatableRead;
-                               case GdaTransactionIsolation.Serializable :
-                                       return IsolationLevel.Serializable;
-                               }
-                               return IsolationLevel.Unspecified;
-                       }
-               }
-
-               #endregion // Properties
-
-               #region Methods
-
-               public OleDbTransaction Begin ()
-               {
-                       if (!isOpen)
-                               throw ExceptionHelper.TransactionNotUsable (GetType ());
-                       return new OleDbTransaction (connection, depth + 1);
-               }
-
-               public OleDbTransaction Begin (IsolationLevel isolevel) 
-               {
-                       if (!isOpen)
-                               throw ExceptionHelper.TransactionNotUsable (GetType ());
-                       return new OleDbTransaction (connection, depth + 1, isolevel);
-               }
-
-               public
-               override
-               void Commit ()
-               {
-                       if (!isOpen)
-                               throw ExceptionHelper.TransactionNotUsable (GetType ());
-
-                       if (!libgda.gda_connection_commit_transaction (connection.GdaConnection,
-                               gdaTransaction))
-                               throw new InvalidOperationException ();
-                       connection = null;
-                       isOpen = false;
-               }
-
-
-               protected override
-               void Dispose (bool disposing)
-               {
-                       if (!disposed) {
-                               if (disposing && isOpen)
-                                       Rollback ();
-                               disposed = true;
-                       }
-
-                       base.Dispose (disposing);
-               }
-
-
-               public
-               override
-               void Rollback ()
-               {
-                       if (!isOpen)
-                               throw ExceptionHelper.TransactionNotUsable (GetType ());
-
-                       if (!libgda.gda_connection_rollback_transaction (connection.GdaConnection,
-                               gdaTransaction))
-                               throw new InvalidOperationException ();
-                       connection = null;
-                       isOpen = false;
-               }
-
-               #endregion // Methods
-       }
-}
diff --git a/mcs/class/System.Data/System.Data.OleDb/OleDbType.cs b/mcs/class/System.Data/System.Data.OleDb/OleDbType.cs
deleted file mode 100644 (file)
index ad730f2..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-//
-// System.Data.OleDb.OleDbType
-//
-// Author:
-//   Rodrigo Moya (rodrigo@ximian.com)
-//   Tim Coleman (tim@timcoleman.com)
-//
-// Copyright (C) Rodrigo Moya, 2002
-// Copyright (C) Tim Coleman, 2002
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Data;
-using System.Data.Common;
-
-namespace System.Data.OleDb
-{
-       public enum OleDbType {
-               BigInt = 20,
-               Binary = 128,
-               Boolean = 11,
-               BSTR = 8,
-               Char = 129,
-               Currency = 6,
-               Date = 7,
-               DBDate = 133,
-               DBTime = 134,
-               DBTimeStamp = 135,
-               Decimal = 14,
-               Double = 5,
-               Empty = 0,
-               Error = 10,
-               Filetime = 64,
-               Guid = 72,
-               IDispatch = 9,
-               Integer = 3,
-               IUnknown = 13,
-               LongVarBinary = 205,
-               LongVarChar = 201,
-               LongVarWChar = 203,
-               Numeric = 131,
-               PropVariant = 138,
-               Single = 4,
-               SmallInt = 2,
-               TinyInt = 16,
-               UnsignedBigInt = 21,
-               UnsignedInt = 19,
-               UnsignedSmallInt = 18,
-               UnsignedTinyInt = 17,
-               VarBinary = 204,
-               VarChar = 200,
-               Variant = 12,
-               VarNumeric = 139,
-               VarWChar = 202,
-               WChar = 130
-       }
-}
diff --git a/mcs/class/System.Data/System.Data.OleDb/libgda.cs b/mcs/class/System.Data/System.Data.OleDb/libgda.cs
deleted file mode 100644 (file)
index 835a0f9..0000000
+++ /dev/null
@@ -1,341 +0,0 @@
-//
-// System.Data.OleDb.libgda
-//
-// Authors:
-//   Rodrigo Moya (rodrigo@ximian.com)
-//   Tim Coleman (tim@timcoleman.com)
-//
-// Copyright (C) Rodrigo Moya, 2002
-// Copyright (C) Tim Coleman, 2002
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Data;
-using System.Data.Common;
-using System.Runtime.InteropServices;
-
-namespace System.Data.OleDb
-{
-       internal enum GdaConnectionOptions {
-               ReadOnly = 1 << 0
-       };
-       
-       internal enum GdaCommandOptions {
-               IgnoreErrors = 1,
-               StopOnErrors = 1 << 1,
-               BadOption = 1 << 2,
-       };
-
-       internal enum GdaCommandType {
-               Sql = 0,
-               Xml = 1,
-               Procedure = 2,
-               Table = 3,
-               Schema = 4,
-               Invalid = 5
-       };
-
-       internal enum GdaTransactionIsolation {
-               Unknown,
-               ReadCommitted,
-               ReadUncommitted,
-               RepeatableRead,
-               Serializable
-       };
-       
-       internal enum GdaValueType {
-               Null = 0,
-               Bigint = 1,
-               Binary = 2,
-               Boolean = 3,
-               Date = 4,
-               Double = 5,
-               GeometricPoint = 6,
-               Integer = 7,
-               List = 8,
-               Numeric = 9,
-               Single = 10,
-               Smallint = 11,
-               String = 12,
-               Time = 13,
-               Timestamp = 14,
-               Tinyint = 15,
-               Type = 16,
-               Unknown = 17
-       };
-
-       [StructLayout(LayoutKind.Sequential)]
-       internal class GdaDate
-       {
-               public short year;
-               public ushort month;
-               public ushort day;
-       }
-
-       [StructLayout(LayoutKind.Sequential)]
-       internal class GdaTime
-       {
-               public ushort hour;
-               public ushort minute;
-               public ushort second;
-               public long timezone;
-       }
-       
-       [StructLayout(LayoutKind.Sequential)]
-       internal class GdaTimestamp
-       {
-               public short year;
-               public ushort month;
-               public ushort day;
-               public ushort hour;
-               public ushort minute;
-               public ushort second;
-               public ulong fraction;
-               public long timezone;
-       }
-       
-       [StructLayout(LayoutKind.Sequential)]
-       internal class GdaList
-       {
-               public IntPtr data;
-               public IntPtr next;
-               public IntPtr prev;
-       }
-       
-       sealed internal class libgda
-       {
-               private static IntPtr gdaClient = IntPtr.Zero;
-
-               public static IntPtr GdaClient
-               {
-                       get {
-                               if (gdaClient == IntPtr.Zero)
-                                       gdaClient = gda_client_new ();
-
-                               return gdaClient;
-                       }
-               }
-
-               [DllImport("gobject-2.0",
-                          EntryPoint="g_object_unref")]
-               public static extern void FreeObject (IntPtr obj);
-
-               [DllImport("gda-2")]
-               public static extern void gda_init (string app_id, string version, int nargs, string[] args);
-
-               [DllImport("gda-2")]
-               public static extern GdaValueType gda_value_get_type (IntPtr value);
-
-               [DllImport("gda-2")]
-               public static extern long gda_value_get_bigint (IntPtr value);
-               
-               [DllImport("gda-2")]
-               public static extern bool gda_value_get_boolean (IntPtr value);
-
-               [DllImport("gda-2")]
-               public static extern IntPtr gda_value_get_date (IntPtr value);
-               
-               [DllImport("gda-2")]
-               public static extern double gda_value_get_double (IntPtr value);
-
-               [DllImport("gda-2")]
-               public static extern int gda_value_get_integer (IntPtr value);
-               
-               [DllImport("gda-2")]
-               public static extern float gda_value_get_single (IntPtr value);
-               
-               [DllImport("gda-2")]
-               public static extern int gda_value_get_smallint (IntPtr value);
-
-               [DllImport("gda-2")]
-               public static extern string gda_value_get_string (IntPtr value);
-
-               [DllImport("gda-2")]
-               public static extern IntPtr gda_value_get_time (IntPtr value);
-               
-               [DllImport("gda-2")]
-               public static extern IntPtr gda_value_get_timestamp (IntPtr value);
-               
-               [DllImport("gda-2")]
-               public static extern byte gda_value_get_tinyint (IntPtr value);
-
-               [DllImport("gda-2")]
-               public static extern bool gda_value_is_null (IntPtr value);
-               
-               [DllImport("gda-2")]
-               public static extern string gda_value_stringify (IntPtr value);
-               
-               [DllImport("gda-2")]
-               public static extern IntPtr gda_parameter_list_new ();
-
-               [DllImport("gda-2")]
-               public static extern string gda_type_to_string (GdaValueType type);
-               
-               [DllImport("gda-2")]
-               public static extern int gda_data_model_get_n_rows (IntPtr model);
-
-               [DllImport("gda-2")]
-               public static extern int gda_data_model_get_n_columns (IntPtr model);
-
-               [DllImport("gda-2")]
-               public static extern IntPtr gda_data_model_get_value_at (IntPtr model, int col, int row);
-
-               [DllImport("gda-2")]
-               public static extern string gda_data_model_get_column_title (IntPtr model, int col);
-
-               [DllImport("gda-2")]
-               public static extern IntPtr gda_data_model_describe_column (IntPtr model, int col);
-
-               [DllImport("gda-2")]
-               public static extern int gda_data_model_get_column_position (IntPtr model, string name);
-               
-               [DllImport("gda-2")]
-               public static extern void gda_field_attributes_free (IntPtr fa);
-
-               [DllImport("gda-2")]
-               public static extern string gda_field_attributes_get_name (IntPtr fa);
-               
-               [DllImport("gda-2")]
-               public static extern GdaValueType gda_field_attributes_get_gdatype (IntPtr fa);
-
-               [DllImport("gda-2")]
-               public static extern long gda_field_attributes_get_defined_size (IntPtr fa);
-
-               [DllImport("gda-2")]
-               public static extern long gda_field_attributes_get_scale (IntPtr fa);
-
-               [DllImport("gda-2")]
-               public static extern bool gda_field_attributes_get_allow_null (IntPtr fa);
-               
-               [DllImport("gda-2")]
-               public static extern bool gda_field_attributes_get_primary_key (IntPtr fa);
-               
-               [DllImport("gda-2")]
-               public static extern bool gda_field_attributes_get_unique_key (IntPtr fa);
-               
-               [DllImport("gda-2")]
-               public static extern IntPtr gda_client_new ();
-
-               [DllImport("gda-2")]
-               public static extern IntPtr gda_client_open_connection (IntPtr client, string dsn,
-                                                                       string username, string password,
-                                                                       GdaConnectionOptions options);
-
-               [DllImport("gda-2")]
-               public static extern IntPtr gda_client_open_connection_from_string (IntPtr client,
-                                                                                   string provider,
-                                                                                   string cnc_string,
-                                                                                   GdaConnectionOptions options);
-
-               [DllImport("gda-2")]
-               public static extern bool gda_connection_is_open (IntPtr cnc);
-               
-               [DllImport("gda-2")]
-               public static extern bool gda_connection_close (IntPtr cnc);
-
-               [DllImport("gda-2")]
-               public static extern string gda_connection_get_server_version (IntPtr cnc);
-               
-               [DllImport("gda-2")]
-               public static extern string gda_connection_get_database (IntPtr cnc);
-
-               [DllImport("gda-2")]
-               public static extern string gda_connection_get_dsn (IntPtr cnc);
-
-               [DllImport("gda-2")]
-               public static extern string gda_connection_get_cnc_string (IntPtr cnc);
-
-               [DllImport("gda-2")]
-               public static extern string gda_connection_get_provider (IntPtr cnc);
-
-               [DllImport("gda-2")]
-               public static extern string gda_connection_get_username (IntPtr cnc);
-
-               [DllImport("gda-2")]
-               public static extern string gda_connection_get_password (IntPtr cnc);
-
-               [DllImport("gda-2")]
-               public static extern bool gda_connection_change_database (IntPtr cnc, string name);
-               
-               [DllImport("gda-2")]
-               public static extern IntPtr gda_transaction_new (string name);
-
-               [DllImport("gda-2")]
-               public static extern IntPtr gda_transaction_get_name (IntPtr xaction);
-
-               [DllImport("gda-2")]
-               public static extern IntPtr gda_transaction_set_name (IntPtr xaction, string name);
-
-               [DllImport("gda-2")]
-               public static extern GdaTransactionIsolation gda_transaction_get_isolation_level (IntPtr xaction);
-
-               [DllImport("gda-2")]
-               public static extern void gda_transaction_set_isolation_level (IntPtr xaction,
-                                                                              GdaTransactionIsolation level);
-               
-               [DllImport("gda-2")]
-               public static extern bool gda_connection_begin_transaction (IntPtr cnc, IntPtr xaction);
-
-               [DllImport("gda-2")]
-               public static extern bool gda_connection_commit_transaction (IntPtr cnc, IntPtr xaction);
-
-               [DllImport("gda-2")]
-               public static extern bool gda_connection_rollback_transaction (IntPtr cnc, IntPtr xaction);
-
-               [DllImport("gda-2")]
-               public static extern IntPtr gda_connection_execute_command (IntPtr cnc, IntPtr cmd, IntPtr parameterList);
-               
-               [DllImport("gda-2")]
-               public static extern int gda_connection_execute_non_query (IntPtr cnc, IntPtr command, IntPtr parameterList);
-
-               [DllImport("gda-2")]
-               public static extern IntPtr gda_connection_execute_single_command (IntPtr cnc, IntPtr command, IntPtr parameterList);
-
-               [DllImport("gda-2")]
-               public static extern IntPtr gda_connection_get_errors (IntPtr cnc);
-
-               [DllImport("gda-2")]
-               public static extern IntPtr gda_command_new (string text, GdaCommandType type, GdaCommandOptions options);
-
-               [DllImport("gda-2")]
-               public static extern void gda_command_set_text (IntPtr cmd, string text);
-
-               [DllImport("gda-2")]
-               public static extern void gda_command_set_command_type (IntPtr cmd, GdaCommandType type);
-
-               [DllImport("gda-2")]
-               public static extern string gda_error_get_description (IntPtr error);
-
-               [DllImport("gda-2")]
-               public static extern long gda_error_get_number (IntPtr error);
-
-               [DllImport("gda-2")]
-               public static extern string gda_error_get_source (IntPtr error);
-               
-               [DllImport("gda-2")]
-               public static extern string gda_error_get_sqlstate (IntPtr error);
-               
-       }
-}
diff --git a/mcs/class/System.Data/System.Data.ProviderBase.jvm/.gitattributes b/mcs/class/System.Data/System.Data.ProviderBase.jvm/.gitattributes
deleted file mode 100644 (file)
index 7b2e59e..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-/AbstractDBCommand.cs -crlf
-/AbstractDBConnection.cs -crlf
-/AbstractDataReader.cs -crlf
-/AbstractDbError.cs -crlf
-/AbstractDbErrorCollection.cs -crlf
-/AbstractDbException.cs -crlf
-/AbstractTransaction.cs -crlf
-/DbConvert.cs -crlf
-/ParameterMetadataWrapper.cs -crlf
-/ReaderCache.cs -crlf
-/regex.cs -crlf
diff --git a/mcs/class/System.Data/System.Data.ProviderBase.jvm/AbstractDbCommandBuilder.cs b/mcs/class/System.Data/System.Data.ProviderBase.jvm/AbstractDbCommandBuilder.cs
deleted file mode 100644 (file)
index 300e9cd..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-//
-// System.Data.ProviderBase.AbstractDbCommand
-//
-// Authors:
-//     Konstantin Triger <kostat@mainsoft.com>
-//     
-// (C) 2006 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-using System;
-using System.Collections;
-using System.ComponentModel;
-using System.Data;
-using System.Data.Common;
-using System.Text;
-
-namespace System.Data.ProviderBase {
-       public abstract class AbstractDbCommandBuilder : DbCommandBuilder {
-               protected override void ApplyParameterInfo(DbParameter parameter, DataRow row, StatementType statementType, bool whereClause) {
-                       throw new NotImplementedException();
-               }
-
-               protected override string GetParameterName(int parameterOrdinal) {
-                       throw new NotImplementedException();
-               }
-
-               protected override string GetParameterName(String parameterName) {
-                       throw new NotImplementedException();
-               }
-
-               protected override string GetParameterPlaceholder(int parameterOrdinal) {
-                       return "?";
-               }
-
-               protected override void SetRowUpdatingHandler(DbDataAdapter adapter) {
-                       throw new NotImplementedException();
-               }
-
-               protected static void DeriveParameters (AbstractDbCommand command) {
-                       if (command.Connection.State != ConnectionState.Open) {
-                               throw new InvalidOperationException("DeriveParameters requires an open and available Connection. The connection's current state is Closed.");
-                       }
-                       
-                       if(command.CommandType != CommandType.StoredProcedure) {
-                               throw ExceptionHelper.DeriveParametersNotSupported(command.GetType(),command.CommandType);
-                       }
-
-                       ArrayList parameters = command.DeriveParameters(command.CommandText, true);
-                       command.Parameters.Clear();
-                       foreach (AbstractDbParameter param in parameters) {
-                               command.Parameters.Add(param.Clone());
-                       }
-               }
-       }
-}
\ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data.ProviderBase.jvm/AbstractDbParameterCollection.cs b/mcs/class/System.Data/System.Data.ProviderBase.jvm/AbstractDbParameterCollection.cs
deleted file mode 100644 (file)
index f2fee7f..0000000
+++ /dev/null
@@ -1,255 +0,0 @@
-//
-// System.Data.Common.AbstractDbParameterCollection
-//
-// Authors:
-//     Konstantin Triger <kostat@mainsoft.com>
-//     Boris Kirzner <borisk@mainsoft.com>
-//     
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-using System;
-using System.Data.Common;
-using System.Collections;
-
-namespace System.Data.ProviderBase
-{
-       public abstract class AbstractDbParameterCollection : DbParameterCollection
-       {
-               #region Fields
-
-               readonly AbstractDbCommand _parent;
-               readonly ArrayList _list = new ArrayList();
-
-               #endregion // Fields
-
-               #region Constructors
-
-               public AbstractDbParameterCollection(DbCommand parent)
-        {
-                       _parent = (AbstractDbCommand)parent;
-        }
-
-               #endregion // Constructors
-
-               #region Properties
-
-               public override int Count {
-                       get { return _list.Count; }
-               }
-
-               public override bool IsFixedSize {
-                       get { return _list.IsFixedSize; }
-               }
-
-               public override bool IsReadOnly {
-                       get { return _list.IsReadOnly; }
-               }
-
-               public override bool IsSynchronized {
-                       get { return _list.IsSynchronized; }
-               }
-
-               protected abstract Type ItemType { get; }
-
-               public override object SyncRoot {
-                       get { return _list.SyncRoot; }
-               }
-
-               #endregion // Properties
-
-               #region Methods
-
-               public override int Add (object value) {
-                       Validate (-1, value);
-                       OnSchemaChanging();
-                       ((AbstractDbParameter)value).Parent = this;
-                       return _list.Add (value);
-               }
-
-               public override void AddRange (Array values)
-               {
-                       foreach (object value in values)
-                               Add (value);
-               }
-
-
-               public override void Clear () {
-                       OnSchemaChanging();
-                       if (_list != null && Count != 0) {
-                               for (int i = 0; i < _list.Count; i++) {
-                                       ((AbstractDbParameter)_list [i]).Parent = null;
-                               }
-                               _list.Clear ();
-                       }
-               }
-
-               public override bool Contains (object value) {
-                       if (IndexOf (value) != -1)
-                               return true;
-                       else
-                               return false;
-               }
-
-               public override bool Contains (string value) {
-                       if (IndexOf (value) != -1)
-                               return true;
-                       else
-                               return false;
-               }
-
-               public override void CopyTo (Array array, int index) {
-                       _list.CopyTo (array, index);
-               }
-
-               public override IEnumerator GetEnumerator () {
-                       return _list.GetEnumerator ();
-               }
-
-               protected override DbParameter GetParameter (int index) {
-                       return (DbParameter) _list [index];
-               }
-
-               protected override DbParameter GetParameter (string parameterName) {
-                       return GetParameter (IndexOf (parameterName));
-               }
-
-               protected override void SetParameter (string parameterName, DbParameter value) {
-                       SetParameter (IndexOf (parameterName), value);
-               }
-
-               public override int IndexOf (object value) {
-                       ValidateType (value);
-                       return _list.IndexOf (value);
-               }
-
-               public override int IndexOf (string parameterName) {
-                       if (_list == null)
-                               return -1;
-
-                       for (int i = 0; i < _list.Count; i++) {
-                               string name = ((DbParameter)_list [i]).ParameterName;
-                               if (String.Compare (name, parameterName, StringComparison.OrdinalIgnoreCase) == 0) {
-                                       return i;
-                               }
-                       }
-                       return -1;
-               }
-
-               public override void Insert (int index, object value) {
-                       Validate(-1, (DbParameter)value);
-                       OnSchemaChanging();
-                       ((AbstractDbParameter)value).Parent = this;
-                       _list.Insert (index, value);
-               }
-
-               public override void Remove (object value) {
-                       ValidateType (value);
-                       int index = IndexOf (value);
-                       RemoveIndex (index);
-               }
-
-               public override void RemoveAt (int index) {
-                       RemoveIndex (index);
-               }
-
-               public override void RemoveAt (string parameterName) {
-                       int index = IndexOf (parameterName);
-                       RemoveIndex (index);
-               }
-
-               protected override void SetParameter (int index, DbParameter value) {
-                       Replace (index, value);
-               }
-
-               void Validate (int index, object value) {
-                       ValidateType (value);
-                       AbstractDbParameter parameter = (AbstractDbParameter) value;
-
-                       if (parameter.Parent != null) {
-                               if (parameter.Parent.Equals (this)) {
-                                       if (IndexOf (parameter) != index)
-                                               throw ExceptionHelper.CollectionAlreadyContains (ItemType,"ParameterName",parameter.ParameterName,this);                    
-                               }
-                               else {
-                                       // FIXME :  The OleDbParameter with ParameterName 'MyParam2' is already contained by another OleDbParameterCollection.
-                                       throw new ArgumentException ("");
-                               }
-                       }
-
-                       if (parameter.ParameterName == null  || parameter.ParameterName == String.Empty) {
-                               int newIndex = 1;
-                               string parameterName;
-                               
-                               do {
-                                       parameterName = "Parameter" + newIndex;
-                                       newIndex++;
-                               }
-                               while(IndexOf (parameterName) != -1);
-
-                               parameter.ParameterName = parameterName;
-                       }
-               }               
-
-               void ValidateType (object value) {
-                       if (value == null)
-                               throw ExceptionHelper.CollectionNoNullsAllowed (this,ItemType);
-
-                       Type objectType = value.GetType ();
-                       Type itemType = ItemType;
-
-                       if (itemType.IsInstanceOfType(objectType)) {
-                               Type thisType = this.GetType ();
-                               string err = String.Format ("The {0} only accepts non-null {1} type objects, not {2} objects.", thisType.Name, itemType.Name, objectType.Name);
-                               throw new InvalidCastException (err);
-                       }
-               }
-
-               private void RemoveIndex (int index) {
-                       OnSchemaChanging();
-                       AbstractDbParameter oldItem = (AbstractDbParameter)_list [index];
-                       oldItem.Parent = null;
-                       _list.RemoveAt (index);
-               }               
-
-               private void Replace (int index, DbParameter value) {
-                       Validate (index, value);
-                       AbstractDbParameter oldItem = (AbstractDbParameter)this [index];
-                       oldItem.Parent = null;
-
-                       ((AbstractDbParameter)value).Parent = this;
-                       _list [index] = value;
-               }
-
-               protected internal void OnSchemaChanging()
-        {
-            if (_parent != null) {
-                _parent.OnSchemaChanging();
-            }
-        }
-
-               #endregion // Methods
-       }
-}
diff --git a/mcs/class/System.Data/System.Data.ProviderBase.jvm/ChangeLog b/mcs/class/System.Data/System.Data.ProviderBase.jvm/ChangeLog
deleted file mode 100644 (file)
index 4867cbb..0000000
+++ /dev/null
@@ -1,110 +0,0 @@
-2007-08-19 Vladimir Krasnov <vladimirk@mainsoft.com>
-
-       * AbstractDataReader.cs: optimized IndexOf in Results proprty
-
-2007-08-14 Vladimir Krasnov <vladimirk@mainsoft.com>
-
-       * AbstractDBConnection.cs: performance optimization
-
-2006-11-29 Vladimir Krasnov <vladimirk@mainsoft.com>
-
-       * AbstractDBConnection.cs: fixed ExecuteDbDataReader, wrong exception
-       if executiong on closed connection
-
-2006-08-24 Vladimir Krasnov <vladimirk@mainsoft.com>
-
-       * AbstractDBConnection.cs: fixed GetSyntaxPatterns, configuration
-       section moved
-
-2006-05-09 Boris Kirzner <borisk@mainsoft.com>
-       * AbstractDBCommand.cs: only input parameters can be set by specialized methods.
-
-2006-05-07 Boris Kirzner <borisk@mainsfot.com>
-       * AbstractDBConnection.cs : resolved ambigous reference.
-
-2006-03-26  Konstantin Triger <kostat@mainsoft.com>
-
-       * AbstractDataReader.cs: check for SQLServer uniqueidentifier type for VARCHAR.
-
-2006-03-21     Boris Kirzner <borisk@mainsoft.com>
-       * AbstractDBConnection.cs: resolve abguity.
-
-2006-03-05  Konstantin Triger <kostat@mainsoft.com>
-
-       * AbstractDBCommand.cs: differentiate between setting varying and fixed length strings.
-
-2006-03-05  Konstantin Triger <kostat@mainsoft.com>
-
-       * AbstractDataReader.cs, ReaderCache.cs: enable provider specific caches.
-
-2006-02-26  Konstantin Triger <kostat@mainsoft.com>
-
-       * AbstractDataReader.cs: Prevent recursion when GetXXX is overriden and GetXXXSafe is called.
-       * ReaderCache.cs: Added IsNumeric to cache containers.
-       * AbstractDBCommand.cs, regex.cs: Refactoring.
-
-2006-05-01 Konstantin Triger <kostat@mainsoft.com
-
-       *      AbstractDataReader.cs, ReaderCache.cs: use stream interfaces
-               where appropriate.
-
-2005-14-12 Konstantin Triger <kostat@mainsoft.com>
-
-       * DbPortResolver.cs, AbstractDBConnection.cs: differentiate between the situation where
-               don't have a response and where instance name does not exist.
-       
-2005-14-12 Konstantin Triger <kostat@mainsoft.com>
-
-       * DbPortResolver.cs: fix port resolution for unnamed instances.
-
-2005-27-11 Boris Kirzner <borisk@mainsoft.com>
-       AbstractDBCommand.cs: TARGET_JVM fix. Proper handle of return value 
-       parameter and corresponding user parameter.
-
-2006-22-11 Konstantin Triger <kostat@mainsoft.com>
-
-       * AbstractTransaction.cs: set inner exception.
-
-2005-16-11 Boris Kirzner <borisk@mainsoft.com>
-       * AbstractDBConnection.cs: TARGET_JVM fix. Throw exception if MSSQL port
-       resolution failed.
-
-2005-14-11 Boris Kirzner <borisk@mainsoft.com>
-       * AbstractDBCommand.cs: TARGET_JVM fix. Provider name can be in any case..
-
-2005-13-09 Boris Kirzner <borisk@mainsoft.com>
-       * AbstractDBCommand.cs: TARGET_JVM fix. Check for derived parameters
-       array length.
-
-2005-28-08 Boris Kirzner <borisk@mainsoft.com>
-       * ReaderCache.cs: 
-               - Create Guid from the string fetched.
-
-2005-28-08 Boris Kirzner <borisk@mainsoft.com>
-       * AbstractDBCommand.cs: 
-               - Do not check for "select ... from", just add "for browse" if needed.
-               Removed unused regex.
-
-2005-25-08 Boris Kirzner <borisk@mainsoft.com>
-       * AbstractDBCommand.cs: 
-               - Set max fetch size for jdbc statement.
-               
-2005-21-08 Boris Kirzner <borisk@mainsoft.com>
-       * ReaderCache.cs: no not create guid if the value fetched is null.
-       * SqlClientStrings.resx: fixed CON_PORT key value.
-
-2005-18-08 Boris Kirzner <borisk@mainsoft.com>
-       * AbstractDBCommand.cs: 
-               - Using Java regex instead of .Net ones.
-               - Added GetReturnParameter method, used in resolving return value 
-               user parameter for stored procedures.
-               - Do not set max rows for jdbc statement - this causes sp on sql server
-               to fail in creating additional rows.
-
-2005-22-06  Konstantin Triger <kostat@mainsoft.com>
-
-       * AbstractDataReader.cs: GetBytes should return the data length if target buffer is null
-
-2005-21-06  Konstantin Triger <kostat@mainsoft.com>
-
-       * AbstractDataReader.cs: if command is preapred, recalculate params on every ExecReader
diff --git a/mcs/class/System.Data/System.Data.ProviderBase.jvm/regex.cs b/mcs/class/System.Data/System.Data.ProviderBase.jvm/regex.cs
deleted file mode 100644 (file)
index 797a589..0000000
+++ /dev/null
@@ -1,258 +0,0 @@
-//\r
-// System.Data.ProviderBase.regex.cs\r
-//\r
-// Authors:\r
-//     Konstantin Triger <kostat@mainsoft.com>\r
-//     \r
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)\r
-//\r
-\r
-//\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-// \r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-// \r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
-//\r
-\r
-using System.Data;\r
-using System.Data.Common;\r
-using System.Data.OleDb;\r
-\r
-namespace System.Data.ProviderBase {\r
-       public abstract class SimpleRegex {\r
-               abstract protected internal SimpleMatch Match(string input, int beginning, int length);\r
-               protected internal SimpleMatch Match(string input) {\r
-                       return Match(input, 0, input.Length);\r
-               }\r
-\r
-               protected bool IsWordChar(char c) { //regexp w ([a-zA-Z_0-9]) + #@$\r
-                       if (c < '@') {\r
-                               return (c >= '0' && c <= '9') ||\r
-                                               (c == '#' || c == '$');\r
-                       }\r
-                       else {\r
-                               return (c <= 'Z') ||\r
-                                       (c <= 'z' && c >= '_' && c != '`');\r
-                       }\r
-               }\r
-       }\r
-       public class SimpleCapture {\r
-               readonly int _index;\r
-               readonly int _length;\r
-               readonly string _input;\r
-\r
-               protected SimpleCapture(int index, int length, string input) {\r
-                       _index = index;\r
-                       _length = length;\r
-                       _input = input;\r
-               }\r
-\r
-               protected internal int Index {\r
-                       get {\r
-                               return _index;\r
-                       }\r
-               }\r
-\r
-               protected internal int Length {\r
-                       get {\r
-                               return _length;\r
-                       }\r
-               }\r
-\r
-               protected internal string Value {\r
-                       get {\r
-                               return Input.Substring(Index, Length);\r
-                       }\r
-               }\r
-\r
-               protected string Input {\r
-                       get {\r
-                               return _input;\r
-                       }\r
-               }\r
-       }\r
-\r
-       public class SimpleMatch : SimpleCapture {\r
-               readonly bool _success;\r
-               readonly SimpleRegex _regex;\r
-               readonly int _total;\r
-               readonly int _skip;\r
-\r
-               public SimpleMatch(SimpleRegex regex, int total, bool success, int index, int length, string input)\r
-                       : this(regex, total, success, index, length, 0, input) {}\r
-\r
-               public SimpleMatch(SimpleRegex regex, int total, bool success, int index, int length, int skip, string input)\r
-                       : base(index, length, input) {\r
-                       _success = success;\r
-                       _regex = regex;\r
-                       _total = total;\r
-                       _skip = skip;\r
-               }\r
-\r
-               protected internal SimpleMatch NextMatch() {\r
-                       return _regex.Match(Input, Index+Length+_skip, _total);\r
-               }\r
-\r
-               protected internal bool Success {\r
-                       get {\r
-                               return _success;\r
-                       }\r
-               }\r
-       }\r
-\r
-       internal class OleDbParamsRegex : SimpleRegex {\r
-               protected internal override SimpleMatch Match(string input, int beginning, int length) {\r
-\r
-                       for (int i = beginning; i < length; i++) {\r
-                               char ch = input[i];\r
-                               switch(ch) {\r
-                                       case '\'': {\r
-                                               int end = input.IndexOf('\'', i+1);\r
-                                               if (end < 0)\r
-                                                       break;\r
-\r
-                                               i = end;\r
-                                               break;\r
-                                       }\r
-                                       case '"': {\r
-                                               int end = input.IndexOf('"', i+1);\r
-                                               if (end < 0)\r
-                                                       break;\r
-\r
-                                               i = end;\r
-                                               break;\r
-                                       }\r
-                                       case '[': {\r
-                                               int end = input.IndexOf(']', i+1);\r
-                                               if (end < 0)\r
-                                                       break;\r
-\r
-                                               i = end;\r
-                                               break;\r
-                                       }\r
-                                       case '?': {\r
-                                               return new SimpleMatch(this, length, true, i, 1, input);\r
-                                       }\r
-                               }\r
-                       }\r
-\r
-                       return new SimpleMatch(this, length, false, length, 0, input);\r
-               }\r
-       }\r
-\r
-       internal class SqlParamsRegex : SimpleRegex {\r
-               //static readonly char[] charsEnd = new char[] {' ', '\f', '\t', '\v', '\r', '\n',  ',', ';', '(', ')', '[', ']','='};\r
-               protected internal override SimpleMatch Match(string input, int beginning, int length) {\r
-\r
-                       int actualLen = length-1; //there must be something after @\r
-                       for (int i = beginning; i < actualLen; i++) {\r
-                               char ch = input[i];\r
-                               switch(ch) {\r
-                                       case '\'': {\r
-                                               int end = input.IndexOf('\'', i+1);\r
-                                               if (end < 0)\r
-                                                       break;\r
-\r
-                                               i = end;\r
-                                               break;\r
-                                       }\r
-                                       case '"': {\r
-                                               int end = input.IndexOf('"', i+1);\r
-                                               if (end < 0)\r
-                                                       break;\r
-\r
-                                               i = end;\r
-                                               break;\r
-                                       }\r
-                                       case '[': {\r
-                                               int end = input.IndexOf(']', i+1);\r
-                                               if (end < 0)\r
-                                                       break;\r
-\r
-                                               i = end;\r
-                                               break;\r
-                                       }\r
-                                       case '@': {\r
-                                               int start = i;\r
-\r
-                                               do {\r
-                                                       i++;\r
-                                               }while (i < length && input[i] == '@');\r
-\r
-                                               if (i - start > 1)\r
-                                                       break;\r
-\r
-                                               while (i < length && IsWordChar(input[i]))\r
-                                                       i++;\r
-       \r
-                                               return new SimpleMatch(this, length, true, start, i-start, input);\r
-                                       }\r
-                               }\r
-                       }\r
-\r
-                       return new SimpleMatch(this, length, false, length, 0, input);\r
-               }\r
-       }\r
-\r
-       internal class CharacterSplitterRegex : SimpleRegex {\r
-               char _delimiter;\r
-               internal CharacterSplitterRegex(char delimiter) {\r
-                       _delimiter = delimiter;\r
-               }\r
-               protected internal override SimpleMatch Match(string input, int beginning, int length) {\r
-\r
-                       for (int i = beginning; i < length; i++) {\r
-                               char ch = input[i];\r
-                               switch(ch) {\r
-                                       case '\'': {\r
-                                               int end = input.IndexOf('\'', i+1);\r
-                                               if (end < 0)\r
-                                                       break;\r
-\r
-                                               i = end;\r
-                                               break;\r
-                                       }\r
-                                       case '"': {\r
-                                               int end = input.IndexOf('"', i+1);\r
-                                               if (end < 0)\r
-                                                       break;\r
-\r
-                                               i = end;\r
-                                               break;\r
-                                       }\r
-                                       case '[': {\r
-                                               int end = input.IndexOf(']', i+1);\r
-                                               if (end < 0)\r
-                                                       break;\r
-\r
-                                               i = end;\r
-                                               break;\r
-                                       }\r
-                                       default: {\r
-                                               if (ch != _delimiter)\r
-                                                       break;\r
-\r
-                                               return new SimpleMatch(this, length, true, beginning, i-beginning, 1, input);\r
-                                       }\r
-                               }\r
-                       }\r
-\r
-                       int matchLength = length-beginning;\r
-                       return new SimpleMatch(this, length, matchLength > 0, beginning, matchLength, input);\r
-               }\r
-       }\r
-}
\ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data.ProviderBase/ChangeLog b/mcs/class/System.Data/System.Data.ProviderBase/ChangeLog
deleted file mode 100644 (file)
index 883b6a2..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-2006-02-17  Chris Toshok  <toshok@ximian.com>
-
-       * DbDataReaderBase.cs: Switch to the (bool) form of Dispose to
-       override, as the no-arg form isn't virtual.
-
-2005-11-21 Senganal T <tsenganal@novell.com>
-       
-       * DbParameterCollectionBase.cs 
-               - Marked CheckName method as virtual
-       * DbParameterBase.cs
-               - Marked Offset property and CopyTo method as virtual
-
-2005-05-29 Boris Kirzner <borisk@mainsoft.com>
-       * DbCommandBase.cs 
-               - Private members names changed.
-               - Implemented ExsecuteScalar, ExecuteNonQuery, PropertyChanging and ResetCommandTimeout.
-               - Implemented copy ctor.
-       * DbDataReaderBase.cs
-               - Implemented Depth property.
-               - Added #ifdef NET_2_0 on ISValidRow (not used in TARGET_JVM).
-               - Implemented Dispose and GetEnumerator methods.
-       * DbParameterBase.cs
-               - Private members names changed.
-               - Implemented copy ctor.
-               - Reimplemented Direction, ParameterName, Size and SourceColumn properties.
-               - Added #ifdef NET_2_0 on methods not used in TARGET_JVM
-               - Implemented CopyTo and ShouldSerializeSize methods
-               - Added internal Parent property (used by DbParameterCollectionBase)
-       * DbParameterCollectionBase.cs
-               - Private members names changed.
-               - Re/Implemented public methods and added private ones.
-       * DbStringManager.cs - removed.
-       
-2005-03-11  Sureshkumar T  <tsureshkumar@novell.com>
-
-       * DbConnectionBase.cs : Implemented OnStateChange.
-
-2005-03-08  Sureshkumar T  <tsureshkumar@novell.com>
-
-       * DbParameterBase.cs: Implemented most of get set methods.
-       * DbConnectionBase.cs: Commented ConnectionOptions creation,
-       because it is not yet implemented.
-       * DbCommandBase.cs: Implemented ExecuteScalar method.
-       * DbParameterCollectionBase.cs: Implemented Add method.
-       * DbDataReaderBase.cs: removed internal constructor DbDataReader
-       (DbCommand).
-
-2005-03-02  Sureshkumar T  <tsureshkumar@novell.com>
-
-       * DbConnectionBase.cs: CreateDbCommand: assign connection to the
-       created command.
-
-2005-02-02  Sureshkumar T  <tsureshkumar@novell.com>
-
-       * DbConnectionBase.cs: Implement Dispose Pattern
-
-2004-11-24  Sureshkumar T  <tsureshkumar@novell.com>
-
-       * DbParameterCollectionBase.cs: Class name changed according to
-       the documentation
-       * DbDataReaderBase.cs: Added internal constructor to satisfy
-       SqlDataReader, which takes command object.
-       * DbConnectionBase.cs: Added additional methods overriding
-       DbConnection
-
-2003-12-28  Tim Coleman <tim@timcoleman.com>
-       * DbParameterBase.cs:
-               Correct type of ValueSize method to int
-
-2003-12-23  Tim Coleman <tim@timcoleman.com>
-       * DbCommandBase.cs DbConnectionBase.cs DbConnectionFactory.cs
-       * DbParameterCollectionBase.cs:
-               Some implementation
-
-2003-12-21  Tim Coleman <tim@timcoleman.com>
-       * DbConnectionBase.cs DbConnectionFactory.cs DbConnectionInternal.cs
-       * DbConnectionPoolCounters.cs DbConnectionPoolOptions.cs
-       * DbDataReaderBase.cs DbMetaDataFactory.cs DbParameterBase.cs
-       * DbParameterCollectionBase.cs DbReferenceCollection.cs:
-               New stubs added
-
-2003-12-19  Tim Coleman <tim@timcoleman.com>
-       * DbCommandBase.cs:
-               New stub added
diff --git a/mcs/class/System.Data/System.Data.ProviderBase/DbCommandBase.cs b/mcs/class/System.Data/System.Data.ProviderBase/DbCommandBase.cs
deleted file mode 100644 (file)
index 78e753a..0000000
+++ /dev/null
@@ -1,163 +0,0 @@
-//
-// System.Data.ProviderBase.DbCommandBase
-//
-// Author:
-//   Tim Coleman (tim@timcoleman.com)
-//      Boris Kirzner (borisk@mainsoft.com)
-//
-// Copyright (C) Tim Coleman, 2003
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-using System.Data.Common;
-
-namespace System.Data.ProviderBase {
-       public abstract class DbCommandBase : DbCommand
-       {
-               #region Fields
-               
-               string _commandText;
-               int _commandTimeout;
-               CommandType _commandType;
-               bool _designTimeVisible;
-               UpdateRowSource _updatedRowSource;
-
-               #endregion // Fields
-
-               #region Constructors
-               
-               protected DbCommandBase ()
-               {
-                       _commandText = String.Empty;
-                       _commandTimeout = 30;
-                       _commandType = CommandType.Text;
-                       _designTimeVisible = true;
-                       _updatedRowSource = UpdateRowSource.Both;
-               }
-
-               protected DbCommandBase (DbCommandBase from)
-               {
-                       _commandText = from._commandText;
-                       _commandTimeout = from._commandTimeout;
-                       _commandType = from._commandType;
-                       _updatedRowSource = from._updatedRowSource;
-                       _designTimeVisible = from._designTimeVisible;
-               }
-
-               #endregion // Constructors
-
-               #region Properties
-
-               public override string CommandText {
-                       get { return _commandText; }
-                       set { _commandText = value; }
-               }
-               public override int CommandTimeout {
-                       get { return _commandTimeout; }
-                       set { _commandTimeout = value; }
-               }
-
-               public override CommandType CommandType {
-                       get { return _commandType; }
-                       set { _commandType = value; }
-               }
-
-               public override bool DesignTimeVisible {
-                       get { return _designTimeVisible; }
-                       set { _designTimeVisible = value; }
-               }       
-
-               public override UpdateRowSource UpdatedRowSource {
-                       get { return _updatedRowSource; }
-                       set { _updatedRowSource = value; }
-               }
-
-               #endregion // Properties
-
-               #region Methods
-
-               [MonoTODO]
-               public override void Cancel ()
-               {
-                       throw new NotImplementedException ();
-               }
-
-               
-               public override int ExecuteNonQuery ()
-               {
-                       IDataReader reader = null;
-                       try {
-                               reader = ExecuteReader ();
-                       }
-                       finally {
-                               if (reader != null)
-                                       reader.Close ();                                
-                       }
-                       return reader.RecordsAffected;
-               }
-
-               public override object ExecuteScalar ()
-               {
-                       IDataReader reader = ExecuteReader(CommandBehavior.SingleRow | CommandBehavior.SequentialAccess);
-                       
-                       try {
-                               do {
-                                       if (reader.FieldCount > 0 && reader.Read ())
-                                               return reader.GetValue (0);                     
-                               }
-                               while (reader.NextResult ());
-                               return null;
-                       } finally {
-                               reader.Close();
-                       }
-               }
-
-               [MonoTODO]
-               public override void Prepare ()
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public virtual void PropertyChanging ()
-               {
-               }
-
-               public virtual void ResetCommandTimeout ()
-               {
-                       _commandTimeout = 30;
-               }
-
-               [MonoTODO]
-               protected internal static void SetInputParameterValues (DbCommand command, object[] inputParameterValues)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               #endregion // Methods
-       }
-}
-
diff --git a/mcs/class/System.Data/System.Data.ProviderBase/DbConnectionBase.cs b/mcs/class/System.Data/System.Data.ProviderBase/DbConnectionBase.cs
deleted file mode 100644 (file)
index 56685cd..0000000
+++ /dev/null
@@ -1,226 +0,0 @@
-//
-// System.Data.ProviderBase.DbConnectionBase
-//
-// Author:
-//   Tim Coleman (tim@timcoleman.com)
-//
-// Copyright (C) Tim Coleman, 2003
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Transactions;
-using System.Data.Common;
-using System.EnterpriseServices;
-
-namespace System.Data.ProviderBase {
-       public abstract class DbConnectionBase : DbConnection
-       {
-               #region Fields
-
-               DbConnectionFactory connectionFactory;
-               DbConnectionString connectionOptions;
-               string connectionString;
-                bool disposed = false;
-               
-               #endregion // Fields
-
-               #region Constructors
-
-               protected DbConnectionBase (DbConnectionBase connection)
-                       : this (connection.ConnectionFactory)
-               {
-               }
-
-               protected DbConnectionBase (DbConnectionFactory connectionFactory)
-               {
-                       this.connectionFactory = connectionFactory;
-               }
-
-                protected DbConnectionBase ()
-                {
-                        
-                }
-               
-               #endregion // Constructors
-
-               #region Properties
-
-               [MonoTODO]
-               protected int CloseCount {
-                       get { throw new NotImplementedException (); }
-               }
-
-               protected internal DbConnectionFactory ConnectionFactory {
-                       get { return connectionFactory; }
-               }
-
-               protected internal DbConnectionString ConnectionOptions {
-                       get { return connectionOptions; }
-               }
-
-               public override string ConnectionString {
-                       get { return connectionString; }
-                       set { 
-                               //connectionOptions = ConnectionFactory.CreateConnectionOptionsInternal (value);
-                               connectionString = value;
-                       }
-               }
-
-               [MonoTODO]
-               public override int ConnectionTimeout {
-                       get { throw new NotImplementedException (); }
-               }
-
-               [MonoTODO]
-               protected virtual int ConnectionTimeoutInternal {
-                       get { throw new NotImplementedException (); }
-               }
-
-               [MonoTODO]
-               public override string Database {
-                       get { throw new NotImplementedException (); }
-               }
-
-               [MonoTODO]
-               public override string DataSource {
-                       get { throw new NotImplementedException (); }
-               }
-
-               [MonoTODO]
-               protected internal DbConnectionInternal InnerConnection {
-                       get { throw new NotImplementedException (); }
-               }
-
-               [MonoTODO]
-               public override string ServerVersion {
-                       get { throw new NotImplementedException (); }
-               }
-
-               [MonoTODO]
-               public override ConnectionState State {
-                       get { throw new NotImplementedException (); }
-               }
-
-               #endregion // Properties
-
-               #region Events
-
-               public event StateChangeEventHandler StateChange;
-
-               #endregion // Events
-
-               #region Methods
-
-               [MonoTODO]
-               protected override DbTransaction BeginDbTransaction (IsolationLevel isolationLevel)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               public override void ChangeDatabase (string value)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               public override void Close ()
-               {
-                       throw new NotImplementedException ();
-               }
-
-               protected override DbCommand CreateDbCommand ()
-               {
-                       DbCommand cmd = (DbCommand) ConnectionFactory.ProviderFactory.CreateCommand ();
-                        cmd.Connection = this;
-                        return cmd;
-               }
-
-               protected override void Dispose (bool disposing)
-               {
-                        if (!disposed) { 
-                                try {
-                                        if (disposing) {
-                                                // do necessary clean up
-                                        }
-                                        disposed = true;
-                                } finally {
-                                        base.Dispose (disposing);
-                                }
-                       }
-               }
-
-               [MonoTODO]
-               public void EnlistDistributedTransaction (EnterpriseServices.ITransaction transaction)
-               {
-                       throw new NotImplementedException ();
-               }
-
-                [MonoTODO]
-                public void EnlistTransaction (Transaction transaction)
-                {
-                       throw new NotImplementedException ();                        
-                }
-
-               [MonoTODO]
-               protected virtual DbMetaDataFactory GetMetaDataFactory (DbConnectionInternal internalConnection)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               protected void OnStateChange (ConnectionState originalState, ConnectionState currentState)
-               {
-                        if (StateChange != null)
-                                StateChange (this, new StateChangeEventArgs (originalState, currentState));
-               }
-
-               [MonoTODO]
-               public override void Open ()
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               public override DataTable GetSchema ()
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               public override DataTable GetSchema (string collectionName)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               public override DataTable GetSchema (string collectionName, string [] restrictionValues)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               #endregion // Methods
-       }
-}
-
diff --git a/mcs/class/System.Data/System.Data.ProviderBase/DbConnectionFactory.cs b/mcs/class/System.Data/System.Data.ProviderBase/DbConnectionFactory.cs
deleted file mode 100644 (file)
index 37f8bcb..0000000
+++ /dev/null
@@ -1,119 +0,0 @@
-//
-// System.Data.ProviderBase.DbConnectionFactory
-//
-// Author:
-//   Tim Coleman (tim@timcoleman.com)
-//
-// Copyright (C) Tim Coleman, 2003
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-using System.Data.Common;
-
-namespace System.Data.ProviderBase {
-       public abstract class DbConnectionFactory 
-       {
-               #region Fields
-               
-               #endregion // Fields
-
-               #region Constructors
-
-               [MonoTODO]
-               protected DbConnectionFactory ()
-               {
-               }
-
-               [MonoTODO]
-               protected DbConnectionFactory (DbConnectionPoolCounters performanceCounters)
-               {
-               }
-               
-               #endregion // Constructors
-
-               #region Properties
-
-               public abstract DbProviderFactory ProviderFactory { get; }
-
-               #endregion // Properties
-
-               #region Methods
-
-               [MonoTODO]
-               protected virtual IAsyncResult BeginCreateConnection (DbConnectionBase owningObject, DbConnectionString connectionOptions, DbConnectionInternal connection, AsyncCallback callback, object asyncStateObject)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               public void ClearAllPools ()
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               public void ClearPool (DbConnectionBase connection)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               protected abstract DbConnectionInternal CreateConnection (DbConnectionString options, DbConnectionBase owningObject);
-               protected abstract DbConnectionString CreateConnectionOptions (string connectionString);
-               protected abstract DbConnectionPoolOptions CreateConnectionPoolOptions (DbConnectionString options);
-
-               [MonoTODO]
-               protected virtual DbMetaDataFactory CreateMetaDataFactory (DbConnectionInternal internalConnection)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               protected virtual DbConnectionInternal EndCreateConnection (IAsyncResult asyncResult)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               protected internal DbMetaDataFactory GetMetaDataFactory (DbConnectionString connectionOptions, DbConnectionInternal internalConnection)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               internal DbConnectionString CreateConnectionOptionsInternal (string connectionString)
-               {
-                       return CreateConnectionOptions (connectionString);
-               }
-
-               [MonoTODO]
-               public void SetConnectionPoolOptions (string connectionString, DbConnectionPoolOptions poolOptions)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               #endregion // Methods
-       }
-}
-
diff --git a/mcs/class/System.Data/System.Data.ProviderBase/DbConnectionInternal.cs b/mcs/class/System.Data/System.Data.ProviderBase/DbConnectionInternal.cs
deleted file mode 100644 (file)
index 5a22ebe..0000000
+++ /dev/null
@@ -1,166 +0,0 @@
-//
-// System.Data.ProviderBase.DbConnectionInternal
-//
-// Author:
-//   Tim Coleman (tim@timcoleman.com)
-//
-// Copyright (C) Tim Coleman, 2003
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-using System.Data.Common;
-using System.EnterpriseServices;
-
-namespace System.Data.ProviderBase {
-       public abstract class DbConnectionInternal 
-       {
-               #region Fields
-               
-               #endregion // Fields
-
-               #region Constructors
-
-               [MonoTODO]
-               protected DbConnectionInternal ()
-               {
-               }
-               
-               #endregion // Constructors
-
-               #region Properties
-
-               [MonoTODO]
-               protected bool IsEnlistedInDistributedTransaction {
-                       get { throw new NotImplementedException (); }
-               }
-
-               [MonoTODO]
-               protected internal object Owner {
-                       get { throw new NotImplementedException (); }
-               }
-
-               [MonoTODO]
-               protected internal DbReferenceCollection ReferenceCollection {
-                       get { throw new NotImplementedException (); }
-               }
-
-               public abstract string ServerVersion { get; }
-
-               [MonoTODO]
-               public virtual string ServerVersionNormalized {
-                       get { throw new NotImplementedException (); }
-               }
-
-               public abstract ConnectionState State { get; }
-
-               #endregion // Properties
-
-               #region Methods
-
-               protected abstract void Activate (bool isInTransaction);
-
-               [MonoTODO]
-               protected virtual IAsyncResult BeginOpen (DbConnectionBase outerConnection, AsyncCallback callback, object asyncStateObject)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public abstract DbTransaction BeginTransaction (IsolationLevel il);
-
-               [MonoTODO]
-               public virtual void ChangeDatabase (string value)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               public virtual void Close ()
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               protected virtual DbReferenceCollection CreateReferenceCollection ()
-               {
-                       throw new NotImplementedException ();
-               }
-
-               protected abstract void Deactivate ();
-
-               [MonoTODO]
-               public void Dispose ()
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               protected virtual void Dispose (bool disposing)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               protected internal void DoomThisConnection ()
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               public virtual void EndOpen (DbConnectionBase outerConnection, IAsyncResult asyncResult)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public abstract void EnlistDistributedTransaction (ITransaction transaction);
-
-               [MonoTODO]
-               protected virtual DataTable GetSchemaInternal (DbConnectionBase outerConnection, string collectionName, string[] restrictions)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               public virtual void Open (DbConnectionBase outerConnection)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               protected void PurgeWeakReferences ()
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               protected internal void SetDistributedTransaction (ITransaction transaction, bool manualEnlistment)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               #endregion // Methods
-       }
-}
-
diff --git a/mcs/class/System.Data/System.Data.ProviderBase/DbConnectionPoolCounters.cs b/mcs/class/System.Data/System.Data.ProviderBase/DbConnectionPoolCounters.cs
deleted file mode 100644 (file)
index 9791e76..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-//
-// System.Data.ProviderBase.DbConnectionPoolCounters
-//
-// Author:
-//   Tim Coleman (tim@timcoleman.com)
-//
-// Copyright (C) Tim Coleman, 2003
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-using System.Data.Common;
-
-namespace System.Data.ProviderBase {
-       public abstract class DbConnectionPoolCounters
-       {
-               #region Constructors
-       
-               [MonoTODO]
-               protected DbConnectionPoolCounters ()
-               {
-               }
-
-               #endregion // Constructors
-
-               #region Methods
-
-               [MonoTODO]
-               public virtual void Dispose ()
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               protected void InitCounters ()
-               {
-                       throw new NotImplementedException ();
-               }
-
-               #endregion // Methods
-       }
-}
-
diff --git a/mcs/class/System.Data/System.Data.ProviderBase/DbConnectionPoolOptions.cs b/mcs/class/System.Data/System.Data.ProviderBase/DbConnectionPoolOptions.cs
deleted file mode 100644 (file)
index e996830..0000000
+++ /dev/null
@@ -1,105 +0,0 @@
-//
-// System.Data.ProviderBase.DbConnectionPoolOptions
-//
-// Author:
-//   Tim Coleman (tim@timcoleman.com)
-//
-// Copyright (C) Tim Coleman, 2003
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-using System.Data.Common;
-
-namespace System.Data.ProviderBase {
-       public sealed class DbConnectionPoolOptions
-       {
-               #region Fields
-
-               bool poolByIdentity;
-               int creationTimeout;
-               bool hasTransactionAffinity;
-               int loadBalanceTimeout;
-               int maxPoolSize;
-               int minPoolSize;
-               bool useDeactivateQueue;
-
-               #endregion // Fields
-
-               #region Constructors
-       
-               [MonoTODO]
-               public DbConnectionPoolOptions (bool poolByIdentity, int minPoolSize, int maxPoolSize, int creationTimeout, int loadBalanceTimeout, bool hasTransactionAffinity, bool useDeactivateQueue)
-               {
-                       this.poolByIdentity = poolByIdentity;
-                       this.minPoolSize = minPoolSize;
-                       this.maxPoolSize = maxPoolSize;
-                       this.creationTimeout = creationTimeout;
-                       this.loadBalanceTimeout = loadBalanceTimeout;
-                       this.hasTransactionAffinity = hasTransactionAffinity;
-                       this.useDeactivateQueue = useDeactivateQueue;
-               }
-
-               #endregion // Constructors
-
-               #region Properties
-
-               public int CreationTimeout {
-                       get { return creationTimeout; }
-               }
-
-               public bool HasTransactionAffinity {
-                       get { return hasTransactionAffinity; }
-               }
-
-               public int LoadBalanceTimeout {
-                       get { return loadBalanceTimeout; }
-               }
-
-               public int MaxPoolSize {
-                       get { return maxPoolSize; }
-               }
-
-               public int MinPoolSize {
-                       get { return minPoolSize; }
-               }
-
-               public bool PoolByIdentity {
-                       get { return poolByIdentity; }
-               }
-
-               public bool UseDeactivateQueue {
-                       get { return useDeactivateQueue; }
-               }
-
-               [MonoTODO]
-               public bool UseLoadBalancing {
-                       get { throw new NotImplementedException (); }
-               }
-
-               #endregion // Properties
-       }
-}
-
diff --git a/mcs/class/System.Data/System.Data.ProviderBase/DbDataReaderBase.cs b/mcs/class/System.Data/System.Data.ProviderBase/DbDataReaderBase.cs
deleted file mode 100644 (file)
index a667b9c..0000000
+++ /dev/null
@@ -1,306 +0,0 @@
-//
-// System.Data.ProviderBase.DbDataReaderBase
-//
-// Author:
-//   Tim Coleman (tim@timcoleman.com)
-//      Boris Kirzner (borisk@mainsoft.com)
-//
-// Copyright (C) Tim Coleman, 2003
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-using System.Collections;
-using System.Data.Common;
-using System.Runtime.InteropServices;
-
-namespace System.Data.ProviderBase {
-       public abstract class DbDataReaderBase : DbDataReader
-       {
-               #region Fields
-               
-               CommandBehavior behavior;
-               
-               #endregion // Fields
-
-               #region Constructors
-
-               protected DbDataReaderBase (CommandBehavior behavior)
-               {
-                       this.behavior = behavior;
-               }
-
-               #endregion // Constructors
-
-               #region Properties
-
-               protected CommandBehavior CommandBehavior {
-                       get { return behavior; }
-               }
-
-               public override int Depth {
-                       // default value to be overriden by user
-                       get { return 0; }
-               }
-
-               [MonoTODO]
-               public override int FieldCount {
-                       get { throw new NotImplementedException (); }
-               }
-
-               [MonoTODO]
-               public override bool HasRows {
-                       get { throw new NotImplementedException (); }
-               }
-
-               [MonoTODO]
-               public override bool IsClosed {
-                       get { throw new NotImplementedException (); }
-               }
-
-               protected abstract bool IsValidRow { get; }
-
-               [MonoTODO]
-               public override object this [[Optional] int index] {
-                       get { throw new NotImplementedException (); }
-               }
-
-               [MonoTODO]
-               public override object this [[Optional] string columnName] {
-                       get { throw new NotImplementedException (); }
-               }
-
-               [MonoTODO]
-               public override int RecordsAffected {
-                       get { throw new NotImplementedException (); }
-               }
-
-               #endregion // Properties
-
-               #region Methods
-
-               [MonoTODO]
-               protected void AssertReaderHasColumns ()
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               protected void AssertReaderHasData ()
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               protected void AssertReaderIsOpen (string methodName)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               public override void Close ()
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               protected static DataTable CreateSchemaTable ()
-               {
-                       throw new NotImplementedException ();
-               }
-
-               protected override void Dispose (bool disposing)
-               {
-                       if (disposing)
-                               Close ();
-               }
-
-               [MonoTODO]
-               protected virtual void FillSchemaTable (DataTable dataTable)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               public override bool GetBoolean (int ordinal)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               public override byte GetByte (int ordinal)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               public override long GetBytes (int ordinal, long fieldoffset, byte[] buffer, int bufferoffset, int length)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               public override char GetChar (int ordinal)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               public override long GetChars (int ordinal, long fieldoffset, char[] buffer, int bufferoffset, int length)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               public override string GetDataTypeName (int ordinal)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               public override DateTime GetDateTime (int ordinal)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               public override decimal GetDecimal (int ordinal)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               public override double GetDouble (int ordinal)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public override IEnumerator GetEnumerator ()
-               {
-                       bool closeReader = (CommandBehavior & CommandBehavior.CloseConnection) != 0;
-                       return new DbEnumerator (this , closeReader);
-               }
-
-               [MonoTODO]
-               public override Type GetFieldType (int ordinal)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               public override float GetFloat (int ordinal)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               public override Guid GetGuid (int ordinal)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               public override short GetInt16 (int ordinal)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               public override int GetInt32 (int ordinal)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               public override long GetInt64 (int ordinal)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               public override string GetName (int ordinal)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               public override int GetOrdinal (string name)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               public override DataTable GetSchemaTable ()
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               public override string GetString (int ordinal)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               public override object GetValue (int ordinal)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               public override int GetValues (object[] values)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               protected bool IsCommandBehavior (CommandBehavior condition)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               public override bool IsDBNull (int ordinal)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               public override bool NextResult ()
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               public override bool Read ()
-               {
-                       throw new NotImplementedException ();
-               }
-
-               #endregion // Methods
-       }
-}
-
diff --git a/mcs/class/System.Data/System.Data.ProviderBase/DbMetaDataFactory.cs b/mcs/class/System.Data/System.Data.ProviderBase/DbMetaDataFactory.cs
deleted file mode 100644 (file)
index 088b701..0000000
+++ /dev/null
@@ -1,192 +0,0 @@
-//
-// System.Data.ProviderBase.DbMetaDataFactory
-//
-// Author:
-//   Tim Coleman (tim@timcoleman.com)
-//
-// Copyright (C) Tim Coleman, 2003
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-using System.Data.Common;
-using System.IO;
-
-namespace System.Data.ProviderBase {
-       public class DbMetaDataFactory 
-       {
-               #region Fields
-
-               Stream xmlStream;
-               string serverVersion;
-               string serverVersionNormalized;
-               
-               #endregion // Fields
-
-               #region Constructors
-
-               [MonoTODO]
-               public DbMetaDataFactory (Stream XmlStream, string serverVersion, string serverVersionNormalized)
-               {
-                       this.xmlStream = XmlStream;
-                       this.serverVersion = serverVersion;
-                       this.serverVersionNormalized = serverVersionNormalized;
-               }
-
-               #endregion // Constructors
-
-               #region Properties
-
-               [MonoTODO]
-               protected DataSet CollectionDataSet {
-                       get { throw new NotImplementedException (); }
-               }
-
-               protected string ServerVersion {
-                       get { return serverVersion; }
-               }
-
-               protected string ServerVersionNormalized {
-                       get { return serverVersionNormalized; }
-               }
-
-               #endregion // Properties
-
-               #region Methods
-
-               [MonoTODO]
-               protected DataTable CloneAndFilterCollection (string collectionName, string[] hiddenColumnNames)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               public void Dispose ()
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               protected virtual void Dispose (bool disposing)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               public virtual DataTable GetSchema (DbConnection connection, DbConnectionInternal internalConnection, string collectionName, string[] restrictions)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               public virtual DataTable PrepareCollection (string collectionName, string[] restrictions, DbConnection connection, DbConnectionInternal internalConnection)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               #endregion // Methods
-
-               public class CollectionNames
-               {
-                       #region Fields
-
-                       public const string DataSourceInformation = "DataSourceInformation";
-                       public const string DataTypes = "DataTypes";
-                       public const string MetaDataCollections = "MetaDataCollections";
-                       public const string ReservedWords = "ReservedWords";
-                       public const string Restrictions = "Restrictions";
-
-                       #endregion // Fields
-
-                       #region Constructors
-       
-                       [MonoTODO]
-                       protected CollectionNames ()
-                       {
-                       }
-
-                       #endregion // Constructors
-               }
-
-               public class ColumnNames
-               {
-                       #region Fields
-
-                       public const string CollectionName = "CollectionName";
-                       public const string ColumnSize = "ColumnSize";
-                       public const string CompositeIdentifierSeparatorPattern = "CompositeIdentifierSeparatorPattern";
-                       public const string CreateFormat = "CreateFormat";
-                       public const string CreateParameters = "CreateParameters";
-                       public const string DataSourceProductName = "DataSourceProductName";
-                       public const string DataSourceProductVersion = "DataSourceProductVersion";
-                       public const string DataSourceProductVersionNormalized = "DataSourceProductVersionNormalized";
-                       public const string DataType = "DataType";
-                       public const string GroupByBehavior = "GroupByBehavior";
-                       public const string IdentifierCase = "IdentifierCase";
-                       public const string IdentifierPattern = "IdentifierPattern";
-                       public const string IsAutoIncrementable = "IsAutoIncrementable";
-                       public const string IsBestMatch = "IsBestMatch";
-                       public const string IsCaseSensitive = "IsCaseSensitive";
-                       public const string IsFixedLength = "IsFixedLength";
-                       public const string IsFixedPrecisionScale = "IsFixedPrecisionScale";
-                       public const string IsLiteralSupported = "IsLiteralSupported";
-                       public const string IsLong = "IsLong";
-                       public const string IsNullable = "IsNullable";
-                       public const string IsSearchable = "IsSearchable";
-                       public const string IsSearchableWithLike = "IsSearchableWithLike";
-                       public const string IsUnsigned = "IsUnsigned";
-                       public const string LiteralPrefix = "LiteralPrefix";
-                       public const string LiteralSuffix = "LiteralSuffix";
-                       public const string MaximumScale = "MaximumScale";
-                       public const string MinimumScale = "MinimumScale";
-                       public const string NumberOfIdentifierParts = "NumberOfIdentifierParts";
-                       public const string NumberOfRestrictions = "NumberOfRestrictions";
-                       public const string OrderByColumnsInSelect = "OrderByColumnsInSelect";
-                       public const string ParameterMarkerFormat = "ParameterMarkerFormat";
-                       public const string ParameterMarkerPattern = "ParameterMarkerPattern";
-                       public const string ParameterNameMaxLength = "ParameterNameMaxLength";
-                       public const string ProviderDbType = "ProviderDbType";
-                       public const string QuotedIdentifierCase = "QuotedIdentifierCase";
-                       public const string QuotedIdentifierPattern = "QuotedIdentifierPattern";
-                       public const string ReservedWord = "ReservedWord";
-                       public const string SQLJoinSupport = "SQLJoinSupport";
-                       public const string StatementSeparatorPattern = "StatementSeparatorPattern";
-                       public const string StringLiteralPattern = "StringLiteralPattern";
-                       public const string TypeName = "TypeName";
-
-                       #endregion // Fields
-
-                       #region Constructors
-
-                       [MonoTODO]
-                       public ColumnNames ()
-                       {
-                       }
-
-                       #endregion // Constructors
-               }
-       }
-}
-
diff --git a/mcs/class/System.Data/System.Data.ProviderBase/DbParameterBase.cs b/mcs/class/System.Data/System.Data.ProviderBase/DbParameterBase.cs
deleted file mode 100644 (file)
index a1a428a..0000000
+++ /dev/null
@@ -1,263 +0,0 @@
-//
-// System.Data.ProviderBase.DbParameterBase
-//
-// Author:
-//   Sureshkumar T (tsureshkumar@novell.com)
-//   Tim Coleman (tim@timcoleman.com)
-//   Boris Kirzner <borisk@mainsoft.com>
-//
-// Copyright (C) Tim Coleman, 2003
-//
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-using System.Data.Common;
-
-namespace System.Data.ProviderBase {
-       public abstract class DbParameterBase : DbParameter
-       {
-                #region Fields
-               string _parameterName;
-                ParameterDirection _direction = ParameterDirection.Input;
-               int _size;
-               byte _precision;
-               byte _scale;
-               DataRowVersion _sourceVersion;
-               object _value;
-               bool _isNullable;
-               int _offset;
-               string _sourceColumn;
-               DbParameterCollection _parent = null;
-
-                #endregion // Fields
-
-               #region Constructors
-       
-               [MonoTODO]
-               protected DbParameterBase ()
-               {
-               }
-
-               protected DbParameterBase (DbParameterBase source)
-               {
-                       if (source == null) 
-                               throw ExceptionHelper.ArgumentNull ("source");
-
-                       source.CopyTo (this);
-                       ICloneable cloneable = source._value as ICloneable;
-                       if (cloneable != null)
-                               _value = cloneable.Clone ();
-               }
-        
-               #endregion // Constructors
-
-               #region Properties
-
-               [MonoTODO]
-               protected object CoercedValue {
-                       get { throw new NotImplementedException (); }
-               }
-
-               public override ParameterDirection Direction {
-                       get { return _direction; }
-                       set {
-                               if (_direction != value) {
-                                       switch (value) {
-                                                       case ParameterDirection.Input:
-                                                       case ParameterDirection.Output:
-                                                       case ParameterDirection.InputOutput:
-                                                       case ParameterDirection.ReturnValue:
-                                                       {
-                                                               PropertyChanging ();
-                                                               _direction = value;
-                                                               return;
-                                                       }
-                                       }
-                                       throw ExceptionHelper.InvalidParameterDirection (value);
-                               }
-                       }
-               }
-
-               public override bool IsNullable {
-                       get { return _isNullable; }
-                       set { _isNullable = value; }
-               }
-
-               
-               public virtual int Offset {
-                       get { return _offset; }
-                       set { _offset = value; }                        
-               }
-
-               public override string ParameterName {
-                       get {
-                               if (_parameterName == null)
-                                               return String.Empty;
-
-                               return _parameterName;
-                       }
-                       set {
-                               if (_parameterName != value) {
-                                       PropertyChanging ();
-                                       _parameterName = value;
-                               }
-                       }
-               }
-
-               public override int Size {
-                       get { return _size; }
-
-                       set {
-                               if (_size != value) {
-                                       if (value < -1)
-                                               throw ExceptionHelper.InvalidSizeValue (value);
-
-                                       PropertyChanging ();
-                                       _size = value;
-                               }
-                       }
-               }
-
-               
-               public override string SourceColumn {
-                       get { 
-                               if (_sourceColumn == null)
-                                       return String.Empty;
-
-                               return _sourceColumn;
-                       }
-
-                       set     { _sourceColumn = value; }
-               }
-
-               public override DataRowVersion SourceVersion {
-                       get { return _sourceVersion; }
-                       set { _sourceVersion = value; }
-               }
-
-               
-               public override object Value {
-                       get { return _value; }
-                       set { _value = value; }
-               }
-
-               internal DbParameterCollection Parent
-               {
-                       get { return _parent; }
-                       set { _parent = value; }
-               }
-
-               #endregion // Properties
-
-               #region Methods
-
-               [MonoTODO]
-               public virtual void CopyTo (DbParameter destination)
-               {
-                       if (destination == null)
-                               throw ExceptionHelper.ArgumentNull ("destination");
-
-                       DbParameterBase t = (DbParameterBase)destination;
-                       t._parameterName = _parameterName;                      
-                       t._size = _size;
-                       t._offset = _offset;
-                       t._isNullable = _isNullable;
-                       t._sourceColumn = _sourceColumn;
-                       t._direction = _direction;
-
-                       if (_value is ICloneable)
-                t._value = ((ICloneable) _value).Clone ();
-            else
-                t._value = this._value;
-               }               
-
-               public virtual void PropertyChanging ()
-               {
-               }
-
-
-               [MonoTODO]
-               protected void ResetCoercedValue ()
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               protected void ResetScale ()
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               protected void SetCoercedValue ()
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               protected bool ShouldSerializePrecision ()
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               protected bool ShouldSerializeScale ()
-               {
-                       throw new NotImplementedException ();
-               }
-       
-               protected bool ShouldSerializeSize ()
-               {
-                       return (_size != 0);
-               }
-
-               [MonoTODO]
-               public override string ToString ()
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               protected virtual byte ValuePrecision (object value)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               protected virtual byte ValueScale (object value)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               protected virtual int ValueSize (object value)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               #endregion // Methods
-       }
-}
-
diff --git a/mcs/class/System.Data/System.Data.ProviderBase/DbParameterCollectionBase.cs b/mcs/class/System.Data/System.Data.ProviderBase/DbParameterCollectionBase.cs
deleted file mode 100644 (file)
index 23986ee..0000000
+++ /dev/null
@@ -1,277 +0,0 @@
-//
-// System.Data.ProviderBase.DbParameterCollectionBase
-//
-// Author:
-//   Tim Coleman (tim@timcoleman.com)
-//      Boris Kirzner (borisk@mainsoft.com)
-//
-// Copyright (C) Tim Coleman, 2003
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-using System.Collections;
-using System.Data.Common;
-
-namespace System.Data.ProviderBase {
-       public abstract class DbParameterBaseCollection : DbParameterCollection
-       {
-               #region Fields
-
-               ArrayList _list;
-
-               #endregion // Fields
-
-               #region Constructors
-       
-               protected DbParameterBaseCollection ()
-               {
-                       _list = new ArrayList ();
-               }
-
-               #endregion // Constructors
-
-               #region Properties
-
-               public override int Count {
-                       get { return _list.Count; }
-               }
-
-               public override bool IsFixedSize {
-                       get { return _list.IsFixedSize; }
-               }
-
-               public override bool IsReadOnly {
-                       get { return _list.IsReadOnly; }
-               }
-
-               public override bool IsSynchronized {
-                       get { return _list.IsSynchronized; }
-               }
-
-               protected abstract Type ItemType { get; }
-
-               [MonoTODO]
-               protected virtual string ParameterNamePrefix {
-                       get { throw new NotImplementedException (); }
-               }
-
-               public override object SyncRoot {
-                       get { return _list.SyncRoot; }
-               }
-
-               #endregion // Properties
-
-               #region Methods
-
-               public override int Add (object value)
-               {
-            Validate (-1, value);
-            ((DbParameterBase)value).Parent = this;
-                        return _list.Add (value);
-               }
-
-               public override void AddRange (Array values)
-               {
-                       foreach (object value in values)
-                               Add (value);
-               }
-
-               [MonoTODO]
-               protected virtual int CheckName (string parameterName)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public override void Clear ()
-               {
-            if (_list != null && Count != 0) {
-                               for (int i = 0; i < _list.Count; i++) {
-                                       ((DbParameterBase)_list [i]).Parent = null;
-                               }
-                               _list.Clear ();
-            }
-               }
-
-               public override bool Contains (object value)
-               {
-            if (IndexOf (value) != -1)
-                return true;
-            else
-                return false;
-               }
-
-               public override bool Contains (string value)
-               {
-            if (IndexOf (value) != -1)
-                return true;
-            else
-                return false;
-               }
-
-               public override void CopyTo (Array array, int index)
-               {
-                       _list.CopyTo (array, index);
-               }
-
-               public override IEnumerator GetEnumerator ()
-               {
-                       return _list.GetEnumerator ();
-               }
-
-               protected override DbParameter GetParameter (int index)
-               {
-                       return (DbParameter) _list [index];
-               }
-
-               public override int IndexOf (object value)
-               {
-            ValidateType (value);
-                       return _list.IndexOf (value);
-               }
-
-               public override int IndexOf (string parameterName)
-               {
-            if (_list == null)
-                return -1;
-
-            for (int i = 0; i < _list.Count; i++) {
-                string name = ((DbParameterBase)_list [i]).ParameterName;
-                if (name == parameterName) {
-                    return i;
-                }
-            }
-            return -1;
-               }
-
-               [MonoTODO]
-               protected internal static int IndexOf (IEnumerable items, string parameterName)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public override void Insert (int index, object value)
-               {
-                       Validate(-1, (DbParameterBase)value);
-                       ((DbParameterBase)value).Parent = this;
-                       _list.Insert (index, value);
-               }
-
-               [MonoTODO]
-               protected virtual void OnChange ()
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public override void Remove (object value)
-               {
-            ValidateType (value);
-                       int index = IndexOf (value);
-            RemoveIndex (index);
-               }
-
-               public override void RemoveAt (int index)
-               {
-                       RemoveIndex (index);
-               }
-
-               public override void RemoveAt (string parameterName)
-               {
-            int index = IndexOf (parameterName);
-            RemoveIndex (index);
-               }
-
-               protected override void SetParameter (int index, DbParameter value)
-               {
-                       Replace (index, value);
-               }
-
-               protected virtual void Validate (int index, object value)
-               {
-                       ValidateType (value);
-                       DbParameterBase parameter = (DbParameterBase) value;
-
-            if (parameter.Parent != null) {
-                if (parameter.Parent.Equals (this)) {
-                    if (IndexOf (parameter) != index)
-                        throw ExceptionHelper.CollectionAlreadyContains (ItemType,"ParameterName",parameter.ParameterName,this);                    
-                }
-                else {
-                                       // FIXME :  The OleDbParameter with ParameterName 'MyParam2' is already contained by another OleDbParameterCollection.
-                    throw new ArgumentException ("");
-                }
-            }
-
-            if (parameter.ParameterName == null  || parameter.ParameterName == String.Empty) {
-                               int newIndex = 1;
-                               string parameterName;
-                               
-                               do {
-                                       parameterName = "Parameter" + newIndex;
-                                       newIndex++;
-                               }
-                               while(IndexOf (parameterName) != -1);
-
-                parameter.ParameterName = parameterName;
-            }
-               }               
-
-               protected virtual void ValidateType (object value)
-               {
-                       if (value == null)
-                throw ExceptionHelper.CollectionNoNullsAllowed (this,ItemType);
-
-                       Type objectType = value.GetType ();
-                       Type itemType = ItemType;
-
-                       if (itemType.IsInstanceOfType(objectType)) {
-                               Type thisType = this.GetType ();
-                               string err = String.Format ("The {0} only accepts non-null {1} type objects, not {2} objects.", thisType.Name, itemType.Name, objectType.Name);
-                               throw new InvalidCastException (err);
-                       }
-               }
-
-               private void RemoveIndex (int index)
-        {
-                       DbParameterBase oldItem = (DbParameterBase)_list [index];
-            oldItem.Parent = null;
-            _list.RemoveAt (index);
-        }              
-
-               private void Replace (int index, DbParameter value)
-        {
-            Validate (index, value);
-            DbParameterBase oldItem = (DbParameterBase)this [index];
-            oldItem.Parent = null;
-
-            ((DbParameterBase)value).Parent = this;
-            _list [index] = value;
-        }
-
-               #endregion // Methods
-       }
-}
-
diff --git a/mcs/class/System.Data/System.Data.ProviderBase/DbReferenceCollection.cs b/mcs/class/System.Data/System.Data.ProviderBase/DbReferenceCollection.cs
deleted file mode 100644 (file)
index 77bf72c..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-//
-// System.Data.ProviderBase.DbReferenceCollection
-//
-// Author:
-//   Tim Coleman (tim@timcoleman.com)
-//
-// Copyright (C) Tim Coleman, 2003
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-using System.Collections;
-using System.Data.Common;
-
-namespace System.Data.ProviderBase {
-       public abstract class DbReferenceCollection : IEnumerable
-       {
-               #region Constructors
-       
-               [MonoTODO]
-               protected DbReferenceCollection ()
-               {
-               }
-
-               #endregion // Constructors
-
-               #region Methods
-
-               [MonoTODO]
-               public void Add (object value)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public abstract void Add (object value, int tag);
-
-               [MonoTODO]
-               protected void AddItem (object value, int tag)
-               {
-                       Add (value, tag);
-               }
-
-               [MonoTODO]
-               IEnumerator IEnumerable.GetEnumerator ()
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               public void Notify (int message, int tag, object connectionInternal)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               protected abstract bool NotifyItem (int message, object value, int tag, object connectionInternal);
-
-               [MonoTODO]
-               public void Purge ()
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public abstract void Remove (object value);
-
-               [MonoTODO]
-               protected void RemoveItem (object value)
-               {
-                       Remove (value);
-               }
-
-               #endregion // Methods
-       }
-}
-
diff --git a/mcs/class/System.Data/System.Data.Sql/SqlDataSourceEnumerator.cs b/mcs/class/System.Data/System.Data.Sql/SqlDataSourceEnumerator.cs
deleted file mode 100644 (file)
index ea144fe..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-//
-// System.Data.Sql.SqlDataSourceEnumerator
-//
-// Author:
-//   Tim Coleman (tim@timcoleman.com)
-//
-// Copyright (C) Tim Coleman, 2003
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-using System;
-using System.Data.Common;
-
-namespace System.Data.Sql {
-       public sealed class SqlDataSourceEnumerator : DbDataSourceEnumerator
-       {
-               #region Constructors
-
-               private SqlDataSourceEnumerator ()
-               {
-               }
-
-               #endregion // Constructors
-
-               #region Properties
-
-               [MonoTODO]
-               public static SqlDataSourceEnumerator Instance { 
-                       get { throw new NotImplementedException (); }
-               }
-
-               #endregion // Properties
-
-               #region Methods
-
-               [MonoTODO]
-               public override DataTable GetDataSources ()
-               {
-                       throw new NotImplementedException ();
-               }
-
-               #endregion // Methods
-       }
-}
-
index 8746e40cae635a874a5730662517d669bfe6fdb9..1620c6055ea0d019430deee21bfd407be4d6b548 100644 (file)
@@ -179,6 +179,10 @@ namespace System.Data.SqlClient {
                                                         "exec sp_tablecollations_90 '" +
                                                         DestinationTableName + "'",
                                                         connection);
+
+                       if (externalTransaction != null)
+                               cmd.Transaction = externalTransaction;
+
                        SqlDataReader reader = cmd.ExecuteReader ();
                        int i = 0; // Skipping 1st result
                        do {
@@ -187,7 +191,7 @@ namespace System.Data.SqlClient {
                                  } else if (i == 2) {
                                        SqlDataAdapter adapter = new SqlDataAdapter ();
                                        adapter.MissingSchemaAction = MissingSchemaAction.AddWithKey;
-                                       columnMetaDataTables [i - 1] = new DataTable ();
+                                       columnMetaDataTables [i - 1] = new DataTable (DestinationTableName);
                                        adapter.FillInternal (columnMetaDataTables [i - 1], reader);
                                }
                                i++;
diff --git a/mcs/class/System.Data/System.Data.SqlClient/SqlClientPermission.cs b/mcs/class/System.Data/System.Data.SqlClient/SqlClientPermission.cs
deleted file mode 100644 (file)
index c66bf33..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-//
-// System.Data.SqlClient.SqlClientPermission.cs
-//
-// Authors:
-//     Rodrigo Moya (rodrigo@ximian.com)
-//     Daniel Morgan (danmorg@sc.rr.com)
-//     Tim Coleman (tim@timcoleman.com)
-//     Sebastien Pouliot  <sebastien@ximian.com>
-//
-// (C) Ximian, Inc 2002
-// Copyright (C) Tim Coleman, 2002
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Collections;
-using System.Data.Common;
-using System.Security;
-using System.Security.Permissions;
-
-namespace System.Data.SqlClient {
-
-       [Serializable]
-       public sealed class SqlClientPermission : DBDataPermission {
-
-               #region Fields
-               #endregion // Fields
-
-               #region Constructors
-
-               [Obsolete ("Use SqlClientPermission(PermissionState.None)", true)]
-               public SqlClientPermission ()
-                       : this (PermissionState.None)
-               {
-               }
-
-               public SqlClientPermission (PermissionState state) 
-                       : base (state)
-               {
-               }
-
-               [Obsolete ("Use SqlClientPermission(PermissionState.None)", true)]
-               public SqlClientPermission (PermissionState state, bool allowBlankPassword) 
-                       : base (state)
-               {
-                       AllowBlankPassword = allowBlankPassword;
-               }
-
-               // required for Copy method
-               internal SqlClientPermission (DBDataPermission permission)
-                       : base (permission)
-               {
-               }
-
-               // easier (and common) permission creation from attribute class
-               internal SqlClientPermission (DBDataPermissionAttribute attribute)
-                       : base (attribute)
-               {
-               }
-
-               #endregion // Constructors
-
-               #region Methods
-
-               public override IPermission Copy ()
-               {
-                       return new SqlClientPermission (this);
-               }
-
-               public override void Add (string connectionString, string restrictions, KeyRestrictionBehavior behavior)
-               {
-                       base.Add (connectionString, restrictions, behavior);
-               }
-               #endregion // Methods
-       }
-}
diff --git a/mcs/class/System.Data/System.Data.SqlClient/SqlClientPermissionAttribute.cs b/mcs/class/System.Data/System.Data.SqlClient/SqlClientPermissionAttribute.cs
deleted file mode 100644 (file)
index 7330119..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-//
-// System.Data.SqlClient.SqlClientPermissionAttribute.cs
-//
-// Authors:
-//     Rodrigo Moya (rodrigo@ximian.com)
-//     Daniel Morgan (danmorg@sc.rr.com)
-//     Tim Coleman (tim@timcoleman.com)
-//     Sebastien Pouliot  <sebastien@ximian.com>
-//
-// (C) Ximian, Inc 2002
-// Copyright (C) Tim Coleman, 2002
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Data.Common;
-using System.Security;
-using System.Security.Permissions;
-
-namespace System.Data.SqlClient {
-
-       [AttributeUsage (AttributeTargets.Assembly | AttributeTargets.Class | 
-                        AttributeTargets.Struct | AttributeTargets.Constructor | 
-                        AttributeTargets.Method, AllowMultiple=true,
-                        Inherited=false)]
-       [Serializable]
-       public sealed class SqlClientPermissionAttribute : DBDataPermissionAttribute {
-
-               #region Constructors
-
-               public SqlClientPermissionAttribute (SecurityAction action) 
-                       : base (action)
-               {
-               }
-
-               #endregion // Constructors
-
-               #region Methods
-
-               public override IPermission CreatePermission () 
-               {
-                       return new SqlClientPermission (this);
-               }
-
-               #endregion // Methods
-       }
-}
index 38f7ec7bb6e0d98f2dba2283d9519727e02a4524..194aef4668076d23e69f244c31588d2d58dcc49d 100644 (file)
@@ -419,7 +419,10 @@ namespace System.Data.SqlClient
                
                private SqlInfoMessageEventArgs CreateSqlInfoMessageEvent (TdsInternalErrorCollection errors)
                {
-                       return new SqlInfoMessageEventArgs (errors);
+                       foreach (TdsInternalError e in errors)
+                               return new SqlInfoMessageEventArgs (new SqlException (e.Class, e.LineNumber, e.Message, e.Number, e.Procedure, e.Server, "Mono SqlClient Data Provider", e.State));
+
+                       return null;
                }
 
                private StateChangeEventArgs CreateStateChangeEvent (ConnectionState originalState, ConnectionState currentState)
diff --git a/mcs/class/System.Data/System.Data.SqlClient/SqlConnectionStringBuilder.cs b/mcs/class/System.Data/System.Data.SqlClient/SqlConnectionStringBuilder.cs
deleted file mode 100644 (file)
index ea68940..0000000
+++ /dev/null
@@ -1,864 +0,0 @@
-//
-// System.Data.SqlClient.SqlConnectionStringBuilder.cs
-//
-// Author:
-//   Sureshkumar T (tsureshkumar@novell.com)
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Text;
-using System.Collections;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-
-using System.Data;
-using System.Data.Common;
-using System.ComponentModel;
-
-namespace System.Data.SqlClient
-{
-       [DefaultPropertyAttribute ("DataSource")]
-       [TypeConverterAttribute ("System.Data.SqlClient.SqlConnectionStringBuilder+SqlConnectionStringBuilderConverter, " + Consts.AssemblySystem_Data)]
-       public sealed class SqlConnectionStringBuilder : DbConnectionStringBuilder
-       {
-
-               private const string    DEF_APPLICATIONNAME             = ".NET SqlClient Data Provider";
-               private const bool      DEF_ASYNCHRONOUSPROCESSING      = false;
-               private const string    DEF_ATTACHDBFILENAME            = "";
-               private const bool      DEF_CONNECTIONRESET             = true;
-               private const int       DEF_CONNECTTIMEOUT              = 15;
-               private const string    DEF_CURRENTLANGUAGE             = "";
-               private const string    DEF_DATASOURCE                  = "";
-               private const bool      DEF_ENCRYPT                     = false;
-               private const bool      DEF_ENLIST                      = false;
-               private const string    DEF_FAILOVERPARTNER             = "";
-               private const string    DEF_INITIALCATALOG              = "";
-               private const bool      DEF_INTEGRATEDSECURITY          = false;
-               private const int       DEF_LOADBALANCETIMEOUT          = 0;
-               private const int       DEF_MAXPOOLSIZE                 = 100;
-               private const int       DEF_MINPOOLSIZE                 = 0;
-               private const bool      DEF_MULTIPLEACTIVERESULTSETS    = false;
-               private const string    DEF_NETWORKLIBRARY              = "";
-               private const int       DEF_PACKETSIZE                  = 8000;
-               private const string    DEF_PASSWORD                    = "";
-               private const bool      DEF_PERSISTSECURITYINFO         = false;
-               private const bool      DEF_POOLING                     = true;
-               private const bool      DEF_REPLICATION                 = false;
-               private const string    DEF_USERID                      = "";
-               private const string    DEF_WORKSTATIONID               = "";
-               private const string    DEF_TYPESYSTEMVERSION           = "Latest";
-               private const bool      DEF_TRUSTSERVERCERTIFICATE      = false;
-               private const bool      DEF_USERINSTANCE                = false;  
-               private const bool      DEF_CONTEXTCONNECTION           = false;        
-               private const string    DEF_TRANSACTIONBINDING          = "Implicit Unbind";
-
-
-               #region // Fields
-               private string  _applicationName;
-               private bool    _asynchronousProcessing;
-               private string  _attachDBFilename;
-               private bool    _connectionReset;
-               private int     _connectTimeout;
-               private string  _currentLanguage;
-               private string  _dataSource;
-               private bool    _encrypt;
-               private bool    _enlist;
-               private string  _failoverPartner;
-               private string  _initialCatalog;
-               private bool    _integratedSecurity;
-               private int     _loadBalanceTimeout;
-               private int     _maxPoolSize;
-               private int     _minPoolSize;
-               private bool    _multipleActiveResultSets;
-               private string  _networkLibrary;
-               private int     _packetSize;
-               private string  _password;
-               private bool    _persistSecurityInfo;
-               private bool    _pooling;
-               private bool    _replication;
-               private string  _userID;
-               private string  _workstationID;
-               private bool    _trustServerCertificate;
-               private string  _typeSystemVersion;
-               private bool    _userInstance;
-               private bool    _contextConnection;
-               private string  _transactionBinding;
-
-               private static Dictionary <string, string> _keywords; // for mapping duplicate keywords
-               private static Dictionary <string, object> _defaults; 
-               #endregion // Fields
-
-               #region Constructors
-               public SqlConnectionStringBuilder () : this (String.Empty)
-               {
-               }
-
-               public SqlConnectionStringBuilder (string connectionString)
-               {
-                       Init ();
-                       base.ConnectionString = connectionString;
-               }
-
-               static SqlConnectionStringBuilder ()
-               {
-                       _keywords = new Dictionary <string, string> ();
-                       _keywords ["APP"]                       = "Application Name";
-                       _keywords ["APPLICATION NAME"]          = "Application Name";
-                       _keywords ["ATTACHDBFILENAME"]          = "AttachDbFilename";
-                       _keywords ["EXTENDED PROPERTIES"]       = "Extended Properties";
-                       _keywords ["INITIAL FILE NAME"]         = "Initial File Name";
-                       _keywords ["TIMEOUT"]                   = "Connect Timeout";
-                       _keywords ["CONNECT TIMEOUT"]           = "Connect Timeout";
-                       _keywords ["CONNECTION TIMEOUT"]        = "Connect Timeout";
-                       _keywords ["CONNECTION RESET"]          = "Connection Reset";
-                       _keywords ["LANGUAGE"]                  = "Current Language";
-                       _keywords ["CURRENT LANGUAGE"]          = "Current Language";
-                       _keywords ["DATA SOURCE"]               = "Data Source";
-                       _keywords ["SERVER"]                    = "Data Source";
-                       _keywords ["ADDRESS"]                   = "Data Source";
-                       _keywords ["ADDR"]                      = "Data Source";
-                       _keywords ["NETWORK ADDRESS"]           = "Data Source";
-                       _keywords ["ENCRYPT"]                   = "Encrypt";
-                       _keywords ["ENLIST"]                    = "Enlist";
-                       _keywords ["INITIAL CATALOG"]           = "Initial Catalog";
-                       _keywords ["DATABASE"]                  = "Initial Catalog";
-                       _keywords ["INTEGRATED SECURITY"]       = "Integrated Security";
-                       _keywords ["TRUSTED_CONNECTION"]        = "Integrated Security";
-                       _keywords ["MAX POOL SIZE"]             = "Max Pool Size";
-                       _keywords ["MIN POOL SIZE"]             = "Min Pool Size";
-                       _keywords ["MULTIPLEACTIVERESULTSETS"]  = "MultipleActiveResultSets";
-                       _keywords ["ASYNCHRONOUS PROCESSING"]   = "Asynchronous Processing";
-                       _keywords ["ASYNC"]                     = "Async";
-                       _keywords ["NET"]                       = "Network Library";
-                       _keywords ["NETWORK"]                   = "Network Library";
-                       _keywords ["NETWORK LIBRARY"]           = "Network Library";
-                       _keywords ["PACKET SIZE"]               = "Packet Size";
-                       _keywords ["PASSWORD"]                  = "Password";
-                       _keywords ["PWD"]                       = "Password";
-                       _keywords ["PERSISTSECURITYINFO"]       = "Persist Security Info";
-                       _keywords ["PERSIST SECURITY INFO"]     = "Persist Security Info";
-                       _keywords ["POOLING"]                   = "Pooling";
-                       _keywords ["UID"]                       = "User ID";
-                       _keywords ["USER"]                      = "User ID";
-                       _keywords ["USER ID"]                   = "User ID";
-                       _keywords ["WSID"]                      = "Workstation ID";
-                       _keywords ["WORKSTATION ID"]            = "Workstation ID";
-                       _keywords ["USER INSTANCE"]             = "User Instance";
-                       _keywords ["CONTEXT CONNECTION"]        = "Context Connection";
-                       _keywords ["TRANSACTION BINDING"]       = "Transaction Binding";
-                       _keywords ["FAILOVER PARTNER"]          = "Failover Partner";
-                       _keywords ["REPLICATION"]               = "Replication";
-                       _keywords ["TRUSTSERVERCERTIFICATE"]    = "TrustServerCertificate";
-                       _keywords ["LOAD BALANCE TIMEOUT"]      = "Load Balance Timeout";
-                       _keywords ["TYPE SYSTEM VERSION"]       = "Type System Version";
-
-                       _defaults = new Dictionary<string, object> ();
-                       _defaults.Add("Data Source", DEF_DATASOURCE);
-                       _defaults.Add("Failover Partner", DEF_FAILOVERPARTNER);
-                       _defaults.Add("AttachDbFilename", DEF_ATTACHDBFILENAME);
-                       _defaults.Add("Initial Catalog", DEF_INITIALCATALOG);
-                       _defaults.Add("Integrated Security", DEF_INTEGRATEDSECURITY);
-                       _defaults.Add("Persist Security Info", DEF_PERSISTSECURITYINFO);
-                       _defaults.Add("User ID", DEF_USERID);
-                       _defaults.Add("Password", DEF_PASSWORD);
-                       _defaults.Add("Enlist", DEF_ENLIST);
-                       _defaults.Add("Pooling", DEF_POOLING);
-                       _defaults.Add("Min Pool Size", DEF_MINPOOLSIZE);
-                       _defaults.Add("Max Pool Size", DEF_MAXPOOLSIZE);
-                       _defaults.Add("Asynchronous Processing", DEF_ASYNCHRONOUSPROCESSING);
-                       _defaults.Add("Connection Reset", DEF_CONNECTIONRESET);
-                       _defaults.Add("MultipleActiveResultSets", DEF_MULTIPLEACTIVERESULTSETS);
-                       _defaults.Add("Replication", DEF_REPLICATION);
-                       _defaults.Add("Connect Timeout", DEF_CONNECTTIMEOUT);
-                       _defaults.Add("Encrypt", DEF_ENCRYPT);
-                       _defaults.Add("TrustServerCertificate", DEF_TRUSTSERVERCERTIFICATE);
-                       _defaults.Add("Load Balance Timeout", DEF_LOADBALANCETIMEOUT);
-                       _defaults.Add("Network Library", DEF_NETWORKLIBRARY);
-                       _defaults.Add("Packet Size", DEF_PACKETSIZE);
-                       _defaults.Add("Type System Version", DEF_TYPESYSTEMVERSION);
-                       _defaults.Add("Application Name", DEF_APPLICATIONNAME);
-                       _defaults.Add("Current Language", DEF_CURRENTLANGUAGE);
-                       _defaults.Add("Workstation ID", DEF_WORKSTATIONID);
-                       _defaults.Add("User Instance", DEF_USERINSTANCE);
-                       _defaults.Add("Context Connection", DEF_CONTEXTCONNECTION);
-                       _defaults.Add("Transaction Binding", DEF_TRANSACTIONBINDING);                   
-               }
-               #endregion // Constructors
-
-               #region Properties
-               [DisplayNameAttribute ("Application Name")]
-               [RefreshPropertiesAttribute (RefreshProperties.All)]
-               public string ApplicationName { 
-                       get { return _applicationName; }
-                       set { 
-                               base ["Application Name"] = value;
-                               _applicationName = value; 
-                       }
-               }
-
-               [DisplayNameAttribute ("Asynchronous Processing")]
-               [RefreshPropertiesAttribute (RefreshProperties.All)]
-               public bool AsynchronousProcessing { 
-                       get { return _asynchronousProcessing; }
-                       set { 
-                               base ["Asynchronous Processing"] = value;
-                               _asynchronousProcessing = value; 
-                       }
-               }
-
-               [Editor ("System.Windows.Forms.Design.FileNameEditor, " + Consts.AssemblySystem_Design,
-                        "System.Drawing.Design.UITypeEditor, " + Consts.AssemblySystem_Drawing)]
-               [DisplayNameAttribute ("AttachDbFilename")]
-               [RefreshPropertiesAttribute (RefreshProperties.All)]
-               public string AttachDBFilename { 
-                       get { return _attachDBFilename; }
-                       set { 
-                               base ["AttachDbFilename"] = value;
-                               _attachDBFilename = value; 
-                       }
-               }
-               
-               [DisplayNameAttribute ("Connection Reset")]
-               [RefreshPropertiesAttribute (RefreshProperties.All)]
-               public bool ConnectionReset { 
-                       get { return _connectionReset; }
-                       set { 
-                               base ["Connection Reset"] = value;
-                               _connectionReset = value; 
-                       }
-               }
-               
-               [DisplayNameAttribute ("Connect Timeout")]
-               [RefreshPropertiesAttribute (RefreshProperties.All)]
-               public int ConnectTimeout { 
-                       get { return _connectTimeout; }
-                       set { 
-                               base ["Connect Timeout"] = value;
-                               _connectTimeout = value; 
-                       }
-               }
-
-               [DisplayNameAttribute ("Current Language")]
-               [RefreshPropertiesAttribute (RefreshProperties.All)]
-               public string CurrentLanguage { 
-                       get { return _currentLanguage; }
-                       set { 
-                               base ["Current Language"] = value;
-                               _currentLanguage = value; 
-                       }
-               }
-
-               [DisplayNameAttribute ("Data Source")]
-               [RefreshPropertiesAttribute (RefreshProperties.All)]
-               [TypeConverterAttribute ("System.Data.SqlClient.SqlConnectionStringBuilder+SqlDataSourceConverter, " + Consts.AssemblySystem_Data)]
-               public string DataSource { 
-                       get { return _dataSource; }
-                       set { 
-                               base ["Data Source"] = value;
-                               _dataSource = value; 
-                       }
-               }
-
-               [DisplayNameAttribute ("Encrypt")]
-               [RefreshPropertiesAttribute (RefreshProperties.All)]
-               public bool Encrypt { 
-                       get { return _encrypt; }
-                       set { 
-                               base ["Encrypt"] = value;
-                               _encrypt = value; 
-                       }
-               }
-
-               [DisplayNameAttribute ("Enlist")]
-               [RefreshPropertiesAttribute (RefreshProperties.All)]
-               public bool Enlist { 
-                       get { return _enlist; }
-                       set { 
-                               base ["Enlist"] = value;
-                               _enlist = value; 
-                       }
-               }
-
-               [DisplayNameAttribute ("Failover Partner")]
-               [RefreshPropertiesAttribute (RefreshProperties.All)]
-               [TypeConverterAttribute ("System.Data.SqlClient.SqlConnectionStringBuilder+SqlDataSourceConverter, " + Consts.AssemblySystem_Data)]
-               public string FailoverPartner { 
-                       get { return _failoverPartner; }
-                       set { 
-                               base ["Failover Partner"] = value;
-                               _failoverPartner = value; 
-                       }
-               }
-
-               [DisplayNameAttribute ("Initial Catalog")]
-               [RefreshPropertiesAttribute (RefreshProperties.All)]
-               [TypeConverterAttribute ("System.Data.SqlClient.SqlConnectionStringBuilder+SqlInitialCatalogConverter, " + Consts.AssemblySystem_Data)]
-               public string InitialCatalog { 
-                       get { return _initialCatalog; }
-                       set { 
-                               base ["Initial Catalog"] = value;
-                               _initialCatalog = value; 
-                       }
-               }
-
-               [DisplayNameAttribute ("Integrated Security")]
-               [RefreshPropertiesAttribute (RefreshProperties.All)]
-               public bool IntegratedSecurity { 
-                       get { return _integratedSecurity; }
-                       set { 
-                               base ["Integrated Security"] = value;
-                               _integratedSecurity = value; 
-                       }
-               }
-
-               public override bool IsFixedSize { 
-                       get { return true; }
-               }
-
-               public override object this [string keyword] { 
-                       get { 
-                               string mapped = MapKeyword (keyword);
-                               if (base.ContainsKey (mapped)) 
-                                       return base [mapped];
-                               else
-                                       return _defaults [mapped];
-                       }
-                       set {SetValue (keyword, value);}
-               }
-
-               public override ICollection Keys { 
-                       get { 
-                               List<string> keys = new List<string>();
-                                keys.Add("Data Source");
-                                keys.Add("Failover Partner");
-                                keys.Add("AttachDbFilename");
-                                keys.Add("Initial Catalog");
-                                keys.Add("Integrated Security");
-                                keys.Add("Persist Security Info");
-                                keys.Add("User ID");
-                                keys.Add("Password");
-                                keys.Add("Enlist");
-                                keys.Add("Pooling");
-                                keys.Add("Min Pool Size");
-                                keys.Add("Max Pool Size");
-                                keys.Add("Asynchronous Processing");
-                                keys.Add("Connection Reset");
-                                keys.Add("MultipleActiveResultSets");
-                                keys.Add("Replication");
-                                keys.Add("Connect Timeout");
-                                keys.Add("Encrypt");
-                                keys.Add("TrustServerCertificate");
-                                keys.Add("Load Balance Timeout");
-                                keys.Add("Network Library");
-                                keys.Add("Packet Size");
-                                keys.Add("Type System Version");
-                                keys.Add("Application Name");
-                                keys.Add("Current Language");
-                                keys.Add("Workstation ID");
-                                keys.Add("User Instance");
-                                keys.Add("Context Connection");
-                                keys.Add("Transaction Binding");
-                               var coll = new System.Collections.ObjectModel.ReadOnlyCollection<string>(keys);
-                               return coll;
-                       }
-               }
-
-               [DisplayNameAttribute ("Load Balance Timeout")]
-               [RefreshPropertiesAttribute (RefreshProperties.All)]
-               public int LoadBalanceTimeout { 
-                       get { return _loadBalanceTimeout; }
-                       set { 
-                               base ["Load Balance Timeout"] = value;
-                               _loadBalanceTimeout = value; 
-                       }
-               }
-
-               [DisplayNameAttribute ("Max Pool Size")]
-               [RefreshPropertiesAttribute (RefreshProperties.All)]
-               public int MaxPoolSize { 
-                       get { return _maxPoolSize; }
-                       set { 
-                               base ["Max Pool Size"] = value;
-                               _maxPoolSize = value; 
-                       }
-               }
-
-               [DisplayNameAttribute ("Min Pool Size")]
-               [RefreshPropertiesAttribute (RefreshProperties.All)]
-               public int MinPoolSize { 
-                       get { return _minPoolSize; }
-                       set {
-                               base ["Min Pool Size"] = value;
-                               _minPoolSize = value; 
-                       }
-               }
-
-               [DisplayNameAttribute ("MultipleActiveResultSets")]
-               [RefreshPropertiesAttribute (RefreshProperties.All)]
-               public bool MultipleActiveResultSets { 
-                       get { return _multipleActiveResultSets; }
-                       set { 
-                               base ["Multiple Active Resultsets"] = value;
-                               _multipleActiveResultSets = value; 
-                       }
-               }
-
-               [DisplayNameAttribute ("Network Library")]
-               [RefreshPropertiesAttribute (RefreshProperties.All)]
-               [TypeConverterAttribute ("System.Data.SqlClient.SqlConnectionStringBuilder+NetworkLibraryConverter, " + Consts.AssemblySystem_Data)]
-               public string NetworkLibrary { 
-                       get { return _networkLibrary; }
-                       set { 
-                               base ["Network Library"] = value;
-                               _networkLibrary = value; 
-                       }
-               }
-
-               [DisplayNameAttribute ("Packet Size")]
-               [RefreshPropertiesAttribute (RefreshProperties.All)]
-               public int PacketSize { 
-                       get { return _packetSize; }
-                       set { 
-                               base ["Packet Size"] = value;
-                               _packetSize = value; 
-                       }
-               }
-
-               [DisplayNameAttribute ("Password")]
-               [PasswordPropertyTextAttribute (true)]
-               [RefreshPropertiesAttribute (RefreshProperties.All)]
-               public string Password { 
-                       get { return _password; }
-                       set { 
-                               base ["Password"] = value;
-                               _password = value; 
-                       }
-               }
-
-               [DisplayNameAttribute ("Persist Security Info")]
-               [RefreshPropertiesAttribute (RefreshProperties.All)]
-               public bool PersistSecurityInfo { 
-                       get { return _persistSecurityInfo; }
-                       set {
-                               base ["Persist Security Info"] = value;
-                               _persistSecurityInfo = value; 
-                       }
-               }
-               
-               [DisplayNameAttribute ("Pooling")]
-               [RefreshPropertiesAttribute (RefreshProperties.All)]
-               public bool Pooling { 
-                       get { return _pooling; }
-                       set {
-                               base ["Pooling"] = value;
-                               _pooling = value; 
-                       }
-               }
-
-               [DisplayNameAttribute ("Replication")]
-               [RefreshPropertiesAttribute (RefreshProperties.All)]
-               public bool Replication { 
-                       get { return _replication; }
-                       set { 
-                               base ["Replication"] = value;
-                               _replication = value; 
-                       }
-               }
-
-               [DisplayNameAttribute ("User ID")]
-               [RefreshPropertiesAttribute (RefreshProperties.All)]
-               public string UserID { 
-                       get { return _userID; }
-                       set { 
-                               base ["User Id"]= value;
-                               _userID = value; 
-                       }
-               }
-               
-               public override ICollection Values { 
-                       get {
-                               List<object> values = new List<object>();
-                                values.Add(_dataSource);
-                                values.Add(_failoverPartner);
-                                values.Add(_attachDBFilename);
-                                values.Add(_initialCatalog);
-                                values.Add(_integratedSecurity);
-                                values.Add(_persistSecurityInfo);
-                                values.Add(_userID);
-                                values.Add(_password);
-                                values.Add(_enlist);
-                                values.Add(_pooling);
-                                values.Add(_minPoolSize);
-                                values.Add(_maxPoolSize);
-                                values.Add(_asynchronousProcessing);
-                                values.Add(_connectionReset);
-                                values.Add(_multipleActiveResultSets);
-                                values.Add(_replication);
-                                values.Add(_connectTimeout);
-                                values.Add(_encrypt);
-                                values.Add(_trustServerCertificate);
-                                values.Add(_loadBalanceTimeout);
-                                values.Add(_networkLibrary);
-                                values.Add(_packetSize);
-                                values.Add(_typeSystemVersion);
-                                values.Add(_applicationName);
-                                values.Add(_currentLanguage);
-                                values.Add(_workstationID);
-                                values.Add(_userInstance);
-                                values.Add(_contextConnection);
-                                values.Add(_transactionBinding);
-                               var coll = new System.Collections.ObjectModel.ReadOnlyCollection<object>(values);
-                               return coll;             
-                       }
-               }
-
-               [DisplayNameAttribute ("Workstation ID")]
-               [RefreshPropertiesAttribute (RefreshProperties.All)]
-               public string WorkstationID { 
-                       get { return _workstationID; }
-                       set { 
-                               base ["Workstation Id"] = value;
-                               _workstationID = value; 
-                       }
-               }
-
-               [DisplayNameAttribute ("TrustServerCertificate")]
-               [RefreshProperties (RefreshProperties.All)]
-               public bool TrustServerCertificate { 
-                       get { return _trustServerCertificate; } 
-                       set {
-                               base ["Trust Server Certificate"] = value;
-                                _trustServerCertificate = value;
-                       }
-               }
-
-               [DisplayNameAttribute ("Type System Version")]
-               [RefreshProperties (RefreshProperties.All)]
-               public string TypeSystemVersion { 
-                       get { return _typeSystemVersion; } 
-                       set {
-                               base ["Type System Version"] = value;                           
-                               _typeSystemVersion = value; 
-                       }
-               }
-
-               [DisplayNameAttribute ("User Instance")]
-               [RefreshProperties (RefreshProperties.All)]
-               public bool UserInstance { 
-                       get { return _userInstance; }
-                       set { 
-                               base ["User Instance"] = value;
-                               _userInstance = value;
-                       }
-               }
-
-               [RefreshPropertiesAttribute (RefreshProperties.All)]
-               [DisplayNameAttribute ("Context Connection")]
-               public bool ContextConnection { 
-                       get { return _contextConnection; }
-                       set { 
-                               base ["Context Connection"] = value;
-                               _contextConnection = value;
-                       }
-               }
-               #endregion // Properties
-
-               #region Methods
-               private void Init ()
-               {
-                       _applicationName        = DEF_APPLICATIONNAME;
-                       _asynchronousProcessing = DEF_ASYNCHRONOUSPROCESSING;
-                       _attachDBFilename       = DEF_ATTACHDBFILENAME;
-                       _connectionReset        = DEF_CONNECTIONRESET;
-                       _connectTimeout         = DEF_CONNECTTIMEOUT;
-                       _currentLanguage        = DEF_CURRENTLANGUAGE;
-                       _dataSource             = DEF_DATASOURCE;
-                       _encrypt                = DEF_ENCRYPT;
-                       _enlist                 = DEF_ENLIST;
-                       _failoverPartner        = DEF_FAILOVERPARTNER;
-                       _initialCatalog         = DEF_INITIALCATALOG;
-                       _integratedSecurity     = DEF_INTEGRATEDSECURITY;
-                       _loadBalanceTimeout     = DEF_LOADBALANCETIMEOUT;
-                       _maxPoolSize            = DEF_MAXPOOLSIZE;
-                       _minPoolSize            = DEF_MINPOOLSIZE;
-                       _multipleActiveResultSets= DEF_MULTIPLEACTIVERESULTSETS;
-                       _networkLibrary         = DEF_NETWORKLIBRARY;
-                       _packetSize             = DEF_PACKETSIZE;
-                       _password               = DEF_PASSWORD;
-                       _persistSecurityInfo    = DEF_PERSISTSECURITYINFO;
-                       _pooling                = DEF_POOLING;
-                       _replication            = DEF_REPLICATION;
-                       _userID                 = DEF_USERID;
-                       _workstationID          = DEF_WORKSTATIONID;
-                       _trustServerCertificate = DEF_TRUSTSERVERCERTIFICATE;
-                       _typeSystemVersion      = DEF_TYPESYSTEMVERSION;
-                       _userInstance           = DEF_USERINSTANCE;
-                       _contextConnection      = DEF_CONTEXTCONNECTION;
-                       _transactionBinding     = DEF_TRANSACTIONBINDING;
-               }
-
-               public override void Clear ()
-               {
-                       base.Clear ();
-                       Init ();
-               }
-
-               public override bool ContainsKey (string keyword)
-               {
-                       keyword = keyword.ToUpper ().Trim ();
-                       if (_keywords.ContainsKey (keyword))
-                               return base.ContainsKey (_keywords [keyword]);
-                       return false;
-               }
-
-               public override bool Remove (string keyword)
-               {
-                       if (!ContainsKey (keyword))
-                               return false;
-                       this [keyword] = null;
-                       return true;
-               }
-
-               [MonoNotSupported ("")] // Note that base.ShouldSerialize() is called but not implemented
-               public override bool ShouldSerialize (string keyword)
-               {
-                       if (!ContainsKey (keyword))
-                               return false;
-                       keyword = keyword.ToUpper ().Trim ();
-                       // Assuming passwords cannot be serialized.
-                       if (_keywords [keyword] == "Password")
-                               return false;
-                       return base.ShouldSerialize (_keywords [keyword]);
-               }
-
-               public override bool TryGetValue (string keyword, out object value)
-               {
-                       if (! ContainsKey (keyword)) {
-                               value = String.Empty;
-                               return false;
-                       }
-                       return base.TryGetValue (_keywords [keyword.ToUpper ().Trim ()], out value);
-               }
-
-               #endregion // Methods
-
-               #region Private Methods
-               private string MapKeyword (string keyword)
-               {
-                       keyword = keyword.ToUpper ().Trim ();
-                       if (! _keywords.ContainsKey (keyword))
-                               throw new ArgumentException("Keyword not supported :" + keyword);
-                       return _keywords [keyword];
-               }
-               
-               private void SetValue (string key, object value)
-               {
-                       if (key == null)
-                               throw new ArgumentNullException ("key cannot be null!");
-
-                       string mappedKey = MapKeyword (key);
-
-                       switch (mappedKey.ToUpper ().Trim ()) {
-                       case "APPLICATION NAME" :
-                               if (value == null) {
-                                       _applicationName = DEF_APPLICATIONNAME;
-                                       base.Remove (mappedKey);
-                               } else
-                                       this.ApplicationName = value.ToString ();
-                               break;
-                       case "ATTACHDBFILENAME" :
-                               throw new NotImplementedException ("Attachable database support is " +
-                                                                  "not implemented.");
-                       case "CONNECT TIMEOUT" :
-                               if (value == null) {
-                                       _connectTimeout = DEF_CONNECTTIMEOUT;
-                                       base.Remove (mappedKey);
-                               } else 
-                                       this.ConnectTimeout = DbConnectionStringBuilderHelper.ConvertToInt32 (value);
-                               break;
-                       case "CONNECTION LIFETIME" :
-                               break;
-                       case "CONNECTION RESET" :
-                               if (value == null) {
-                                       _connectionReset = DEF_CONNECTIONRESET;
-                                       base.Remove (mappedKey);
-                               } else 
-                                       this.ConnectionReset = DbConnectionStringBuilderHelper.ConvertToBoolean (value);
-                               break;
-                       case "CURRENT LANGUAGE" :
-                               if (value == null) {
-                                       _currentLanguage = DEF_CURRENTLANGUAGE;
-                                       base.Remove (mappedKey);
-                               } else 
-                                       this.CurrentLanguage = value.ToString ();
-                               break;
-                       case "CONTEXT CONNECTION" :
-                               if (value == null) {
-                                       _contextConnection = DEF_CONTEXTCONNECTION;
-                                       base.Remove (mappedKey);
-                               } else
-                                       this.ContextConnection = DbConnectionStringBuilderHelper.ConvertToBoolean (value);
-                               break;
-                       case "DATA SOURCE" :
-                               if (value == null) {
-                                       _dataSource = DEF_DATASOURCE;
-                                       base.Remove (mappedKey);
-                               } else 
-                                       this.DataSource = value.ToString ();
-                               break;
-                       case "ENCRYPT":
-                               if (value == null) {
-                                       _encrypt = DEF_ENCRYPT;
-                                       base.Remove (mappedKey);
-                               }else if (DbConnectionStringBuilderHelper.ConvertToBoolean(value))
-                                       throw new NotImplementedException("SSL encryption for"
-                                                                         + " data sent between client and server is not"
-                                                                         + " implemented.");
-                               break;
-                       case "ENLIST" :
-                               if (value == null) {
-                                       _enlist = DEF_ENLIST;
-                                       base.Remove (mappedKey);
-                               } else if ( ! DbConnectionStringBuilderHelper.ConvertToBoolean(value))
-                                       throw new NotImplementedException("Disabling the automatic"
-                                                                         + " enlistment of connections in the thread's current"
-                                                                         + " transaction context is not implemented.");
-                               break;
-                       case "INITIAL CATALOG" :
-                               if (value == null) {
-                                       _initialCatalog = DEF_INITIALCATALOG;
-                                       base.Remove (mappedKey);
-                               } else 
-                                       this.InitialCatalog = value.ToString ();
-                               break;
-                       case "INTEGRATED SECURITY" :
-                               if (value == null) {
-                                       _integratedSecurity = DEF_INTEGRATEDSECURITY;
-                                       base.Remove (mappedKey);
-                               } else 
-                                       this.IntegratedSecurity = DbConnectionStringBuilderHelper.ConvertToBoolean (value);
-                               break;
-                       case "MAX POOL SIZE" :
-                               if (value == null) {
-                                       _maxPoolSize = DEF_MAXPOOLSIZE;
-                                       base.Remove (mappedKey);
-                               } else 
-                                       this.MaxPoolSize = DbConnectionStringBuilderHelper.ConvertToInt32 (value);
-                               break;
-                       case "MIN POOL SIZE" :
-                               if (value == null) {
-                                       _minPoolSize = DEF_MINPOOLSIZE;
-                                       base.Remove (mappedKey);
-                               } else 
-                                       this.MinPoolSize = DbConnectionStringBuilderHelper.ConvertToInt32 (value);
-                               break;
-                       case "MULTIPLEACTIVERESULTSETS":
-                               if (value == null) {
-                                       _multipleActiveResultSets = DEF_MULTIPLEACTIVERESULTSETS;
-                                       base.Remove (mappedKey);
-                               } else if ( DbConnectionStringBuilderHelper.ConvertToBoolean (value))
-                                       throw new NotImplementedException ("MARS is not yet implemented!");
-                               break;
-                       case "ASYNCHRONOUS PROCESSING" :
-                               if (value == null) {
-                                       _asynchronousProcessing = DEF_ASYNCHRONOUSPROCESSING;
-                                       base.Remove (mappedKey);
-                               } else 
-                                       this.AsynchronousProcessing = DbConnectionStringBuilderHelper.ConvertToBoolean (value);
-                               break;
-                       case "NETWORK LIBRARY" :
-                               if (value == null) {
-                                       _networkLibrary = DEF_NETWORKLIBRARY;
-                                       base.Remove (mappedKey);
-                               } else {
-                                       if (!value.ToString ().ToUpper ().Equals ("DBMSSOCN"))
-                                               throw new ArgumentException ("Unsupported network library.");
-                                       this.NetworkLibrary = value.ToString ().ToLower ();
-                               }
-                               break;
-                       case "LOAD BALANCE TIMEOUT":
-                               // TODO: what is this?
-                               break;
-                       case "PACKET SIZE" :
-                               if (value == null) {
-                                       _packetSize = DEF_PACKETSIZE;
-                                       base.Remove (mappedKey);
-                               } else 
-                                       this.PacketSize = DbConnectionStringBuilderHelper.ConvertToInt32 (value);
-                               break;
-                       case "PASSWORD" :
-                               if (value == null) {
-                                       _password = DEF_PASSWORD;
-                                       base.Remove (mappedKey);
-                               } else 
-                                       this.Password = value.ToString ();
-                               break;
-                       case "PERSIST SECURITY INFO" :
-                               if (value == null) {
-                                       _persistSecurityInfo = DEF_PERSISTSECURITYINFO;
-                                       base.Remove (mappedKey);
-                               } else if (DbConnectionStringBuilderHelper.ConvertToBoolean (value))
-                                       throw new NotImplementedException ("Persisting security info" +
-                                                                          " is not yet implemented");
-                               break;
-                       case "POOLING" :
-                               if (value == null) {
-                                       _pooling = DEF_POOLING;
-                                       base.Remove (mappedKey);
-                               } else 
-                                       this.Pooling = DbConnectionStringBuilderHelper.ConvertToBoolean (value);
-                               break;
-                       case "USER ID" :
-                               if (value == null) {
-                                       _userID = DEF_USERID;
-                                       base.Remove (mappedKey);
-                               } else 
-                                       this.UserID = value.ToString ();
-                               break;
-                       case "USER INSTANCE" :
-                               if (value == null) {
-                                       _userInstance = DEF_USERINSTANCE;
-                                       base.Remove (mappedKey);
-                               } else
-                                       this.UserInstance = DbConnectionStringBuilderHelper.ConvertToBoolean (value);
-                               break;
-                       case "WORKSTATION ID" :
-                               if (value == null) {
-                                       _workstationID = DEF_WORKSTATIONID;
-                                       base.Remove (mappedKey);
-                               } else 
-                                       this.WorkstationID = value.ToString ();
-                               break;
-                       case "TRANSACTION BINDING":
-                               // TODO: what is this?
-                               break;
-                       default :
-                               throw new ArgumentException("Keyword not supported :" + key);
-                       }
-               }
-               #endregion // Private Methods
-       }
-       
-}
diff --git a/mcs/class/System.Data/System.Data.SqlClient/SqlError.cs b/mcs/class/System.Data/System.Data.SqlClient/SqlError.cs
deleted file mode 100644 (file)
index 995e657..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-//
-// System.Data.SqlClient.SqlError.cs
-//
-// Author:
-//   Rodrigo Moya (rodrigo@ximian.com)
-//   Daniel Morgan (danmorg@sc.rr.com)
-//   Tim Coleman (tim@timcoleman.com)
-//
-// (C) Ximian, Inc 2002
-// Copyright (C) Tim Coleman, 2002
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Data;
-using System.Runtime.InteropServices;
-
-namespace System.Data.SqlClient {
-       /// <summary>
-       /// Describes an error from a SQL database.
-       /// </summary>
-       [Serializable]
-       public sealed class SqlError
-       {
-               #region Fields
-
-               byte errorClass = 0;
-               int lineNumber = 0;
-               string message = "";
-               int number = 0;
-               string procedure = "";
-               string source = "";
-               byte state = 0;
-
-               [NonSerialized]         
-               string server = "";
-               
-
-               #endregion // Fields
-
-               #region Constructors
-
-               internal SqlError (byte errorClass, int lineNumber, string message, int number, string procedure, string server, string source, byte state) 
-               {
-                       this.errorClass = errorClass;
-                       this.lineNumber = lineNumber;
-                       this.message = message;
-                       this.number = number;
-                       this.procedure = procedure;
-                       this.server = server;
-                       this.source = source;
-                       this.state = state;
-               }
-
-               #endregion // Constructors
-               
-               #region Properties
-
-               public byte Class {
-                       get { return errorClass; }
-               }
-
-               public int LineNumber {
-                       get { return lineNumber; }
-               }
-
-               public string Message {
-                       get { return message; }
-               }
-               
-               public int Number {
-                       get { return number; }
-               }
-
-               public string Procedure {
-                       get { return procedure; }
-               }
-
-               public string Server {
-                       get { return server; }
-               }
-
-               public string Source {
-                       get { return source; }
-               }
-
-               public byte State {
-                       get { return state; }
-               }
-
-               #endregion
-
-               #region Methods
-
-               public override string ToString ()
-               {
-                       return Message;
-               }
-
-               #endregion
-               
-       }
-}
diff --git a/mcs/class/System.Data/System.Data.SqlClient/SqlErrorCollection.cs b/mcs/class/System.Data/System.Data.SqlClient/SqlErrorCollection.cs
deleted file mode 100644 (file)
index 7a721f9..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-//
-// System.Data.SqlClient.SqlErrorCollection.cs
-//
-// Author:
-//   Rodrigo Moya (rodrigo@ximian.com)
-//   Daniel Morgan (danmorg@sc.rr.com)
-//   Tim Coleman (tim@timcoleman.com)
-//
-// (C) Ximian, Inc 2002
-// Copyright (C) Tim Coleman, 2002
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.Collections;
-using System.ComponentModel;
-using System.Data;
-using System.Runtime.InteropServices;
-
-namespace System.Data.SqlClient {
-       [ListBindable (false)]
-       [Serializable]
-       public sealed class SqlErrorCollection : ICollection, IEnumerable
-       {
-               #region Fields
-
-               ArrayList list = new ArrayList();
-
-               #endregion // Fields
-
-               #region Constructors
-
-               internal SqlErrorCollection () 
-               {
-               }
-
-               internal SqlErrorCollection (byte theClass, int lineNumber, string message, int number, string procedure, string server, string source, byte state) 
-               {
-                       Add (theClass, lineNumber, message, number, procedure, server, source, state);
-               }
-
-               #endregion // Constructors
-
-               #region Properties
-                
-               public int Count {
-                       get { return list.Count; }                        
-               }
-
-               bool ICollection.IsSynchronized {
-                       get { return list.IsSynchronized; }
-               }
-
-               object ICollection.SyncRoot {
-                       get { return list.SyncRoot; }
-               }
-
-               public SqlError this[int index] {
-                       get { return (SqlError) list [index]; }
-               }
-
-               #endregion
-
-               #region Methods
-               
-               internal void Add(SqlError error) 
-               {
-                       list.Add (error);
-               }
-
-               internal void Add(byte theClass, int lineNumber, string message, int number, string procedure, string server, string source, byte state) 
-               {
-                       SqlError error = new SqlError (theClass, lineNumber, message, number, procedure, server, source, state);
-                       Add (error);
-               }
-
-               public void CopyTo (Array array, int index) 
-               {
-                       list.CopyTo (array, index);
-               }
-
-               public IEnumerator GetEnumerator() 
-               {
-                       return list.GetEnumerator ();
-               }
-
-               public void CopyTo (SqlError[] array, int index)
-               {
-                       list.CopyTo (array, index);
-               }
-
-
-               #endregion              
-       }
-}
index 25cff54ee6280b25f10d777e830dc86d76360e9b..2b0e1a88629b23ff280c94f481b8980fcaa5fb9d 100644 (file)
@@ -39,6 +39,8 @@ using System.Data;
 using System.Data.Common;
 using System.Runtime.Serialization;
 using System.Text;
+using System.Diagnostics;
+using System.Globalization;
 
 using Mono.Data.Tds.Protocol;
 
@@ -54,6 +56,61 @@ namespace System.Data.SqlClient
                        ret.errors.Add (e);
                return ret;
         }
+
+        static internal SqlException CreateException(SqlErrorCollection errorCollection, string serverVersion) {
+            return CreateException(errorCollection, serverVersion, Guid.Empty);
+        }
+
+        static internal SqlException CreateException(SqlErrorCollection errorCollection, string serverVersion, SqlInternalConnectionTds internalConnection, Exception innerException = null) {
+            Guid connectionId = Guid.Empty;
+            var exception = CreateException(errorCollection, serverVersion, connectionId, innerException);
+/*
+            if (internalConnection != null) { 
+                if ((internalConnection.OriginalClientConnectionId != Guid.Empty) && (internalConnection.OriginalClientConnectionId != internalConnection.ClientConnectionId)) {
+                    exception.Data.Add(OriginalClientConnectionIdKey, internalConnection.OriginalClientConnectionId);
+                }
+
+                if (!string.IsNullOrEmpty(internalConnection.RoutingDestination)) {
+                    exception.Data.Add(RoutingDestinationKey, internalConnection.RoutingDestination);
+                }
+            }
+*/
+            return exception;
+        }
+
+
+        static internal SqlException CreateException(SqlErrorCollection errorCollection, string serverVersion, Guid conId, Exception innerException = null) {
+            Debug.Assert(null != errorCollection && errorCollection.Count > 0, "no errorCollection?");
+            
+            // concat all messages together MDAC 65533
+            StringBuilder message = new StringBuilder();
+            for (int i = 0; i < errorCollection.Count; i++) {
+                if (i > 0) {
+                    message.Append(Environment.NewLine);
+                }
+                message.Append(errorCollection[i].Message);
+            }
+
+            if (innerException == null && errorCollection[0].Win32ErrorCode != 0 && errorCollection[0].Win32ErrorCode != -1) {
+                innerException = new Win32Exception(errorCollection[0].Win32ErrorCode);
+            }
+
+            SqlException exception = new SqlException(message.ToString(), /*errorCollection, */innerException/*, conId*/);
+
+            exception.Data.Add("HelpLink.ProdName",    "Microsoft SQL Server");
+
+            if (!ADP.IsEmpty(serverVersion)) {
+                exception.Data.Add("HelpLink.ProdVer", serverVersion);
+            }
+            exception.Data.Add("HelpLink.EvtSrc",      "MSSQLServer");
+            exception.Data.Add("HelpLink.EvtID",       errorCollection[0].Number.ToString(CultureInfo.InvariantCulture));
+            exception.Data.Add("HelpLink.BaseHelpUrl", "http://go.microsoft.com/fwlink");
+            exception.Data.Add("HelpLink.LinkId",      "20476");
+
+            return exception;
+        }
+
+        internal bool _doNotReconnect = false;
 #endregion
 
                #region Fields
@@ -87,9 +144,7 @@ namespace System.Data.SqlClient
                internal SqlException (byte theClass, int lineNumber, string message, int number, string procedure, string server, string source, byte state) 
                        : this (null, 
                                null, 
-                               new SqlError (theClass, lineNumber, message, 
-                                             number, procedure, server, source, 
-                                             state)) 
+                               new SqlError (number, state, theClass, server, message, procedure, lineNumber, 0))
                {
                }
                
@@ -160,10 +215,9 @@ namespace System.Data.SqlClient
 
                internal static SqlException FromTdsInternalException (TdsInternalException e)
                {
-                       SqlError sqlError = new SqlError (e.Class, e.LineNumber, e.Message,
+                       return new SqlException (e.Class, e.LineNumber, e.Message,
                                                          e.Number, e.Procedure, e.Server,
                                                          "Mono SqlClient Data Provider", e.State);
-                       return new SqlException (null, e, sqlError);
                }
 
                public override void GetObjectData (SerializationInfo si, StreamingContext context) 
diff --git a/mcs/class/System.Data/System.Data.SqlClient/SqlInfoMessageEventArgs.cs b/mcs/class/System.Data/System.Data.SqlClient/SqlInfoMessageEventArgs.cs
deleted file mode 100644 (file)
index 4028317..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-//
-// System.Data.SqlClient.SqlInfoMessageEventArgs.cs
-//
-// Author:
-//   Rodrigo Moya (rodrigo@ximian.com)
-//   Daniel Morgan (danmorg@sc.rr.com)
-//   Tim Coleman (tim@timcoleman.com)
-//
-// (C) Ximian, Inc 2002
-// Copyright (C) Tim Coleman, 2002
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using Mono.Data.Tds.Protocol;
-using System;
-using System.Data;
-
-namespace System.Data.SqlClient {
-       public sealed class SqlInfoMessageEventArgs : EventArgs
-       {
-               #region Fields
-
-               SqlErrorCollection errors = new SqlErrorCollection ();
-
-               #endregion // Fields
-
-               #region Constructors
-       
-               internal SqlInfoMessageEventArgs (TdsInternalErrorCollection tdsErrors)
-               {
-                       foreach (TdsInternalError e in tdsErrors) 
-                               errors.Add (e.Class, e.LineNumber, e.Message, e.Number, e.Procedure, e.Server, "Mono SqlClient Data Provider", e.State);
-               }
-
-               #endregion // Constructors
-
-               #region Properties
-
-               public SqlErrorCollection Errors {
-                       get { return errors; }
-               }       
-
-               public string Message {
-                       get { return errors[0].Message; }
-               }       
-
-               public string Source {
-                       get { return errors[0].Source; }
-               }
-
-               #endregion // Properties
-
-               #region Methods
-
-               public override string ToString() 
-               {
-                       return Message;
-               }
-
-               #endregion // Methods
-       }
-}
index 8a3dd70230c71f7ea03ca21488b1048e8199c2f9..f011f7cb3b9d4feb9c015c1131ef9e6cb9a20e62 100644 (file)
@@ -112,6 +112,8 @@ namespace System.Data.SqlClient {
                        DbTypeMapping.Add (SqlDbType.NVarChar, typeof (string));
                        DbTypeMapping.Add (SqlDbType.SmallDateTime, typeof (DateTime));
                        DbTypeMapping.Add (SqlDbType.DateTime, typeof (DateTime));
+                       DbTypeMapping.Add (SqlDbType.DateTime2, typeof (DateTime));
+                       DbTypeMapping.Add (SqlDbType.DateTimeOffset, typeof (DateTimeOffset));
                        DbTypeMapping.Add (SqlDbType.Decimal, typeof (decimal));
                        DbTypeMapping.Add (SqlDbType.Float, typeof (double));
                        DbTypeMapping.Add (SqlDbType.Binary, typeof (byte []));
@@ -177,6 +179,7 @@ namespace System.Data.SqlClient {
                        type_mapping.Add (typeof (SqlTypes.SqlXml), SqlDbType.Xml);
 
                        type_mapping.Add (typeof (object), SqlDbType.Variant);
+                       type_mapping.Add (typeof (DateTimeOffset), SqlDbType.DateTimeOffset);
                }
                
                public SqlParameter () 
@@ -221,8 +224,7 @@ namespace System.Data.SqlClient {
                                                              scale,
                                                              GetFrameworkValue);
                        metaParameter.RawValue =  value;
-                       if (dbType != SqlDbType.Variant) 
-                               SqlDbType = dbType;
+                       SqlDbType = dbType;
                        Direction = direction;
                        SourceColumn = sourceColumn;
                        SourceVersion = sourceVersion;
@@ -774,6 +776,14 @@ namespace System.Data.SqlClient {
                                MetaParameter.TypeName = "smalldatetime";
                                dbType = DbType.DateTime;
                                break;
+                       case SqlDbType.DateTime2:
+                               MetaParameter.TypeName = "datetime2";
+                               dbType = DbType.DateTime2;
+                               break;
+                       case SqlDbType.DateTimeOffset:
+                               MetaParameter.TypeName = "datetimeoffset";
+                               dbType = DbType.DateTimeOffset;
+                               break;
                        case SqlDbType.Decimal:
                                MetaParameter.TypeName = "decimal";
                                dbType = DbType.Decimal;
@@ -1067,6 +1077,13 @@ namespace System.Data.SqlClient {
 
                object ConvertToFrameworkType (object value, Type frameworkType)
                {
+                       if (frameworkType == typeof (string)) {
+                               if (value is DateTime)
+                                       return ((DateTime) value).ToString ("yyyy-MM-dd'T'HH':'mm':'ss.fffffff");
+                               if (value is DateTimeOffset)
+                                       return ((DateTimeOffset) value).ToString ("yyyy-MM-dd'T'HH':'mm':'ss.fffffffzzz");
+                       }
+
                        object sqlvalue = Convert.ChangeType (value, frameworkType);
                        switch (sqlDbType) {
                        case SqlDbType.Money:
diff --git a/mcs/class/System.Data/System.Data.dll.sources b/mcs/class/System.Data/System.Data.dll.sources
deleted file mode 100644 (file)
index fb44281..0000000
+++ /dev/null
@@ -1,357 +0,0 @@
-Assembly/AssemblyInfo.cs
-../../build/common/Consts.cs.in
-../../build/common/Locale.cs
-../../build/common/SR.cs
-System.Data/AcceptRejectRule.cs
-System.Data/ColumnTypeConverter.cs
-System.Data/CommandBehavior.cs
-System.Data/CommandType.cs
-System.Data/ConnectionState.cs
-System.Data/ConflictOption.cs
-System.Data/Constraint.cs
-System.Data/ConstraintCollection.cs
-System.Data/ConstraintConverter.cs
-System.Data/ConstraintException.cs
-System.Data/CustomDataClassGenerator.cs
-System.Data/DataCategoryAttribute.cs
-System.Data/DataColumn.cs
-System.Data/DataColumnChangeEventArgs.cs
-System.Data/DataColumnChangeEventHandler.cs
-System.Data/DataColumnCollection.cs
-System.Data/DataColumnPropertyDescriptor.cs
-System.Data/DataException.cs
-System.Data/RelatedDataView.cs
-System.Data/RelationshipConverter.cs
-System.Data/DataRelation.cs
-System.Data/DataRelationCollection.cs
-System.Data/DataRelationPropertyDescriptor.cs
-System.Data/DataRow.cs
-System.Data/DataRowAction.cs
-System.Data/DataRowBuilder.cs
-System.Data/DataRowChangeEventArgs.cs
-System.Data/DataRowChangeEventHandler.cs
-System.Data/DataRowCollection.cs
-System.Data/DataRowState.cs
-System.Data/DataRowVersion.cs
-System.Data/DataRowView.cs
-System.Data/DataSet.cs
-System.Data/DataSetDateTime.cs
-System.Data/DataSysDescriptionAttribute.cs
-System.Data/DataTable.cs
-System.Data/DataTableCollection.cs
-System.Data/DataTableClearEventArgs.cs
-System.Data/DataTableClearEventHandler.cs
-System.Data/DataTableTypeConverter.cs
-System.Data/DataTablePropertyDescriptor.cs
-System.Data/DataTableReader.cs
-System.Data/DataTableNewRowEventArgs.cs
-System.Data/DataTableNewRowEventHandler.cs
-System.Data/DataView.cs
-System.Data/DataViewManager.cs
-System.Data/DataViewManagerListItemTypeDescriptor.cs
-System.Data/DataViewRowState.cs
-System.Data/DataViewSetting.cs
-System.Data/DataViewSettingCollection.cs
-System.Data/DBConcurrencyException.cs
-System.Data/DbType.cs
-System.Data/DefaultValueTypeConverter.cs
-System.Data/DeletedRowInaccessibleException.cs
-System.Data/DuplicateNameException.cs
-System.Data/EvaluateException.cs
-System.Data/FillErrorEventArgs.cs
-System.Data/FillErrorEventHandler.cs
-System.Data/ForeignKeyConstraint.cs
-System.Data/IColumnMapping.cs
-System.Data/IColumnMappingCollection.cs
-System.Data/IDataAdapter.cs
-System.Data/IDataParameter.cs
-System.Data/IDataParameterCollection.cs
-System.Data/IDataReader.cs
-System.Data/IDataRecord.cs
-System.Data/IDbCommand.cs
-System.Data/IDbConnection.cs
-System.Data/IDbDataAdapter.cs
-System.Data/IDbDataParameter.cs
-System.Data/IDbTransaction.cs
-System.Data/InRowChangingEventException.cs
-System.Data/InternalDataCollectionBase.cs
-System.Data/InvalidConstraintException.cs
-System.Data/InvalidExpressionException.cs
-System.Data/ISafeDataRecord.cs
-System.Data/IsolationLevel.cs
-System.Data/ITableMapping.cs
-System.Data/ITableMappingCollection.cs
-System.Data/LoadOption.cs
-System.Data/MappingType.cs
-System.Data/MergeFailedEventArgs.cs
-System.Data/MergeFailedEventHandler.cs
-System.Data/MergeManager.cs
-System.Data/MissingMappingAction.cs
-System.Data/MissingPrimaryKeyException.cs
-System.Data/MissingSchemaAction.cs
-System.Data/Node.cs
-System.Data/NoNullAllowedException.cs
-System.Data/OperationAbortedException.cs
-System.Data/ParameterDirection.cs
-System.Data/PropertyAttributes.cs
-System.Data/PropertyCollection.cs
-System.Data/ReadOnlyException.cs
-System.Data/ResDescriptionAttribute.cs
-System.Data/RowNotInTableException.cs
-System.Data/Rule.cs
-System.Data/SchemaType.cs
-System.Data/SerializationFormat.cs
-System.Data/SchemaSerializationMode.cs
-System.Data/SqlDbType.cs
-System.Data/StateChangeEventArgs.cs
-System.Data/StateChangeEventHandler.cs
-System.Data/StatementCompletedEventArgs.cs
-System.Data/StatementCompletedEventHandler.cs
-System.Data/StatementType.cs
-System.Data/StrongTypingException.cs
-System.Data/SyntaxErrorException.cs
-../../build/common/MonoTODOAttribute.cs
-System.Data/TableAdapterSchemaInfo.cs
-System.Data/TypedDataSetGenerator.cs
-System.Data/TypeDataSetGeneratorException.cs
-System.Data/UniqueConstraint.cs
-System.Data/UpdateRowSource.cs
-System.Data/UpdateStatus.cs
-System.Data/VersionNotFoundException.cs
-System.Data/XmlDataInferenceLoader.cs
-System.Data/XmlHelper.cs
-System.Data/XmlDataReader.cs
-System.Data/XmlReadMode.cs
-System.Data/XmlWriteMode.cs
-System.Data/XmlConstants.cs
-System.Data/XmlDiffLoader.cs
-System.Data.Common/CatalogLocation.cs
-System.Data.Common/ComparerFactory.cs
-System.Data.Common/DataAdapter.cs
-System.Data.Common/DataContainer.cs
-System.Data.Common/DbCommandBuilder.cs
-System.Data.Common/DbConnectionStringBuilderHelper.cs
-System.Data.Common/DbCommand.cs
-System.Data.Common/DbConnection.cs
-System.Data.Common/DbDataAdapter.cs
-System.Data.Common/DbDataReader.cs
-System.Data.Common/DbDataSourceEnumerator.cs
-System.Data.Common/DbException.cs
-System.Data.Common/DbMetaDataCollectionNames.cs
-System.Data.Common/DbMetaDataColumnNames.cs
-System.Data.Common/DbParameterCollection.cs
-System.Data.Common/DbParameter.cs
-System.Data.Common/DbProviderConfigurationHandler.cs
-System.Data.Common/DbProviderFactoriesConfigurationHandler.cs
-System.Data.Common/DbProviderFactories.cs
-System.Data.Common/DbProviderFactory.cs
-System.Data.Common/DbProviderSpecificTypePropertyAttribute.cs
-System.Data.Common/DbTable.cs
-System.Data.Common/DbTransaction.cs
-System.Data.Common/DbTypes.cs
-System.Data.Common/ExceptionHelper.cs
-System.Data.Common/GroupByBehavior.cs
-System.Data.Common/IdentifierCase.cs
-System.Data.Common/Index.cs
-System.Data.Common/Key.cs
-System.Data.Common/PermissionHelper.cs
-System.Data.Common/RecordCache.cs
-System.Data.Common/RowUpdatedEventArgs.cs
-System.Data.Common/RowUpdatingEventArgs.cs
-System.Data.Common/SchemaTableColumn.cs
-System.Data.Common/SchemaTableOptionalColumn.cs
-System.Data.Common/SupportedJoinOperators.cs
-System.Data.Common/TaskHelper.cs
-System.Data.OleDb/libgda.cs
-System.Data.OleDb/OleDbParameterConverter.cs
-System.Data.OleDb/OleDbCommand.cs
-System.Data.OleDb/OleDbCommandBuilder.cs
-System.Data.OleDb/OleDbConnection.cs
-System.Data.OleDb/OleDbDataAdapter.cs
-System.Data.OleDb/OleDbDataReader.cs
-System.Data.OleDb/OleDbError.cs
-System.Data.OleDb/OleDbErrorCollection.cs
-System.Data.OleDb/OleDbException.cs
-System.Data.OleDb/OleDbFactory.cs
-System.Data.OleDb/OleDbInfoMessageEventArgs.cs
-System.Data.OleDb/OleDbInfoMessageEventHandler.cs
-System.Data.OleDb/OleDbLiteral.cs
-System.Data.OleDb/OleDbMetaDataCollectionNames.cs
-System.Data.OleDb/OleDbParameter.cs
-System.Data.OleDb/OleDbParameterCollection.cs
-System.Data.OleDb/OleDbPermission.cs
-System.Data.OleDb/OleDbPermissionAttribute.cs
-System.Data.OleDb/OleDbRowUpdatedEventArgs.cs
-System.Data.OleDb/OleDbRowUpdatedEventHandler.cs
-System.Data.OleDb/OleDbRowUpdatingEventArgs.cs
-System.Data.OleDb/OleDbRowUpdatingEventHandler.cs
-System.Data.OleDb/OleDbSchemaGuid.cs
-System.Data.OleDb/OleDbTransaction.cs
-System.Data.OleDb/OleDbType.cs
-System.Data.SqlTypes/SqlXml.cs
-System.Data.Odbc/NativeBuffer.cs
-System.Data.Odbc/OdbcFactory.cs
-System.Data.Odbc/OdbcParameterConverter.cs
-System.Data.Odbc/OdbcCategoryAttribute.cs
-System.Data.Odbc/OdbcDescriptionAttribute.cs
-System.Data.Odbc/OdbcColumn.cs
-System.Data.Odbc/OdbcCommand.cs
-System.Data.Odbc/OdbcConnection.cs
-System.Data.Odbc/OdbcDataReader.cs
-System.Data.Odbc/OdbcErrorCollection.cs
-System.Data.Odbc/OdbcException.cs
-System.Data.Odbc/OdbcMetaDataColumnNames.cs
-System.Data.Odbc/OdbcMetaDataCollectionNames.cs
-System.Data.Odbc/OdbcParameter.cs
-System.Data.Odbc/OdbcParameterCollection.cs
-System.Data.Odbc/OdbcTransaction.cs
-System.Data.Odbc/OdbcType.cs
-System.Data.Odbc/OdbcTypeMap.cs
-System.Data.Odbc/OdbcTypeConverter.cs
-System.Data.Odbc/libodbc.cs
-System.Data.Odbc/OdbcDataAdapter.cs
-System.Data.Odbc/OdbcRowUpdatedEventArgs.cs
-System.Data.Odbc/OdbcRowUpdatedEventHandler.cs
-System.Data.Odbc/OdbcRowUpdatingEventArgs.cs
-System.Data.Odbc/OdbcRowUpdatingEventHandler.cs
-System.Data.Odbc/OdbcInfoMessageEventArgs.cs 
-System.Data.Odbc/OdbcInfoMessageEventHandler.cs
-System.Data.Odbc/OdbcCommandBuilder.cs
-System.Data.Sql/SqlDataSourceEnumerator.cs
-System.Data.Sql/SqlNotificationRequest.cs
-Microsoft.SqlServer.Server/Format.cs
-Microsoft.SqlServer.Server/DataAccessKind.cs
-Microsoft.SqlServer.Server/IBinarySerialize.cs
-Microsoft.SqlServer.Server/InvalidUdtException.cs
-Microsoft.SqlServer.Server/SqlFunctionAttribute.cs
-Microsoft.SqlServer.Server/SqlMetaData.cs
-Microsoft.SqlServer.Server/SqlMethodAttribute.cs
-Microsoft.SqlServer.Server/SqlUserDefinedAggregateAttribute.cs
-Microsoft.SqlServer.Server/SqlUserDefinedTypeAttribute.cs
-Microsoft.SqlServer.Server/SystemDataAccessKind.cs
-Microsoft.SqlServer.Server/SqlFacetAttribute.cs
-Microsoft.SqlServer.Server/TriggerAction.cs
-Microsoft.SqlServer.Server/SqlTriggerContext.cs
-Microsoft.SqlServer.Server/SqlProcedureAttribute.cs
-Microsoft.SqlServer.Server/SqlTriggerAttribute.cs
-System.Data.SqlClient/SortOrder.cs
-System.Data.SqlClient/SqlNotificationType.cs
-System.Data.SqlClient/SqlNotificationInfo.cs
-System.Data.SqlClient/SqlNotificationSource.cs
-System.Data.SqlClient/SqlAsyncState.cs
-System.Data.SqlClient/SqlAsyncResult.cs
-System.Data.SqlClient/SqlClientMetaDataCollectionNames.cs
-System.Data.SqlClient/SqlClientPermission.cs
-System.Data.SqlClient/SqlClientPermissionAttribute.cs
-System.Data.SqlClient/SqlCommand.cs
-System.Data.SqlClient/SqlCommandBuilder.cs
-System.Data.SqlClient/SqlConnection.cs
-System.Data.SqlClient/SqlConnectionStringBuilder.cs
-System.Data.SqlClient/SqlCredential.cs
-System.Data.SqlClient/SqlDataAdapter.cs
-System.Data.SqlClient/SqlDataReader.cs
-System.Data.SqlClient/SqlDataSourceConverter.cs
-System.Data.SqlClient/SqlDependency.cs
-System.Data.SqlClient/SqlError.cs
-System.Data.SqlClient/SqlErrorCollection.cs
-System.Data.SqlClient/SqlException.cs
-System.Data.SqlClient/SqlInfoMessageEventArgs.cs
-System.Data.SqlClient/SqlInfoMessageEventHandler.cs
-System.Data.SqlClient/SqlInitialCatalogConverter.cs
-System.Data.SqlClient/NetworkLibraryConverter.cs
-System.Data.SqlClient/SqlParameter.cs
-System.Data.SqlClient/SqlParameterCollection.cs
-System.Data.SqlClient/SqlParameterConverter.cs
-System.Data.SqlClient/SqlRowUpdatedEventArgs.cs
-System.Data.SqlClient/SqlRowUpdatedEventHandler.cs
-System.Data.SqlClient/SqlRowUpdatingEventArgs.cs
-System.Data.SqlClient/SqlRowUpdatingEventHandler.cs
-System.Data.SqlClient/SqlTransaction.cs
-System.Data.SqlClient/SqlXmlTextReader.cs
-System.Data.SqlClient/SQLDebugging.cs
-System.Data.SqlClient/SqlClientFactory.cs
-System.Data.SqlClient/SqlBulkCopy.cs
-System.Data.SqlClient/SqlBulkCopyOptions.cs
-System.Data.SqlClient/SqlBulkCopyColumnMapping.cs
-System.Data.SqlClient/SqlBulkCopyColumnMappingCollection.cs
-System.Data.SqlClient/SqlRowsCopiedEventHandler.cs
-System.Data.SqlClient/SqlRowsCopiedEventArgs.cs
-System.Data.SqlClient/SqlNotificationEventArgs.cs
-System.Data.SqlClient/OnChangeEventHandler.cs
-System.Data.SqlClient/SqlDecimalExtensions.cs
-System.Data/XmlDataLoader.cs
-System.Data/XmlSchemaDataImporter.cs
-System.Data/XmlSchemaWriter.cs
-System.Data/XmlTableWriter.cs
-System.Xml/XmlDataDocument.cs
-Mono.Data.SqlExpressions/Tokenizer.cs
-Mono.Data.SqlExpressions/Numeric.cs
-Mono.Data.SqlExpressions/Expressions.cs
-Mono.Data.SqlExpressions/Literal.cs
-Mono.Data.SqlExpressions/ColumnReference.cs
-Mono.Data.SqlExpressions/ArithmeticExpressions.cs
-Mono.Data.SqlExpressions/BooleanExpressions.cs
-Mono.Data.SqlExpressions/Comparison.cs
-Mono.Data.SqlExpressions/StringFunctions.cs
-Mono.Data.SqlExpressions/Functions.cs
-Mono.Data.SqlExpressions/Like.cs
-Mono.Data.SqlExpressions/In.cs
-Mono.Data.SqlExpressions/Aggregation.cs
-
-ReferenceSources/Bid.cs
-ReferenceSources/BidArgumentTypeAttribute.cs
-ReferenceSources/BidMethodAttribute.cs
-ReferenceSources/DataStorage.cs
-ReferenceSources/InOutOfProcHelper.cs
-ReferenceSources/ODB.cs
-ReferenceSources/Res.cs
-ReferenceSources/ResCategoryAttribute.cs
-ReferenceSources/SafeNativeMethods.cs
-ReferenceSources/ThisAssembly.cs
-
-ReferenceSources/OdbcHandle.cs
-
-../../../external/referencesource/System.Data/Misc/HResults.cs
-../../../external/referencesource/System.Data/System/Data/Common/AdapterUtil.cs
-../../../external/referencesource/System.Data/System/Data/Common/DataColumnMapping.cs
-../../../external/referencesource/System.Data/System/Data/Common/DataColumnMappingCollection.cs
-../../../external/referencesource/System.Data/System/Data/Common/DataTableMapping.cs
-../../../external/referencesource/System.Data/System/Data/Common/DataTableMappingCollection.cs
-../../../external/referencesource/System.Data/System/Data/Common/DataRecordInternal.cs
-../../../external/referencesource/System.Data/System/Data/Common/DbConnectionOptions.cs
-../../../external/referencesource/System.Data/System/Data/Common/DBConnectionString.cs
-../../../external/referencesource/System.Data/System/Data/Common/DbConnectionStringBuilder.cs
-../../../external/referencesource/System.Data/System/Data/Common/DbConnectionStringCommon.cs
-../../../external/referencesource/System.Data/System/Data/Common/DBDataPermission.cs
-../../../external/referencesource/System.Data/System/Data/Common/DBDataPermissionAttribute.cs
-../../../external/referencesource/System.Data/System/Data/Common/dbdatarecord.cs
-../../../external/referencesource/System.Data/System/Data/Common/dbenumerator.cs
-../../../external/referencesource/System.Data/System/Data/Common/FieldNameLookup.cs
-../../../external/referencesource/System.Data/System/Data/Common/NameValuePair.cs
-../../../external/referencesource/System.Data/System/Data/Common/NameValuePermission.cs
-../../../external/referencesource/System.Data/System/Data/Odbc/Odbc32.cs
-../../../external/referencesource/System.Data/System/Data/Odbc/OdbcConnectionString.cs
-../../../external/referencesource/System.Data/System/Data/Odbc/OdbcConnectionStringbuilder.cs
-../../../external/referencesource/System.Data/System/Data/Odbc/OdbcError.cs
-../../../external/referencesource/System.Data/System/Data/Odbc/OdbcPermission.cs
-../../../external/referencesource/System.Data/System/Data/ProviderBase/DbConnectionPoolProviderInfo.cs
-../../../external/referencesource/System.Data/System/Data/SqlClient/ApplicationIntent.cs
-../../../external/referencesource/System.Data/System/Data/SQLTypes/INullable.cs
-../../../external/referencesource/System.Data/System/Data/SQLTypes/SQLBinary.cs
-../../../external/referencesource/System.Data/System/Data/SQLTypes/SQLBoolean.cs
-../../../external/referencesource/System.Data/System/Data/SQLTypes/SQLByte.cs
-../../../external/referencesource/System.Data/System/Data/SQLTypes/SQLBytes.cs
-../../../external/referencesource/System.Data/System/Data/SQLTypes/SQLChars.cs
-../../../external/referencesource/System.Data/System/Data/SQLTypes/SqlCharStream.cs
-../../../external/referencesource/System.Data/System/Data/SQLTypes/SQLDateTime.cs
-../../../external/referencesource/System.Data/System/Data/SQLTypes/SQLDecimal.cs
-../../../external/referencesource/System.Data/System/Data/SQLTypes/SQLDouble.cs
-../../../external/referencesource/System.Data/System/Data/SQLTypes/SQLGuid.cs
-../../../external/referencesource/System.Data/System/Data/SQLTypes/SQLInt16.cs
-../../../external/referencesource/System.Data/System/Data/SQLTypes/SQLInt32.cs
-../../../external/referencesource/System.Data/System/Data/SQLTypes/SQLInt64.cs
-../../../external/referencesource/System.Data/System/Data/SQLTypes/SQLMoney.cs
-../../../external/referencesource/System.Data/System/Data/SQLTypes/SQLResource.cs
-../../../external/referencesource/System.Data/System/Data/SQLTypes/SQLSingle.cs
-../../../external/referencesource/System.Data/System/Data/SQLTypes/SQLString.cs
-../../../external/referencesource/System.Data/System/Data/SQLTypes/SQLUtility.cs
diff --git a/mcs/class/System.Data/System.Data/.gitattributes b/mcs/class/System.Data/System.Data/.gitattributes
deleted file mode 100644 (file)
index ee1ad93..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-/DataColumn.cs -crlf
-/DataRelationPropertyDescriptor.cs -crlf
-/DataRowView.cs -crlf
-/DataSet.cs -crlf
-/DataTable.cs -crlf
-/DataView.cs -crlf
-/DataViewManager.cs -crlf
-/ExpressionElement.cs -crlf
-/RelatedDataView.cs -crlf
-/Res.cs -crlf
-/XmlDataInferenceLoader.cs -crlf
-/XmlDataReader.cs -crlf
diff --git a/mcs/class/System.Data/System.Data/AcceptRejectRule.cs b/mcs/class/System.Data/System.Data/AcceptRejectRule.cs
deleted file mode 100644 (file)
index 0b3bbfd..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-//
-// System.Data.AcceptRejectRule.cs
-//
-// Author:
-//   Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System.Data
-{
-       
-       /// <summary>
-       /// Determines the action that occurs when 
-       /// the AcceptChanges or RejectChanges method 
-       /// is invoked on a DataTable with a ForeignKeyConstraint.
-       /// </summary>
-       public enum AcceptRejectRule
-       {               
-               None = 0,
-               Cascade = 1
-       }
-
-}
diff --git a/mcs/class/System.Data/System.Data/ChangeLog b/mcs/class/System.Data/System.Data/ChangeLog
deleted file mode 100644 (file)
index bdb1a9d..0000000
+++ /dev/null
@@ -1,4191 +0,0 @@
-2011-05-02  Veerapuram Varadhan  <v.varadhan@gmail.com>
-
-       ** Fixes 663914
-       * DataRow.cs (SetOriginalValue): Retain original version if available.
-       
-2011-03-15  Veerapuram Varadhan  <v.varadhan@gmail.com>
-
-       ** Fixes 672113
-       * UniqueConstraint.cs (ctor): Make a copy of columns and columnnames array
-       * ForeignKeyConstraint.cs (ctor): Make a copy of parent and child columns array
-       
-2010-10-01  Veerapuram Varadhan  <v.varadhan@gmail.com>
-
-       ** Fixes #582732 - Patch by Jeffrey Alvarez <kuritsu@gmail.com>
-       * DataColumn.cs (Clone): Deep copy the ExtendedProperties collection.
-       * XmlSchemaDataImporter.cs: Support import of extended properties.
-       * XmlSchemaWriter.cs: Fix exception by writing the extended properties 
-       before simpletype element.
-       
-2010-07-23  Veerapuram Varadhan  <v.varadhan@gmail.com>
-
-       ** Fixes #623451
-       * DataColumnCollection.cs (MoveColumn): Fix shifting of DataColumn  
-       according to the direction of movement.
-       
-2010-06-23  Veerapuram Varadhan  <vvaradhan@novell.com>
-
-       ** Fixes #581679
-       * DataRelationCollection.cs (Add, Remove): Use DataRelation obj instead 
-       of this when raising OnCollectionChang(ing, ed) events.
-       
-2010-04-11  Veerapuram Varadhan  <vvaradhan@novell.com>
-
-       ** Fixes #591443
-       * DataColumn.cs (Clone): Use propert to clone Expression as it builds 
-       compiled expression also, if any. 
-       
-2010-04-10  Veerapuram Varadhan  <vvaradhan@novell.com>
-       
-       ** Fixes #589482
-       * DataColumn.cs (set_DataType): Preserve autoIncrement value 
-       for Decimal types as well.
-       
-2010-04-09  Veerapuram Varadhan  <vvaradhan@novell.com>
-
-       ** Fixes #576520 - Based on a patch by Greg SIROU <gspam@secway.fr>
-       * DataSet.cs (WriteColumnAsElement): Handle system.object types sanely.
-
-2010-04-09  Veerapuram Varadhan  <vvaradhan@novell.com>
-
-       ** Fixes #590232
-       * DataColumn.cs (Clone): Clone extended properties as well
-       
-2010-02-10  Marek Habersack  <mhabersack@novell.com>
-
-       * XmlSchemaDataImporter.cs: the <connections> element might be
-       empty - make sure FirstChild of the element is not null before
-       attempting to use it. Fixes bug #578587
-
-2009-10-30  Veerapuram Varadhan  <vvaradhan@novell.com>
-
-       * DataTable.cs: Reuse old utility methods for raising DataTable 
-       clearing/cleared events.
-       * DataRowCollection.cs (Clear): Raise DataTable clearing/cleared 
-       events only for non 1.x profiles.  Fixes broken 1.x build.
-       
-2009-10-30  Veerapuram Varadhan  <vvaradhan@novell.com>
-
-       ** Fixes 448296
-       * DataTable.cs (Clear): Do not raise TableClearing/Cleared events as 
-       they will be raised from DataRowCollection.Clear().  New utility methods 
-       for raising TableClearing/TableCleared events from outside DataTable.  
-       Don't manually reset indexes as ResetIndexes is called from 
-       DataRowCollection.Clear
-       * DataRowCollection.cs (Clear): Raise TableClearing/Cleared events accordingly.
-       
-2009-10-29  Veerapuram Varadhan  <vvaradhan@novell.com>
-
-       ** Fixes 332875 - based on analysis by Ben Martin <ben@trustorm.com.au>
-       * XmlSchemaDataImporter.cs (AddParentKeyColumn): If a table already has a 
-       PrimaryKey column defined, when called again, fill the PKCol data into the 
-       passed DataColumn and return.
-       
-2009-10-29  Veerapuram Varadhan  <vvaradhan@novell.com>
-
-       ** Fixes #550960 - Patch by Stefano <stefano.sapienti@apsystems.it>
-       * DataTable.cs (BinarySerialize): Use datatype from DataColumn 
-       instead of value of the column.
-       
-2009-10-14  Jonathan Pryor  <jpryor@novell.com>
-
-       * XmlSchemaDataImporter.cs: Remove DbProviderFactories dependency in
-         the MonoTouch profile.
-
-2009-10-13  Veerapuram Varadhan  <vvaradhan@novell.com>
-
-       ** Fixes #537229
-       * XmlDiffLoader (LoadColumnAttributes/Children): Decode column names in 
-       case if they are encoded.
-       
-2009-09-26  Veerapuram Varadhan  <vvaradhan@novell.com>
-
-       ** Fixes part of #427769 - Patch by John Lenz <jlenz2@math.uiuc.edu>
-       * DataSet.cs: XML serialization improvements to be compatible with MS impl.
-       
-2009-09-15  Veerapuram Varadhan  <vvaradhan@novell.com>
-       
-       ** Fixes #536194 - Patch by Andrew Kurochk <aaki.viper@gmail.com>
-       * MergeManager.cs (Merge*): Do nothing when source and target 
-       datasets are same.
-       
-2009-09-10  Veerapuram Varadhan  <vvaradhan@novell.com>
-
-       ** Fixes #510176
-       * DataView.cs (OnRowChanged/OnRowDeleted): Raise appropriate events iff 
-       view is affected. This silence of the numerous Add/Change events that were
-       getting raised from DataView.
-       (ToTable): Use appropriate index to generated DataTable in case of 
-       RowFilter / Sort conditions.
-       
-       * DataRow.cs (AcceptChanges/RejectChanges): Raise appropriate Changing events
-       
-2009-09-03  Ivan N. Zlatev  <contact@i-nz.net>
-
-       * DataColumnPropertyDescriptor.cs, DataView.cs: Not browsable if Hidden.
-       [Fixes the second part of bug #536547]
-
-2009-08-25  Veerapuram Varadhan  <vvaradhan@novell.com>
-
-       ** Fixes #521951
-       * DataViewManager.cs (CollectionToListChangeEventArgs) : Use a corresponding 
-       DataTable/DataRelation obj instead of only DataRelation.
-       
-2009-07-30  Veerapuram Varadhan  <vvaradhan@novell.com>
-
-       * CustomDataClassGenerator.cs (MakeSafeName): Throw NRE instead of 
-       ArgumentNullException - fixes failing tests.
-       
-2009-07-23  Veerapuram Varadhan  <vvaradhan@novell.com>
-
-       * XmlSchemaDataImporter.cs (HandleDataSourceAnnotation): Don't rely 
-       on the order of elements.
-       
-2009-07-23  Veerapuram Varadhan  <vvaradhan@novell.com>
-
-       * XmlSchemaDataImporter.cs: String.IsNullOrEmpty changes
-       
-2009-07-23  Veerapuram Varadhan  <vvaradhan@novell.com>
-
-       * XmlSchemaDataImporter.cs: Added null checks.
-       
-2009-07-22  Veerapuram Varadhan  <vvaradhan@novell.com>
-
-       * XmlSchemaDataImporter.cs:
-       CustomDataClassGenerator.cs: Silence off CWLs.
-       
-2009-07-22  Veerapuram Varadhan  <vvaradhan@novell.com>
-       
-       * CustomDataClassGenerator.cs (CreateCommandCollectionInitializeMethod):
-       Fix generation of DbCommand[] instead of DbCommand()[].  Fix IndexRef to 
-       ref proper index.
-       Avoid using SourceColumnNullMapping property in the constructor 
-       of DbParameter while creating the code.
-       
-2009-07-18  Veerapuram Varadhan  <vvaradhan@novell.com>
-
-       * CustomDataClassGenerator.cs (CreateDbSourceMethods): Handle cases of Scalar 
-       and NoData QueryTypes.
-       
-2009-07-17  Veerapuram Varadhan  <vvaradhan@novell.com>
-       
-       * TableAdapterSchemaInfo.cs: Wrap DbCommand within DbCommandInfo and 
-       define MethodInfo to hold method properties common to both Get and Fill.
-       
-       * CustomDataClassGenerator.cs (CreateDbSourceMethods): Handle cases of Fill 
-       and Get appropriately.
-       
-2009-07-16  Veerapuram Varadhan  <vvaradhan@novell.com>
-
-       * CustomDataClassGenerator.cs (CreateDbSourceMethods):  Handle 
-       methods of type "Fill".
-       
-       * XmlSchemaDataImporter.cs (ProcessDbParameters): Handle empty strings 
-       while setting parameter properties.
-       
-2009-07-15  Veerapuram Varadhan  <vvaradhan@novell.com>
-
-       ** Part of fix for #325464
-       * CustomDataClassGenerator.cs: Add implementation to generate 
-       TableAdapter code.
-       
-       * DataSet.cs (TableAdapterSchemaData): New internal property that 
-       holds TableAdapter details to generate code from.
-       
-       * XmlConstants.cs: Add Msdatasource constant to handle 
-       <...:xml-msdatasource> elements.
-       
-       * XmlSchemaDataImporter.cs: Implement handling of <TableAdapter ...>
-       * TableAdapterSchemaInfo.cs: New 
-       
-2009-05-16  Veerapuram Varadhan  <vvaradhan@novell.com>
-
-       ** Fixes #325464 - ToolItems.xsd
-       * CustomDataClassGenerator.cs (CreateDataSetTableMembers): Prefix a "_" to 
-       member names when it is same as that of the dataset.  Fixes the CS0542 error
-       during compilation of the generated source.
-       
-2009-03-25  Ivan N. Zlatev  <contact@i-nz.net>
-
-       * DataView.cs: Fire ListChanged when the RowFilter changes.
-       [Fixes bug #479405]
-
-2009-02-24  Veerapuram Varadhan  <vvaradhan@novell.com>
-
-       * *Fixes #377146 - in a better way
-       * XmlDataReader.cs (ReadElementElement): For reference types that
-       implement IXmlSerializable, call the corresponding ReadXml.
-       * DataSet.cs (WriteColumnAsElement): For reference types that implement 
-       IXmlSerializable, call the corresponding WriteXml.
-       
-2009-02-24  Veerapuram Varadhan  <vvaradhan@novell.com>
-
-       * Fixes #476523
-       * DbType.cs: Add DateTime2 and DateTimeOffset - 3.5 additions
-       Patch by Jay Wren <jrwren@xmtp.net>
-       
-2009-01-05  Raja R Harinath  <harinath@hurrynot.org>
-
-       * DataRelationCollection.cs (BinarySerialize): New.  Carved out of ...
-       * DataSet.cs (BinarySerialize): ... this.
-
-2009-01-04  Raja R Harinath  <harinath@hurrynot.org>
-
-       * DataRelationCollection.cs: Sequester NET_2_0 and NET_1_1
-       specific code into separate parts.
-
-       * DataTableCollection.cs (BinarySerialize_Schema): New.
-       (BinarySerialize_Data): Likewise.  Carved out of ...
-       * DataSet.cs (BinarySerialize): ... this.
-
-2009-01-04  Raja R Harinath  <harinath@hurrynot.org>
-
-       * DataTableCollection.cs: Sequester NET_2_0 and NET_1_1 specific
-       code into separate parts.
-
-2009-01-02  Ivan N. Zlatev  <contact@i-nz.net>
-
-       * DataViewManager.cs: Implement all MonoTODO. Fixes the WinForms 
-       DataBinding unit tests.
-
-2009-01-01  Ivan N. Zlatev  <contact@i-nz.net>
-
-       * DataViewManager.cs: Hookup to the table/relations changed events and 
-       raise ListChanged events accordingly.
-
-2008-12-30  Gert Driesen  <drieseng@users.sourceforge.net>
-
-       * DBConcurrencyException.cs: Marked .ctor taking DataRow [] as
-       internal so we can use it on the 1.0 profile (internally). Implemented
-       RowCount.
-
-2008-12-29  Gert Driesen  <drieseng@users.sourceforge.net>
-
-       * SqlDbType: Added Date and Time (2.0 only).
-
-2008-11-18  Raja R Harinath  <harinath@hurrynot.org>
-
-       Fix #420862
-       * XmlConstants.cs (QnUnsignedShort): Rename from QnUsigned short
-       and fix the value too.
-       * XmlSchemaWriter.cs (XmlQualifiedName): Update to changes.
-
-2008-09-27  Raja R Harinath  <harinath@hurrynot.org>
-
-       * DataView.cs: Convert into a partial class and sequester
-       interface-implementations and NET_2_0 pieces into separate parts.
-
-2008-09-16  brandin claar  <brandin.claar@gmail.com>
-           Raja R Harinath  <harinath@hurrynot.org>
-
-       * DataTable.cs (BinarySerialize): Handle empty DataTables.
-       (DeserializeRecords): Likewise.
-       (BinaryDeserializeTable): Allow DefaultValue to be set to any value.
-
-2008-09-12  Raja R Harinath  <harinath@hurrynot.org>
-
-       * DataTable.cs (NewRowAdded): Make into partial method.
-       (DataTableClearing, DataTableCleared): New partial methods.
-       (Clear): Use them.
-
-       * DataTable.cs: Sequester ISupportInitializationNotification
-       pieces into separate part.
-       (DataTableInitialized): Turn into a 'partial method' to avoid #ifs.
-
-       * DataTable.cs (AssertNotNullConstraints): Hoist out a more useful
-       loop-invariant by inverting loops.
-       (RowExists): Outdent.  Rewrite for slightly better clarity.
-       (BeginLoadData): Outdent.
-       (GetChanges): Outdent.  Replace GetEnumerator/while with foreach.
-
-       * DataTable.cs: Convert to a partial class, sequester NET_2_0
-       specific and IXmlSerializable specific pieces into separate parts.
-
-2008-09-07  Raja R Harinath  <harinath@hurrynot.org>
-
-       * DataSet.cs: Convert to a partial class and sequester NET_2_0
-       pieces into a separate part.
-
-       * DataRowView.cs: Convert to a partial class, and sequester
-       NET_2_0 parts into a separate part.  Use partial classes instead
-       of ugly #region directives.
-       (Item): Remove redundant attributes.  Cleanup slightly.
-
-2008-09-05  Raja R Harinath  <harinath@hurrynot.org>
-
-       * DataRowCollection.cs (RemoveInternal): Update RowIDs of rows
-       after the deleted row.
-       (IndexOf): Avoid loop to search for a row, since we already know
-       where a row is: its RowID.
-       (Remove): Use IndexOf rather than List.Contains.
-
-       * DataRowCollection.cs (InsertRow): Delegate setting of RowId
-       to the row itself.  Use 'row.AttachAt' instead of 'row.AttachRow'.
-       (AddInternal): Likewise.  Also delegate handling of
-       ChangeCurrentAndOriginal to AttachAt.
-       * DataRow.cs (AttachAt): Rename from AttachRow.  Set rowId from
-       passed-in id.  Handle ChangeCurrentAndOriginal and ChangeOriginal
-       actions.
-
-       * DataRow.cs (_hasParentCollection): Remove.  Implied by _rowId >= 0.
-       (HasParentCollection): Remove.
-       * DataRowCollection.cs (AddInternal, InsertAt): Update to changes.
-
-       * DataTable.cs (NewRowArray): Special case size == 0 to avoid
-       creating a lot of garbage.
-
-       * DataRow.cs (Detach): Rename from DetachRow.  Make private.
-       Simplify code to be more uniform.  Move common prefix code here ...
-       (AcceptChanges) [Deleted]: ... from here ...
-       (Delete) [Added]: ... and here ...
-       (RejectChanges) [Added]: ... and here.
-
-2008-09-04  Raja R Harinath  <harinath@hurrynot.org>
-
-       * DataRow.cs (CheckChildRows) <1-arg variant>: Remove excessive
-       indentation.
-       (CheckChildRows) <3-arg variant>: Likewise.  Move/split loop
-       inside a switch.
-       (EndEdit): Out-dent some code.
-       (IsNullColumns): Simplify slightly.
-
-       * DataRelationCollection.cs (CanRemove): Simplify slightly.
-
-       * DataRelation.cs (CheckStateForProperty): Use the childColumn to
-       get the child table.
-
-       * DataColumn.cs (AllowDBNull.set): Rearrange code to be more readable.
-       (AutoIncrement.set): Likewise.
-       (Caption): Likewise.
-       (SetDefaultValue): Likewise.
-
-2008-08-28  Raja R Harinath  <harinath@hurrynot.org>
-
-       * Constraint.cs (SetExtendedProperties): New internal method.
-       Move here from ...
-       (ExtendedProperties.set): ... here.  Kill a #ifdef.
-       * DataTable.cs (DeserializeConstraints): Update to changes.
-
-2008-08-27  Raja R Harinath  <harinath@hurrynot.org>
-
-       * ConstraintCollection.cs (Item) <string variant>: Don't incur
-       additional check for index that's returned by 'IndexOf'.
-       (_createNewConstraintName): Improve readability of code.
-       (_isDuplicateConstraintName): Perform cheaper test first.
-
-       * ConstraintCollection.cs: Reduce some #ifdef by using partial
-       classes.  Move 'sealed' and '[Serializable]' to appropriate
-       partial class declarations.
-       * DataRowCollection.cs: Likewise.
-
-2008-08-13  Marek Habersack  <mhabersack@novell.com>
-
-       * DataRow.cs: do not check whether a column is read-only when
-       importing a record.
-
-2008-08-08  Raja R Harinath  <harinath@hurrynot.org>
-
-       * DataColumn.cs: Update to changes in DataCollection.
-
-2008-07-29  Veerapuram Varadhan  <vvaradhan@novell.com>
-
-       Fixes ##377146
-       * XmlDataReader.cs (ReadElementElement): Handle custom reference types sanely.
-
-2008-07-20  Gert Driesen  <drieseng@users.sourceforge.net>
-
-       * DataColumnCollection.cs (IndexOf): Include name of column - for which
-       there are multiple matches in a different case - in the exception
-       message.
-       * DataRow.cs (this [int]): On 2.0 profile, throw ArgumentException if
-       value is null and datatype of column is a value type. On 1.0 profile,
-       only allow null value if datatype of column is string. Do not replace
-       value with DBNull.Value if value is null.
-
-2008-07-04  Gert Driesen  <drieseng@users.sourceforge.net>
-
-       * DataRow.cs: Use indexer of DataColumnCollection instead of IndexOf.
-       Cosmetic changes to exception message.
-       * DataColumnCollection.cs: Fixed off by one error in index check. Added
-       null check in name indexer. In Clear, also reset columnNameCount and
-       defaultColumnIndex.
-
-2008-07-03  Gert Driesen  <drieseng@users.sourceforge.net>
-
-       * DataRow.cs: Added missing null checks. Cosmetic changes to exception
-       messages.
-
-2008-07-03  Marek Habersack  <mhabersack@novell.com>
-
-       * DataRow.cs (this []): Use DBNull instead of throwing an exception
-       
-2008-07-01  Rodrigo Kumpera  <rkumpera@novell.com>
-
-       * DataTable.cs: Kill some foreach loops.
-       
-       * DataRow.cs: Same.
-
-2008-07-01  Marek Safar  <marek.safar@gmail.com>
-
-       * DataColumnCollection.cs: Made few simple optimizations.
-
-2008-06-28  Zoltan Varga  <vargaz@gmail.com>
-
-       * DataTable.cs (NewRowArray): Avoid using reflection if possible.
-
-2008-06-19  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataRelation.cs : keep createConstraints flag for cloning in
-         DataSet.Merge(). Use different flag for initialization instead.
-       * MergeManager.cs : When cloning DataRelation, createConstraints
-         flag should depend on the source.
-       * XmlSchemaDataImporter.cs : create constraints when creating
-         DataRelation.
-
-2008-06-18  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataSet.cs : when InferSchema mode, ReadXml() should do "merging
-         inference".
-       * XmlDataInferenceLoader.cs : fixed primary key processing in
-         merging inference mode. Reuse existing one, instead of rejecting
-         such a table.
-
-2008-06-17  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlSchemaWriter.cs, DataSet.cs, XmlTableWriter.cs, DataTable.cs,
-         XmlDataInferenceLoader.cs, XmlSchemaDataImporter.cs:
-         fix xsd output on msdata:Locale and msdata.UseCurrentCulture.
-         Output explicit Locale only when it is explicitly specified.
-         On the other hand, ReadXml/ReadXmlSchema fills Locale as en-US
-         by default (on .NET).
-         Some code unification in DataTable.WriteXmlSchema() overloads.
-
-2008-06-16  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataColumn.cs : replaced Activator.CreateInstance() with
-         returning explicit Null member for each SqlXxx type.
-
-2008-06-13  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataColumn.cs
-         DefaultValue can be non-DBNull. For SqlXxx type, it becomes
-         SqlXxx.Null. Also, changing DataType may change DefaultValue
-         to be consistent with the new type (say, having int DefaultValue
-         for new string DataType is wrong).
-
-       * XmlSchemaWriter.cs
-         This should be fixed to take non-DBNull default value into
-         consideration.
-
-2008-06-12  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataSet.cs, DataTable.cs, XmlSchemaDataImporter.cs : constraints
-         on missing tables are ignored when reading a DataTable schema.
-         Fixes part of DataTableTest.ReadXmlSchema() test.
-
-2008-05-30  Marek Habersack  <mhabersack@novell.com>
-
-       * Constraint.cs: do not use synthetized event accessors (to avoid
-       locks).
-
-2008-05-29  Marek Habersack  <mhabersack@novell.com>
-
-       * DataColumn.cs: do not use synthetic methods for events - this
-       avoids unnecessary locking, especially for internal events.
-
-2008-04-21  Gert Driesen  <drieseng@users.sourceforge.net>
-
-       * DataRowView.cs: Modified argument names to match MS. Use 
-       String.Empty instead of "". Code formatting.
-
-2008-04-16  Veerapuram Varadhan <vvaradhan@novell.com>
-
-       * XmlDataInferenceLoader.cs (ReadXml): Make sure the name of
-       reference key column(s) in child tables are unique.
-
-       * XmlSchemaWriter.cs (WriteSchema, WriteDataSetElement,
-       WriteTableType, WriteChildRelations): Handle the scenario wherein
-       we have a relation and only one table.  This can occur when we
-       have an XML with same parent/child table names. 
-       
-2008-03-31  Veerapuram Varadhan <vvaradhan@novell.com>
-
-       * DataView.cs: Reverting rev#98474 changes - as it broke quite a
-       few test profiles.
-       
-2008-03-23  Gert Driesen  <drieseng@users.sourceforge.net>
-
-       * DataSet.cs: Corcompare fix.
-       * IDataRecord.cs: Corcompare fix.
-
-2008-03-22  Gert Driesen  <drieseng@users.sourceforge.net>
-
-       * DataViewSettingCollection.cs: Corcompare fixes and code formatting.
-       * SyntaxErrorException.cs: Corcompare fixes and code formatting.
-       * EvaluateException.cs: Corcompare fixes and code formatting.
-       * StrongTypingException.cs: Coecompare fixes and code formatting.
-       * ReadOnlyException.cs: Corcompare fixes and code formatting.
-       * DataTableCollection.cs: Corcompare fixes and code formatting.
-       * MissingPrimaryKeyException.cs: Corcompare fixes and code formatting.
-       * DeletedRowInaccesibleException.cs: Corcompare fixes and code
-       formatting.
-       * DataSet.cs: Corcompare fixes and code formatting.
-       * DuplicateNameException.cs: Corcompare fixes and code formatting.
-       * DataView.cs: Corcompare fixes and code formatting.
-       * VersionNotFoundException.cs: Corcompare fixes and code formatting.
-       * MergeFailedEventArgs.cs: Corcomare fixes and code formatting.
-       * InvalidExpressionException.cs: Corcompare fixes and code formatting.
-       * DBConcurrencyException.cs: Corcompare fixes and code formatting.
-       * DataRowView.cs: Corcompare fixes and code formatting.
-       * DataViewManager.cs: Corcompare fixes and code formatting.
-       * ConstraintException.cs: Corcompare fixes and code formatting.
-       * InvalidConstraintException.cs: Corcompare fixes and code formatting.
-       * IDataRecord.cs: Corcompare fixes.
-       * RowNotInTableException.cs: Corcompare fixes and code formatting.
-       * TypeDataSetGeneratorException.cs: Corcompare fixes and code
-       formatting.
-       * InRowChangingEventException.cs: Corcompare fixes and code formatting.
-       * NoNullAllowedException.cs: Corcompare fixes and code formatting.
-       * DataException.cs: Corcompare fixes and code formatting.
-
-2008-03-17  Veerapuram Varadhan <vvaradhan@novell.com>
-       
-       ** Fixes part1 of #357947
-       * DataView.cs: (OnRowDeleted): Don't call update, instead delete the row 
-       directly from Index.  Peformance fix submitted by Hubert FONGARNAND 
-       <informatique.internet@fiducial.fr>.
-
-2008-02-04 Arina Itkes <arinai@mainsoft.com>
-       
-       * DataTable.cs: Fix for IXmlSerializable.ReadXml.
-
-2008-01-28 Arina Itkes <arinai@mainsoft.com>
-       
-       * DataTable.cs: Fix for IXmlSerializable.WriteXml.
-
-2007-10-21  Gert Driesen  <drieseng@users.sourceforge.net>
-
-       * DataColumn.cs: Fixed ParamName of ArgumentNullException. Modified
-       exception message for invalid DateTimeMode value to match MS. Code
-       formatting.
-
-2007-10-19  Nagappan <anagappan@novell.com> 
-
-       * DataRelation.cs: Removed bogus TODO.
-
-2007-09-27  Nagappan A <anagappan@novell.com> 
-
-       * DataRelationCollection.cs: Added LAME spec comment as there is no
-         relevant event. Removed MonoTODO too.
-
-2007-09-26  Nagappan A <anagappan@novell.com> 
-
-       * DataView.cs (ToTable): Added params keyword.
-       
-       * DataTable.cs: Added XmlSchemaProvider attribute.
-
-2007-09-25  Konstantin Triger <kostat@mainsoft.com>
-
-       * DataSet.cs: correct WriteAttributeString while writing xml with
-               XmlWriteMode.WriteSchema.
-
-2007-09-25  Nagappan A  <anagappan@novell.com>
-
-       * DataTable.cs: Code alignment.
-
-2007-08-14  Vladimir Krasnov <vladimirk@mainsoft.com>
-
-       * DataColumnCollection.cs: refactoring, fixed columnNameCount comparer
-       to remove culture sensitive ToLower() calls
-
-2007-07-22  Nagappan A  <anagappan@novell.com>
-
-       * DataRow.cs: Added internal set property for Table in 2.0
-       profile.
-
-       * DataColumn.cs: Added internal set property for Table in 2.0
-       profile.
-
-2007-07-01  Gert Driesen  <drieseng@users.sourceforge.net>
-
-       * DataRowCollection.cs: Only override Count on 2.0 profile.
-       * RelatedDataView.cs: Fixed line endings.
-       * XmlDataInferenceLoader.cs: Fixed line endings.
-
-2007-06-30  Gert Driesen  <drieseng@users.sourceforge.net>
-
-       * DataTableCollection.cs: CopyTo is 2.0 only. Removed extra tabs,
-       and changed spaces to tabs.
-
-2007-06-06  Nagappan A  <anagappan@novell.com>
-
-       * DataTable.cs (Select): Removed ununsed variable.
-
-2007-05-30  Nagappan A  <anagappan@novell.com>
-
-       * DataColumnCollection.cs (CopyTo): Method specific to 2.0
-       profile.
-
-       * DataRowCollection.cs (Count): Property is overridden in 2.0
-       profile.
-
-       * TypedDataSetGenerator.cs: Class is obsolete in 2.0 profile.
-
-       * DataRelationCollection.cs (CopyTo): Method specific to 2.0
-       profile.
-
-2007-05-18  Rolf Bjarne Kvinge  <RKvinge@novell.com>
-
-       * CustomDataClassGenerator.cs: Misc fixes in order to emit correct VB code.
-       CreateDataSetDefaultCtor: we're creating a delegate, not an object, so use a DelegateCreateExpression.
-       CreateDataSetSchemaChanged: we're comparing value types, use the correct equality operator.
-       CreateTableGetEnumerator: explicity state that the method is an implementation of IEnumerable.GetEnumerator.
-       CreateTableEventStarter: we're invoking a delegate, so use a DelegateInvokeExpression.
-       Several changes to not generate members with names that only differ by case.
-
-2007-05-18  Chris Toshok  <toshok@ximian.com>
-
-       * DataColumnCollection.cs (Add ()): handle the default name case
-       in Add(DataColumn).
-       (Add (string)): same - let Add(DataColumn) handle the default name
-       setting.
-       (Add (DataColumn)): in the 1.1 case, we need to add the column's
-       PropertyChanged handler *before* possibly setting the column name
-       to the default so we emit the right events (Changed/Added).  In
-       the 2.0 case, we add the event handler after the name is set, and
-       therefore only emit the Added event.
-
-2007-05-07  Adar Wesley <adarw@mainsoft.com>
-
-       * ConstraintCollection.cs: added CopyTo method with strongly typed Constraint[] 
-       parameter.
-
-       * DataTable.cs: added implementation of IXmlSerializable. Added missing
-       method ReadXmlSerializable.
-
-2007-04-19  Chris Toshok  <toshok@ximian.com>
-
-       * DataColumnCollection.cs (Add): the Element in our
-       CollectionChangedEventArgs should be the column, not the
-       collection.  Also, add an event handler for the column's
-       PropertyChanged event so we can propagate metadata changes.
-       (Remove): Analogous change to the CollectionChangedEventArgs as in
-       Add.  Also, unhook the column's PropertyChanged event.
-       (OnCollectionmetaDataChanged): emit our new event.
-       (ColumnPropertyChanged): called when the column's ColumnName
-       property changes.  Emit the proper CollectionChangeEvent.
-
-       * DataView.cs (ColumnCollectionChanged): fix up the comment about
-       CollectionChangeAction.Refresh, and make explicit what generates
-       it.
-       (RegisterEventHandlers): hook up
-       DataColumnCollectoin.CollectionMetaDataChanged.
-       (RegisterEventHandlers): unhook
-       DataColumnCollectoin.CollectionMetaDataChanged.
-
-2007-02-23  Nagappan A  <anagappan@novell.com>
-
-       * DataRow.cs (Item): Checks whether this DataRow exist in the
-       DataRowCollection, then compute the expression. Fixes bug #
-       80505.
-
-       * DataRowCollection.cs (IndexOf): Modified as internal method for
-       1.0 profile.
-
-       * XmlDataReader.cs (StringToObject): DataTables containing
-       System.Type throw exception on deserializing. Fixes bug # 80596.
-
-       * XmlDataLoader.cs (StringToObject): DataTables containing
-       System.Type throw exception on deserializing. Fixes bug # 80596.
-
-2007-02-20  Konstantin Triger <kostat@mainsoft.com>
-
-       * XmlSchemaDataImporter.cs: ensure the tables are created in document order.
-
-2007-02-19  Konstantin Triger <kostat@mainsoft.com>
-
-       * XmlDataReader.cs, XmlDataInferenceLoader.cs, XmlDiffLoader.cs:
-               ignore attributes from "http://www.w3.org/XML/1998/namespace".
-       * XmlConstants.cs: add constant for "http://www.w3.org/XML/1998/namespace".
-       * XmlDataInferenceLoader.cs: track the added elements index to fix the
-               added column ordinal.
-
-2006-12-11  Chris Toshok  <toshok@ximian.com>
-
-       * DataView.cs: GetItemProperties should return an empty collection
-       if we have no data table.  Presently we NRE.
-
-2006-12-08  Nagappan A  <anagappan@novell.com>
-
-       * DataTable.cs (ReadXml): Removed if condition, as it should not
-       check the exception string.
-
-2006-12-07  Chris Toshok  <toshok@ximian.com>
-
-       * DataView.cs: add CollectionChangeEventHandler's on the
-       ChildRelations and ParentRelations collections, and emit
-       ListChanged events with PropertyDescriptor.Added/Deleted/Changed
-       in response.
-
-2006-12-07  Nagappan A  <anagappan@novell.com>
-
-       * DataTable.cs (ReadXml): Integrated the implementation of
-       ReadXml, patch provided by deepak_2603@yahoo.com.
-
-2006-12-05  Nagappan A  <anagappan@novell.com>
-
-       * DataTable.cs (WriteXmlSchema): Using XmlTextWriter instead of
-       XmlWriter, solved the File Sharing IO Exception.
-
-2006-11-28     Hubert FONGARNAND, FrAcdAcric Mestayer <informatique.internet@fiducial.fr>
-
-       * DataColumnCollection.cs : Improved Column searching when not
-       using exact column name (case sensitivity). Fixes bug # 80075.
-
-2006-11-28  Nagappan A  <anagappan@novell.com>
-
-       * XmlSchemaDataImporter.cs: Fixed 2.0 profile compilation
-       warnings. Using AttributeSchemaType instead of AttributeType and
-       ElementSchemaType instead of ElementType.
-
-       * TypedDataSetGenerator.cs: Modified the profile check from
-       !NET_1_1 to !NET_1_0, as this class is obsolete from 1.1 profile.
-
-       * DataRelationCollection.cs (Item): Modified the property Item as
-       abstract and implemented it in DataSetRelationCollection and
-       DataTableRelationCollection classes.
-
-       * DataRowView.cs: Remove bogus MonoTODOs.
-
-       * ForeignKeyConstraint.cs (ForeignKeyConstraint): Implemented
-       2.0 profile's missing constructor.
-
-       * XmlDataLoader.cs (StringToObject): Modify XmlConvert.ToDateTime
-       to use XmlDateTimeSerializationMode, as the default ToDataTime
-       method id obsolete.
-
-       * XmlDataReader.cs (StringToObject): Modify XmlConvert.ToDateTime
-       to use XmlDateTimeSerializationMode, as the default ToDataTime
-       method id obsolete.
-
-       * DataView.cs (IsInitialized): Added browsable attribute. 
-
-       * DataViewSettingCollection.cs (CopyTo): Implemented missing 2.0
-       API.
-
-       * DataRelation.cs (DataRelation): Added 2.0 profile constructor to
-       take parentTableNameSpace and childTableNameSpace as argument.
-       (FinishInit): Update parentTableNameSpace and childTableNameSpace,
-       when the string is not empty in 2.0 profile.
-
-       * DataRowCollection.cs: Implemented Count public property.
-       Added !NET_2_0 for List protected property, as it has been removed
-       in 2.0 prifle.
-       (IndexOf): Implemented new public method.
-       (CopyTo): Implemented new public override method.
-       (GetEnumerator): Implemented new public override method.
-
-       * DataTable.cs (Load): Throw ArgumentNullException, when reader
-       argument is null.
-       (WriteXmlSchema): Throw InvalidOperationException, when table name
-       is empty. When DataSet Namespace is set, append that with '_x003A_'
-       and table name.
-       (IsInitialized): Added browsable attribute.
-
-       * DataSet.cs (Load): Throw ArgumentNullException, when reader
-       argument is null.
-       (IsInitialized): Added browsable attribute.
-       (WriteObjectXml): Modify XmlConvert.ToDateTime to use
-       XmlDateTimeSerializationMode, as the default ToDataTime method id
-       obsolete.
-
-       * XmlSchemaWriter.cs (WriteSchema): Modified UseCurrentCulture to
-       UseCurrentLocale.
-       (WriteDataSetElement): Added minOccurs attribute.
-       (WriteConstraints): Check for tables length, if > 1 then add the
-       relations to XmlSchema.
-
-2006-11-21  Nagappan A  <anagappan@novell.com>
-
-       * DataView.cs: Added public event Initialized.
-       (IsInitialized): Implemented public function to check whether a
-       dataview is initialized or not.
-
-       * DataSet.cs: Added ISupportInitializeNotification for .NET 2.0
-       profile.
-       (RemotingFormat): Set the default value attribute as
-       SerializationFormat.Xml.
-       (IsInitialized): Implemented public function to check whether a
-       table is initialized or not.
-       (CreateDataReader): Added params keyword in argument.
-       (Load): Implemented all Load overloaded functions.
-       (GetObjectData): Modified to public for .NET 2.0 implementation.
-       (IsBinarySerialized): Implemented the public API to check whether
-       the given stream is binary serialized or not.
-       * DataTable.cs: Added ISupportInitializeNotification for .NET 2.0
-       profile.
-
-2006-11-15  Nagappan A  <anagappan@novell.com>
-
-       * DataTable.cs (RemotingFormat): Set the default value attribute
-       as SerializationFormat.Xml.
-       (OnTableNewRow, NewRowAdded): Implemented new function to raise an
-       event when a new row is added to the table.
-       (DataTableInitialized, OnTableInitialized): Implemented new
-       function to raise an event when a table is initialized.
-       (IsInitialized): Implemented public function to check whether a
-       table is initialized or not.
-       (OnTableClearing): Raise an event before the table is cleared.
-       (GetObjectData): Modified to public for .NET 2.0 implementation.
-       (Load): Implemented missing API to call the registered delegate
-       function on load exception.
-       (WriteXmlSchema): Implemented overloaded function to write the
-       hierarchy with XML Schema.
-
-2006-11-15  Konstantin Triger <kostat@mainsoft.com>
-
-       * DataTable.cs: Fixed LoadDataRow scenarios.
-       * DataRowCollection.cs: Added override for AddInternal taking DataRowAction parameter.
-
-2006-11-14  Konstantin Triger <kostat@mainsoft.com>
-
-       * DataColumn.cs: consider row version wen checking row.IsNull().
-
-2006-10-18  Nagappan A  <anagappan@novell.com>
-
-       * ForeignKeyConstraint.cs (_validateColumns): Parent and child
-       columns can't be the same column - Exception, bug # 79689
-
-2006-10-13  Nagappan A  <anagappan@novell.com>
-
-       * DataTable.cs (DeserializeConstraints): Fine tuned the
-       serialization and deserialization of constraints.
-
-       * DataRelationCollection.cs (Contains): Fixes bug
-       #79233. DuplicateNameException when two relations for different
-       DataTables in DataSet are defined
-
-2006-10-06  Patrick Earl <mono@patearl.net>
-
-       * DataTable.cs, XmlTableWriter.cs, XmlSchemaWriter.cs, DataSet.cs:
-       Implemented DataTable.WriteXml
-
-2006-09-26  Nagappan A  <anagappan@novell.com>
-
-       * DataTable.cs, DataSet.cs, DataColumn.cs, Constraint.cs,
-       DataRow.cs: Implementation of Binary Serialization /
-       Deserialization.
-
-       * DataTable.cs (RowsExist): Check rows based on version.
-
-       * DataRow.cs: Raise exception same as MS.NET. Thanks to
-       Hubert FONGARNAND <informatique.internet@fiducial.fr> for
-       providing this patch.
-
-2006-09-07  Vladimir Krasnov <vladimirk@mainsoft.com>
-
-       * DataSet.cs: added 2.0 stubs to solve typed dataset porting issues
-
-2006-08-30  Nagappan A  <anagappan@novell.com>
-
-       * DataRow.cs (EndEdit): DataRow.EndEdit emits RowChanged too
-       often. Fixes bug # 78885.
-
-2006-08-14  Konstantin Triger <kostat@mainsoft.com>
-
-       * DataTableCollection.cs, DataRelationCollection.cs, DataRowCollection.cs,
-               DataColumnCollection.cs: implemented specialized CopyTo() method.
-
-2006-07-26  Nagappan A  <anagappan@novell.com>
-
-       * DataTable.cs (GetIndex): Fixes memory explode on
-       DataTable.Select - Bug # 77691.
-
-2006-07-25  Nagappan A  <anagappan@novell.com>
-
-       * DataView.cs (OnRowCollectionChanged): On DataTable.Clear,
-       setting rowCache to empty DataRowView. Fixes bug # 78610.
-
-       * DataTable.cs (AcceptChanges): Raises Reset event. Fixes bug #
-       78610.
-
-2006-07-20  Senganal T  <tsenganal@novell.com>
-
-       * MergeManager.cs :
-               - Merge : moved the columntypecheck to AdjustSchema,
-               Remove the unncessary calls to Table.ResetIndexes.
-               - AdjustSchema : check for columntypes
-       Thanks to Deepak Kr Valechha for the patch
-
-2006-07-17  Senganal T  <tsenganal@novell.com>
-
-       * DataView.cs :
-               - ToTable : Implemented all the overloads
-               - Equals : Implemented 
-               - IBindingListView : Implemented the interface
-
-2006-07-15  Senganal T  <tsenganal@novell.com>
-
-       * DataTableCollection.cs :
-               - Contain,IndexOf,Remove,Add,Indexer : support for table
-               namespace. Remove redundant checks in Remove/Add.
-
-2006-07-14  Senganal T  <tsenganal@novell.com>
-       
-       * DataColumn.cs :
-               - SetOrdinal : Implemented
-               - Ordinal : added internal set
-       * DataColumnCollection.cs : 
-               - Add : Set the column ordinals
-               - MoveColumn : Changes the position of column in the
-               collection
-
-2006-07-14  Senganal T  <tsenganal@novell.com>
-
-       * DataTable.cs :
-               - Merge - Implement the merge methods
-               - Clone - Ensure column's DateTimeMode property is also copied
-       * DataColumn.cs :
-               - DateTimeMode : Implemement
-               - DataTypeMatches : Added. In 2.0 profile, test DateTime
-               property when verifying column types.
-       * DataRelation.cs :
-               - ctr :  For DateTime columns, check DateTimeMode property
-       * ForeignKeyConstraint.cs :
-               - _validateColumns : For DateTime columns, check DateTimeMode
-               property
-       * MergeManager : 
-               - Merge : Added. Overload to merge two tables
-               - ResolveColumns : Change the method to use a table instead of
-               a DataSet
-               - Renamed AdjustSchema to AdjustSchemaRelations
-
-2006-07-13  Senganal T  <tsenganal@novell.com>
-
-       * DataSet.cs :
-               - WriteTables : Remove some commented out code
-               - WriteTable : Fix the logic to skip the table data when the
-               table has a nested relation.
-               fixes bug #78842
-
-2006-07-12  Senganal T  <tsenganal@novell.com>
-
-       * ConstraintCollection.cs : 
-               - Remove (string): If constraint name is not found, throw exception
-               - Remove (Constraint): Set the ConstraintCollection of the removed
-               Constraint to null.
-       Thanks to Deepak Kr Velachha for reporting the bug.
-
-2006-07-12  Senganal T  <tsenganal@novell.com>
-
-       * XmlDiffLoader.cs : 
-               - LoadColumnChildren : If schema name is missing, skip the
-               element.
-       Thanks to Deepak Kr Velachha for identifying the bug.
-
-2006-07-11  Senganal T  <tsenganal@novell.com>
-       
-       * XmlSchemaWriter.cs :
-               - WriteTableType : If Relation.Nested is true, then nest the 
-               table schemas. Correct the xml to add the table element within
-               the <Sequence> element.
-               - WriteChildRelations : Correct the Xml element name and
-               attributes. Close the attribute correctly.
-
-       * XmlSchemaDataImporter.cs :
-               - GenerateRelationship : When creating the relations, if
-               ParentColumn exists but Corr ChildCol is null, create a child
-               Column with the same name and type as the parent column.
-               - Renamed DataSetDefinesPrimaryKey to DataSetDefinesKey
-               - DataSetDefinesKey : if either xsd:key or xsd:keyref is
-               defined for the dataset, do not manually create the relations.
-               - AddParentKeyColumn : if Columnname already exists, use
-               colname_0 instead of throwing an exception.
-               - FillDataColumnRepeatedSimpleElement : Do not set the Unique
-               value as it creates a constraint by default. The unique value
-               is automatically set when pk is set.
-               - CreateChildColumns : Added. Creates a ChildColumn duplicating 
-               ParentColumn properties.
-
-2006-06-30  Senganal T  <tsenganal@novell.com>
-
-       * DataRow.cs : 
-               - SetAdded, SetModified : new methods in 2.0
-
-2006-06-30  Senganal T  <tsenganal@novell.com>
-       * SerializationFormat.cs, DataSetDateTime.cs, DataTableNewRowEventArgs.cs,
-       DataTableNewRowEventHandler.cs : Added 
-       * SyntaxErrorException.cs EvaluateException.cs StrongTypingException.cs 
-       IsolationLevel.cs ReadOnlyException.cs DataTableCollection.cs 
-       DataRowState.cs MissingPrimaryKeyException.cs DeletedRowInaccessibleException.cs 
-       DuplicateNameException.cs PropertyAttributes.cs StatementType.cs 
-       VersionNotFoundException.cs FillErrorEventHandler.cs DataRowChangeEventHandler.cs 
-       XmlWriteMode.cs InvalidExpressionException.cs StateChangeEventHandler.cs 
-       DbType.cs DataColumnChangeEventHandler.cs KeyRestrictionBehavior.cs 
-       ConnectionState.cs SchemaType.cs MergeFailedEventHandler.cs SqlDbType.cs 
-       DataRowVersion.cs ForeignKeyConstraint.cs DBConcurrencyException.cs 
-       OperationAbortedException.cs MissingSchemaAction.cs DataTableClearEventHandler.cs 
-       DataRowView.cs DataRowAction.cs ConstraintCollection.cs DataTableReader.cs 
-       LoadOption.cs InvalidConstraintException.cs InternalDataCollectionBase.cs 
-       ParameterDirection.cs AcceptRejectRule.cs UpdateRowSource.cs XmlReadMode.cs 
-       TypedDataSetGenerator.cs RowNotInTableException.cs TypeDataSetGeneratorException.cs
-       InRowChangingEventException.cs  MissingMappingAction.cs NoNullAllowedException.cs 
-       CommandBehavior.cs PropertyCollection.cs CommandType.cs 
-       UpdateStatus.cs ConflictOption.cs DataViewRowState.cs  Rule.cs 
-       DataColumnCollection.cs :
-               2.0 api fixes.
-
-2006-06-27  Senganal T  <tsenganal@novell.com>
-
-       * DataSet.cs, DataTable.cs : implement CreateDataReader methods 
-       * InternalDataCollectionBase.cs
-               - ToArray () : helper method
-       * DataTableReader.cs : 
-               - GetSchemaTable : set the schema info correctly
-               - GetProvider*, GetChars, GetBytes, GetValues :
-                       Implemented the methods
-               - GetName : return the name of corresponding schema.
-               - ValidateSchemaIntact, OnColumnCollectionChanged, 
-               OnColumnChanged :
-                       Listen and raise expception if schema changes
-
-2006-06-21  Chris Toshok  <toshok@ximian.com>
-
-       * DataView.cs: update the index after we successfully add the new
-       row.  This keeps the dataview's row view count in sync with the
-       table.
-
-2006-06-20  Chris Toshok  <toshok@ximian.com>
-
-       * DataView.cs: the PropertyDescriptorCollection returned by
-       ITyepdList.GetItemProperties should include the child relations of
-       our table, in order to match MS's behavior.
-
-       * DataViewManager.cs: ICollection.Count property is always 1.
-
-2006-06-15  Senganal T  <tsenganal@novell.com>
-
-       * DataTable.cs :
-               - Select : If Sort String is not provided, sort the result
-               DataRows in Ascending Order of the Columns used in the filter
-
-2006-06-15  Senganal T  <tsenganal@novell.com>
-
-       * DataSet.cs :
-               - InternalEnforceConstraints : Check if any null constraints 
-               are violated. Throw ConstraintException only after all the errors
-               are filled.
-       * DataTable.cs :
-               - EnforceConstraints : Move away the logic to check for 
-               NullConstraintViolation.
-               - AssertNotNullConstraint : Checks for Null Constraint
-               Violation.
-               - EndLoadData : Do not throw any exceptions here. All the
-               errors have to be found and RowErrors set before throwing the
-               exception.
-       * DataRow.cs :
-               - ImportRecrod : Check the values of the row for any null
-               values.
-               - SetColumnError : If the error for column is already set,
-               do not add a new error but edit the existing error. 
-               - CheckValue : Set the NullConstraintViolation flag if either
-               table is being loaded or if EnforceConstraints is set to
-               false.
-       * Constraint.cs : Do not throw exception when EnforceConstraints is
-       set to false or table is being loaded.
-       * UniqueConstraint.cs : Correct the error message. Set ColumnErrors
-       along with the RowError.
-
-2006-05-31  Gert Driesen  <drieseng@users.sourceforge.net>
-
-       * DataTable.cs: Renamed initInProgress to fInitInProgress. BeginInit
-       and EndInit must only be virtual in 2.0 profile. Set eol-style to CRLF.
-
-2006-05-31  Senganal T  <tsenganal@novell.com>
-
-       * XmlDataInferenceLoader.cs :
-               - InferTableElement : Repeated element should result in a single
-               inferred table.
-       Patch from Deepak Kr Velachha 
-
-2006-04-21  Senganal T  <tsenganal@novell.com>
-
-       * DataRowCollection.cs :
-               - Find : If search on the table using PrimaryKey fails and if
-               index is not being maintained (during table load), search the 
-               entire table.
-               - Find (int) : Removed. Deadcode. 
-               - Clear :
-                       - Not necessary to delete each row from the Index.
-                       Just reset the Indexes after cleaning up the row
-                       collection.
-                       - Simplify dependency check for child tables
-       * DataTable.cs :
-               - LoadDataRow : 
-                       - Do not use DataRowCollection.Find to search for
-                       existing records as this wud check even newly loaded rows.
-                       Use Index.Find.
-                       - Do not add new records to Index. Update Index only
-                       if an existing record is modified. New records will be
-                       taken care by EndLoadData.
-
-2006-04-19  Senganal T  <tsenganal@novell.com>
-
-       * XmlHelper.cs : A helper class for encoding/decoding schema names.
-       Caches the Schema names to minimize encoding/decoding operations and
-       duplicate strings created.
-       * XmlSchemaWriter : 
-               - Use XmlHelper for encoding/decoding schema names.
-               - Encode ConstraintNames when writing as xml.
-       * DataSet.cs
-       * XmlDataReader.cs
-       * XmlDataInferenceLoader.cs
-       * XmlSchemaDataImporter.cs
-               - Use XmlHelper for encoding/decoding schema names.
-       * DataTableCollections : Minor code refactor.
-       * DataRow.cs : Create XmlElement only if required.
-
-2006-04-07  Senganal T  <tsenganal@novell.com>
-
-       * DataSet.cs :
-               - InternalEnforceConstraints() : Reset Indexes of all tables
-               before validating constraints. Fixes #78010
-
-2006-03-04     Boris Kirzner <borisk@mainsoft.com>
-       * TypeDataSetGeneratorException.cs: fix .Net Soap serialization compatibility.
-
-2006-03-25  Senganal T  <tsenganal@novell.com>
-
-       * DataRow.cs : 
-               - RejectChanges : When row is in Deleted state, add the row back to
-               Indexes and Validate the row.
-
-
-2006-03-23  Senganal T  <tsenganal@novell.com>
-
-       * DataTable.cs : 
-               - LoadDataRow : Add the row to the indexes, when loading a new row.
-
-2006-03-22  Senganal T  <tsenganal@novell.com>
-
-       * DataTable.cs :
-               - PrimaryKey : Set the IsPrimaryKey attribute before Removing from collection.
-               - RemoveUniqueConstraints : Removed. dead code.
-       * DataColumn.cs :
-               - Unique : 
-                       - If adding/removing constraint fails, retain Unique value
-                       - Remove redundant code
-       * UniqueConstraint.cs :
-               - SetIsPrimaryKey : Added. Sets the value of IsPrimaryKey.
-               - RemoveFromConstraintCollectionCleanup : If constraint is on a single column, then
-               set Unique for that column to false.
-               - CanRemoveFromCollection : Do not remove constraint, if its a PrimaryKey
-
-2006-03-20  Senganal T  <tsenganal@novell.com>
-
-       * DataSet.cs :
-               - CopyRelations () : When copying the relation, do not add constraints
-               automatically for the relation.
-               - OnMergeFailed () : If merge fails and no handler is set for the MergeFailedEvent,
-               then throw DataException 
-       * ConstraintCollection.cs :
-               - Add () : Check if a constraint already exists on the Columns that are being 
-               constrained.
-               - IndexOf () : Do not check for equivalent constraints, check for the exact instance.
-       * MergeManager.cs (): 
-               -  AdjustSchema () : 
-                       - Handle the MissingSchemaAction.Error case, 
-                       - Do not create constraints when mergin the DataRelation
-                       - Follow the semantics for schema merge/validation  when constraints are already present
-                       in the target DataSet.
-               - AdjustPrimaryKeys () :
-                       - Code cleanup
-                       - Verify Order of Columns in the PrimaryKey when merging.
-               - ResolveColumns : Changed the arument to DataSet. Simplifies code elsewhere.
-               - CompareColumnArrays, CompareColumnArrays : Helper funtions.
-               
-2006-03-09  Senganal T  <tsenganal@novell.com>
-
-       * DataRow.cs :
-               - RejectChanges () :  Add the row to index, if it was in deleted state and
-               Update the index if in Modified State.
-               - AcceptChanges () : Do not update the Indexes.
-               - EndEdit () : Update the indexes even if BeginLoadData has been called
-               on the table. Ideally, indexes should not be maintained during DataLoad,
-               but this needs to handled in multiple places correctly. For now, just maintain
-               the index to ensure correct operation.
-       
-2006-03-05  Senganal T  <tsenganal@novell.com>
-
-       * DataSet.cs :
-               - BeginInit (), EndInit () : Implemented methods
-               - InitInProgress : Added.
-       * DataTable.cs
-               - EndInit () : Move the adding of columns and constraints
-               to FinishInit.
-               - FinishInit () : Added. Adds the Constraints and Columns
-               to the collection.
-               - InitInProgress : Added.
-       * Constraint.cs
-               - FinishInit () : Added. Virtual method
-               - InitInProgress : Added. Virtual property
-       * UniqueConstraint.cs
-       * ForeignKeyConstraint.cs
-               - FinishInit () : Added.
-               - InitInProgress : Added.
-               - DataColsNotValidated : Removed.
-       * ConstraintCollection.cs
-               - PostAddRange : Removed event
-               - PostEndEdit () : Renamed to PostAddRange
-               - Add () : Simplified the testing if constraint is initialized
-               - AddRange () : Simplified initializing the constraints
-       * DataTableCollection.cs
-               - PostAddRange () : Added. Adds the tables to the collection
-       * DataColumnColletion.cs
-               - PostEndInit () : Renamed to PostAddRange.Also, add column to
-               the collection only if not null.
-       Added/Implemented methods for design time support. Renamed some methods for consistency
-       in naming across classes for methods serving the same purpose. 
-
-2006-02-24  Senganal T  <tsenganal@novell.com>
-
-       * UniqueConstraint.cs :
-               - ChildConstraint : Added. Simplifies verifying if constraints are
-               related.
-               - CanRemoveFromCollection : Fixed the check to verify if constraints is
-               linked to a ForeignKeyConstraint. Fixes #77630
-       * ForeignKeyConstraint.cs :
-               - _validateRemoveParentConstraint : Removed. Not used anymore
-               - ParentConstraint : Added. Simplifies verifying if constraints are
-
-2006-02-22  Senganal T  <tsenganal@novell.com>
-
-       * DataRow.cs 
-               - RejectChanges : Do not remove Row from Indexes when state is Deleted.
-               - CheckChildRows : When checking for the ChildRows, use the current value
-               and not the original value.
-
-2006-02-18  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * CustomDataClassGenerator.cs : Patch by Marek Habersack. xsd now
-         outputs AutoIncrement, AutoIncrementSeed, AutoIncrementStep and
-         ReadOnly properties. This fixes bug #77576.
-
-2006-02-17  Chris Toshok  <toshok@ximian.com>
-
-       * System.Data/DataSet.cs, System.Data/DataView.cs,
-       System.Data/ForeignKeyConstraint.cs,
-       System.Data/DataViewManager.cs, System.Data/DataRow.cs,
-       System.Data/DataSysDescriptionAttribute.cs,
-       System.Data/UniqueConstraint.cs, System.Data/DataTable.cs,
-       System.Data/DataRelation.cs: lots of attribute work, removing
-       DataSysDescription atributes (and marking the class obsolete) for
-       2.0.
-
-2006-02-17  Chris Toshok  <toshok@ximian.com>
-
-       * DataAdapterException.cs: remove this file.
-       
-2006-02-17  Chris Toshok  <toshok@ximian.com>
-
-       * DataTableReader.cs: Switch to the (bool) form of Dispose to
-       override, as the no-arg form isn't virtual.
-
-       * Constraint.cs: #ifdef out more DataSysDescriptions.
-
-       * ConstraintException.cs: add ..ctor (string, Exception) for 2.0.
-
-2006-02-17  Chris Toshok  <toshok@ximian.com>
-
-       * DataColumn.cs: #ifdef all the DataSysDescriptions !NET_2_0.
-
-       * AdapterMappingException.cs: nuke this file.
-
-       * IDbAsyncConnection.cs, IDbAsyncCommand.cs, IGetTypedData.cs,
-       ISetTypedData.cs, IDataReader2.cs, IDataSources.cs,
-       IDbExecutionContext.cs, IDataRecord2.cs, IDataUpdatableRecord.cs:
-       remove these 2.0 files.
-
-2006-02-17  Chris Toshok  <toshok@ximian.com>
-
-       * ConstraintCollection.cs: in 2.0, class is not serializable and
-       is sealed.  make all the "virtuals" #if !NET_2_0 as well.
-
-       * Constraint.cs: not serializable in 2.0.
-
-       * DataColumnCollection.cs: in 2.0, class is not serializable and
-       is sealed.  make all the "virtuals" #if !NET_2_0 as well.
-
-       * DataRelationCollection.cs: not serializable in 2.0.
-
-       * DataRelation.cs: not serializable in 2.0.
-
-       * DataRowBuilder.cs: class is sealed in 2.0.
-
-       * DataRowCollection.cs: in 2.0, class is not serialized and is
-       sealed.  Also, Add isn't virtual in 2.0 (as the class is sealed).
-
-       * DataRow.cs: not serializable in 2.0.
-
-       * DataSet.cs: remove some DataSysDescriptions from the 2.0 build,
-       and s/GetDataReader/CreateDataReader.
-
-       * DataTableCollection.cs: in 2.0, class is not serializable and is
-       sealed.  make all the "virtuals" #if !NET_2_0 as well.
-
-       * DataTableReader.cs: remove VisibleFieldCount property.
-
-       * DataViewSettingCollection.cs: not serializable in 2.0.
-
-       * DataViewSetting.cs: not serializable in 2.0.
-
-       * ForeignKeyConstraint.cs: serializable in 2.0.
-
-       * OperationAbortedException.cs: class is sealed and serializable.
-
-       * PropertyCollection.cs: serializable in 2.0.
-
-       * StatementCompletedEventArgs.cs: class is sealed.
-
-       * UniqueConstraint.cs: not serializable in 2.0.
-
-2006-02-16  Senganal T  <tsenganal@novell.com>
-
-       * XmlSchemaWriter :
-               WriteDataSetElement : Add an annotation element if exists.
-               WriteDataRelationAnnotation : New. Write a DataRelation as an annotation.
-               WriteConstraints : Write ForeignKeyConstraint even when not associated with
-                       a DataRelation and add a "ConstraintOnly=true" attribute for such constraints.
-       * XmlConstants.cs : Add a new constant - ConstraintOnly
-       * XmlSchemaImporter.cs :
-               - ConstraintStructure : Add field ,IsConstraintOnly, to distinguish if a foreignkeyconstraint
-                       is related to relation or not.
-               - GenerateRelation : Handle the case when parentkey and childkey contain multiple columnnames.
-
-2006-02-11  Senganal T  <tsenganal@novell.com>
-       
-       * UniqueConstraint.cs :
-               - PostAddRange : Check PrimaryKey is not already set for the table
-       * DataTable.cs :
-               - PrimaryKey : follow ms.net behavior when BeginInit , EndInit is used.
-                       - Add new priamry key only when EndInit is called.
-                       - Incase of an error, retain old primarykey 
-               - EndInit :
-                       - Add Constraints after columns are added.
-                       - If both PrimaryKey Property and PrimaryKey Constraint are set,
-                       then the Constraint takes precedence.
-               fixes bug #77404
-
-2006-02-03  Senganal T  <tsenganal@novell.com>
-
-       * DataTableCollection.cs : 
-               - Remove () : Check for invalid TableName
-               - Add () : Verify the table doesn't belong to another dataset
-       * DataView.cs :
-               - CompleteLastAdded () : Do not raise ItemAdded Event as it is
-                       already raised in AddNew().
-       * DataColumn.cs :
-               - Expression : Verify that the Column names in the expression are valid 
-               - ResetCollectionInfo : Renamed to ResetColumnInfo
-       * DataRow.cs :
-               - RejectChanges () : Reorganized the code to do the Right thing.
-               - Item  : Dont check for detached and deleted rows as these are
-                       done elsewhere.
-       * DataRowCollection.cs :
-               - Add () : Check for null value
-       * DataTable.cs :
-               - PrimaryKey : Set AllowDBNull=false for all the key columns
-               - ImportRow : Import the row only if it is not in Detached state. if in Deleted
-                       state, perform the validation when AcceptChanges/RejectChanges is called.
-       * DataColumnCollection.cs :
-               - Add : Validate the column expression before adding it to the collection.
-               - GetColumnDependency () : New. Get the dependencies on the column 
-               - CanRemove : Move checks to GetColumnDependency
-               - Clear () : Simplified code. Remove unncessary checks.Also, dont check Expression col.
-               - IndexOf - Check argument.
-               Overall , appropriate error msg's are thrown if Remove/Clear fails. Removed a few
-               redundant checks performed and moved the common code to GetColumnDependency.
-
-2006-01-31  Senganal T  <tsenganal@novell.com>
-
-       * DataSet.cs : Modified CopyRelations ()
-               - Added code to copy ForeignKeyConstraints. Fixes #77411.
-       
-2006-01-18 Boris Kirzner <borisk@mainsoft.com>
-       * DataColumn.cs: added PropertyCchangedEvent handling.
-
-2006-01-17  Senganal T  <tsenganal@novell.com>
-       
-       * DataRow.cs:
-               ItemArray : Modified to raise RowInTableException only if
-               the concerned row has been removed from the table.Fixes 
-               bug #77267
-
-2006-01-16 Boris Kirzner <borisk@mainsoft.com>
-       * DataTable.cs: Drop dependend indexes on column removal.
-
-2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * CustomDataClassGenerator.cs :
-         When a DataRelation connects the same table as parent and child,
-         generate parent row property as BlahRowParent. Fixed bug #77248.
-
-2006-01-10  Senganal T <tsenganal@novell.com>
-       * DataRowCollection.cs
-               - Added ListChangedEvent to notify reset of the collection.
-       * DataView.cs
-               - Subscribes to the ListChangedEvent of DataRowCollection
-               Fixes bug #77188
-
-2006-01-09  Senganal T <tsenganal@novell.com>
-       * RelatedDataView.cs
-       * DataColumn.cs
-               - Resolving a name clash in IExpression
-
-2006-01-06  Senganal T <tsenganal@novell.com>
-       
-       * DataColumn.cs
-       * DataColumnCollection.cs
-               - Reset the Parameters of DataColumn to Default Values when 
-               column is removed from the Table's Collection
-
-2006-01-03  Senganal T <tsenganal@novell.com>
-
-       * DataTable.cs :
-               - ParseSortString() : Changed the way the sort string is parsed.
-               Using a regex to parse the string.Fixes bug #77104
-
-2005-12-12  Konstantin Triger <kostat@mainsoft.com>
-
-       * DataRow.cs: Added index Updates.
-               EndEdit() fixed to first update indices and then AssertConstraints
-               based on those indices.
-               Added Validate() and AssertConstraints() functions.
-       * DataRowCollection.cs: Removed ValidateDataRowInternal().
-       * DataTable: Fixed Clear().
-
-2005-12-06  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * CustomDataClassGenerator.cs : (InitializeFields) handle AllowDBNull
-         and DefaultValue as well. Patch by Marek Habersack (bug #76709).
-
-2005-12-01  Miguel de Icaza  <miguel@novell.com>
-
-       * DataSet.cs: Apply patch from Robert Jordan, to fix #76817
-
-2005-11-26  Konstantin Triger <kostat@mainsoft.com>
-
-       * ConflictOption.cs: TARGET_JVM include.
-
-2005-11-11  Senganal T <tsenganal@novell.com>
-       
-       * ConflictOption.cs (new file)
-               - Added ConflictOption Enumeration 
-       * DataTableReader.cs
-       * IDataRecord2.cs 
-               - GetProviderSpecificFieldType : Corrected the method name
-
-2005-11-11  Senganal T <tsenganal@novell.com>
-
-       * DataSet.cs : Added the SchemaSerializationMode Property for NET_2_0
-       compatibility.
-       * SchemaSerializationMode.cs : Added SchemaSerializationMode Enumeration
-       for NET_2_0 compatibility.
-
-       Fixes bug #76517
-
-2005-10-20  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlSchemaWriter.cs : escape names in the schema with XmlConvert.
-         Fixed bug #76480.
-
-2005-10-14  Sureshkumar T  <tsureshkumar@novell.com>
-
-       * DataView.cs: Correct multiple throwing of events. Patch from
-       Marc Haisenko.
-       (RowStateFilter): Fire ListChangedEvent.
-       (ApplyDefaultSort): Fire ListChangedEvent.
-       (CompleteLastAdded): call UpdateIndex to remove the row from rowCache.
-       (IBindingList.Find): Implemented.
-
-2005-10-11  Sureshkumar T  <tsureshkumar@novell.com>
-
-       * DataView.cs (IBindingList): Implemented methods for IBindingList interface.
-
-2005-09-26  Lluis Sanchez Gual <lluis@novell.com>
-
-       * DataSet.cs: In IXmlSerializable.GetSchema, return null again for
-       untyped datasets. Fixes bug #76101.
-
-2005-09-21 Boris Kirzner <borisk@mainsoft.com>
-       * DataRow.cs: Fixes for index updating.
-       * DataTable.cs: 
-               - Reset case-sensitive indexes also if their filter contains columns 
-               of type string.
-               - Use GetIndex instead of FindIndex, so the indexes created in Select()
-               are reused. 
-       * RelatedDataView.cs: implement IExpression.Equals() and GetHashCode().
-       
-2005-09-20  Sureshkumar T  <tsureshkumar@novell.com>
-
-       * DataView.cs (Sort): Apply default Sorting Order if Sort property
-       is reset to null. Sort property handles this. Patch from Marc.
-
-       * DataTable.cs (ParseSortString): Patch from  Marc Haisenko for
-       allowing [ & ] in DataView.Sort string.
-
-2005-09-01 Boris Kirzner <borisk@mainsoft.com>
-       * System.Data/DataRowCollection.cs: indexes should be updated even if 
-       EnforceConstraints is false. Check for EnforceConstraints in
-       ValidateDataRowInternal.
-
-2005-08-08  Gert Driesen  <drieseng@users.sourceforge.net>
-
-       * DataView.cs: Changed accessibility of dataTable, rowState and
-       rowCache field to internal to fix public API. Assigned TypeConverter
-       to Table property.
-       * ForeignKeyConstraint.cs: IsConstraintViolated is now internal.
-       * Constraint.cs: IsConstraintViolated is now internal.
-       * UniqueConstraint.cs: IsConstraintViolated is now internal.
-
-2005-08-05  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlSchemaDataImporter.cs : When "dataset element" has identity
-         constraints, then first reserve constraints room for them and then
-         process elements, skipping pkey creation if there is already
-         reserved one. Fixed bug #75711.
-
-2005-08-05  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlDataInferenceLoader.cs : in GetElementMappingType(), don't guess
-         the same (QNamed) element again when it was already evaluated as
-         not simple type. Fixed one part of bug #75711.
-
-2005-08-02 Boris Kirzner <borisk@mainsoft.com>
-       * XmlSchemaDataImporter.cs : Data relations should be processed after the
-       keys, so no redundant constraints created while relations processing.
-
-2005-07-25 Boris Kirzner <borisk@mainsoft.com>
-       * FillOptions.cs, ConflictOptions.cs, UpdateOptions.cs: 
-       added ifdef TARGET_JVM.
-
-2005-07-22  Sureshkumar T  <tsureshkumar@novell.com>
-
-       * DataViewSettingCollection.cs, DataTableCollection.cs,
-       DataSet.cs, DataView.cs, DataColumn.cs, ForeignKeyConstraint.cs,
-       DataRelationCollection.cs, UniqueConstraint.cs, DataTable.cs,
-       DataColumnCollection.cs, DataRelation.cs, DataSet.cs:
-       - updated attributes & attribute descriptions to match with
-       masterinfos.
-
-       * DataView.cs: changed protected members
-       rowstate,rowcache,dataTable to protected internal.
-       * Constraint.cs, ForeignKeyConstraint.cs, UniqueConstraint.cs:
-       changed InConstraintViolated to protected internal.
-       * ConflictOptions.cs, UpdateOptions.cs, FillOptions.cs: enclosed
-       with NET_2_0 define.
-
-2005-07-21  Sureshkumar T  <tsureshkumar@novell.com>
-
-       * ForeignKeyConstraint.cs: 
-       - IsConstraintViolated (): no matter what EnforceConstraints is,
-       this function now honestly validates. It is upto the caller to run
-       this or not.
-       - AddToConstraintCollectionSetup (): AssertConstraint according to
-       EnforceConstraints.
-       
-2005-07-21 Boris Kirzner <borisk@mainsoft.com>
-       * ForeignKeyConstraint.cs - IsConstraintViolated() should check also for Table.EnforceConstraints.
-       * DataTable.cs - EnforceConstraints becomes internal so it can be used by ForeignKeyConstraint.
-
-2005-07-19  Sureshkumar T  <tsureshkumar@novell.com>
-
-       * DataTable.cs - CopyConstraints (): copy constraints only if it
-       does not exist.
-
-       * DataSet.cs - Copy ():
-       - use activator.CreateInstance to create a typed dataset.
-       - copy tables if target does not exist, otherwise, just add rows.
-       - add relation only if it does not exists.
-
-       Typed datasets create the constraints & relations through
-       constructors. Fixes bug #75211.
-
-2005-07-14  Sureshkumar T  <tsureshkumar@novell.com>
-
-       * DataView.cs: Patch from Marc Haisenko to throw descriptive error
-       message when accessing Item, with invalid index.
-
-2005-07-14  Sureshkumar T  <tsureshkumar@novell.com>
-
-       reapplied patch from Marc Haisenko.
-       * DataView.cs: Patch from Marc Haisenko that ensures that rowCache
-       is never null.
-
-2005-07-13  Sureshkumar T  <tsureshkumar@novell.com>
-
-       * DataRelationCollection.cs: adding a relation with same set of
-       parent columns & child columns, should not be allowed.
-
-2005-07-08  Sureshkumar T  <tsureshkumar@novell.com>
-
-       * DataTableReader.cs: GetSchemaTable: DataType column should be
-       passed a type of Type.
-
-       * DataRow.cs: Load : Fired necessary events.
-
-       * DataTable.cs: LoadDataRow (object [], LoadOption): Fired
-       necessary events.
-
-2005-06-28  Sureshkumar T  <tsureshkumar@novell.com>
-
-       * DataRow.cs: Delete (): if row is detached, do nothing.
-       fixes bug #75388.
-
-2005-06-22  Sureshkumar T  <tsureshkumar@novell.com>
-
-       * DataRow.cs: Added method MergeValuesToRow copy merge two rows
-       according to the merge rules.
-
-       * MergeManager.cs: (MergeRow): use MergeValuesToRow
-       API. CopyValuesToRow simply makes the target row same as source
-       row. Rather, MergeValuesToRow merges with the target row according
-       to the merge rules.
-
-2005-06-19  Konstantin Triger <kostat@mainsoft.com>
-
-       * DataSet.cs: Fixed ReadXml to work with IXmlSerializable
-
-2005-06-17  Jordi Mas i Hernandez <jordi@ximian.com>
-
-       * DataViewManager.cs: fixes exception and creates DataView
-
-2005-06-15  Sureshkumar T  <tsureshkumar@novell.com>
-
-       * DataRow.cs: CheckChildRows: cascade parent changes to child rows
-       only if there is a change in columns of the fk constraint.
-
-2005-06-14  Sureshkumar T  <tsureshkumar@novell.com>
-
-       * DataSet.cs: GetChanges: if row is deleted, get parent rows based
-       on original version. fixes bug #75227.
-
-2005-06-13  Sureshkumar T  <tsureshkumar@novell.com>
-
-       * DataRowCollection.cs: Find (keys, version): Added an overload to
-       find keys matching given DataViewRowState filter. Used in
-       DataSet.Merge and DataTable.LoadDataRow.
-
-       * DataTable.cs: LoadDataRow (values, LoadOption): Use
-       DataRowCollection.Find (object [], DataViewRowState) overload.
-
-       * DataRow.cs:
-       - CopyValuesToRow: Create target "records" out of loop. Records
-       should be created once, not for each column. Dispose Unused target
-       records.
-
-       * MergeManager.cs:
-       - MergeRow: Find rows with matching original records. If not,
-       select with current values.
-       - MergeRow: While adding new row, use NewNotInitializedRow.
-
-       * ForeignKeyConstraint.cs: IsConstraintViolated: should not check
-       if EnforceConstraints is false.
-
-2005-06-10  Sureshkumar T  <tsureshkumar@novell.com>
-
-       * DataRow.cs: CopyValuesToRow: if orginal == current, don't create
-       a new current record.
-
-       * DataSet.cs: GetChanges :Temporarily disable EnforceConstraints.
-
-       * MergeManager.cs: Merge: Temporarily disable
-       EnforceConstraints. Patch from george.barbarosie@gmail.com (George
-       Barbarosie).
-
-2005-06-09  Jordi Mas i Hernandez <jordi@ximian.com>
-
-       * DataView.cs: fixes GetListName
-
-2005-06-02  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlSchemaConstants.cs,
-         XmlSchemaDataImporter.cs,
-         XmlSchemaWriter.cs : AutoIncrementStep support. Patch partly by
-         George Barbarosie. Fixed bug #75121.
-       * XmlSchemaMapper.cs : it is not used anymore, so just removed.
-
-2005-05-31 Boris Kirzner <borisk@mainsoft.com>
-       * DataRow.cs : SetParentRow on Detached row with no Default version throws an exception.
-       
-2005-05-29 Konstantin Triger <kostat@mainsoft.com>
-
-       * This patch fixes #74813
-       * DataView.cs: rework the CreateChildView to receive the index into the indexed row array, rowState became protected to be initialized from RelatedDataView
-       * DataRowView.cs: movo the logic of creating the child view to the DataView
-       * RelatedDataView.cs: perform correct init.
-
-2005-05-25  Sureshkumar T  <tsureshkumar@novell.com>
-
-       * DataTable.cs: Reworked DataTable.LoadDataRow method after
-       regressions caused by Index redesign.
-       * DataRow.cs: Load : reworked.
-
-2005-05-25 Konstantin Triger <kostat@mainsoft.com>
-
-       * ISafeDataRecord.cs: Added GetDateTimeSafe method, the interface was made derived from IDataRecord
-
-2005-05-22 Konstantin Triger <kostat@mainsoft.com>
-
-       * DataTable.cs, DataColumn.cs: in continuation to the previous fix - moving the common logic to 1 function and throwing the correct exception in any flow
-
-2005-05-20  Sureshkumar T  <tsureshkumar@novell.com>
-
-       * DataTable.cs: CreateRecord :value should be set to auto
-       increment value or default value if the given value is null.
-
-2005-05-16 Konstantin Triger <kostat@mainsoft.com>
-
-       * DataTable.cs: In DataTable.LoadDataRow with LoadOption - reverting the search order back to Original -> Current (by Suresh request)
-
-2005-05-16 Konstantin Triger <kostat@mainsoft.com>
-
-        * DataRow.cs, DataTable.cs: code under net_2_0 changed to use the new interface
-        * DataTable.cs: Added CompareRecords, which compares records in column order
-
-
-2005-05-16  Sureshkumar T  <tsureshkumar@novell.com>
-
-       * DataRow.cs:
-       * DataTable.cs: quick fix to make build 2.0 profile (follow up for
-       check in 2005-05-16). Merge with previous changes.
-
-2005-05-11  Sureshkumar T  <tsureshkumar@novell.com>
-
-       fix for "import row does not import deleted records"
-
-       * UniqueConstraint.cs: Make a way to access value even from a
-       deleted record. deleted records are added to the collection by
-       ImportRow method.
-
-       * DataRow.cs:
-       - Added restriction-less methods GetValue to fetch a
-       value even if it is in deleted state.
-       - If a row is detached, don't try to delete it from indexes.
-       - sanity check for record_index in CopyValuesToRow method
-
-2005-05-05  Sureshkumar T  <tsureshkumar@novell.com>
-
-       * DataTableReader.cs: Implemented Delete handler and move the
-       current pointer accordingly.
-
-2005-05-04  Sureshkumar T  <tsureshkumar@novell.com>
-
-       * DataTableReader.cs: Added event handlers to make reader stable
-       when the datasource is modified. Thanks to Umadevi for giving the
-       review comments for this implementation.
-
-       * DataTable.cs: Clear (): Raise TableCleared event.
-
-       * DataTableClearEventArgs.cs: Args for DataTableClearEventHandler.
-
-       * DataTableClearEventHandler.cs: Handler for DataTable.TableClear
-       event.
-
-       * DataRow.cs: AcceptChanges: raise row changing & row changed
-       events.
-
-       * DataRowCollection.cs: Clear : remove rows from indexes
-
-2005-05-02  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlSchemaDataImporter.cs : XmlSchemaParicle might be XmlSchemaAny.
-         This fixes bug #74784.
-
-2005-04-29  Sureshkumar T  <tsureshkumar@novell.com>
-
-       * DataTableReader.cs: removed use of _first. throw if given index
-       is out of range of columns. Copy DataTable [] to local array so
-       that not to be disturbed.
-
-2005-04-27  Sureshkumar T  <tsureshkumar@novell.com>
-
-       * DataTableReader.cs: Implemented most of the TODO.
-
-2005-04-22  Sureshkumar T  <tsureshkumar@novell.com>
-
-       * LoadOption.cs: Changed the enums. Keeping old values for
-       migration.
-
-       * DataTable.cs: Implemented methods Load and its overloads. Also
-       implemented LoadDataRow.
-
-       * DataRowCollection.cs: Added a variation of the Find method to
-       return a row even if it is of state Deleted. This is required for
-       DataTable.LoadDataRow method.
-
-       * DataRow.cs: Implemented internal helper method Load for loading
-       values from an object array and given an LoadOption (2.0 feature).
-
-       * DataRowAction.cs: Added few more enums for .net 2.0. Sorted
-       alphabetically.
-
-2005-05-16 Konstantin Triger <kostat@mainsoft.com>
-
-       * UniqueConstraint.cs : IsNull check is relevant for rows having default row version.
-       * DataTable.cs : The row should be validated when imported
-       * DataRowCollection.cs : if the row does not contain Proposed neither Current version, it's irrelevant for validation
-
-2005-04-26 Boris Kirzner <borisk@mainsoft.com>
-
-       * UniqueConstraint.cs :
-               - Add indication whenever the constraint belongs to collection. 
-               - Calculation of IsPrimaryKey simplified.
-               - If constraint is based on single column, the column becomes unique.
-               - Use boolean IsConstraintViolated() instead of AssertConstraint().
-               - Use Index.Duplicates to proper exception message formatting.
-               - AssertConstraint(DataRow) changed to suite new indexes interface.
-               - Added CanRemoveFromCollection method.
-               - Contains() method renamed to IsColumnContained().
-       * RelatedDataView.cs : added new class.
-       * MergeManager.cs :
-               - Reset indexes after merge.
-               - Add new tables when row array is merged into dataset.
-               - Clean proposed record in MergeRow.
-               - Inherit nesting on creating new relations in target data set.
-               - Avoid double loop on constraints collection.
-       * Locale.cs : added new class.
-       * ISafeDataRecord.cs : added new interface.
-       * Index.cs : commented out. Index implementation moved to System.Data.Common.
-       * ForeignKeyConstraint.cs : 
-               - No more use of childColumnsExtended since new indexes allow duplicate records.
-               - Constraints can not be created on expression columns.
-               - Removed unnecessary delegation.
-               - Use boolean IsConstraintViolated() instead of AssertConstraint(). 
-               - Use proper exception message formatting.
-               - Contains() method renamed to IsColumnContained().
-       * DataViewRowState.cs : use enum members to simplify notation.
-       * MergeManager.cs : implemented RelationCollectionChanged().
-       * DataView.cs :  new implementation.
-       * DataTableCollection.cs : 
-               - Added boundary check in indexer.
-               - More accurate handling in AddRange().
-               - Raise event in Remove().
-       * DataTable.cs :
-               - Hold primary key as constraint.
-               - Added accurate handling of DefaultView.
-               - Hold DataRowBuilder per table.
-               - Proper exception messages if enforce Constraints is violated.
-               - If there is no rows, Compute() returns DBNull.
-               - Use DataRow properties instead of private members.
-               - CopyProperties() fixed.
-               - Raise proper events in EndInit().
-               - Proper order of violation checks in EndLoadData().
-               - Create array of rows using NewRowArray().
-               - ImportRow handles rows according to their versions.
-               - LoadDataRow make use of records (instead of raw object array).
-               - Added and implemented LoadDataRow() that gets IDataRecord as a parameter (used in Fill)
-               - Select() uses indexes filtering and sorting ability (instead of "loop-throw-sort" approach).
-               - Removed redundant RowSorter and Sortable column classes.
-               - ParseSortString() fixed to threat bracketed column names.
-               - Table holds collection of property descriptors.
-       * DataSet.cs :
-               - Reset table case sensitive indexes on CaseSensitive change.
-               - EnforceConstraints update logic moved to internal method (used by DataTable).
-               - InAddChangedRow first add row and than copy values for proper handling of default values.
-       * DataRowView.cs :
-               - Changed private member names to suite name convention.
-               - CancelEdit() fixed.
-               - CreateChildView() delegates to DataView.
-               - IsNew fixed.
-               - Proper exception messages in indexers.
-               - RowVersion uses DataView.
-               - GetProperties() delegates to corresponding table if needed.
-       * DataRowCollection.cs :
-               - Common Add() logic moved to AddInternal() (used also by DataTable).
-               - Removed redundant check from Contains().
-               - Dalegate Find() calls when possible.
-               - Remove() fixed.
-               - RomoveAt() delegates to Remove().
-               - Optimized constraints check in row validation.
-       * DataRelationPropertyDescriptor.cs : added new class.
-       * DataRelationCollection.cs :
-               - Indexers fixed.
-               - Fixed order of actions in AddCore().
-               - RemoveCore() also delegates to base.
-               - Add relation to dataset also in AddCore().
-               - Remove relation from dataset also in RemoveCore().
-               - InTransition hold a data relation so we can properly identify the "in transition" state.
-               - Added threat of parent and child table s property descriptors in Add().
-               - Common Add() logic moved to AddCore().
-               - Clear() fixed.
-               - Remove() threats "in transition" state properly.
-               - Remove methods delegate to single implementation.
-       * DataColumnPropertyDescriptior.cs :
-               - Added new constructor.
-               - Commented out redundant method.
-       * DataColumnCollection.cs :
-               - Boundary check in indexer.
-               - RegisterName and UnregisterName become internal (used also by DataColumn).
-               - Fixed AddRange().
-               - Fixed CanRemove().
-               - Rethrow correct exception in Clear();
-               - Change in collection resets parent table property descriptors.
-               - Added PostEndEdit() helper method (used by DataTable).
-       * DataColumn.cs :
-               - Private member names changed to suite name convention.
-               - Created method for CanAutoIncrement() logic.
-               - Proper handling of column name update.
-               - Proper exception messages on expression update.
-               - Proper namespace handling (delegates to table when needed).
-               - Removed redundant check in Unique update.
-               - Implemented internal Clone().
-               - GetParentRalation() and GetChildRelation() become private.
-       * Constraint.cs :
-               - Added abstract methods (implemented in UniqueConstraint and ForeignKeyConstraint).
-               - Simplified index update.
-       * ConstraintCollection.cs :
-               - Use Locale instead of CaseSensitive in column names comparison.
-               - Removed #ifdef
-               - Rethrow correct exception type in Add().
-               - Proper update of table primary key in Add().
-               - Delegate CanRemove() to constraint.
-               - Remove table primary key in Clear();
-               - Delegate "can remove" check to constraint in Remove().
-               - Removed unnecessary methods and properties.
-       * DataRow.cs :
-               - RowSate becomes calculated property.
-               - Use properties instead of private members where possible.
-               - Fixed indexer.
-               - Fixed order of actions in ItemArray update.
-               - Fixed DetachRow().
-               - Added ImportRecord() method.
-               - Removed redundant SetValuesFromDataRecord().
-               - Fixed IndexFromVersion().
-               - Added VersionFromIndex() method. Returns row version the passed record index corresponds to.
-               - Fixed AcceptChanges().
-               - Fixed creating proposed version in BeginEdit();
-               - Added record disposal in Delete().
-               - Fixed CheckChildRows().
-               - EndEdit() fixed. Checks for readonly. Uses straight flow instead of "try and fix if fail" approach.
-               - GetChildRows() and GetPrarentRows() rewrited. Use records and indexes for rows lookup.
-               - GetColumnError() delegates to another implementation.
-               - HasVersion() fixed.
-               - RejectCahnges checks on child rows before passing through.
-               - SetParentRow() fixed. Create relation collection if needed. Use typed data container value copy.
-               - CopyErrors() logic moved to separate method (used also by DataTable).
-       * ExpressionElement.cs : added new class.
-       * Res.cs : added new class.
-
-2005-04-20  Jordi Mas i Hernandez <jordi@ximian.com>
-
-       * DataViewManager.cs: implements TypedList.GetListName used in SWF
-
-2005-04-19  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataRowView.cs : indexer should access to DataRow with proper
-         DataRowVersion. Fixed bug #74650.
-
-2005-04-18  Sureshkumar T  <tsureshkumar@novell.com>
-
-        * DataRow.cs: if there are no mapping fields, fill with default
-         value.
-
-2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataView.cs : Delete() should not try to remove row twice.
-         Fixed bug #74631.
-
-2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataTable.cs : Use GetRowType() for the base of the returning array 
-         type of Select(). Fix by Gerhard Rittweger.
-       * CustomDataClassGenerator.cs : Fixed slightly harmless wrong code.
-
-2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * CustomDataClassGenerator.cs : custom relation was not added to
-         Relations property. The second entry of bug #69276 was fixed.
-         Patch by Daniel Rodriguez.
-
-2005-04-07  Lluis Sanchez Gual <lluis@novell.com>
-
-       * DataRowCollection.cs: Fix the signature of the Add method
-       for NET_2_0.
-
-2005-03-16  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataRow.cs : on importing row, it was copying data from incorrect
-         DataRow. This fixes bug #73288.
-
-2005-03-07  Jackson Harper  <jackson@ximian.com>
-
-       * DataViewManagerListItemTypeDescriptor.cs: Implement missing
-       features. These are needed for System.Windows.Forms databinding.
-
-2005-02-25  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataColumn.cs : setting negative value on MaxLength of SimpleContent
-         column is still valid.
-
-2005-02-15  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlSchemaWriter.cs : new file for outputting XmlSchema.
-       * DataSet.cs : removed rewritten code in XmlSchemaWriter.
-       * XmlConstants.cs : added UseCurrentCulture constant.
-       * DataTable.cs :
-         Use new Xml Schema writer.
-         Use XmlSchemaDataImporter as we use in DataSet.
-
-2005-02-10  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataView.cs, DataRowView.cs : Fixed bug #72421. CreateChildView()
-         should target only child rows.
-
-2005-02-03  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataViewManager.cs: misuse of ReadStartElement(string).
-       * DataRowView.cs : removed some MonoTODO.
-
-2005-02-02  Sureshkumar T  <tsureshkumar@novell.com>
-           Ankit Jain     <radical@corewars.org>
-
-       * DataColumn.cs: throw exception if the column is part of a
-       relationship, when chaning the data type. Added methods
-       "GetParentRelation ()" and "GetChildRelation ()" get the relation
-       which contains the current column
-       * DataRelation.cs: Added method "Contains (DataColumn)" to check
-       whether the relation contains the given column.
-
-       fixes nunit failure: DataRelationTest.InvalidConstraintException2.
-
-2005-02-02  Sureshkumar T  <tsureshkumar@novell.com>
-
-       * DataColumnCollection.cs: implemented todo item "check for
-       constraints" when removing columns from table.
-       * DataRowCollection.cs: Clear (): don't have to throw child key
-       constraint exception when the child table does not have any
-       rows. safe to remove parent rows.
-       * UniqueConstraint.cs: added method "Contains (DataColumn)" to
-       check whether a column is part of UniqueConstraint.
-       * ForeignKeyConstraint.cs: added method "Contains (DataColumn,
-       lookInParent)" to check whether a column is part of foreignkey.
-
-       fixes nunit failure: DataTableTest.ClearTest ()
-
-2005-02-02  Sureshkumar T  <tsureshkumar@novell.com>
-
-       * ForeignKeyConstraint.cs: validating columns: move checking
-       "tables are of same dataset" before "checking column types".
-
-       fixes nunit failure: ForeignKeyConstraint.CtorExceptions.
-       
-2005-02-02  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataViewManager.cs : let's just use StringWriter instead of 
-         XmlTextWriter (to avoid empty tag string mismatch annoyance.)
-       * DataView.cs : implemented BeginInit() and EndInit(). Don't update
-         rows during init phase until EndInit() is invoked. During init phase,
-         just hold properties such as Sort that affects on rows.
-
-2005-02-02  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataTableCollection.cs : (RemoveAt) just use IndexOutOfRangeException.
-
-2005-02-02  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataView.cs : DataRowView.EndEdit() raises ItemMoved event.
-         set_Table clears Sort and RowFilter.
-
-2005-02-02  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataView.cs :
-         - Clear() should clear AddNew cache.
-         - Open() invokes Reset().
-         - ConstraintCollectionChanged() itself does not invoke OnListChanged().
-         - Reset() does not Open, Close and Update Index.
-         - UpdateIndex() can be invoked even if it has no table.
-         - Reset event is invoked always after actual query to table.
-         - set_Table should raise PropertyDescriptorChanged event.
-
-2005-02-02  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataView.cs : ColumnCollectionChanged() is the event invoker (i.e.
-         when overriden, no column change events are fired).
-
-2005-02-02  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataView.cs : CancelEditRowView() and DeleteRowView() was incorrectly
-         checking target tables. They also should raise events if required.
-
-2005-02-02  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataView.cs : simplify code with UnsortedList.
-
-2005-02-01  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataView.cs : Mostly reimplemented.
-         - UpdateIndex() is invoked only when it is required (results in 
-           significant performance improvement).
-         - Use SortedList and wrapper OptionalSortedList which switches
-           between SortedList (with Sort) and UnsortedList (without Sort).
-         - DataView itself now contains two collections for rowviews:
-           Table rows based pool and AddNew() based cache. Consider those
-           two collections in every members.
-         - Reset() does not clear rows. Just invokes UpdateIndex().
-         - Hook RowDeleting, ColumnChanging and ColumnChanged events in table
-           which is required to handle state changes.
-         - Reimplemented Find() and FindRows() because of internal changes.
-
-2005-02-01  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataTable.cs : Fixed row comparer. Even if every of the sort target
-         columns are identical for two rows, they should not be regarded as
-         the same unless they are Object.ReferenceEquals.
-
-2005-02-01  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataRowCollection.cs : on adding a row, should raise
-         ChangingDataRow() as well as ChangedDataRow().
-
-2005-01-31  Sureshkumar T  <tsureshkumar@novell.com>
-
-       * DataRow.cs: SetParentRow (): use relation.ParentColumns &
-       relation.ChildColumns instead of relation.ChildKeyConstraint.*
-       because createConstrains flag may be false when creating data
-       relations. Hack along with Ankit Jain.
-       
-2005-01-31  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataView.cs :some interface implementations.
-
-2005-01-28  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataView.cs : Add to table only when the row is not in the table.
-
-2005-01-28  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataView.cs : implemented FindRows() (btw we should not use
-         DataTable since there are detached rows by AddNew().)
-
-2005-01-28  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataView.cs :
-         Code cleanup: privatify some members, remove unused methods.
-         Some event-based invocation methods should not raise NotImplemented.
-
-2005-01-28  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataSet.cs : ReadXml() became closer to MS behavior, being hacky.
-
-2005-01-28  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlSchemaDataImporter.cs : empty element is not regarded as a column.
-
-2005-01-28  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * UniqueConstraint.cs : mostly reverted the previous patch + check
-         IsPrimaryKey before validation.
-
-2005-01-28  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataView.cs : Fixed duplicate insertion to Hashtable.
-       * UniqueConstraint.cs : Unique constrained pair of columns could be
-         nullable.
-
-2005-01-27  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataView.cs :
-         Don't do anything for Sort/ApplyDefaultSort/RowFilter/RowStateFilter
-         when the same value is being set.
-         Examined UpdateIndex() and marked FIXME where MS does not invoke it.
-         Removed unused OnColumnChanged().
-         Now store rowViewPool and reuse DataRowView objects.
-         Optimized UpdateIndex() - avoid ArrayList. Avoid Haashtable.Rehash().
-
-2005-01-27  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataViewSettings.cs : no MonoTODO anymore.
-       * DataViewManager.cs : pass itself to new DataView() (new ctor).
-       * DataRowView.cs : GetHashCode() returns its Row's hash.
-       * DataTablePropertyDescriptor.cs : use new ctor().
-       * DataView.cs : added new ctor()s that accept DataViewManager.
-
-2005-01-27  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataView.cs, DataRowView.cs : AddNew() should not add the row to table
-         (it is still detached). So handle those rows differntly.
-         CancelEdit(), EndEdit() and Delete() propagates those events to
-         DataView (and handle row collection).
-         Eliminate "throw new Exception()".
-         Don't catch all the exception thrown in ListChanged event.
-       * DataTable.cs : made RowSorter as internal and use it in DataView.
-         no need to pass DataRow[] to .ctor().
-
-2005-01-27  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataTable.cs : don't create DefaultView unless it is required. It
-         significantly improves performance. (i.e. DataView perf. is sick ;-)
-
-2005-01-27  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataViewSetting.cs,
-         DataViewSettingCollection.cs,
-         DataViewManager.cs : implemented basic members.
-
-2005-01-26  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * Node.cs, DataColumnPropertyDescriptor.cs, DataTable.cs :
-         Eliminate "throw new Exception".
-
-2005-01-25  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataRow.cs : (set_Item) RowNotInTableExeption check should be done
-         regardless of index existence.
-
-2005-01-25  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataTable.cs : use new IExpression.EvalBoolean() to avoid extraneous
-         boxing.
-
-2005-01-25  Sureshkumar T  <tsureshkumar@novell.com>
-
-       * DataTable.cs: ImportRow :Do not add to rows collection if the
-       import row is in detached state.
-
-2005-01-25  Sureshkumar T  <tsureshkumar@novell.com>
-
-       * DataRow.cs: CopyValuesToRow : set the column value with the
-       default version of the given row.
-       * DataTable.cs: ImportRow: Copy values before adding row.
-       * DataSet.cs: AddChangedRow: Add the row to the table after
-       copying values.
-       
-       Fixes bug #67317. Patch by Ankit Jain.
-
-2005-01-25  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataRowView.cs : Fixed IsEdit to reflect correct status of DataRow.
-       * DataRow.cs : Expose editing status internally.
-
-2005-01-25  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataView.cs : missing attributes.
-
-2005-01-24  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataRowView.cs : implemented CreateChildView().
-
-2005-01-24  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataTable.cs, DataView.cs :
-         Optimized DataView to compile only once RowFilter and Sort when 
-         those properties are set. To make it possible, extracted 
-         SortableColumn out of DataTable and added internal DataTable.Select()
-         that accepts precompiled IExpression and SortableColumns[].
-
-2005-01-24  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataColumn.cs : set_MaxLength is not allowed when it is mapped to
-         SimpleContent. (However, it is weird but it never fails when we set
-         ColumnMapping = MappingType.SimpleContent when we fhave MaxLength.)
-
-2005-01-21  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataRow.cs : more Current -> Default fixes. Check if it should throw
-         VersionNotFoundException. Patch by Ankit Jain.
-
-2005-01-21  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataRow.cs : Default selects the right version for the current
-         state of the row. Current is not always available. Also change
-         that for GetParentRow(). Patch by Ankit Jain.
-
-2005-01-21  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataTable.cs : CopyColumn() should copy AutoIncrement after
-         DefaultValue, or it will raise an error in some cases.
-
-2005-01-20  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * ConstraintCollection.cs : Add() should throw ArgumentException when
-         the argument constraint fails validation.
-         DataTable.cs : set_PrimaryKey should throw ArgumentException when
-         the argument contains constraints which fail validation.
-
-2005-01-19  Sureshkumar T  <tsureshkumar@novell.com>
-
-       * DataRelationCollection.cs: 
-
-       Method Remove : Donot throw exception if DataRelation argument is
-       null in DataRelationCollection.Remove method.
-
-       Method RemoveAt : Exception should be IndexOutOfRangeException if
-       row index is not in list range.
-
-       Fixes nunit failures DataRelationCollection.Remove and
-       DataRelationCollection.RemoveAt.
-
-2005-01-19  Sureshkumar T  <tsureshkumar@novell.com>   
-
-       * ConstraintCollection.cs: Donot throw exception if constraints
-       are null in AddRange method. Check for null before using the
-       argument.
-
-       fixes bug #69381.
-
-2004-01-19  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlDataInferenceLoader.cs,
-         XmlDataReader.cs : Check if the XmlReader (node) represents DataSet
-         or a table, reusing code block in XmlDataInferenceLoader.
-         This fixes bug #60118.
-
-2004-01-19  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlDiffLoader.cs : Ankit Jain <radical@imt.ac.in> has a conflicting
-         patches and some good catches. Some attributes should be skipped,
-         and loaded value must be typed.
-
-2004-01-19  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlConstants.cs,
-         XmlDataInferenceLoader.cs, 
-         XmlDataReader.cs : use common const for http://www.w3.org/2000/xmlns/.
-       * XmlDiffLoader.cs : It was not handling attributes. Fixed bug #70961.
-
-2005-01-18  Sureshkumar T  <tsureshkumar@novell.com>
-
-       Fix for bug #66838. This patch is submitted by "Ankit Jain"
-       <radical@corewars.org> and refactored.
-
-       * DataRow.cs: Allows to set a parent row even if the row is in
-       detached state.
-
-       * DataRelation.cs: method "UpdateConstraints" is added to check
-       and create missing keys when adding a relation. This is refactored
-       approach from DataRelationCollection.Add method.
-
-       * DataRelationCollection.cs: AddCore methods of all relation types
-       are synchronized. A Check for existing constraints is
-       done. Relation is added to the list only if all checks are passed.
-
-2004-01-18  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataColumnCollection.cs : Clear() throws ArgumentException that
-         wraps thrown innerException.
-       * XmlSchemaDataImporter.cs : removed FIXMEs.
-
-2004-01-12  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataSet.cs : When serializing DataTable, BuildSchema() is passed
-         null relation collections.
-         Quick fix for XmlSerializer deserialization. It does not require
-         XML Schema included.
-
-2004-01-11  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataSet.cs,
-         CustomDataClassGenerator.cs :
-         In DataSet class, IXmlSerializable.GetSchema() returns null.
-         In strongly-typed class, it returns schema.
-
-2004-01-07  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlDataInferenceLoader.cs : test driver class should be excluded.
-
-2004-12-01  Miguel de Icaza  <miguel@ximian.com>
-
-       * DataView.cs: Patch from Marc Haisenko that ensures that rowCache
-       is never null.
-
-2004-11-10  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * CustomDataClassGenerator.cs : generated foreign key constraint
-         construction code was creating empty child columns and thus it
-         was invalid. This fixes bug #69276 (patch by Martin Voelkle).
-
-2004-11-02  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * CustomDataClassGenerator.cs : custom DataTable ctor should call
-         InitializeFields(), and those DataColumns created by that method
-         should take data type. This should fix bug #68972.
-
-2004-10-15  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataSet.cs : Also clear UnhandledAttributes ArrayList before 
-         generating next attribute column schema. This fixes bug #68432.
-
-2004-10-14 Umadevi S <sumadevi@novell.com>
-        * DataTable.cs : Corrected the Clone method to use  Activator.CreateInstance so that the
-        correct subclass is returned. This fixes bug #67631
-                                                                                        
-2004-10-14 Umadevi S <sumadevi@novell.com>
-       * DataSet.cs : Corrected the Clone method to use  Activator.CreateInstance so that the  
-       correct subclass is returned. This fixes bug #67627
-
-2004-10-13  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataSet.cs : clear UnhandledAttributes ArrayList before generating
-         next element column schema. This fixes bug #68256.
-
-2004-10-12  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataSet.cs : now xs:schema contains xmlns="".
-         This fixes bug #68008.
-
-2004-10-12  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataSet.cs : DBNull attribute column should not be written as
-         empty attribute. This fixes bug #68007.
-
-2004-10-12  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataSet.cs, XmlConstant.cs, XmlSchemaDataImporter.cs:
-         DataColumn.ReadOnly was not handled. This fixes bug #68005.
-         Attribute defaultValue was not handled too.
-
-2004-10-07  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataSet.cs :
-         - When AllowDBNull is false on attribute DataColumn, its schema
-           should contain use="required". This fixes bug #66792.
-         - If MaxLength is set on attribute DataColumn, the mapped schema
-           type should contain maxLength facet. This fixes bug #66793.
-
-2004-10-04  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataSet.cs : For a row, when a relation is not nested, then it is
-         still output target since it won't be written as a child of its
-         parent. It fixes bug #66379.
-
-2004-10-03  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataSet.cs : Attribute constraint field XPath must be written as
-         @blah. This fixes bug #66366.
-
-2004-09-28 Umadevi S <sumadevi@novell.com>
-       * DataRow.cs - checked for Enforceconstraints, while using indices to search for related rows
-
-2004-09-24  Sureshkumar T  <tsureshkumar@novell.com>
-
-       * DataSet.cs : Don't check constraints for dataset clear
-       * DataRowCollection.cs : check for EnforceConstraints flag 
-       before checking foriegn key constraints in Clear method
-       * DataTable.cs : Redundant checking removed in Clear method as it is
-       checked in DataRowCollection.Clear method. 
-
-
-2004-09-19  Sureshkumar T <tsureshkumar@novell.com>
-       * DataRow.cs : while deserialization of dataset, adding a current row precedes the original row.
-                      hence, adding a row cache is necessary if the original row happens to be current.
-                      fixed bug #63097
-
-2004-08-23  Martin Baulig  <martin@ximian.com>
-
-       * XmlDataInferenceLoader.cs (Driver): Make this class internal,
-       not public.
-
-2004-08-18 Umadevi S <sumadevi@novell.com>
-       * DataView.cs - Completed most of the event handling. 
-       Thanks to Punit Todi <punit_todi@da-iict.org> for implementing most of it.
-       Thanks to Boris Kirzner <borisk@mainsoft.com> for commenting and suggesting changes to the implementation.
-       * DataTable.cs - Changed Access modifiers of class/methods since it was used by DataView.
-
-2004-08-06  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataSet.cs : DataSet's ExtendedProperties were not XmlConverted.
-
-2004-08-05  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlConstants.cs : Added constants for "msprop" support.
-       * DataSet.cs : ExtendedProperties should be written in the schema.
-         This fixes bug #61233.
-
-2004-07-27  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataSet.cs : on serialization to XmlWriter, XmlConvert should be
-         used. There were also some culture dependency problems to write int.
-
-2004-06-27  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlDataInferenceLoader.cs : It was not always filling relation
-         child table information correctly. This fixes bug #60742.
-
-2004-06-23 Umadevi S <sumadevi@novell.com>
-       * UniqueConstraint.cs :changed a ifdef true to ifdef NET_1_1
-
-2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataSet.cs : Fixed ReadXml(). When ReadMode is ReadSchema and the
-         schema is inside the document element (as created in XmlWriteMode
-         .WriteSchema), it should read schema from that non-document element.
-         This fixes one case reported in bug #60470.
-
-2004-06-20  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlDataInferenceLoader.cs : Kindly reject xml schema document as a
-         inference target. For bug #60470. (MS does not support schema
-         document inference and results in unconsistent dataset structure.)
-
-2004-06-20  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataTableCollection.cs : reset the table's DataSet to null when
-         removing a table from this collection.
-       * DataTable.cs : When Namespace is not specified explicitly, its
-         Namespace property reflects DataSet's Namespace if exist.
-         This fixes bug #60469.
-
-2004-06-18  Gert Driesen <drieseng@users.sourceforge.net>
-
-       * DBConcurrentcyException.cs: CRLF to LF
-       * DataViewSetting.cs: CRLF to LF
-
-2004-06-18  Gert Driesen <drieseng@users.sourceforge.net>
-
-        * DataViewSetting.cs: renamed fields to match MS.NET
-
-2004-06-18  Gert Driesen <drieseng@users.sourceforge.net>
-
-        * DBConcurrencyException.cs: fixed serialization compatibility with
-        MS.NET
-
-2004-06-17  Boris Kirzner  <borisk@mainsoft.com>
-
-       * ChangeLog : Fix for misspelled words.
-
-2004-06-17  Boris Kirzner  <borisk@mainsoft.com>
-
-       * DataRowCollection.cs : Removed onColumnRemoved since it is not in use.
-       
-2004-06-17  Boris Kirzner  <borisk@mainsoft.com>
-
-       * DataTable.cs :
-         - Table stores default values for columns in special default values row. 
-         It is allocated once (in NewRow).
-         - DataTable.Copy rewrited. It works with uninitialized rows for better perfomance.
-         - OnRemoveColumn has nothing to perform by now.
-
-2004-06-17  Boris Kirzner  <borisk@mainsoft.com>
-
-       * DataRow.cs : 
-         - Changed access of original, current and proposed indexes to internal.
-         - ColumnErrors reviewed : now column errors stored in ArrayList and allocated on demand only.
-         - Added new DataRow constructor that creates uninitialized DataRow (used in DataTable.Copy).
-         - Use DataContainer.CopyValue and default values row for faster set of default values in row.
-         - SetColumnValue become CheckValue. Now it does not changes the value, but only checks for its correctness.
-         Care about Null and DBNull values is now in DataContainer.
-         - Use DataColumn.AutoIncrementValue and GetInt64 for faster set of autoincrement value.
-         - Use Datacontainer.CopyValue and default values row to speed up CheckChildRows.
-         - Fix in CopyState : clone column errors.
-         - Removed CollectionChanged and onColumnRemoved since we are not using both of them anymore.
-
-2004-06-17  Boris Kirzner  <borisk@mainsoft.com>
-
-       * DataColumnCollection.cs : 
-         - Fix : Add() now delegates to Add(DataColumn).
-         - autoIncrement list holds DataColumn objects, and not just column names.
-
-2004-06-17  Boris Kirzner  <borisk@mainsoft.com>
-
-       * DataColumn.cs : 
-         - AutoIncrementValue fixes. Now AutoIncrement uses DataContainer.GetInt64 to avoid boxing.
-         - DefaultValue fixes. Default value from now on is also stored in special record in 
-         DataTable, so we're able to set default value for the column faster (typed).
-       
-       
-2004-06-15  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataSet.cs : children of non-root rows were not properly written.
-         Fixed bug #53959.
-
-2004-06-10 Umadevi S <sumadevi@novell.com>
-       * DataRelation.cs - Constructor
-       - The datatypes of the parentcolumn(s) and the childcolumn(s) should match
-
-2004-06-06  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlSchemaDataImporter.cs : We should fill Namespace for DataTable.
-
-2004-06-04  Gert Driesen <drieseng@users.sourceforge.net>
-
-       * Constraint.cs: marked methods internal to fix public API
-       * ConstraintCollection.cs: to fix public API, use 
-       DataTable.fInitInProgress to check whether initialization 
-       of DataTable is in progress
-       * DataColumn.cs: added stubs for missing methods
-       * DataRowBuilder.cs: marked Table property internal to
-       fix public API
-       * DataSet.cs: removed extra empty destructor, marked 
-       OnMergeFailed internal to fix public API
-       * DataTable.cs: use fInitInProgress field to hold init
-       status, to match MS.NET
-       * DataView.cs: added missing attributes on IsOpen
-
-2004-06-03  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataSet.cs : Use NameTable.Get() before calling LookupNamespace()
-         in XmlNamespaceManager.
-
-2004-06-03  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataSet.cs : complex table content child was not properly added
-         when it is the only one child in the parent table. Fixed bug #53959.
-
-2004-06-02  Gert Driesen <drieseng@users.sourceforge.net>
-       * DataTableTypeConverter.cs: added
-       * DataView.cs: added missing attribute on Table property
-       * DataViewManager.cs: moved attribute to correct property
-       * UniqueConstraint.cs: removed extra ReadOnly attribute from
-        IsPrimaryKey property
-
-2004-06-01  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataRow.cs : ColumnsChanged event is not required in .ctor().
-
-2004-06-01  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlDataReader.cs : type change is required before setting value
-         string to row item.
-
-2004-05-31  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataSet.cs : Loop-break of the last fix was incorrect.
-
-2004-05-31  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataSet.cs : When a row has no parent row but the table has parent
-         relation(s), that row had been always ignored.
-
-2004-05-31  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlDataInferenceLoader.cs : Fixed GetMappedTable() that incorrectly
-         rejected same-named tables in different hierarchy. Thanks to Boris.
-
-2004-05-31  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlDiffLoader.cs : Added some Skip() that is required not to go to
-         infinite loop. Thanks to Boris for this fix.
-
-2004-05-31  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlDataInferenceLoader.cs : XmlSchema elements should not be infered.
-         Thanks to Boris for this fix.
-
-2004-05-30  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataTable.cs : serialization .ctor() should use XmlReadMode.DiffGram
-         for ReadXml(). Thanks to Boris.
-
-2004-05-27  Boris Kirzner  <borisk@mainsoft.com>
-       * DataRow.cs : 
-               - CheckReadOnlyStatus : use typed (and faster comparing).
-               - EndEdit : bug fix - do not dispose record if it holds original version.
-               - SetValuesFromDataRecord : Take care about autoincrement columns.
-               
-
-2004-05-27  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * MergeManager.cs : don't output debug message to Console.
-
-2004-05-27  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlDataInferenceLoader.cs : Namespace are not imported to the table
-         structure. Thanks to Boris Kirzner for the fix.
-
-2004-05-27  Umadevi S <sumadevi@novell.com>
-         * DataRelationCollection.cs - fixed nunit test errors
-
-2004-05-27  Umadevi S <sumadevi@novell.com>
-        * DataTableCollection.cs - fixed nunit test errors
-
-2004-05-21  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataColumnCollection.cs : NullReferenceException was thrown when
-         the table was not found.
-       * DataRowCollection.cs :
-         Find() just returns null for null value under MS.NET 1.1.
-         RemoveAt() should also avoid to call AcceptChanges() like Remove().
-       * UniqueConstraint.cs : in AssertConstraint() throw ConstraintException
-         directly under MS.NET (for nunit test).
-
-2004-05-21  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlSchemaDataImporter.cs : Setting startindex in LastIndexOf() 
-         caused problem on qualified name to get schema Field name.
-
-2004-05-21  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlDataReader.cs : Now data reader is namespace aware in all places.
-         When table's namespace is different, it entered to infinite loop.
-
-2004-05-19  Boris Kirzner  <borisk@mainsoft.com>
-       * MergeManager.cs : AdjustSchema now updates by reference new created table,
-       so in Merge you do not need to lookup for it (were unable to do this for unnamed tables).
-       Code styling.
-       
-2004-05-19  Boris Kirzner  <borisk@mainsoft.com>
-
-       * DataColumn.cs : In set_Item[int] - if autoincrement, adjust next autoincrement value.
-       * DataColumnCollection.cs : fixed parantethes.
-       * DataRow.cs : 
-               - AcceptChanges : do nothing if row state is unchanged.
-               - GetChildRows, GetParentRows  : bug fix (use correct index).
-       * DataRowCollection.cs : bug fix (compare all row's values).
-       * DataTable.cs : bug fix (use correct row version).
-       
-2004-05-20  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlSchemaDataImporter.cs : xs:positiveInteger is mapped to ulong.
-         When content type is Mixed, text column is not required (it is
-         required only when the complex type has no particle). 
-         "Repeated element" column is also created (considering maxOccurs=0 
-         and complex content extension).
-
-2004-05-20  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlSchemaDataImporter.cs : XmlSchemaGroupBase was not handled 
-         properly.
-
-2004-05-20  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlSchemaDataImporter.cs : Removed unused code and extra MonoTODO.
-         Fixed relation inference to consider attribute XPath.
-
-2004-05-19  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataColumn.cs : Fixed set_Item[int]. Convert.ToInt64(DBNull.Value)
-         always fails.
-
-2004-05-19  Boris Kirzner  <borisk@mainsoft.com>
-
-       * DataColumn.cs - removed default member attribute.
-
-2004-05-19  Boris Kirzner  <borisk@mainsoft.com>
-
-       * DataColumn.cs,
-         DataColumnChangeEventArgs.cs,
-         DataColumnCollection.cs,
-         DataRow.cs,
-         DataRowCollection.cs,
-         DataTable.cs,
-         Index.cs : Data storage in the row is redesigned. Now data is stored in 
-         typed containers inside DataColumn. Row holds its versions as indexes inside
-         each of data container, accessed through the row that holds it.
-
-2004-05-19  Boris Kirzner  <borisk@mainsoft.com>
-
-       * UniqueConstraint.cs - added comment.
-       
-2004-05-19  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlDataInferenceLoader.cs : Don't add already-existing DataTable to
-         DataSet.
-
-2004-05-17  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataSet.cs,
-         XmlDataInferenceLoader.cs,
-         XmlDataReader.cs,
-         XmlSchemaDataImporter.cs : XmlDecode every local name to read and
-         XmlEncode every local name to write. This should fix bug #58268.
-
-2004-05-17  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataSet.cs : Implemented ignored namespaces in InferXmlSchema().
-         Supported repeated elements. Removed MonoTODOs.
-       * XmlDataInferenceLoader.cs : Design change to support ignored
-         namespace and repeated elements.
-       * XmlSchemaDataImporter.cs : Added mapping support classes.
-
-2004-05-15  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * CustomDataClassGenerator.cs :
-         Added property parent "[foo]Row" and children "Get[foo]Row" support
-         for custom DataRow classes.
-         Fixed DataColumn property accessibility (public --> internal).
-
-2004-05-14  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * CustomDataClassGenerator.cs :
-         - Put classes inside custom DataSet class.
-         - Added automatic DataRelation creation support.
-         - Added Constraints creation support. That is done separate from
-           relations, since they might be independently created.
-         - Added non-MS public DataRelation fields.
-         - Removed extraneous "DataRelation type generation" code.
-         - Fixed custom_dataset.Initialize() not to create "c" field that
-           was created more than once.
-         - Implemented AddxxxRow() that takes parameters for every column.
-
-2004-05-14  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlSchemaDataImporter.cs : When primary key is used more than once,
-         DataRelation borked because of empty parent column name.
-
-2004-05-14  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlSchemaDataImporter.cs : When Creating constraints with related
-         to DataRelation creation, also set PrimaryKey to the parent table.
-
-2004-05-14  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlSchemaDataImporter.cs : 
-         Design change to add indirect table and relation structures.
-         Support for "relation" annotation for local element.
-         Support for repeatable simple element column (maxOccurs > 1).
-         Fixed handling of Nested property on DataRelation (for globally
-         annotated relation, Nested is false).
-
-2004-05-13  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataRow.cs : Added DataElement property to avoid storing every row-
-         element mapping. It stored even for nodes that should be removed.
-
-2004-05-13  Umadevi S <sumadevi@novell.com>
-
-       * RelationshipConverter.cs - Stubbed this class
-       * DataRelation.cs - added TypeConveterAttribute
-
-2004-05-13  Umadevi S  <sumadevi@novell.com>
-
-       * DataColumnCollection.cs - Added ResDescriptionAttribute
-       * DataRelation.cs - Added TypeConverterAttribute
-       * DataRelationCollection.cs - Added DefaultPropertyAttribute
-       * DataRowView.cs - Added GetHashCode method with a TODO tag
-        * DataSet.cs - Added DesignerAttribute
-       * DataView.cs - Added DesignerAttribute
-        * DataViewManager.cs - Added DesignerAttribute
-       * DataViewSetting.cs - Added TypeConverterAttribute
-       
-2004-05-12  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataRow.cs : Added XmlDataElement initialization code.
-
-2004-05-11  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlDataInferenceLoader.cs :
-         It now requires XmlDocument as input.  Improved identification of
-         DataSet element.  Removed extra lines.
-         Moved boresome design notes to bottom of the source and
-         added standalone runnable driver (not included on build).
-       * DataSet.cs :
-         Update with related to the change above.
-         WriteXml() should call Flush() after writing. This fixes bug #58327.
-       * XmlSchemaDataImporter.cs :
-         Improved indentification of DataSet element.
-
-2004-05-11  Gert Driesen (drieseng@users.sourceforge.net)
-       * DataTable: marked initStatus enum internal
-
-2004-05-09  Gert Driesen (drieseng@users.sourceforge.net)
-       * DataTable.cs: removed TypeConverterAttribute, marked RowsExist
-       methods internal
-       * DataRowView.cs: removed extra Error property
-       * DataRow.cs: reduced accessibility of CollectionChanged method 
-       to private
-       * DataColumnPropertyDescriptor.cs: made class internal
-       * DataColumn.cs: removed extra TypeConvertorAttribute
-       * ConstrainCollection.cs: marked PostEndInit method internal
-
-2004-05-07  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataSet.cs : 
-         In WriteXmlSchema(), when complex type contains simple type content
-         attributes must not added to XmlSchemaComplexType directly. It
-         causes schema compilation error.
-         DataRelation should not be output when related columns are hidden.
-
-2004-05-07  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlDataInferenceReader.cs : Added. It does InferXmlSchema() (it is
-         also expected to do ReadXml(), but I will remove that feature and
-         support column reordering).
-       * XmlSchemaDataImporter.cs : Always initialize dataset name.
-         Always set Nested and primary key for parent table.
-       * XmlDataReader.cs : Now it is used.
-         Top level element might not match to dataset name nor any table 
-         name, but still possible to read content tables.
-         Handle empty element correctly in some places.
-         Handle Fragment mode (read up XmlReader to the end).
-       * DataSet.cs : Modified InferXmlSchema() and ReadXml() to use
-         XmlDataInferenceLoader and XmlDataReader.
-
-2004-05-06  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataSet.cs :
-         Eliminated CRLF injection.
-         More clear message in Clear().
-         Updates reflecting XmlSchemaDataImporter change.
-         Added duplicate check for XmlSerializerNamespaces in BuildSchema().
-         Don't use xmlns attribute for UnhandledAttributes (its not mandatory
-         but that depends on different behavior from ms.net).
-         Set locale also for DataTable.
-         Add xs:element only when target namespace matches to the
-         element's namespace. Otherwise, add xs:import for external namespace.
-         Put xs:sequence for dataset element's particle _only when_ actual
-         contents exist.
-
-2004-05-06  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlDataReader.cs : Added. This class will work better when our
-         schema inference and schema read engine gets improved. (It contains
-         standalone testable Driver class.)
-
-2004-05-06  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * ForeignKeyConstraint.cs : Check step change. Existence then column
-         validity. just for tests.
-       * XmlSchemaDataImporter.cs : code simplification. reduced extraneous
-         fields.
-
-2004-05-05  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataSet.cs : Ignore empty content only when output type is diffgram.
-
-2004-05-05  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * CustomDataClassGenerator.cs : Modified that DataSet contains each
-         DataTable field so that each table property can access them directly.
-         (plus, modified standalone code driver code: shouldn't affect)
-
-2004-05-05  Boris Kirzner  <borisk@mainsoft.com>
-
-       * DataView.cs , DataRowView.cs : Added implementation to basic methods and properties.
-         
-2004-05-05  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlSchemaDataImporter.cs : 
-         SimpleContent column support.
-         Annotated relation support.
-         Top-level element is counted only when its type is complex.
-         xs:anyType is no longer treated as complex type.
-         dataset existence is mandatory now. 
-         Improved DataType and DefaultValue support.
-         Attribute namespace is properly handled now.
-         Prohibited attribute is now treated as hidden column.
-         Reject list or union simple type.
-
-         Still incomplete 1) to read relationship in some cases, 2) to 
-         determine whether an element is dataset or table, 3) thus to
-         exclude extraneous column, 4) to remove extraneous *_Id column.
-
-2004-05-05  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataTable.cs :
-         We had better reuse DataSet's ReadXmlSchema() and ReadXml() in
-         serialization .ctor() (thus schema read/inference should be easier).
-         DataRowSorter should consider Table's Locale.
-
-2004-05-05  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataColumnCollection.cs : We already had AutoIncrementValue(), so
-         use it instead of duplicating logic.
-
-2004-05-05  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * ConstraintCollection.cs :
-         Use Table.CaseSensitive and Table.Locale to compare strings.
-         Duplicate constraint name exception does not occur under .NET 1.1.
-
-2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
-
-       * XmlSchemaDataImporter.cs: Added little type check.
-
-2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
-
-       * DataSet.cs: Implemented support for runtime serialization. Fixed support
-         for xml serialization.
-       * XmlDiffLoader.cs: Skip diffgram element when it is empty.
-
-2004-04-30  Umadevi S  <sumadevi@novell.com>
-       * DataColumnCollection.cs : Fixed nunit test errors, removed TODOs
-       * DataTableCollection.cs  : Tested and removed TODO
-       * TypedDataSetGeneratorException.cs : Fixed a couple of TODOs   
-
-2004-04-29  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataRow.cs : My previous patch unintentionally reverted Boris patch.
-
-2004-04-29  Boris Kirzner <borisk@mainsoft.com>
-
-       * UniqueConstraint.cs : Constraint columns becaomes unique after adding constraint ifand only if 
-       constraint is defined on single column.
-
-2004-04-29  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataRowCollection.cs : .NET 1.1 throws InvalidConstaintException,
-         not ArgumentException (maybe changed after 1.1).
-
-2004-04-29  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataRow.cs : When Column was added and it was AutoIncrement column,
-         it extended the item object array incorrectly.
-         (Plus tiny comment and incorrect indentation fix.)
-
-2004-04-29  Boris Kirzner <borisk@mainsoft.com>
-
-       * MergeManager.cs : added ( incomplete yet ) support for merging DataSet schema.
-
-2004-04-29  Boris Kirzner <borisk@mainsoft.com>
-
-       * DataRow.cs : Bug fix in CopyValuesToRow().
-       
-2004-04-29  Boris Kirzner <borisk@mainsoft.com>
-
-       * UniqueConstraint.cs : There is no reason to mark constraint's columns as unique, because
-         each of the columns should not be unique, but only all the constraint's columns together.
-       
-2004-04-28  Boris Kirzner <borisk@mainsoft.com>
-       * DataRow.cs :
-         - Perfomance fixes: 
-               - Added using of list of autoIncrement columns
-               - SetColumnValue receives also DataColumn to avoid duplicate lookup in DatacolumnCollection
-         - Fix in CheckNullConstraints
-         - Fix in this[] and HasVersion() : when evaluating an expression deleted rows values can be accessed.
-         - Fix in SetColumnValue() , added CanAccess() method to avoid case of accessing internal array values berore it actually allocated.
-         - Added onColumnRemoved() method to threat column removal accurately.
-       
-       * DataRowCollection.cs :
-         - Added using of DataRow._nullConstraintViolation (for perfomance fix in EndLoadData())
-         - Added method onColumnRemoved() - calls each row's onColumnRemoved() (to ensure column removal is treated accurately)
-       
-       * DataTable.cs :
-         - Call DataRowCollection.onColumnRemoved() in OnRemoveColumn() (to ensure column removal is treated accurately)
-       
-       * DataColumnCollection.cs :
-         - Perfomance fixes :
-               - collection holds a list of its autoIncrement columns (avoids unnesessary lookup through whole collection)
-               - collection holds mapping from column names to DataColumn objects (avoids lookup through whole collection).
-               - automatic creation of column names rewrited (bug fixes + perfomance improvement)
-       
-       * DataColumn.cs :
-         - Uses autoincrement list of a table
-
-2004-04-27  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlDataLoader.cs : Even when it should ignore schema, it was 
-         infering schema.
-       * XmlSchemaDataImporter.cs : DataRelation creation support.
-         Improved "DataSet" element handing. When attributes are on the
-         element, it is not a "DataSet" element.
-         Fixed parent key column name.
-         Unique name creation is not required. Just raise an error.
-         Fill facet also for attribute types.
-
-2004-04-27  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataRow.cs : Null check for CheckReadOnlyStatus() and
-         CheckNullConstraints(), with some coding guideline fixes.
-         Type check should be done by Type instance comparison.
-
-2004-04-27  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataColumnCollection.cs : When add a column to the collection, fill
-         auto-increment column.
-
-2004-04-26  Boris Kirzner <borisk@mainsoft.com>
-
-       * DataColumn.cs : Small perfomance fix (avoid unnesessary string concatenation).
-       
-2004-04-26  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * CustomDataClassGenerator.cs : Added.
-       * TypedDataSetGenerator.cs : Implemented Generate().
-         Changed GenerateIdName() to call CustomDataClassGenerator.MakeSafeName
-       * XmlSchemaDataImporter.cs : Table Locale should be supplied.
-
-2004-04-25  Boris Kirzner <borisk@mainsoft.com>
-
-       * DataTable.cs : Small perfomance fix (avoid unnesessary string concatenation).
-       
-2004-04-25  Boris Kirzner <borisk@mainsoft.com>
-
-       * Constraint.cs : Small perfomance fix (avoid unnesessary string concatenation).
-
-2004-04-23 Umadevi S (sumadevi@novell.com)
-       *  DataRow.cs: Checked BeginEdit,EndEdit,CancelEdit and Delete methods
-          - Added error handling to the above methods
-
-2004-04-22  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataSet.cs : Data should be read when mode is IgnoreSchema (well,
-         the support is incomplete yet).
-       * XmlDataLoader.cs : 
-         Reverted ReadModeSchema() argument change. XmlReadMode would be 
-         useful to handle IgnoreSchema.
-         Don't overwrite DataSetName when mode is not such kind.
-         Set Prefix and Namespace as well as DataSetName.
-         AllowDBNull looks set false by default for element column.
-         Set unique constraint as primary key when infering the table schema.
-
-2004-04-21  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataSet.cs : 
-         Never set null string for Prefix and Namespace.
-         In InferXmlSchema() when null XmlReader is passed, just do nothing.
-         In WriteXmlSchema(string), earlier try block.
-         In BuildSchema(), try to add serialization namespaces for each
-         namespaces in DataSet/DataTable/DataColumn.
-         Removed namespace argument from WriteColumnAsElement() and don't
-         overwrite when namespace is "". This fixes bug #57330.
-       * DataColumn.cs : For Namespace and Prefix, never set null.
-
-2004-04-21  Boris Kirzner <borisk@mainsoft.com>
-
-       * XmlSchemaMapper.cs : Check for not null unique constraint in ReadXmlSchemaKeyref()
-         before creating and adding foreign key constraint and relation. 
-
-2004-04-21  Boris Kirzner <borisk@mainsoft.com>
-
-       * MergeManager.cs : In AdjustSchema() source table clone should be added
-         and not the table itself. 
-
-2004-04-21  Boris Kirzner <borisk@mainsoft.com>
-
-       * DataSet.cs : 
-         - CaseSensitive : Additional fix (removed unnesessary assignment).
-         - CopyProperties : Do not try to copy ExtendedProperties if the collection is empty.
-
-2004-04-21  Boris Kirzner <borisk@mainsoft.com>
-
-       * DataTable.cs : Ensure that DataSet property is not null before using it in Clear().
-         
-2004-04-20  Boris Kirzner <borisk@mainsoft.com>
-
-       * DataTable.cs : 
-         - EndLoadData() : perfomance fix in case of null constraint violation
-           during data load (also in DataRow.cs).
-         - CaseSensitive : If DataTable belongs to DataSet it should always use
-           DataSet.CaseSensitive untill explicitly changed.
-         - CopyProperties() : do not try to copy ExtendedProperties if the collection is empty.
-         
-       * DataRow.cs :
-         - Pefromance fix in case of null constraint violation
-           during data load (also in DataTable.cs).
-         - CollectionChanged() : use correct column number after new DataColumn was added
-           (differs in case some DataColumn was previosly removed).
-         - EndEdit() - throw away  proposed values only after CheckChildRows() complete.
-
-2004-04-20  Boris Kirzner <borisk@mainsoft.com>
-
-       * DataColumnCollection.cs : Since unique constraint is added now
-         in DataColumn.SetTable() the additional creation of constraint in 
-         DataColumnCollection.Add() is redundant and causes exception - fixed.
-         
-2004-04-19  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlDataLoader.cs : Added "never add data rows" mode.
-         Removed unused code. However, it is temporary fixes to unify
-         ReadXml() and InferXmlSchema().
-       * DataSet.cs : Implemented InferXmlSchema(), though it is incomplete.
-
-         I'll create another XmlDataLoader since there are many problems
-         such that 1) it is too waste to read the entire xml into an
-         XmlDocument, 2) it does not handle attributes correctly, and 3) it
-         must handle "ignored namespaces".
-
-2004-04-19  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * Added XmlSchemaDataImporter.cs (new schema reader).
-       * DataSet.cs : Use XmlSchemaDataImporter (right now for DataSet only)
-         for ReadXmlSchema().
-         Let schema reading work to ReadXmlSchema().
-         Don't return ReadSchema when argument read mode was DiffGram.
-
-2004-04-15 Umadevi S (sumadevi@novell.com)
-       *  Updated Clone/Copy methods in DataSet along with Testcase
-       *  ForeignKeyConstraint.cs - special ctor implemented 
-           Logic : ParentTable in the ctor - Since only name is given (not the DataTable object), we cannot associate any DataTable or DataSet right now.  So, only possible way is to do it when AddRange() is called. The ParentTable is searched in the DataSet  to which the calling DataTable belongs. And make the calling DataTable as ChildTable. In the PostAddRange() method check is addedd to perform the assignment of parent and child data columns once the information becomes available (When AddRange is called).
-       * Changes in  ConstraintCollection.cs for the above
-        Add (Constraint) - A check is performed to see if the constraint is ForeignKeyConstraint and whether data columns  are validated.  If no, whether it is called with AddRange(), If no, an Exception is thrown. AddRange() - PostAddRange() is called on the ForeignKeyConstraint object with the "table" as argument. Thanks to Deepak for the patch.
-       
-
-2004-04-15  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlSchemaMapper.cs : set parent key and foreign key info to 
-         DataRelation when reading refkey constraints.
-         Supply constraint name for fkey.
-
-2004-04-15  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlDataLoader.cs : Don't overwrite existing DataSetName. When read
-         mode is Auto, just ignore the schema if there is already schema info.
-       * DataSet.cs : Similarly ignore schema info for XmlReadMode = Auto.
-
-2004-04-14  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataSet.cs :
-         - In MS output, XML declaration looks to have standalone decl (yes).
-         - ReadXml(reader) just calls to ReadXml(reader, XmlReadMode.Auto)
-         - ReadXml(reader, mode)
-           1) return originally specified mode, instead of (always) Auto. 
-           2) Check empty reader.
-           3) Check diffgram schema and content separately.
-           4) When diffgram exists, remaining (the same-level) contents 
-              won't be consumed. 
-           5) Similar fact should be applied, but somewhat different. 
-              InferSchema and IgnoreSchema just skips, Fragment reads both
-              schema and content, others just reads schema.
-         - Removed unused code.
-       * XmlDataLoader.cs :
-         - Read() should skip in some ReadMode.
-         - Don't compare schema element name as case-insensitive (well,
-           should schemas be checked here?)
-         - Avoided BuildDocument() not to create confusing DataSet
-           document element.
-         - Don't add any tables when reader has single element.
-       * XmlDiffLoader.cs :
-         When target table was not found, MS.NET doesn't raise an error.
-       * XmlSchemaMapper.cs :
-         When XmlSchema.Read() left xml reader at </xs:schema>, read once.
-
-2004-04-13  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataSet.cs :
-         - InferXmlSchema(): Throw explicit NotImplementedException now.
-         - Don't put XML declaration everywhere. Write just for filename arg.
-         - xmlns="" should not be written. Maybe WebService problem is 
-           because default namespace is overwritten. This patch will keep
-           the WS problem away and actually fixes some unit tests (i.e. use
-           explicit String.Empty for null namespace in WriteStartElement()).
-         - MoveToContent() should always be called, not only when 
-           LocalName="xml". It will ignore prolog (DTD, PI, comment etc.).
-         - Even XmlReadMode is DiffGram, reader might not be "diffgram"
-           element. As to MSDN, diffgram does not contain schema.
-
-2004-04-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
-       * DataTable.cs: made _initStatus private so that System.Data is CLS
-       compliant.
-
-2004-04-13 Umadevi S   <sumadevi@novell.com>
-       *  UniqueConstraint.cs:
-       *  ConstraintCollection.cs:
-       *  DataTable.cs:
-       - Implemented a Constructor for UniqueConstraint.cs
-       - Used  EndInit on DataTable  to call a delegate which adds the
-         constraints passed to the most recent call of AddRange().Used
-         AddRange() on ConstraintCollection to check whether
-         DataTable.BeginInit has occurred.  If yes, save the argument
-         constraint collection passed, then return.  If no, Check whether the
-         constraints are of type UniqueConstraint and initialized with the
-         special constructor  If yes Initialized the table property of this
-         UniqueConstraint object with table assosciated with the current
-         instance of ConstraintCollection class.
-
-2004-04-07  Marek Safar  <marek.safar@seznam.cz>
-
-       * Constraint.cs: changed ClsCompliant to CLSCompliant, build fix.
-
-2004-04-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
-       * Constraint.cs:
-       * DataColumnCollection.cs:
-       * DataRelationCollection.cs:
-       * DataRowCollection.cs:
-       * DataTableCollection.cs:
-       * InternalDataCollectionBase.cs:
-       * Node.cs: CLS compliance for System.Data. Patch by Gert Driesen.
-       Fixes bug #56557.
-
-2004-04-05  Jackson Harper  <jackson@ximian.com>
-
-       * DataTable.cs: Add rows to the row list if there is no filter.
-       
-2004-03-31  Juraj Skripsky <juraj@hotfeet.ch>
-
-       * DataColumn.cs : Setting Caption to null sets it to the empty string
-       (ms.net behaviour, testcase is in DataColumnTest).
-       
-       * DataRow.cs : Evaluate DataColumn.Expression when such a column's
-       value is requested.
-
-2004-03-30 Lluis Sanchez Gual <lluis@ximian.com>
-
-       * DataColumn.cs: In Expression setter, set the expression member even if 
-         it is an empty string.
-       * DataSet.cs: Support serialization of byte[] columns.
-       * XmlDataLoader.cs: Support deserialization  of Guid columns. 
-         Set MappingType.Attribute to columns infered from attributes.
-
-2004-03-29  Juraj Skripsky <juraj@hotfeet.ch>
-
-       * ExpressionElements.cs : remove
-       * DataColumn.cs, DataRelationCollection.cs, DataTable.cs :
-       Integration of new Mono.Data.SqlExpressions classes used in
-       DataTable.{Select, Compute}.
-       Fixes bug #55503 and lots of failures in DataTableTest.cs.
-
-2004-03-28  Juraj Skripsky <juraj@hotfeet.ch>
-
-       * Index.cs: Simple fix in ComparePartialRowNonUnique.
-       This fixes bugs #56129 and #56014.
-
-2004-03-25 Lluis Sanchez Gual <lluis@ximian.com>
-
-       * DataSet.cs: In WriteXml (string filename, XmlWriteMode mode), close the
-         stream after writing the dataset. This fixes bug #52581.
-         Also added several writer.Close into finally blocks, so writers are properly
-         closed in case of an exception.
-
-2004-03-12  Andreas Nahr <ClassDevelopment@A-SoftTech.com>
-
-       * Constraint.cs: DO NOT USE the consts scheme if types can be referenced directly!
-       * DataColumn.cs: DO NOT USE the consts scheme if types can be referenced directly!
-       * ColumnTypeConverter.cs: Added stub
-       * DefaultValueTypeConverter: Added stub
-       * ConstraintConverter.cs: Added stub
-
-2004-03-04 Eran Domb <erand@mainsoft.com>
-
-       * XmlDataLoader.cs : Xml reading reviewed. Added support for additional xml formats as described
-       in MS.NET documentation (missing DataSet element etc).
-
-2004-03-04 Eran Domb <erand@mainsoft.com>
-
-       * Node.cs : Added.
-       * Index.cs : Rollback last changes.
-       
-2004-03-03  Atsushi Enomoto <atsushi@ximian.com>
-
-       * Index.cs : justa build fix.
-
-2004-03-03 Eran Domb <erand@mainsoft.com>
-       
-       * Index.cs : Added.
-       * Constraint.cs, ForeignKeyConstraint.cs, UniqueConstraint, ConstraintCollection.cs, DataColumn.cs,
-       DataRow.cs, DataRowCollection.cs, DataSet.cs, DataTable.cs : Changes made for using indexes on tables.
-       This changes made for performance improvement.
-
-2004-02-08 Eran Domb <erand@mainsoft.com>
-
-       * XmlSchemaMapper.cs : Read columns is they were written as SimpleContent or as Attributes.
-
-2004-02-08 Eran Domb <erand@mainsoft.com>
-
-       * DataSet.cs: Fix some bugs in ReadXml().
-
-2004-02-04 Lluis Sanchez Gual <lluis@ximian.com>
-
-       * DataSet.cs: Added missing method that broke the build.
-
-2004-02-04 Eran Domb <erand@mainsoft.com>
-
-       * DataRowCollection.cs (InsertAt): Add a check for null row. Replace check of IndexOf with RowId for
-       better performance.
-       * DataSet.cs (GetTableSchema) : Add supprot for simple content columns. Change the condition for a case
-       when all column are attributes (elements count is 0), we still want to add the relations. No relations
-       can be on simple contents.
-       (AddUniqueConstraints) Check that the column of the constraint are not hidden.
-       (AddForeignKeys) Check that the relation has constraints attach to it.
-       * XmlConstants.cs : Added constant.
-
-2004-02-04 Eran Domb <erand@mainsoft.com>
-       
-       * DataSet.cs : GetSchemaSerializable() return null and not BuildSchema().
-       DoWriteXmlSchema calls BuildSchema ().
-
-2004-02-04 Lluis Sanchez Gual <lluis@ximian.com>
-
-       * DataRow.cs: Added SetOriginalValue(), which is used to set the original
-         value of a column.
-       * DataRowCollection.cs: In InsertAt(), perform the correct checks and
-         attach the row.
-       * DataSet.cs: Fixed method GetChanges(): Parent rows of modified rows must
-         also be added to the dataset.
-         In WriteTable(), do not write unchanged rows when writing the original
-         version of the table.
-         Added WriteIndividualTableContent(), for writing the contents of a single
-         table.
-         Changed BuildSchema and related methods, so it can generate a schema for
-         any set of tables, not just the tables of the dataset (needed for 
-         single datatable serialization).
-       * DataTable.cs: Implemented serialization constructor and GetObjectData method.
-         Also implemented some ReadXmlSchema methods.
-       * XmlDiffLoader.cs: Read and process the xml document directly from XmlReader,
-         instead of loading the full dataset in an XmlDocument. It is faster and
-         saves memory. Also fixed several problems when generating the changes.
-       * XmlSchemaMapper.cs: Support reading schemas for single tables (used by
-         table serialization).
-
-2004-02-02 Eran Domb <erand@mainsoft.com>
-
-       * DataSet.cs : Add indentation to the xml serialization only if we create the XmlWriter.
-       Add the namespace attribute even if namespace is an empty string for inteoperability with MS.NET.
-       * DataTable.cs (NewRow): Create only one DataRowBuilder.
-       Initiate new row with row id -1.
-       * DataRow.cs : Add RowId property.
-       * DataRowBuilder.cs : Add _rowId member.
-       * DataRowCollection.cs (Add) : Use the RowId property of the new row to check if it is already exists in the collection.
-
-2004-01-26 Eran Domb <erand@mainsoft.com>
-
-       * XmlConstants.cs : Added some constants.
-       * DataColumn.cs : Added a method to retrive AutoIncrement value.
-       * XmlDataLoader.cs : Set the value of the foriegn key column, according to the value of the
-       parent table column.
-       * XmlDiffLoader.cs : Convert the value comming from the xml.
-       * XmlSchemaMapper.cs (Read) : Set the DataSet namespace.
-        (ReadXmlSchemaSequence) : Change the logic that decides if this element is a column or a table.
-        (ReadXmlSchemaElement) : Set the locale of the dataset.
-        (ReadColumn) : Set the column type. Find if the column is AutoIncrement.
-        (GetColumnType) : New method to get the column type from the attribute value.
-        (ReadXmlSchemaUnique) : Improve parsing of XPath. Set the constraint as a PK if needed,
-        and add the constraint to the table.
-        (ReadXmlSchemaKeyref) : Improve parsing of XPath. Create the FK constraint and add it to
-        the table.
-       * DataSet.cs : Improving writing of unique constraints, and foriegn key constraint. Givving them the correct names.
-        Writing more information to the schema for interoperability with ms.net.
-        Improve diffgarm writing mode.
-        
-
-2004-01-21 Atsushi Enomoto <atsushi@ximian.com>
-
-       * TypedDataSetGenerator.cs : Implemented GenerateIdName().
-
-2004-01-21 Eran Domb <erand@mainsoft.com>
-
-       * XmlDataLoader.cs (AddRowToTable) : Give thre new relation correct name.
-       Do not set the child column to be AutoIncrement.
-       Create the new column for the relation as MappingType.Hidden so they will not be serialized
-       when writing the dataset to xml.
-
-2004-01-20 Atsushi Enomoto <atsushi@ximian.com>
-
-       * Added missing TypedDataSetGenerator.cs.
-
-2004-01-08 Eran Domb <erand@mainsoft.com>
-
-       * XmlSchemaMapper.cs : Fix a bug. Check if table already in DataSet before adding it.
-       * DataSet.cs (ReadXml) : Fix bugs. Read correctly the xml file with XmlReadMode of DiffGram, 
-       InferSchema, ReadSchema and IgnoreSchema.
-       * XmlDataLoader.cs : All modes use the same logic.
-       * XmlDiffLoader.cs : Adding BuildXmlDocument method to the class.
-
-2004-01-06 Eran Domb <erand@mainsoft.com>
-
-       * DataRelationCollection.cs : Use IndexOf in indexer.
-       * DataSet.cs : Adding support for WriteXml with diffgram. Code style changes.
-       * XmlDataLoader.cs : Set the DataSet.enforceConstraints to false before loading the tables.
-       * XmlDiffLoader.cs : Reading nested tables.
-       * XmlSchemaMapper.cs : Reading the relation.
-       * XmlConstants.cs : Adding some constants.
-
-2004-01-05  Jackson Harper <jackson@ximian.com>
-
-       * DataView.cs: Set readonly property of property descriptor. This
-       fixes bug #52598.
-       
-2004-01-01  Sanjay Gupta <gsanjay@novell.com>
-
-       * DataRelationCollection.cs : Fixed incorrect generation of default 
-         Relation name.
-       * DataSet.cs : Added missing functionality in WriteXml().
-        * XmlConstants.cs : Added new constants.
-2003-12-27  Atsushi Enomoto <atsushi@ximian.com>
-
-       * DataSet.cs : Fixed incorrect WriteXml() signature.
-
-2003-12-18  Jackson Harper <jackson@ximian.com>
-
-       * DataView.cs: Implement AddNew, Delete, and OnListChanged.
-       
-2003-12-17  Atsushi Enomoto <atsushi@ximian.com>
-
-       * DataSet.cs, XmlDataLoader.cs : Table name should be encoded before
-         they take shape of xml. This fixed bug #52240
-
-2003-12-16  Tim Coleman <tim@timcoleman.com>
-       * KeyRestrictionBehavior.cs:
-               New stubs added for .NET 1.2
-       * DataTable.cs:
-               Changes for 1.2
-
-2003-12-08 Eran Domb <erand@mainsoft.com>
-       * DataColumn.cs (Expression) : Validate the expression.
-       
-       * DataRelationCollection.cs (IndexOf) : Added new method sensetive to case differences in relation name.
-       (Contains, IndexOf, this[], Add) : Call new IndexOf when needed.
-       
-       * DataRow.cs (this[]) : Fix the condition for throwing RowNotInTableException.
-       (RejectChanges) : Detach row when state was Added.
-       (CollectionChanged) : Fix a bug.
-       
-       * ExpressionElement (ValidateExpression) : Fix a bug.
-       
-       * ForeignKeyConstraint.cs (AssertConstraint) : Added implementation. Check all rows from child table have
-       a parent row in the parent table.
-       (_validateColumns) : Fix bugs.
-       
-       * MergeManager.cs (AdjustSchema) : Fix a bug.
-       
-       * XmlDataLoader.cs (ReadModeInferSchema) : Change implementation. Now we can read nested xml, and we generate the relations
-       between the tables.
-
-2003-11-30 Eran Domb <erand@mainsoft.com>
-       * DataColumnCollection.cs (this[string name]) : Use IndexOf to find the column.
-       (Add) : Find if the new column name is the same as the one found in IndexOf.
-       (IndexOf) : New method.
-       (Contains) : Use new IndexOf.
-       (IndexOf) : Use new IndexOf.
-       
-       * DataRelationCollection.cs (DataRelationCollection.AddCore) : Add The Relation to the collection.
-       (DataSetRelationCollection.AddCore) : First add the UniqueConstraint.
-       
-       * DataRow.cs (this[int columnIndex, DataRowVersion version]) : Change exceptions.
-       (Delete) : Detach row if the RowState was Added.
-       (GetChildRows) : Get the array form the ChildTable.
-       (GetParentRows) : Get the array from the ParenTable.
-       
-       * DataRowCollection.cs (Remove) : Check if row state is Detached to avoid exception.
-       
-       * DataSet.cs (IXmlSerializable.ReadXml) : Do not call MoveToContent and ReadEndElement - the XmlSerializationReader does it.
-       
-       * DataTable.cs (PrimaryKey) : Fix bugs.
-       (Compute) : First call Select. Then create ExpressionAggregate to aggregate the Select result.
-       
-       * DataTableCollection.cs (Add) : Fix a bug.
-       
-       * ExpressionElement.cs (ValidateExpression) : Turning ValidateExpression to static.
-       (Result) : Added new interface to AggregateExpression that get DataRow[] as a param.
-       Some code style changes (tab instead of whit spaces, alignment, etc...).
-       
-       * ForeignKeyConstraint.cs (_validateColumns) : Throw correct exception.
-       
-       * MergeManager.cs (AdjustSchema) : Fix a bug.
-       
-       
-
-2003-11-26  Miguel de Icaza  <miguel@ximian.com>
-
-       * DataSet.cs: Add a few more missing methods, code style updated
-       to Mono style.
-
-2003-11-26  Tim Coleman <tim@timcoleman.com>
-       
-       * ConflictOptions.cs DataAdapterException.cs DataTableReader.cs
-       * DbMetaData.cs FillOptions.cs IDataReader2.cs IDataRecord2.cs
-       * IDataUpdatableRecord.cs IDbAsyncCommand.cs IDbAsyncConnection.cs
-       * IDbExecutionContext.cs IGetTypedData.cs ISetTypedData.cs
-       * LoadOption.cs OperationAbortedException.cs ResultSetOptions.cs
-       * ResultSetSensitivity.cs StatementCompletedEventArgs.cs 
-       * StatementCompletedEventHandler.cs UpdateOptions.cs:
-               New classes added for NET_2_0
-       * DBConcurrencyException.cs DataRelation.cs DataSet.cs DataTable.cs
-       * DataTableCollection.cs DataView.cs ForeignKeyConstraint.cs:
-               Modifications to add new NET_2_0 functions
-
-2003-11-25  Tim Coleman <tim@timcoleman.com>
-       * IDataSources.cs:
-               New 1.2 class added
-
-2003-11-21  Pedro Martinez Julia  <yoros@wanadoo.es>
-
-       * DataRow.cs: Detached row can be accesible (new rows from data
-       table are detached). Closes but #51263.
-
-2003-11-19  Eran Domb  <erand@mainsoft.com>
-       * DataRow.cs : Throw exceptions if Row is Detached. 
-       (EndEdit) : Check that we are not in middle of ChangeEvent.
-       (AcceptChanges) : Detach the row.
-       
-       * DataRelation.cs : throw correct exception.
-       *UniqueConstraint.cs : throw correct exception.
-       
-
-2003-11-09  Pedro Martinez Julia  <yoros@wanadoo.es>
-
-       * DataRow.cs: Use RemoveInternal instead of Remove because the last
-       one uses Delete and AcceptChanges.
-
-       * DataRowCollection.cs: When removing, Delete and AcceptChanges
-       method from the row are called. Added an internal method that will
-       be used by DataRow to "physically" remove the row from the list.
-
-2003-11-09  Pedro Martinez Julia  <yoros@wanadoo.es>
-
-       * DataRowCollection.cs: To follow the specification: Remove and
-       RemoveAt should remove the row. But needed to call DeletingDataRow
-       to prepare the deleting.
-
-       * DataRow.cs: Don't call DeletingDataRow when it is called by the
-       method Table.Rows.Remove.
-
-2003-11-09  Pedro Martinez Julia  <yoros@wanadoo.es>
-
-       * DataRowCollection.cs: Make the row be deleted by itself. If not,
-       it fails because we need to call OnRowDeleting and OnRowDeleted. It
-       is full implemented inside DataRow.
-
-2003-11-05  Eran Domb  <erand@mainsoft.com>
-       * DataView.cs (ctor) : Changing default RowStateFilter to CurrentRow.
-
-2003-11-04  Eran Domb  <erand@mainsoft.com>
-       * DataRow.cs (CheckChildRows) : Improving the implementation - checking child for all FK, and not
-       on all Relations.
-       (GetChildRows) : Adding some checks.
-       (GetParentRows) : Adding some checks. Fix a bug in implementation.
-       (SetParentRow) : Added implementation.
-       
-       * DataRowCollection.cs (Add) : Added more checks on the row added to the collection.
-       * DataTable.cs (Copy) : Set the During Loading flag to save unnecessary assertions.
-       * ForeignKeyConstraint.cs (AssertConstraint) : Fixing bugs in implementation. Checking for DBNull values in the row.
-       * MergeManager.cs : Check that the target table is not null.
-
-2003-10-27  Eran Domb  <erand@mainsoft.com>
-       * DataColumn.cs (DefaultValue) : Changing null value to DBNull. Checking that the type of the new default value 
-       can be converted to the column type.
-       
-       * DataRelationCollection.cs (AddCore) : Give the new FK the name of the relation.
-       
-       * DataRow.cs (EndEdit) : Check if we need to validate the constraints.
-       (GetParentRows, GetChildRows) : Checking that the row has the wanted version, before accessing the row's value.
-       
-       * DataRowCollection.cs (Add) : Fixing a bug. 
-       (Clear) : Before clearing the array check that there is no violation of FK constraint.
-       
-       * DataSet.cs (Prefix) : If value is null chage it to empty string.
-       (GetXml) : Removing the Processing Instructions from the xml string as in MS ADO.NET.
-       
-       * ExpressionElement : Adding support for IN expresion.
-       
-       * DataTable (CopyConstraints) : New method that copy the tables constraints to the copy table.
-       (Select) : Adding support for DataViewwRowState.
-       
-       * ForeignKeyConstraint.cs (AssertConstraint) : Adding implementation.
-       
-       * MergeManager.cs (MergeRow) : Fix bugs.
-       
-2003-10-27  Eran Domb  <erand@mainsoft.com>
-       * DataRow.cs (SetColumnValue): Donot check null value when in midle of loading data.
-       check null values when ending loading data.
-       
-       * DataSet.cs (RejectChanges) : Imlementation.
-       (Prefix) : If prefix was changed fire event. Check that the prefix is not null - if null, 
-       change it to empty string.
-       
-       * DataTable.cs (BeginLoadData, EndLoadData) : Impemantation.
-       
-2003-10-22  Eran Domb  <erand@mainsoft.com>
-       * MergeManager.cs : Fixing bugs. Adding check for PrimaryKey matching.
-       
-       * ConstraintCollection.cs (RamoveAt): Change implemntation.
-       
-       * DataTableCollection (CanRemove): Removing cast to Constraint.
-
-2003-10-22  Eran Domb  <erand@mainsoft.com>
-       * DataRelationCollection.cs (AddCore): The unique constraint was added even if the createConstraints flag was false.
-       (Clear): The collection was cleared without removing the relation from the parent and child tables.
-       
-       * DataSet.cs (Copy, Clone): The Relations of the DataSet were not copy.
-       (HasChanges, Reset): Imlementation.
-       
-       * DataTable.cs (HasErrors): There is no flag for errors, instead the table ask her row if they have any errors.
-       This is because the we do not no when to turn off the flag.
-       (Locale): Changing implementation to behave like ADO.NET.
-       (AcceptChanges): Fix bug.
-       (Clear): Check that this table is not referenced from a foreign key constraint.
-       (Copy): Do not try to access a deleted row.
-       (CopyProperties): Copy the PrimaryKey.
-       (GetChanges, ImportRow): Implementation.
-       (LoadDataRow): Adding implementation if the table has PrimaryKey.
-       (ToString): Changing implementation to behave like ADO.NET.
-       
-       * UniqueConstraint.cs (AssertConstraint): support for Multiple DataColumns in the constraint.
-       
-       * DataRow.cs (Ctor): In the constructor we initiate the current array, but we should initiate only the proposed array for new rows.
-       (HasErrors): Implementation.
-       (Delete): Added checking for child rows of the deleted row.
-       (EndEdit): Added checking for child row and firing events.
-       (GetColumnError): Added a check that the method will not return null, as in ADO.NET(an empty string is returned).
-       (GetColumnsInError): Added a check for null values in column error.
-       (HasVersion): Added special treatment for special RowState.
-       (CollectionChanged): More checks to avoid NullReferenceException.
-       
-       * DataRowCollection.cs (Remove): Fix a bug.
-
-
-2003-10-01  Duncan Mak  <duncan@ximian.com>
-
-       More patches from Eran Domb <erand@mainsoft.com>.
-
-       * MergeManager.cs: New file.
-
-       * DataRelationCollection.cs (AddCore): Check that a
-       UniqueConstraint is already exists. It loops over the Relations
-       instead of the Constraints.
-       (Add, AddCore): The relation was added twice.
-
-       * DataSet.cs (Merge, GetChanges, HasChanges): Implemented.      
-
-2003-09-30  Duncan Mak  <duncan@ximian.com>        
-
-       Patches from Eran Domb <erand@mainsoft.com>.
-
-       * DataRelation.cs (constructor): When the name of the relation is
-       null, it should return an empty, not "Relation".
-       
-       * DataRow.cs (AcceptChanges): Added special case for
-       RowState.Detached.
-       (CancelEdit): Set editing flag to false.
-       (IsNull): Check that the value is DBNull.
-
-       * DataRowCollection.cs (Add): There was no check that the table of
-       the collection is owned by a DataSet.
-
-       * DataSet.cs (OnMergeFailed): Added.    
-
-       * UniqueConstraint.cs (AssertConstraint): There was no check that
-       values in the row are not null, where it is a primary key
-       column. Also check that the row has a proposed version, if not,
-       get the current version when we compare the rows.
-
-2003-09-25  Duncan Mak  <duncan@ximian.com>
-
-        Patches from Eran Domb <erand@mainsoft.com>.
-
-       * DataColumn.cs (Unique): Implemented.
-       
-       * DataTable.cs:
-       * ConstraintCollection.cs:
-       * ForeignKeyConstraint.cs (_ensureUniqueConstraintExists): Fixes
-       an Exception thrown. Details:
-       http://lists.ximian.com/archives/public/mono-devel-list/2003-September/002130.html
-       
-       * DataRowCollection.cs (Add): There is no checking that there is
-       no violation of the unique constrains.
-
-       * UniqueConstraint.cs (AssertConstraint): There is no checking on
-       all columns in the constraint.
-
-       * DataTableCollection (Add): Correctly throw an Exception, more
-       details here:
-       http://lists.ximian.com/archives/public/mono-devel-list/2003-September/002117.html
-       (Remove, RemoveAt): Implemented.
-
-2003-07-31  Duncan Mak  <duncan@ximian.com>
-
-       * DBConcurrencyException.cs: Added new NET_1_1 no-param constructor.
-
-2003-07-25  Ravi Pratap  <ravi@ximian.com>
-
-       * DataRelation.cs (OnPropertyChanging): Calling the 'Invoke'
-       method on a delegate is disallowed - fix this.
-
-2003-07-22  Lluis Sanchez Gual  <lluis@ximian.com>
-
-       * DataSet.cs: Implemented IXmlSerializable interface. Added basic support for
-         xml serialization. Modified method of writing schema. Now it creates
-         a XmlSchema object and serializes it using XmlSerializer.
-       * XmlConstants.cs: Added constants for data type names.
-       * XmlDataLoader.cs: Fixed deserialization of data. Now converts data to the
-         type specified in the column.
-
-2003-04-20  Alan Tam <Tam@SiuLung.com>
-
-       * DataRelationCollection.cs: Fix a bug that prevent relations
-       from being added via DataSet.
-
-2003-04-12  Ville Palo <vi64pa@kolumbus.fi>
-
-       * UniqueConstraint.cs: one tiny fix.
-       
-2003-04-05  Ville Palo <vi64pa@kolumbus.fi>
-
-       * DataTable.cs: Remove UniqueConstraints when adding new ones
-       
-2003-04-04  Ville Palo <vi64pa@kolumbus.fi>
-
-       * DataColumnCollection.cs: Little 'case sensitive' fix
-       
-2003-04-04  Ville Palo <vi64pa@kolumbus.fi>
-
-       * DataRow.cs: AutoIncrement handling to Constructor
-       * DataRowCollection.cs: This doesnt need anymore AutoIncrements
-       
-2003-03-27  Ville Palo <vi64pa@kolumbus.fi>
-
-       * DataTable.cs: Some fixes to PrimaryKey etc...
-       * UniqueConstraint.cs: Little clean up
-       
-2003-03-27  Ville Palo <vi64pa@kolumbus.fi>
-
-       * DataTable.cs: Tiny fix to ToString () -method
-       
-2003-03-27  Ville Palo <vi64pa@kolumbus.fi>
-
-       * ConstraintCollection.cs: Little fix.
-       * DataColumn.cs: Added new internal method SetUnique()
-       * UniqueConstraint.cs: some little fixes
-       
-2003-03-26  Ville Palo <vi64pa@kolumbus.fi>
-
-       * DataRowCollection.cs: Bugfixes, implementation,...
-       
-2003-03-26  Ville Palo <vi64pa@kolumbus.fi>
-
-       * DataColumn.cs: If DataType if set to something else than short, int
-       or long and AutoIncrement is true, AutoIncrement is must set to false.
-       
-2003-03-26  Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
-       * DataRow.cs:
-       (BeginEdit): fixed array bound problem when a column has been added.
-       (EndEdit): just assign proposed to current as proposed is set to null.
-       This also fixes another array boudn problem.
-
-2003-03-21  Alan Tam <Tam@SiuLung.com>
-
-       * DataRow.cs: Fixed problems in accessers, BeginEdit, CancelEdit,
-       EndEdit and AcceptChanges to act correctly according to DataRowState
-       and DataRowVersion.
-       * DataRowCollection.cs: Call AttachRow and DetachRow when a row is
-       attached and detached from the collection.
-
-2003-03-20  Alan Tam <Tam@SiuLung.com>
-
-       * DataColumn.cs: Store empty string for Expression when null is passed in.
-       Classes generated by XSD.exe passes null by default.
-
-2003-03-16  Ville Palo <vi64pa@kolumbus.fi>
-
-       * DataColumnCollection.cs: Tiny clean up
-
-2003-03-16  Ville Palo <vi64pa@kolumbus.fi>
-
-       * DataColumn.cs: little fixes.
-       * DataColumnCollection.cs: Lots of little fixes and improvments.
-       
-2003-03-12  Alan Tam <Tam@SiuLung.com>
-
-       * DataSet.cs: Fixed a bug that the file written does not close correctly.
-
-2003-03-08  Alan Tam <Tam@SiuLung.com>
-
-       * DataRelationCollection.cs: Removed the mis-overridden methods
-       * DataRow.cs: Fixed an attribute
-       * DataSet.cs: Fixed the modifiers
-
-2003-03-06  Aleksey Demakov <avd@openlinksw.com>
-
-       * DataTableCollection.cs: The Contains (string name),
-       IndexOf (string name) methods, and item[string name] indexer
-       now behave more like .NET with respect to case-sensitivity.
-       That is if there is an exactly matching item then this one is used.
-       If there is only one item differing in case then it used.
-       If there are more than one item differing in case then
-       Contains returns false, IndexOf returns -1, and item[]
-       throws an ArgumentException.
-
-2003-02-28  Ville Palo <vi64pa@kolumbus.fi>
-
-       * ExpressionElement.cs: More implementation. 
-       
-2003-02-28  Alan Tam <Tam@SiuLung.com>
-       * DataSet.cs: Changed WriteTable so that it now calls the newly written
-       WriteObjectXml to direct the call to the respective XmlConvert method.
-       This fixes the wrong format written to XML files of bool, float,
-       double, DateTime and TimeSpan types.
-
-2003-02-25  Alan Tam <Tam@SiuLung.com>
-
-       * DataRelation.cs: Added SetDataSet for DataSetRelationCollection to use.
-       * DataRelationCollection.cs: Implemented AddRange and Contains.
-       Implemented AddRange, Clear, List and RemoveCore for DataSetRelationColletion.
-       Implemented AddCore, List and RemoveCore for DataTableRelationCollection.
-       Reimplemented most Add methods to eliminate duplicated checks.
-       Centralized RelationName generation procedure in GetNextDefaultRelationName.
-
-2003-02-25  Alan Tam <Tam@SiuLung.com>
-
-       * DataColumn.cs: Fixed wrong storage representation of Expression
-       (using empty string instead of null) so that ToString() returns nothing.
-       * DataColumnCollection.cs: Reimplemented GetNextDefaultColumnName so that
-       auto column naming now works as expected. Reimplemented some Add methods
-       to eliminate code duplication.
-
-2003-02-19  Ville Palo <vi64pa@kolumbus.fi>
-
-       * DataTable.cs: DataTable.CaseSensitive follows parent 
-       DataSet.CaseSensitive property if DataTable.CaseSensitive has never
-       been changed directly from DataTable
-       
-2003-02-19  Ville Palo <vi64pa@kolumbus.fi>
-
-       * DataSet.cs: When CaseSensitive property is changed all of the Tables
-       of DataSet have to change too
-       
-2003-02-19  Daniel Morgan <danmorg@sc.rr.com>
-
-       * InternalDataCollectionBase.cs: revert change to field
-       to fix build
-       
-       * DataViewManager.cs
-       * DataView.cs
-       * DataTable.cs
-       * DataSet.cs: commented use of DesignerAttribute
-       because it broke the build.  According to MSDN,
-       DesignerAttribute does not have a zero-argument constructor
-
-2003-02-18  Ville Palo <vi64pa@kolumbus.fi>
-
-       * DataColumnCollectin.cs: Little fix for indexer and case sensitivity
-       
-2003-02-18  Alan Tam <Tam@SiuLung.com>
-
-       * DataRow.cs: Implemented GetParentRow and GetParentRows.
-       * DataSet.cs: Added stub for HasChanges, InferXmlSchema,
-                     OnPropertyChanging, OnRemoveRelation, OnRemoveTable,
-                     RaisePropertyChanging.
-       * DataTable.cs: Implemented NewRowArray.
-       * DataTablePropertyDescriptor: Fixed a modifier.
-       * InternalDataCollectionBase.cs: Fixed modifiers. Implemented SyncRoot.
-       * PropertyCollection.cs: Minor fix.
-       * ConstraintCollection.cs DataColumn.cs DataColumnCollection.cs 
-       * DataRelation.cs DataRelationCollection.cs DataRow.cs
-       * DataRowCollection.cs DataRowState.cs DataSet.cs DataTable.cs
-       * DataTableCollection.cs DataTablePropertyDescriptor.cs DataView.cs
-       * DataViewManager.cs DataViewRowState.cs DataViewSettingCollection.cs
-       * ForeignKeyConstraint.cs InternalDataCollectionBase.cs
-       * PropertyCollection.cs UniqueConstraint.cs: Added missing attributes
-       
-2003-02-08  Ville Palo <vi64pa@koti.soon.fi>
-
-       * ExpressionElement.cs: More implementation
-       
-2003-02-05  Alan Tam <Tam@SiuLung.com>
-
-       * DataSet.cs: Added framework for DataSet.Update Implemented missing 
-       methods GetSchemaSerializable, GetSerializationData, 
-       ReadXmlSerializable, ShouldSerializeRelations and ShouldSerializeTables
-       for DataSet
-       * DataTable.cs: Implemented missing methods CreateInstance and 
-       GetRowType for DataTable
-       
-2003-02-03  Ville Palo <vi64pa@koti.soon.fi>
-
-       * DataSet.cs: Implemented private method MapType for 
-       mapping datatypes for XmlSchema
-       
-2003-02-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
-       * DataView.cs: implemented Dispose.
-
-2003-01-30  Ville Palo <vi64pa@koti.soon.fi>
-
-       * ExpressionElement.cs: Added new file. This file is for parsing
-         and DataData.Select () -methods and DataColumn.Expression -property
-       * DataTable.cs: Implemented Select(string) -method      
-       
-2003-01-28  Ville Palo <vi64pa@koti.soon.fi>
-
-       * DataSet.cs: One little fix to writing xml
-       
-2003-01-27  Ville Palo <vi64pa@koti.soon.fi>
-
-       * XmlSchemaMapper.cs: Some fixes.
-       * DatSet.cs: Some XmlFixes and BeginInit ()/ EndInit () -fix
-
-               
-2003-01-24  Ville Palo <vi64pa@koti.soon.fi>
-
-       * UniqueConstraint.cs: Do not set columns Unique property true 
-       as a default.
-       * ForeignKeyConstraint.cs: Add UniqueConstraint to parent Table
-       
-2003-01-18  Ville Palo <vi64pa@koti.soon.fi>
-
-       * DataTableCollection.cs: Now names new DataTable if it doesn't 
-       already have a name.
-       
-2003-01-17  Ville Palo <vi64pa@koti.soon.fi>
-
-       * XmlSchemaMapper.cs: Improvments.
-       * XmlConstaints.cs: Added more constants.
-       * DataSet.cs: Improvments of reading and writing xml
-       * DataColumn.cs: Added default values of properties.
-               
-2003-01-14  Ville Palo <vi64pa@koti.soon.fi>
-
-       * XmlSchemaMapper.cs: Some improvments
-       
-2003-01-13  Ville Palo <vi64pa@koti.soon.fi>
-
-       * DataRowCollection.cs: Added IndexOutOfRangeException
-       * DataTableCollection.cs: Added OnCollectionChanging and 
-       OnCollectionChanged events.
-       * DataSet.cs: Many fixes. Implemented Clone () and Copy () -methods
-       * DataTable.cs: Implemented Copy () and Clone () methods.
-       * XmlDataLoader.cs: some fixes.
-       * XmlSchemaMapper.cs: comments.
-       
-2003-01-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
-       * DataColumnPropertyDescriptor.cs: store columnIndex in the .ctor.
-
-2003-01-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
-       * DataColumnPropertyDescriptor.cs: fixed typo.
-       * DataViewManagerListItemTypeDescriptor.cs: added new internal property
-       to get the DataViewManager and removed TablePD class.
-       * DataTablePropertyDescriptor.cs: TablePD class is now this one as
-       suggested by danmorg.
-
-2003-01-06  Ville Palo <vi64pa@koti.soon.fi>
-
-       * XmlDataLoader.cs: Moved diffgram stuff to new internal class
-       XmlDiffLoader.
-       * XmlDiffLoader.cs: new class for diffgrams. Added handling of 
-       diffgr:Errors and some fixes and changed XmlReader to XPathNavigator.
-       
-2003-01-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
-       * DataView.cs: made dataViewManager internal.
-       * DataViewManager.cs: use ICustomTypeDescriptor. We don't want the
-       properties of the object, but the values of the columns present in a
-       row.
-       
-       * DataViewManagerListItemTypeDescriptor.cs: implemented GetProperties,
-       which returns a PropertyDescriptorCollection. Created a new class
-       derived from PropertyDescriptor that treats Table as an object whose
-       properties are DataRowView.
-
-2003-01-04  Ville Palo <vi64pa@koti.soon.fi>
-
-       * XmlSchemaMapper.cs: Added handling for Constraints, Attributes.
-       
-2003-01-04  Ville Palo <vi64pa@koti.soon.fi>
-
-       * DataColumn.cs: ExtendedProperties is by default !null-
-       
-2003-01-04  Ville Palo <vi64pa@koti.soon.fi>
-
-       * DataColumnCollection.cs: Add (DataColumn Column) -method didn't 
-       set column's ordinal.
-       
-2003-01-02  Ville Palo <vi64pa@koti.soon.fi>
-
-       * DataSet.cs: 
-       * XmlDataLoader.cs: XmlReader closing fixes.
-       * XmlSchemaReader.cs: Added support for ref=
-       
-2003-01-01  Ville Palo <vi64pa@koti.soon.fi>
-
-       * DataSet.cs: 
-         - Added XmlReader and XmlWriter Closing.
-         - Moved ReadXmlSchema stuff to new internal class XmlSchemaMapper.
-       * XmlSchemaMapper.cs
-         - Much better way IMHO  to map xmlschema than the old one in 
-           DataSet.cs. Its, more flexible, cleaner, ...
-                       
-2002-12-29  Ville Palo <vi64pa@koti.soon.fi>
-
-       * XmlDataLoader.cs: Reading diffgrams.
-       
-2002-12-29  Ville Palo <vi64pa@koti.soon.fi>
-
-       * DataRow.cs: Little fix to indexer and DataColumnCang* trigger fixes.
-       * DataTable.cs: Added ChanginDataColumn () for triggering 
-       DataColumnChanging event
-       
-2002-12-28  Ville Palo <vi64pa@koti.soon.fi>
-
-       * DataSet.cs: Indentations to WriteXmlSchema () and one little fix
-       
-2002-12-28  Ville Palo <vi64pa@koti.soon.fi>
-
-       * DataSet.cs: Indentations to WriteXml ()
-       
-2002-12-27  Ville Palo <vi64pa@koti.soon.fi>
-
-       * DataSet.cs:
-       * XmlDataLoader.cs: Moved ReadXml -stuff from DataSet.cs to new
-       class XmlDataLoader.cs
-       
-2002-12-19  Ville Palo <vi64pa@koti.soon.fi>
-
-       * DataSet.cs Implemented ReadXml with XmlReadMode.ReadSchema
-       
-2002-12-18  Ville Palo <vi64pa@koti.soon.fi>
-
-       * DataSet.cs: Started to implement ReadXml-methods.
-       
-2002-12-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
-       * DataSet.cs: implemented DefaultViewManager and GetList.
-
-       * DataViewManager.cs: a bit of work on IList and ITypedList needed by
-       DataList in System.Web.
-
-       * DataViewManagerListItemTypeDescriptor.cs: custom type descriptor for
-       DataViewManager.
-
-2002-12-16  Ville Palo <vi64pa@koti.soon.fi>
-
-       * DataRow.cs
-       * DataTable.cs: Fixed NullException (rollback -event)
-       * DataSet.cs: WriteXml -method does not anymore write <?xml... row.
-       
-2002-12-15  Ville Palo <vi64pa@koti.soon.fi>
-
-       * DataRow.cs:
-       * DataRowCollection.cs: Moved event triggering from DataRow to
-       DataRowCollection.
-       
-2002-12-09  Ville Palo <vi64pa@koti.soon.fi>
-
-       * DataSet.cs: Little fix to WriteTable () -method 
-       and DoReadXmlSchema () -method.
-       
-2002-12-06  Ville Palo <vi64pa@koti.soon.fi>
-
-       * DataSet.cs: Clean up to reading xmlschema. This looks much better 
-       now (work better too), but it not working correctly yet.
-       
-2002-12-04  Ville Palo <vi64pa@koti.soon.fi>
-
-       * DataRow.cs: 
-       * DataRowCollection.cs: Added some event handlins stuff.
-       * DataSet.cs: Some fixes.
-       * DataTable.cs: Added event handlers.
-       
-2002-11-30  Ville Palo <vi64pa@koti.soon.fi>
-
-       * DataRowChangeEventArgs.cs: Implemented Action and Row properties 
-       
-2002-11-30  Ville Palo <vi64pa@koti.soon.fi>
-
-       * System.Data/DataRow.cs: Added internal property XmlDataID
-       
-2002-11-29  Ville Palo <vi64pa@koti.soon.fi>
-
-       * DataSystem.Data.DataTableCollection.cs:
-       Removed HashTable. There could be situations where DataTable
-       is added to collection before it hava TableName. So using 
-       HashTable is impossible.
-       
-2002-11-19  Carlos Guzman Alvarez <carlosga@telefonica.net>
-
-       * DataRow.cs: an object that is equal to null 
-       should be allowed to be set in this indexer too
-       to be like .NET
-
-2002-11-06  Daniel Morgan <danmorg@sc.rr.com>
-
-       * DataColumnPropertyDescriptor.cs: added file
-       
-       * System.Data/DataRowView.cs: started implementation
-       
-       * DataTable.cs: stubbed more interfaces.  Implemented
-       IListSource.GetList()
-       
-       * DataView.cs: stubbed more interfaces.  Implemented
-       some properties and methods: GetEnumerator(), 
-       ITypedList.GetItemProperties, Item indexer, CopyTo()
-
-2002-05-18  Nick Drochak  <ndrochak@gol.com>
-
-       * DataRow.cs: Fix typo.
diff --git a/mcs/class/System.Data/System.Data/ColumnTypeConverter.cs b/mcs/class/System.Data/System.Data/ColumnTypeConverter.cs
deleted file mode 100644 (file)
index f6b564a..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-//
-// System.Data.ColumnTypeConverter.cs
-//
-// Author:
-//   Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//
-// (C) 2004 Andreas Nahr
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Globalization;
-using System.ComponentModel;
-
-namespace System.Data
-{
-       internal sealed class ColumnTypeConverter : ExpandableObjectConverter
-       {
-               [MonoTODO]
-               public ColumnTypeConverter ()
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               public override object ConvertTo (ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               public override bool CanConvertTo (ITypeDescriptorContext context, Type destinationType)
-               {
-                       throw new NotImplementedException ();
-               }
-       }
-}
diff --git a/mcs/class/System.Data/System.Data/CommandBehavior.cs b/mcs/class/System.Data/System.Data/CommandBehavior.cs
deleted file mode 100644 (file)
index f445da5..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-//
-// System.Data.CommandBehavior.cs
-//
-// Author:
-//   Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System.Data
-{
-
-       /// <summary>
-       /// Specifies a description of the results and the affect on the database of the query command.
-       /// This enumeration has a FlagsAttribute that allows a bitwise combination of its member values.
-       /// </summary>
-       [Flags]
-       public enum CommandBehavior
-       {
-               Default = 0,
-               SingleResult = 1,
-               SchemaOnly = 2,
-               KeyInfo = 4,
-               SingleRow = 8,
-               SequentialAccess = 16,
-               CloseConnection = 32            
-       }
-}
\ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/CommandType.cs b/mcs/class/System.Data/System.Data/CommandType.cs
deleted file mode 100644 (file)
index 72fe96d..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-//
-// System.Data.CommandType.cs
-//
-// Author:
-//   Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace System.Data
-{
-       /// <summary>
-       /// Specifies how a command string is interpreted.
-       /// </summary>
-       public enum CommandType
-       {
-               Text = 1,
-               StoredProcedure = 4,
-               TableDirect = 512
-               
-       }
-}
diff --git a/mcs/class/System.Data/System.Data/ConflictOption.cs b/mcs/class/System.Data/System.Data/ConflictOption.cs
deleted file mode 100644 (file)
index c52fc62..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-//
-// System.Data.ConflictOption.cs
-//
-// Author:
-//   Senganal T
-//
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-namespace System.Data {
-       public enum ConflictOption
-       {
-               CompareAllSearchableValues=1,
-               CompareRowVersion=2,
-               OverwriteChanges=3
-       }
-}
-
diff --git a/mcs/class/System.Data/System.Data/ConflictOptions.cs b/mcs/class/System.Data/System.Data/ConflictOptions.cs
deleted file mode 100644 (file)
index aa4b7d1..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-//
-// System.Data.ConflictOptions.cs
-//
-// Author:
-//   Tim Coleman (tim@timcoleman.com)
-//
-// Copyright (C) Tim Coleman, 2003
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-namespace System.Data {
-       public enum ConflictOptions 
-       {
-               Optimistic,
-               SetAllValues,
-               CompareRowVersion,
-               CompareRowVersionUpdate,
-               CompareRowVersionDelete,
-               CompareAllValues,
-               CompareAllValuesUpdate,
-               CompareAllValuesDelete,
-               CompareChangedValues,
-               CompareChangedValuesUpdate,
-               CompareChangedValuesDelete,
-               OverwriteChanges,
-               OverwriteChangesUpdate,
-               OverwriteChangesDelete
-       }
-}
-
diff --git a/mcs/class/System.Data/System.Data/ConnectionState.cs b/mcs/class/System.Data/System.Data/ConnectionState.cs
deleted file mode 100644 (file)
index 33d25e9..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-//
-// System.Data.ConnectionState.cs
-//
-// Author:
-//   Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace System.Data
-{
-
-       /// <summary>
-       /// Returns the current state of the connection to a data source.
-       /// This enumeration has a FlagsAttribute that allows a bitwise combination of its member values.
-       /// </summary>
-       [Flags]
-       public enum ConnectionState
-       {
-               Closed = 0,
-               Open = 1,
-               Connecting = 2,
-               Executing = 4,
-               Fetching = 8,
-               Broken = 16
-       }
-}
\ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/Constraint.cs b/mcs/class/System.Data/System.Data/Constraint.cs
deleted file mode 100644 (file)
index db3bf11..0000000
+++ /dev/null
@@ -1,206 +0,0 @@
-//
-// System.Data.Constraint.cs
-//
-// Author:
-//     Franklin Wise <gracenote@earthlink.net>
-//     Daniel Morgan
-//      Tim Coleman (tim@timcoleman.com)
-//
-//
-// (C) Ximian, Inc. 2002
-// Copyright (C) Tim Coleman, 2002
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections;
-using System.ComponentModel;
-using System.Runtime.InteropServices;
-using System.Runtime.Serialization;
-using System.Data.Common;
-
-namespace System.Data {
-       [Serializable]
-       internal delegate void DelegateConstraintNameChange (object sender, string newName);
-
-       [DefaultProperty ("ConstraintName")]
-       [TypeConverterAttribute (typeof (ConstraintConverter))]
-       public abstract class Constraint {
-               static readonly object beforeConstraintNameChange = new object ();
-
-               EventHandlerList events = new EventHandlerList ();
-
-               internal event DelegateConstraintNameChange BeforeConstraintNameChange {
-                       add { events.AddHandler (beforeConstraintNameChange, value); }
-                       remove { events.RemoveHandler (beforeConstraintNameChange, value); }
-               }
-
-               //if constraintName is not set then a name is
-               //created when it is added to
-               //the ConstraintCollection
-               //it can not be set to null, empty or duplicate
-               //once it has been added to the collection
-               private string _constraintName;
-               private PropertyCollection _properties;
-
-               private Index _index;
-
-               //Used for membership checking
-               private ConstraintCollection _constraintCollection;
-
-               DataSet dataSet;
-
-               protected Constraint ()
-               {
-                       dataSet = null;
-                       _properties = new PropertyCollection ();
-               }
-
-               [CLSCompliant (false)]
-               protected internal virtual DataSet _DataSet {
-                       get { return dataSet; }
-               }
-
-               [DataCategory ("Data")]
-               [DefaultValue ("")]
-               public virtual string ConstraintName {
-                       get { return _constraintName == null ? "" : _constraintName; }
-                       set {
-                               //This should only throw an exception when it
-                               //is a member of a ConstraintCollection which
-                               //means we should let the ConstraintCollection
-                               //handle exceptions when this value changes
-                               _onConstraintNameChange (value);
-                               _constraintName = value;
-                       }
-               }
-
-               [Browsable (false)]
-               [DataCategory ("Data")]
-               public PropertyCollection ExtendedProperties {
-                       get { return _properties; }
-               }
-
-               public abstract DataTable Table {
-                       get;
-               }
-
-               internal ConstraintCollection ConstraintCollection {
-                       get { return _constraintCollection; }
-                       set { _constraintCollection = value; }
-               }
-
-               private void _onConstraintNameChange (string newName)
-               {
-                       DelegateConstraintNameChange eh = events [beforeConstraintNameChange] as DelegateConstraintNameChange;
-                       if (eh != null)
-                               eh (this, newName);
-               }
-
-               //call once before adding a constraint to a collection
-               //will throw an exception to prevent the add if a rule is broken
-               internal abstract void AddToConstraintCollectionSetup (ConstraintCollection collection);
-
-               internal abstract bool IsConstraintViolated ();
-
-               internal static void ThrowConstraintException ()
-               {
-                       throw new ConstraintException("Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.");
-               }
-
-               bool initInProgress = false;
-               internal virtual bool InitInProgress {
-                       get { return initInProgress; }
-                       set { initInProgress = value; }
-               }
-
-               internal virtual void FinishInit (DataTable table)
-               {
-               }
-
-               internal void AssertConstraint ()
-               {
-                       // The order is important.. IsConstraintViolated fills the RowErrors if it detects
-                       // a violation
-                       if (!IsConstraintViolated ())
-                               return;
-                       if (Table._duringDataLoad || (Table.DataSet != null && !Table.DataSet.EnforceConstraints))
-                               return;
-                       ThrowConstraintException ();
-               }
-
-               internal abstract void AssertConstraint (DataRow row);
-
-               internal virtual void RollbackAssert (DataRow row)
-               {
-               }
-
-               //call once before removing a constraint to a collection
-               //can throw an exception to prevent the removal
-               internal abstract void RemoveFromConstraintCollectionCleanup (ConstraintCollection collection);
-
-               [MonoTODO]
-               protected void CheckStateForProperty ()
-               {
-                       throw new NotImplementedException ();
-               }
-
-               protected internal void SetDataSet (DataSet dataSet)
-               {
-                       this.dataSet = dataSet;
-               }
-
-               internal void SetExtendedProperties (PropertyCollection properties)
-               {
-                       _properties = properties;
-               }
-
-               internal Index Index {
-                       get { return _index; }
-                       set {
-                               if (_index != null) {
-                                       _index.RemoveRef();
-                                       Table.DropIndex(_index);
-                               }
-
-                               _index = value;
-
-                               if (_index != null)
-                                       _index.AddRef();
-                       }
-               }
-
-               internal abstract bool IsColumnContained (DataColumn column);
-               internal abstract bool CanRemoveFromCollection (ConstraintCollection col, bool shouldThrow);
-
-               /// <summary>
-               /// Gets the ConstraintName, if there is one, as a string.
-               /// </summary>
-               public override string ToString ()
-               {
-                       return _constraintName == null ? "" : _constraintName;
-               }
-       }
-}
diff --git a/mcs/class/System.Data/System.Data/ConstraintCollection.cs b/mcs/class/System.Data/System.Data/ConstraintCollection.cs
deleted file mode 100644 (file)
index f71de4e..0000000
+++ /dev/null
@@ -1,359 +0,0 @@
-//
-// System.Data.ConstraintCollection.cs
-//
-// Author:
-//   Franklin Wise <gracenote@earthlink.net>
-//   Daniel Morgan
-//
-// (C) Ximian, Inc. 2002
-// (C) 2002 Franklin Wise
-// (C) 2002 Daniel Morgan
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections;
-using System.ComponentModel;
-
-namespace System.Data {
-       [Editor]
-       [Serializable]
-       internal delegate void DelegateValidateRemoveConstraint (ConstraintCollection sender, Constraint constraintToRemove, ref bool fail,ref string failReason);
-
-       /// <summary>
-       /// hold collection of constraints for data table
-       /// </summary>
-       [DefaultEvent ("CollectionChanged")]
-       [Editor ("Microsoft.VSDesigner.Data.Design.ConstraintsCollectionEditor, " + Consts.AssemblyMicrosoft_VSDesigner,
-                "System.Drawing.Design.UITypeEditor, " + Consts.AssemblySystem_Drawing)]
-       public partial class ConstraintCollection : InternalDataCollectionBase {
-               public event CollectionChangeEventHandler CollectionChanged;
-               private DataTable table;
-
-               // Keep reference to most recent constraints passed to AddRange()
-               // so that they can be added when EndInit() is called.
-               private Constraint [] _mostRecentConstraints;
-
-               //Don't allow public instantiation
-               //Will be instantianted from DataTable
-               internal ConstraintCollection(DataTable table)
-               {
-                       this.table = table;
-               }
-
-               internal DataTable Table {
-                       get { return this.table; }
-               }
-
-               public
-               Constraint this [string name] {
-                       get {
-                               int index = IndexOf (name);
-                               return -1 == index ? null : (Constraint) List [index];
-                       }
-               }
-
-               public
-               Constraint this [int index] {
-                       get {
-                               if (index < 0 || index >= List.Count)
-                                       throw new IndexOutOfRangeException ();
-                               return (Constraint) List [index];
-                       }
-               }
-
-               private void _handleBeforeConstraintNameChange (object sender, string newName)
-               {
-                       if (newName == null || newName == "")
-                               throw new ArgumentException (
-                                       "ConstraintName cannot be set to null or empty after adding it to a ConstraintCollection.");
-
-                       if (_isDuplicateConstraintName (newName, (Constraint) sender))
-                               throw new DuplicateNameException ("Constraint name already exists.");
-               }
-
-               private bool _isDuplicateConstraintName (string constraintName, Constraint excludeFromComparison)
-               {
-                       foreach (Constraint cst in List) {
-                               if (cst == excludeFromComparison)
-                                       continue;
-                               if (String.Compare (constraintName, cst.ConstraintName, false, Table.Locale) == 0)
-                                       return true;
-                       }
-
-                       return false;
-               }
-
-               //finds an open name slot of ConstraintXX
-               //where XX is a number
-               private string _createNewConstraintName ()
-               {
-                       // FIXME: Do constraint id's need to be reused?  This loop is horrendously slow.
-                       for (int i = 1; ; ++i) {
-                               string new_name = "Constraint" + i;
-                               if (IndexOf (new_name) == -1)
-                                       return new_name;
-                       }
-               }
-
-
-               // Overloaded Add method (5 of them)
-               // to add Constraint object to the collection
-
-               public void Add (Constraint constraint)
-               {
-                       //not null
-                       if (null == constraint)
-                               throw new ArgumentNullException ("Can not add null.");
-
-                       if (constraint.InitInProgress)
-                               throw new ArgumentException ("Hmm .. Failed to Add to collection");
-
-                       //check constraint membership
-                       //can't already exist in this collection or any other
-                       if (this == constraint.ConstraintCollection)
-                               throw new ArgumentException ("Constraint already belongs to this collection.");
-                       if (null != constraint.ConstraintCollection)
-                               throw new ArgumentException ("Constraint already belongs to another collection.");
-
-                       //check if a constraint already exists for the datacolums
-                       foreach (Constraint c in this) {
-                               if (c.Equals (constraint))
-                                       throw new DataException (
-                                               "Constraint matches contraint named '" + c.ConstraintName + "' already in collection");
-                       }
-
-                       //check for duplicate name
-                       if (_isDuplicateConstraintName (constraint.ConstraintName, null))
-                               throw new DuplicateNameException ("Constraint name already exists.");
-
-                       //Allow constraint to run validation rules and setup
-                       constraint.AddToConstraintCollectionSetup (this); //may throw if it can't setup
-
-                       //if name is null or empty give it a name
-                       if (constraint.ConstraintName == null || constraint.ConstraintName == "")
-                               constraint.ConstraintName = _createNewConstraintName ();
-
-                       //Add event handler for ConstraintName change
-                       constraint.BeforeConstraintNameChange += new DelegateConstraintNameChange (_handleBeforeConstraintNameChange);
-
-                       constraint.ConstraintCollection = this;
-                       List.Add (constraint);
-
-                       if (constraint is UniqueConstraint && ((UniqueConstraint) constraint).IsPrimaryKey)
-                               table.PrimaryKey = ((UniqueConstraint) constraint).Columns;
-
-                       OnCollectionChanged (new CollectionChangeEventArgs (CollectionChangeAction.Add, this));
-               }
-
-               public
-               Constraint Add (string name, DataColumn column, bool primaryKey)
-               {
-                       UniqueConstraint uc = new UniqueConstraint (name, column, primaryKey);
-                       Add (uc);
-                       return uc;
-               }
-
-               public
-               Constraint Add (string name, DataColumn primaryKeyColumn, DataColumn foreignKeyColumn)
-               {
-                       ForeignKeyConstraint fc = new ForeignKeyConstraint (name, primaryKeyColumn, foreignKeyColumn);
-                       Add (fc);
-                       return fc;
-               }
-
-               public
-               Constraint Add (string name, DataColumn[] columns, bool primaryKey)
-               {
-                       UniqueConstraint uc = new UniqueConstraint (name, columns, primaryKey);
-                       Add (uc);
-                       return uc;
-               }
-
-               public
-               Constraint Add (string name, DataColumn[] primaryKeyColumns, DataColumn[] foreignKeyColumns)
-               {
-                       ForeignKeyConstraint fc = new ForeignKeyConstraint (name, primaryKeyColumns, foreignKeyColumns);
-                       Add (fc);
-                       return fc;
-               }
-
-               public void AddRange (Constraint[] constraints)
-               {
-                       //When AddRange() occurs after BeginInit,
-                       //it does not add any elements to the collection until EndInit is called.
-                       if (Table.InitInProgress) {
-                               // Keep reference so that they can be added when EndInit() is called.
-                               _mostRecentConstraints = constraints;
-                               return;
-                       }
-
-                       if (constraints == null)
-                               return;
-
-                       for (int i = 0; i < constraints.Length; ++i) {
-                               if (constraints [i] != null)
-                                       Add (constraints [i]);
-                       }
-               }
-
-               // Helper AddRange() - Call this function when EndInit is called
-               // keeps track of the Constraints most recently added and adds them
-               // to the collection
-               internal void PostAddRange ()
-               {
-                       if (_mostRecentConstraints == null)
-                               return;
-
-                       // Check whether the constraint is Initialized
-                       // If not, initialize before adding to collection
-                       for (int i = 0; i < _mostRecentConstraints.Length; i++) {
-                               Constraint c = _mostRecentConstraints [i];
-                               if (c == null)
-                                       continue;
-                               if (c.InitInProgress)
-                                       c.FinishInit (Table);
-                               Add (c);
-                       }
-                       _mostRecentConstraints = null;
-               }
-
-               public bool CanRemove (Constraint constraint)
-               {
-                       return constraint.CanRemoveFromCollection (this, false);
-               }
-
-               public void Clear ()
-               {
-                       // Clear should also remove PrimaryKey
-                       Table.PrimaryKey = null;
-
-                       //CanRemove? See Lamespec below.
-                       //the Constraints have a reference to us
-                       //and we listen to name change events
-                       //we should remove these before clearing
-                       foreach (Constraint con in List) {
-                               con.ConstraintCollection = null;
-                               con.BeforeConstraintNameChange -= new DelegateConstraintNameChange (_handleBeforeConstraintNameChange);
-                       }
-
-                       //LAMESPEC: MSFT implementation allows this
-                       //even when a ForeignKeyConstraint exist for a UniqueConstraint
-                       //thus violating the CanRemove logic
-                       //CanRemove will throws Exception incase of the above
-                       List.Clear (); //Will violate CanRemove rule
-                       OnCollectionChanged (new CollectionChangeEventArgs (CollectionChangeAction.Refresh, this));
-               }
-
-               public bool Contains (string name)
-               {
-                       return -1 != IndexOf (name);
-               }
-
-               public int IndexOf (Constraint constraint)
-               {
-                       int index = 0;
-                       foreach (Constraint c in this) {
-                               if (c == constraint)
-                                       return index;
-                               index++;
-                       }
-                       return -1;
-               }
-
-               public
-               int IndexOf (string constraintName)
-               {
-                       //LAMESPEC: Spec doesn't say case insensitive
-                       //it should to be consistant with the other
-                       //case insensitive comparisons in this class
-
-                       int index = 0;
-                       foreach (Constraint con in List) {
-                               if (String.Compare (constraintName, con.ConstraintName, !Table.CaseSensitive, Table.Locale) == 0)
-                                       return index;
-                               index++;
-                       }
-                       return -1; //not found
-               }
-
-               public void Remove (Constraint constraint)
-               {
-                       //LAMESPEC: spec doesn't document the ArgumentException the
-                       //will be thrown if the CanRemove rule is violated
-
-                       //LAMESPEC: spec says an exception will be thrown
-                       //if the element is not in the collection. The implementation
-                       //doesn't throw an exception. ArrayList.Remove doesn't throw if the
-                       //element doesn't exist
-                       //ALSO the overloaded remove in the spec doesn't say it throws any exceptions
-
-                       //not null
-                       if (null == constraint)
-                               throw new ArgumentNullException();
-
-                       if (!constraint.CanRemoveFromCollection (this, true))
-                               return;
-
-                       constraint.RemoveFromConstraintCollectionCleanup (this);
-                       constraint.ConstraintCollection = null;
-                       List.Remove (constraint);
-                       OnCollectionChanged (new CollectionChangeEventArgs (CollectionChangeAction.Remove, this));
-               }
-
-               public void Remove (string name)
-               {
-                       int index = IndexOf (name);
-                       if (-1 == index)
-                               throw new ArgumentException ("Constraint '" + name + "' does not belong to this DataTable.");
-
-                       Remove (this [index]);
-               }
-
-               public void RemoveAt(int index)
-               {
-                       Remove (this [index]);
-               }
-
-               protected override ArrayList List {
-                       get { return base.List; }
-               }
-
-
-               internal
-               void OnCollectionChanged (CollectionChangeEventArgs ccevent)
-               {
-                       if (null != CollectionChanged)
-                               CollectionChanged(this, ccevent);
-               }
-       }
-
-       sealed partial class ConstraintCollection {
-               public void CopyTo (Constraint [] array, int index)
-               {
-                       base.CopyTo (array, index);
-               }
-       }
-}
diff --git a/mcs/class/System.Data/System.Data/ConstraintConverter.cs b/mcs/class/System.Data/System.Data/ConstraintConverter.cs
deleted file mode 100644 (file)
index 22b6fac..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-//
-// System.Data.ConstraintConverter.cs
-//
-// Author:
-//   Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//
-// (C) 2004 Andreas Nahr
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Globalization;
-using System.ComponentModel;
-
-namespace System.Data
-{
-       internal sealed class ConstraintConverter : ExpandableObjectConverter
-       {
-               [MonoTODO]
-               public ConstraintConverter ()
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               public override object ConvertTo (ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               public override bool CanConvertTo (ITypeDescriptorContext context, Type destinationType)
-               {
-                       throw new NotImplementedException ();
-               }
-       }
-}
diff --git a/mcs/class/System.Data/System.Data/ConstraintException.cs b/mcs/class/System.Data/System.Data/ConstraintException.cs
deleted file mode 100644 (file)
index 393e595..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-//
-// System.Data.ConstraintException.cs
-//
-// Author: Duncan Mak  (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System.Data
-{
-       [Serializable]
-       public class ConstraintException : DataException
-       {
-               public ConstraintException ()
-                       : base (Locale.GetText ("This operation violates a constraint"))
-               {
-               }
-
-               public ConstraintException (string s) : base (s)
-               {
-               }
-
-               public ConstraintException (string message, Exception innerException)
-                       : base (message, innerException)
-               {
-               }
-
-               protected ConstraintException (SerializationInfo info, StreamingContext context)
-                       : base (info, context)
-               {
-               }
-       }
-}
diff --git a/mcs/class/System.Data/System.Data/CustomDataClassGenerator.cs b/mcs/class/System.Data/System.Data/CustomDataClassGenerator.cs
deleted file mode 100644 (file)
index 23e0d00..0000000
+++ /dev/null
@@ -1,2584 +0,0 @@
-//
-// Mono.Data.CustomDataClassGenerator
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// (C)2004 Novell Inc.
-//
-// API notes are the bottom of the source.
-//
-// This class is standalone testable (even under MS.NET) when compiled with
-// -d:DATACLASS_GENERATOR_STANDALONE .
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.Xml;
-using System.Data;
-using System.Data.Common;
-using System.Collections;
-using System.CodeDom;
-using System.Globalization;
-using System.Text;
-using System.CodeDom.Compiler;
-using System.ComponentModel;
-using System.Runtime.Serialization;
-using System.Xml.Schema;
-using System.Xml.Serialization;
-using System.Reflection;
-
-// only for Driver
-using Microsoft.CSharp;
-using System.IO;
-
-namespace System.Data
-{
-
-#if DATACLASS_GENERATOR_STANDALONE
-       public class Driver
-       {
-               public static void Main (string [] args)
-               {
-                       try {
-                               if (args.Length < 1) {
-                                       Console.WriteLine ("mono dsgentest.exe filename");
-                                       return;
-                               }
-
-                               DataSet ds = new DataSet ();
-                               ds.ReadXml (args [0]);
-                               ICodeGenerator gen = new CSharpCodeProvider ().CreateGenerator ();
-
-                               CodeNamespace cns = new CodeNamespace ("MyNamespace");
-                               TextWriter tw = new StreamWriter (Path.ChangeExtension (args [0], ".ms.cs"), false, Encoding.Default);
-                               TypedDataSetGenerator.Generate (ds, cns, gen);
-                               gen.GenerateCodeFromNamespace (cns, tw, null);
-                               tw.Close ();
-
-                               cns = new CodeNamespace ("MyNamespace");
-                               tw = new StreamWriter (Path.ChangeExtension (args [0], ".mono.cs"), false, Encoding.Default);
-                               CustomDataClassGenerator.CreateDataSetClasses (ds, cns, gen, null);
-                               gen.GenerateCodeFromNamespace (cns, tw, null);
-                               tw.Close ();
-                       } catch (Exception ex) {
-                               Console.WriteLine (ex);
-                       }
-               }
-       }
-#endif
-
-#if DATACLASS_GENERATOR_STANDALONE
-       public class CustomDataClassGenerator
-#else
-       internal class CustomDataClassGenerator
-#endif
-       {
-               public static void CreateDataSetClasses (DataSet ds,
-                       CodeNamespace cns, ICodeGenerator gen,
-                       ClassGeneratorOptions options)
-               {
-                       new Generator (ds, cns, gen, options).Run ();
-               }
-
-               public static void CreateDataSetClasses (DataSet ds,
-                       CodeNamespace cns, CodeDomProvider codeProvider,
-                       ClassGeneratorOptions options)
-               {
-                       new Generator (ds, cns, codeProvider, options).Run ();
-               }
-
-               public static void CreateDataSetClasses (DataSet ds, 
-                                                        CodeCompileUnit cunit, 
-                                                        CodeNamespace cns, 
-                                                        CodeDomProvider codeProvider, 
-                                                        ClassGeneratorOptions options)
-               {
-                       new Generator (ds, cunit, cns, codeProvider, options).Run ();
-               }
-               public static string MakeSafeName (string name, ICodeGenerator codeGen)
-               {
-                       if (name == null || codeGen == null)
-                               throw new NullReferenceException ();
-
-                       name = codeGen.CreateValidIdentifier (name);
-
-                       return MakeSafeNameInternal (name);
-               }
-               
-               public static string MakeSafeName (string name, CodeDomProvider provider)
-               {
-                       if (name == null || provider == null)
-                               throw new NullReferenceException ();
-
-                       name = provider.CreateValidIdentifier (name);
-
-                       return MakeSafeNameInternal (name);
-               }
-               
-               public static string MakeSafeNameInternal (string name)
-               {
-                       if (name.Length == 0)
-                               return "_";
-
-                       StringBuilder sb = null;
-                       if (!Char.IsLetter (name, 0) && name [0] != '_') {
-                               sb = new StringBuilder ();
-                               sb.Append ('_');
-                       }
-
-                       int start = 0;
-                       for (int i = 0; i < name.Length; i++) {
-                               if (!Char.IsLetterOrDigit (name, i)) {
-                                       if (sb == null)
-                                               sb = new StringBuilder ();
-                                       sb.Append (name, start, i - start);
-                                       sb.Append ('_');
-                                       start = i + 1;
-                               }
-                       }
-
-                       if (sb != null) {
-                               sb.Append (name, start, name.Length - start);
-                               return sb.ToString ();
-                       }
-                       else
-                               return name;
-               }
-       }
-
-#if DATACLASS_GENERATOR_STANDALONE
-       public delegate string CodeNamingMethod (string source, ICodeGenerator gen);
-#else
-       internal delegate string CodeNamingMethod (string source, ICodeGenerator gen);
-#endif
-
-#if DATACLASS_GENERATOR_STANDALONE
-       public delegate string CodeDomNamingMethod (string source, CodeDomProvider provider);
-#else
-       internal delegate string CodeDomNamingMethod (string source, CodeDomProvider provider);
-#endif 
-       
-#if DATACLASS_GENERATOR_STANDALONE
-       public class ClassICodeGeneratorOptions : ClassGeneratorOptions
-#else
-       internal class ClassICodeGeneratorOptions : ClassGeneratorOptions
-#endif
-       {
-               ICodeGenerator gen;
-               
-               public CodeNamingMethod CreateDataSetName;
-               public CodeNamingMethod CreateTableTypeName;
-               public CodeNamingMethod CreateTableMemberName;
-               public CodeNamingMethod CreateTableColumnName;
-               public CodeNamingMethod CreateColumnName;
-               public CodeNamingMethod CreateRowName;
-               public CodeNamingMethod CreateRelationName;
-               public CodeNamingMethod CreateTableDelegateName;
-               public CodeNamingMethod CreateEventArgsName;
-               public CodeNamingMethod CreateTableAdapterNSName;
-               public CodeNamingMethod CreateTableAdapterName;
-
-               public ClassICodeGeneratorOptions (ICodeGenerator codeGen)
-               {
-                       this.gen = codeGen;
-               }
-               
-               internal override string DataSetName (string source)
-               {
-                       if (CreateDataSetName != null)
-                               return CreateDataSetName (source, gen);
-                       else
-                               return CustomDataClassGenerator.MakeSafeName (source, gen);
-               }
-
-               internal override string TableTypeName (string source)
-               {
-                       if (CreateTableTypeName != null)
-                               return CreateTableTypeName (source, gen);
-                       else
-                               return CustomDataClassGenerator.MakeSafeName (source, gen) + "DataTable";
-               }
-
-               internal override string TableMemberName (string source)
-               {
-                       if (CreateTableMemberName != null)
-                               return CreateTableMemberName (source, gen);
-                       else
-                               return CustomDataClassGenerator.MakeSafeName (source, gen);
-               }
-
-               internal override string TableColName (string source)
-               {
-                       if (CreateTableColumnName != null)
-                               return CreateTableColumnName (source, gen);
-                       else
-                               return CustomDataClassGenerator.MakeSafeName (source, gen);
-               }
-
-               internal override string TableDelegateName (string source)
-               {
-                       if (CreateTableDelegateName != null)
-                               return CreateTableDelegateName (source, gen);
-                       else
-                               return CustomDataClassGenerator.MakeSafeName (source, gen) + "RowChangedEventHandler";
-               }
-
-               internal override string EventArgsName (string source)
-               {
-                       if (CreateEventArgsName != null)
-                               return CreateEventArgsName (source, gen);
-                       else
-                               return CustomDataClassGenerator.MakeSafeName (source, gen) + "RowChangedEventArgs";
-               }
-
-               internal override string ColumnName (string source)
-               {
-                       if (CreateColumnName != null)
-                               return CreateColumnName (source, gen);
-                       else
-                               return CustomDataClassGenerator.MakeSafeName (source, gen);
-               }
-
-               internal override string RowName (string source)
-               {
-                       if (CreateRowName != null)
-                               return CreateRowName (source, gen);
-                       else
-                               return CustomDataClassGenerator.MakeSafeName (source, gen) + "Row";
-               }
-
-               internal override string RelationName (string source)
-               {
-                       if (CreateRelationName != null)
-                               return CreateRelationName (source, gen);
-                       else
-                               return CustomDataClassGenerator.MakeSafeName (source, gen) + "Relation";
-               }
-
-               internal override string TableAdapterNSName (string source)
-               {
-                       if (CreateTableAdapterNSName != null)
-                               return CreateTableAdapterNSName (source, gen);
-                       else
-                               return CustomDataClassGenerator.MakeSafeName (source, gen) + "TableAdapters";
-               }
-               
-               internal override string TableAdapterName (string source)
-               {
-                       if (CreateTableAdapterName != null)
-                               return CreateTableAdapterName (source, gen);
-                       else
-                               return CustomDataClassGenerator.MakeSafeName (source, gen);
-               }
-       }
-       
-#if DATACLASS_GENERATOR_STANDALONE
-       public class ClassCodeDomProviderOptions : ClassGeneratorOptions
-#else
-       internal class ClassCodeDomProviderOptions : ClassGeneratorOptions
-#endif
-       {
-               CodeDomProvider provider;
-               
-               public CodeDomNamingMethod CreateDataSetName;
-               public CodeDomNamingMethod CreateTableTypeName;
-               public CodeDomNamingMethod CreateTableMemberName;
-               public CodeDomNamingMethod CreateTableColumnName;
-               public CodeDomNamingMethod CreateColumnName;
-               public CodeDomNamingMethod CreateRowName;
-               public CodeDomNamingMethod CreateRelationName;
-               public CodeDomNamingMethod CreateTableDelegateName;
-               public CodeDomNamingMethod CreateEventArgsName;                 
-               public CodeDomNamingMethod CreateTableAdapterNSName;
-               public CodeDomNamingMethod CreateTableAdapterName;
-               
-               public ClassCodeDomProviderOptions (CodeDomProvider codeProvider)
-               {
-                       this.provider = codeProvider;
-               }
-               
-               internal override string DataSetName (string source)
-               {
-                       if (CreateDataSetName != null)
-                               return CreateDataSetName (source, provider);
-                       else
-                               return CustomDataClassGenerator.MakeSafeName (source, provider);
-               }
-
-               internal override string TableTypeName (string source)
-               {
-                       if (CreateTableTypeName != null)
-                               return CreateTableTypeName (source, provider);
-                       else
-                               return CustomDataClassGenerator.MakeSafeName (source, provider) + "DataTable";
-               }
-
-               internal override string TableMemberName (string source)
-               {
-                       if (CreateTableMemberName != null)
-                               return CreateTableMemberName (source, provider);
-                       else
-                               return CustomDataClassGenerator.MakeSafeName (source, provider);
-               }
-
-               internal override string TableColName (string source)
-               {
-                       if (CreateTableColumnName != null)
-                               return CreateTableColumnName (source, provider);
-                       else
-                               return CustomDataClassGenerator.MakeSafeName (source, provider);
-               }
-
-               internal override string TableDelegateName (string source)
-               {
-                       if (CreateTableDelegateName != null)
-                               return CreateTableDelegateName (source, provider);
-                       else
-                               return CustomDataClassGenerator.MakeSafeName (source, provider) + "RowChangedEventHandler";
-               }
-
-               internal override string EventArgsName (string source)
-               {
-                       if (CreateEventArgsName != null)
-                               return CreateEventArgsName (source, provider);
-                       else
-                               return CustomDataClassGenerator.MakeSafeName (source, provider) + "RowChangedEventArgs";
-               }
-
-               internal override string ColumnName (string source)
-               {
-                       if (CreateColumnName != null)
-                               return CreateColumnName (source, provider);
-                       else
-                               return CustomDataClassGenerator.MakeSafeName (source, provider);
-               }
-
-               internal override string RowName (string source)
-               {
-                       if (CreateRowName != null)
-                               return CreateRowName (source, provider);
-                       else
-                               return CustomDataClassGenerator.MakeSafeName (source, provider) + "Row";
-               }
-
-               internal override string RelationName (string source)
-               {
-                       if (CreateRelationName != null)
-                               return CreateRelationName (source, provider);
-                       else
-                               return CustomDataClassGenerator.MakeSafeName (source, provider) + "Relation";
-               }
-
-               internal override string TableAdapterNSName (string source)
-               {
-                       if (CreateTableAdapterNSName != null)
-                               return CreateTableAdapterNSName (source, provider);
-                       else
-                               return CustomDataClassGenerator.MakeSafeName (source, provider) + "TableAdapters";
-               }
-
-               internal override string TableAdapterName (string source)
-               {
-                       if (CreateTableAdapterName != null)
-                               return CreateTableAdapterName (source, provider);
-                       else
-                               return CustomDataClassGenerator.MakeSafeName (source, provider);
-               }               
-       }
-       
-#if DATACLASS_GENERATOR_STANDALONE
-       public abstract class ClassGeneratorOptions
-#else
-       internal abstract class ClassGeneratorOptions
-#endif
-       {
-               public bool MakeClassesInsideDataSet = true; // default = MS compatible
-               
-               internal abstract string DataSetName (string source);
-               internal abstract string TableTypeName (string source);
-               internal abstract string TableMemberName (string source);
-               internal abstract string TableColName (string source);
-               internal abstract string TableDelegateName (string source);
-               internal abstract string EventArgsName (string source);
-               internal abstract string ColumnName (string source);
-               internal abstract string RowName (string source);
-               internal abstract string RelationName (string source);
-               internal abstract string TableAdapterNSName (string source);
-               internal abstract string TableAdapterName (string source);
-       }
-
-       internal class Generator
-       {
-//             static ClassGeneratorOptions DefaultOptions = new ClassGeneratorOptions ();
-
-               DataSet ds;
-               CodeNamespace cns;
-               ClassGeneratorOptions opts;
-               CodeCompileUnit cunit;
-
-               CodeTypeDeclaration dsType;
-
-               public Generator (DataSet ds, CodeNamespace cns, ICodeGenerator codeGen, ClassGeneratorOptions options)
-               {
-                       this.ds = ds;
-                       this.cns = cns;
-                       this.opts = options;
-                       this.cunit = null;
-                       if (opts == null)
-                               opts = new ClassICodeGeneratorOptions (codeGen);
-               }
-               public Generator (DataSet ds, CodeNamespace cns, CodeDomProvider codeProvider, 
-                                 ClassGeneratorOptions options)
-               {
-                       this.ds = ds;
-                       this.cns = cns;
-                       this.opts = options;
-                       this.cunit = null;
-                       if (opts == null)
-                               opts = new ClassCodeDomProviderOptions (codeProvider);                  
-               }
-
-               public Generator (DataSet ds, CodeCompileUnit cunit, CodeNamespace cns, 
-                                 CodeDomProvider codeProvider, ClassGeneratorOptions options)
-               {
-                       this.ds = ds;
-                       this.cns = cns;
-                       this.opts = options;
-                       this.cunit = cunit;
-                       if (opts == null)
-                               opts = new ClassCodeDomProviderOptions (codeProvider);
-               }
-               public void Run ()
-               {
-                       // using decls
-                       cns.Imports.Add (new CodeNamespaceImport ("System"));
-                       cns.Imports.Add (new CodeNamespaceImport ("System.Collections"));
-                       cns.Imports.Add (new CodeNamespaceImport ("System.ComponentModel"));
-                       cns.Imports.Add (new CodeNamespaceImport ("System.Data"));
-                       cns.Imports.Add (new CodeNamespaceImport ("System.Runtime.Serialization"));
-                       cns.Imports.Add (new CodeNamespaceImport ("System.Xml"));
-
-
-                       CodeTypeDeclaration dsType = GenerateDataSetType ();
-                       cns.Types.Add (dsType);
-
-                       foreach (DataTable dt in ds.Tables) {
-                               // 1. table types ([foo]DataTable)
-                               // 2. row types ([foo]Row)
-                               // 3. delegates ([foo]RowChangedEventHandler)
-                               // 4. eventargs ([foo]RowChangeEventArgs)
-
-                               CodeTypeDeclaration dtType = GenerateDataTableType (dt);
-
-                               CodeTypeDeclaration dtRow = GenerateDataRowType (dt);
-
-                               CodeTypeDelegate dtDelegate = new CodeTypeDelegate (opts.TableDelegateName (dt.TableName));
-                               dtDelegate.Parameters.Add (Param (typeof (object), "o"));
-                               dtDelegate.Parameters.Add (Param (opts.EventArgsName (dt.TableName), "e"));
-
-                               CodeTypeDeclaration dtEventType = GenerateEventType (dt);
-
-                               // Add types to either DataSet or CodeNamespace
-                               if (opts.MakeClassesInsideDataSet) {
-                                       dsType.Members.Add (dtType);
-                                       dsType.Members.Add (dtRow);
-                                       dsType.Members.Add (dtDelegate);
-                                       dsType.Members.Add (dtEventType);
-                               }
-                               else {
-                                       cns.Types.Add (dtType);
-                                       cns.Types.Add (dtRow);
-                                       cns.Types.Add (dtDelegate);
-                                       cns.Types.Add (dtEventType);
-                               }
-                       }
-
-                       if (cunit == null)
-                               return;
-                       
-                       TableAdapterSchemaInfo adapterInfo = ds.TableAdapterSchemaData;
-                       if (adapterInfo != null) {
-                               // #325464 debugging
-                               //Console.WriteLine (opts.TableAdapterNSName(opts.DataSetName (ds.DataSetName)));
-                               CodeNamespace cnsTA = new CodeNamespace (opts.TableAdapterNSName(opts.DataSetName (ds.DataSetName)));
-                               CodeTypeDeclaration dtAdapter = GenerateTableAdapterType (adapterInfo);
-                               cnsTA.Types.Add (dtAdapter);
-                               cunit.Namespaces.Add (cnsTA);
-                       }
-               }
-               
-               private CodeThisReferenceExpression This ()
-               {
-                       return new CodeThisReferenceExpression ();
-               }
-
-               private CodeBaseReferenceExpression Base ()
-               {
-                       return new CodeBaseReferenceExpression ();
-               }
-
-               private CodePrimitiveExpression Const (object value)
-               {
-                       return new CodePrimitiveExpression (value);
-               }
-
-               private CodeTypeReference TypeRef (Type t)
-               {
-                       return new CodeTypeReference (t);
-               }
-
-               private CodeTypeReference TypeRef (string name)
-               {
-                       return new CodeTypeReference (name);
-               }
-
-               private CodeTypeReference TypeRefArray (Type t, int dimension)
-               {
-                       return new CodeTypeReference (TypeRef (t), dimension);
-               }
-
-               private CodeTypeReference TypeRefArray (string name, int dimension)
-               {
-                       return new CodeTypeReference (TypeRef (name), dimension);
-               }
-               
-               private CodeParameterDeclarationExpression Param (string t, string name)
-               {
-                       return new CodeParameterDeclarationExpression (t, name);
-               }
-
-               private CodeParameterDeclarationExpression Param (Type t, string name)
-               {
-                       return new CodeParameterDeclarationExpression (t, name);
-               }
-
-               private CodeParameterDeclarationExpression Param (CodeTypeReference t, string name)
-               {
-                       return new CodeParameterDeclarationExpression (t, name);
-               }
-
-               private CodeArgumentReferenceExpression ParamRef (string name)
-               {
-                       return new CodeArgumentReferenceExpression (name);
-               }
-
-               private CodeCastExpression Cast (string t, CodeExpression exp)
-               {
-                       return new CodeCastExpression (t, exp);
-               }
-
-               private CodeCastExpression Cast (Type t, CodeExpression exp)
-               {
-                       return new CodeCastExpression (t, exp);
-               }
-
-               private CodeCastExpression Cast (CodeTypeReference t, CodeExpression exp)
-               {
-                       return new CodeCastExpression (t, exp);
-               }
-
-               private CodeExpression New (Type t, params CodeExpression [] parameters)
-               {
-                       return new CodeObjectCreateExpression (t, parameters);
-               }
-
-               private CodeExpression New (string t, params CodeExpression [] parameters)
-               {
-                       return new CodeObjectCreateExpression (TypeRef (t), parameters);
-               }
-
-               private CodeExpression NewArray (Type t, params CodeExpression [] parameters)
-               {
-                       return new CodeArrayCreateExpression (t, parameters);
-               }
-
-               private CodeExpression NewArray (Type t, int size )
-               {
-                       return new CodeArrayCreateExpression (t, size);
-               }
-
-               private CodeVariableReferenceExpression Local (string name)
-               {
-                       return new CodeVariableReferenceExpression (name);
-               }
-
-               private CodeFieldReferenceExpression FieldRef (string name)
-               {
-                       return new CodeFieldReferenceExpression (new CodeThisReferenceExpression (), name);
-               }
-
-               private CodeFieldReferenceExpression FieldRef (CodeExpression exp, string name)
-               {
-                       return new CodeFieldReferenceExpression (exp, name);
-               }
-
-               private CodePropertyReferenceExpression PropRef (string name)
-               {
-                       return new CodePropertyReferenceExpression (new CodeThisReferenceExpression (), name);
-               }
-
-               private CodePropertyReferenceExpression PropRef (CodeExpression target, string name)
-               {
-                       return new CodePropertyReferenceExpression (target, name);
-               }
-
-               private CodeIndexerExpression IndexerRef (CodeExpression target, CodeExpression parameters)
-               {
-                       return new CodeIndexerExpression (target, parameters);
-               }
-
-               private CodeIndexerExpression IndexerRef (CodeExpression param)
-               {
-                       return new CodeIndexerExpression (new CodeThisReferenceExpression (), param);
-               }
-
-               private CodeEventReferenceExpression EventRef (string name)
-               {
-                       return new CodeEventReferenceExpression (new CodeThisReferenceExpression (), name);
-               }
-
-               private CodeEventReferenceExpression EventRef (CodeExpression target, string name)
-               {
-                       return new CodeEventReferenceExpression (target, name);
-               }
-
-               private CodeMethodInvokeExpression MethodInvoke (string name, params CodeExpression [] parameters)
-               {
-                       return new CodeMethodInvokeExpression (new CodeThisReferenceExpression (), name, parameters);
-               }
-
-               private CodeMethodInvokeExpression MethodInvoke (CodeExpression target, string name, params CodeExpression [] parameters)
-               {
-                       return new CodeMethodInvokeExpression (target, name, parameters);
-               }
-
-               private CodeBinaryOperatorExpression EqualsValue (CodeExpression exp1, CodeExpression exp2)
-               {
-                       return new CodeBinaryOperatorExpression (exp1, CodeBinaryOperatorType.ValueEquality, exp2);
-               }
-
-               // note that this is "Identity" equality comparison
-               private CodeBinaryOperatorExpression Equals (CodeExpression exp1, CodeExpression exp2)
-               {
-                       return new CodeBinaryOperatorExpression (exp1, CodeBinaryOperatorType.IdentityEquality, exp2);
-               }
-
-               private CodeBinaryOperatorExpression Inequals (CodeExpression exp1, CodeExpression exp2)
-               {
-                       return new CodeBinaryOperatorExpression (exp1, CodeBinaryOperatorType.IdentityInequality, exp2);
-               }
-
-               private CodeBinaryOperatorExpression GreaterThan (CodeExpression exp1, CodeExpression exp2)
-               {
-                       return new CodeBinaryOperatorExpression (exp1, CodeBinaryOperatorType.GreaterThan, exp2);
-               }
-
-               private CodeBinaryOperatorExpression LessThan (CodeExpression exp1, CodeExpression exp2)
-               {
-                       return new CodeBinaryOperatorExpression (exp1, CodeBinaryOperatorType.LessThan, exp2);
-               }
-
-               private CodeBinaryOperatorExpression Compute (CodeExpression exp1, CodeExpression exp2, CodeBinaryOperatorType ops)
-               {
-                       if (ops >= CodeBinaryOperatorType.Add && ops < CodeBinaryOperatorType.Assign)
-                               return new CodeBinaryOperatorExpression (exp1, ops, exp2);
-                       else
-                               return null;
-               }
-
-               private CodeBinaryOperatorExpression BitOps (CodeExpression exp1, CodeExpression exp2, CodeBinaryOperatorType ops)
-               {
-                       if (ops >= CodeBinaryOperatorType.BitwiseOr && ops <= CodeBinaryOperatorType.BitwiseAnd)
-                               return new CodeBinaryOperatorExpression (exp1, ops, exp2);
-                       else
-                               return null;
-               }
-               
-               private CodeBinaryOperatorExpression BooleanOps (CodeExpression exp1, CodeExpression exp2, CodeBinaryOperatorType ops)
-               {
-                       if (ops >= CodeBinaryOperatorType.BooleanOr && ops <= CodeBinaryOperatorType.BooleanAnd)
-                               return new CodeBinaryOperatorExpression (exp1, ops, exp2);
-                       else
-                               return null;
-               }
-
-               private CodeTypeReferenceExpression TypeRefExp (Type t)
-               {
-                       return new CodeTypeReferenceExpression (t);
-               }
-
-               private CodeTypeOfExpression TypeOfRef (string name)
-               {
-                       return new CodeTypeOfExpression (TypeRef (name));
-               }
-
-               private CodeExpressionStatement Eval (CodeExpression exp)
-               {
-                       return new CodeExpressionStatement (exp);
-               }
-
-               private CodeAssignStatement Let (CodeExpression exp, CodeExpression value)
-               {
-                       return new CodeAssignStatement (exp, value);
-               }
-
-               private CodeMethodReturnStatement Return (CodeExpression exp)
-               {
-                       return new CodeMethodReturnStatement (exp);
-               }
-
-               private CodeVariableDeclarationStatement VarDecl (Type t,
-                       string name, CodeExpression init)
-               {
-                       return new CodeVariableDeclarationStatement (t, name, init);
-               }
-
-               private CodeVariableDeclarationStatement VarDecl (string t,
-                       string name, CodeExpression init)
-               {
-                       return new CodeVariableDeclarationStatement (t, name, init);
-               }
-
-               private CodeCommentStatement Comment (string comment)
-               {
-                       return new CodeCommentStatement (comment);
-               }
-
-               private CodeThrowExceptionStatement Throw (CodeExpression exp)
-               {
-                       return new CodeThrowExceptionStatement (exp);
-               }
-
-#region DataSet class
-
-               private CodeTypeDeclaration GenerateDataSetType ()
-               {
-                       // Type
-                       dsType = new CodeTypeDeclaration (opts.DataSetName (ds.DataSetName));
-                       dsType.BaseTypes.Add (TypeRef (typeof (DataSet)));
-                       dsType.BaseTypes.Add (TypeRef (typeof (IXmlSerializable)));
-
-                       // .ctor()
-                       dsType.Members.Add (CreateDataSetDefaultCtor ());
-                       // runtime serialization .ctor()
-                       dsType.Members.Add (CreateDataSetSerializationCtor ());
-
-                       // Clone()
-                       dsType.Members.Add (CreateDataSetCloneMethod (dsType));
-
-// FIXME: I keep these methods out of the generated source right now.
-// It should be added after runtime serialization was implemented.
-/*
-                       // ShouldSerializeTables()
-                       dsType.Members.Add (CreateDataSetShouldSerializeTables ());
-
-                       // ShouldSerializeRelations()
-                       dsType.Members.Add (CreateDataSetShouldSerializeRelations ());
-
-                       // ReadXmlSerializable()
-                       dsType.Members.Add (CreateDataSetReadXmlSerializable ());
-*/
-
-                       // GetSchemaSerializable()
-                       dsType.Members.Add (CreateDataSetGetSchemaSerializable ());
-
-                       dsType.Members.Add (CreateDataSetGetSchema ());
-                       dsType.Members.Add (CreateDataSetInitializeClass ());
-                       dsType.Members.Add (CreateDataSetInitializeFields ());
-                       dsType.Members.Add (CreateDataSetSchemaChanged ());
-
-                       // table class and members
-                       foreach (DataTable table in ds.Tables)
-                               CreateDataSetTableMembers (dsType, table);
-                       // relation class and members
-                       foreach (DataRelation rel in ds.Relations)
-                               CreateDataSetRelationMembers (dsType, rel);
-
-                       return dsType;
-               }
-
-               // Code:
-               // public Foo ()
-               // {
-               //   InitializeClass();
-               //   CollectionChangeEventHandler handler = new CollectionChangeEventHandler (SchemaChanged);
-               //   Tables.CollectionChanged += handler;
-               //   Relations.CollectionChanged += handler;
-               // }
-               private CodeConstructor CreateDataSetDefaultCtor ()
-               {
-                       CodeConstructor ctor = new CodeConstructor ();
-                       ctor.Attributes = MemberAttributes.Public;
-                       // Code: InitializeClass().
-                       ctor.Statements.Add (Eval (MethodInvoke ("InitializeClass")));
-
-                       // Code: CollectionChangedEventHandler handler = new CollectionChangeEventHandler (SchemeChanged);
-                       CodeVariableDeclarationStatement stmt2 = 
-                               VarDecl (
-                                       typeof (CollectionChangeEventHandler), 
-                                       "handler", 
-                                       New (
-                                               typeof (CollectionChangeEventHandler), 
-                                               new CodeDelegateCreateExpression (
-                                                       new CodeTypeReference (typeof (CollectionChangeEventHandler)),
-                                                       new CodeThisReferenceExpression (), 
-                                                       "SchemaChanged")));
-
-                       ctor.Statements.Add (stmt2);
-
-                       // Code: Tables.CollectionChanged += handler;
-                       ctor.Statements.Add (
-                               new CodeAttachEventStatement (
-                                       EventRef (
-                                               PropRef ("Tables"), 
-                                               "CollectionChanged"),
-                                       Local ("handler")));
-
-                       // Code: Relations.CollectionChanged += handler;
-                       ctor.Statements.Add (
-                               new CodeAttachEventStatement (
-                                       EventRef (
-                                               PropRef ("Relations"), 
-                                               "CollectionChanged"), 
-                                       Local ("handler")));
-
-                       return ctor;
-               }
-
-               // TODO: implement
-
-               // Code:
-               // protected Foo (SerializationInfo info, StreamingContext ctx)
-               // {
-               //   throw new NotImplementedException ();
-               // }
-               private CodeConstructor CreateDataSetSerializationCtor ()
-               {
-                       CodeConstructor ctor = new CodeConstructor ();
-                       ctor.Attributes = MemberAttributes.Family;
-                       ctor.Parameters.Add (Param (typeof (SerializationInfo), "info"));
-                       ctor.Parameters.Add (Param (typeof (StreamingContext), "ctx"));
-
-                       // Code: 
-                       //  // TODO: implement
-                       //  throw new NotImplementedException ();
-                       ctor.Statements.Add (Comment ("TODO: implement"));
-                       ctor.Statements.Add (Throw (New (typeof (NotImplementedException))));
-
-                       return ctor;
-               }
-
-               // Code:
-               //  public override DataSet Clone()
-               //  {
-               //    [foo] set = ([foo]) base.Clone ();
-               //    set.InitializeFields ();
-               //    return set;
-               //  }
-               private CodeMemberMethod CreateDataSetCloneMethod (CodeTypeDeclaration dsType)
-               {
-                       CodeMemberMethod m = new CodeMemberMethod ();
-                       m.ReturnType = TypeRef (typeof (DataSet));
-                       m.Attributes = MemberAttributes.Public | MemberAttributes.Override;
-                       m.Name = "Clone";
-                       // Code: [foo] set = ([foo]) base.Clone ();
-                       CodeVariableReferenceExpression set = Local ("set");
-                       m.Statements.Add (VarDecl (
-                                       dsType.Name,
-                                       "set", 
-                                       Cast (
-                                               dsType.Name,
-                                               MethodInvoke (Base (), "Clone"))));
-                       m.Statements.Add (Eval (MethodInvoke (set, "InitializeFields")));
-                       m.Statements.Add (Return (set));
-                       return m;
-               }
-
-               // Code:
-               // protected override bool ShouldSerializeTables ()
-               // {
-               //   return true; // it should be false
-               // }
-               /*
-               private CodeMemberMethod CreateDataSetShouldSerializeTables ()
-               {
-                       CodeMemberMethod m = new CodeMemberMethod ();
-                       m.Name = "ShouldSerializeTables";
-                       m.ReturnType = TypeRef (typeof (bool));
-                       m.Attributes = MemberAttributes.Family | MemberAttributes.Override;
-                       // FIXME: set "false" after serialization .ctor() implementation
-                       m.Statements.Add (Return (Const (true)));
-                       return m;
-               }
-               */
-               // Code:
-               // protected override bool ShouldSerializeRelations ()
-               // {
-               //   return true; // it should be false
-               // }
-               
-               /*
-               private CodeMemberMethod CreateDataSetShouldSerializeRelations ()
-               {
-                       CodeMemberMethod m = new CodeMemberMethod ();
-                       m.Name = "ShouldSerializeRelations";
-                       m.ReturnType = TypeRef (typeof (bool));
-                       m.Attributes = MemberAttributes.Family | MemberAttributes.Override;
-                       // FIXME: set "false" after serialization .ctor() implementation
-                       m.Statements.Add (Return (Const (true)));
-                       return m;
-               }
-               */
-
-               // Code:
-               // protected override void ReadXmlSerializable()
-               // {
-               //   // TODO: implement
-               //   throw new NotImplementedException ();
-               // }
-               /*
-               private CodeMemberMethod CreateDataSetReadXmlSerializable ()
-               {
-                       CodeMemberMethod method = new CodeMemberMethod ();
-                       method.Name = "ReadXmlSerializable";
-                       method.Attributes = MemberAttributes.Family | MemberAttributes.Override;
-                       method.Parameters.Add (Param (TypeRef (typeof (XmlReader)), "reader"));
-                       // TODO: implemnet
-                       method.Statements.Add (Comment ("TODO: implement"));
-                       // Hey, how can I specify the constructor to invoke chained ctor with an empty parameter list!?
-                       method.Statements.Add (Throw (New (typeof (NotImplementedException))));
-                       return method;
-               }
-               */
-
-               private CodeMemberMethod CreateDataSetGetSchema ()
-               {
-                       CodeMemberMethod m = new CodeMemberMethod ();
-                       m.PrivateImplementationType = TypeRef (typeof (IXmlSerializable));
-                       m.Name = "GetSchema";
-                       m.ReturnType = TypeRef (typeof (XmlSchema));
-                       m.Statements.Add (Return (MethodInvoke ("GetSchemaSerializable")));
-
-                       return m;
-               }
-
-               private CodeMemberMethod CreateDataSetGetSchemaSerializable ()
-               {
-                       CodeMemberMethod m = new CodeMemberMethod ();
-                       m.Attributes = MemberAttributes.Family | 
-                               MemberAttributes.Override;
-                       m.Name = "GetSchemaSerializable";
-                       m.ReturnType = TypeRef (typeof (XmlSchema));
-
-                       m.Statements.Add (VarDecl (typeof (StringWriter), "sw",
-                               New (typeof (StringWriter))));
-                       m.Statements.Add (Eval (MethodInvoke ("WriteXmlSchema", Local ("sw"))));
-                       m.Statements.Add (Return (MethodInvoke (
-                               TypeRefExp (typeof (XmlSchema)),
-                               "Read",
-                               New (typeof (XmlTextReader),
-                                       New (typeof (StringReader),
-                                               MethodInvoke (Local ("sw"),
-                                                       "ToString"))),
-                               Const (null))));
-
-                       return m;
-               }
-
-               private CodeMemberMethod CreateDataSetInitializeClass ()
-               {
-                       CodeMemberMethod m = new CodeMemberMethod ();
-                       m.Name = "InitializeClass";
-                       m.Attributes = MemberAttributes.Assembly;
-
-                       // dataset properties
-                       m.Statements.Add (Let (PropRef ("DataSetName"), Const (ds.DataSetName)));
-                       m.Statements.Add (Let (PropRef ("Prefix"), Const (ds.Prefix)));
-                       m.Statements.Add (Let (PropRef ("Namespace"), Const (ds.Namespace)));
-                       m.Statements.Add (Let (PropRef ("Locale"), New (typeof (CultureInfo), Const (ds.Locale.Name))));
-                       m.Statements.Add (Let (PropRef ("CaseSensitive"), Const (ds.CaseSensitive)));
-                       m.Statements.Add (Let (PropRef ("EnforceConstraints"), Const (ds.EnforceConstraints)));
-
-                       // table
-                       foreach (DataTable dt in ds.Tables) {
-                               string tableFieldName = "__table" + opts.TableMemberName (dt.TableName);
-                               string tableTypeName = opts.TableTypeName (dt.TableName);
-                               m.Statements.Add (Let (FieldRef (tableFieldName), New (tableTypeName)));
-                               m.Statements.Add (Eval (MethodInvoke (PropRef ("Tables"), "Add", FieldRef (tableFieldName))));
-                       }
-
-                       bool fkcExists = false;
-                       bool ucExists = false;
-                       // First the UniqueConstraints
-                       foreach (DataTable dt in ds.Tables) {
-                               string tname = "__table" + opts.TableMemberName (dt.TableName);
-                               foreach (Constraint c in dt.Constraints) {
-                                       UniqueConstraint uc = c as UniqueConstraint;
-                                       if (uc != null) {
-                                               if (!ucExists) {
-                                                       m.Statements.Add (VarDecl (typeof (UniqueConstraint), "uc", null));
-                                                       ucExists = true;
-                                               }
-                                               CreateUniqueKeyStatements (m, uc, tname);
-                                       }
-                               }
-                       }
-                       // Then the ForeignKeyConstraints
-                       foreach (DataTable dt in ds.Tables) {
-                               string tname = "__table" + opts.TableMemberName (dt.TableName);
-                               foreach (Constraint c in dt.Constraints) {
-                                       ForeignKeyConstraint fkc = c as ForeignKeyConstraint;
-                                       if (fkc != null) {
-                                               if (!fkcExists) {
-                                                       m.Statements.Add (VarDecl (typeof (ForeignKeyConstraint), "fkc", null));
-                                                       fkcExists = true;
-                                               }
-                                               string rtname = "__table" + opts.TableMemberName (fkc.RelatedTable.TableName);
-                                               CreateForeignKeyStatements (m, fkc, tname, rtname);
-                                       }
-                               }
-                       }
-                       // What if other cases? dunno. Just ignore ;-)
-                       foreach (DataRelation rel in ds.Relations) {
-                               string relName = opts.RelationName (rel.RelationName);
-                               ArrayList pcols = new ArrayList ();
-                               foreach (DataColumn pcol in rel.ParentColumns)
-                                       pcols.Add (IndexerRef (PropRef (FieldRef ("__table" + opts.TableMemberName (rel.ParentTable.TableName)), "Columns"), Const (pcol.ColumnName)));
-
-                               ArrayList ccols = new ArrayList ();
-                               foreach (DataColumn ccol in rel.ChildColumns)
-                                       ccols.Add (IndexerRef (PropRef (FieldRef ("__table" + opts.TableMemberName (rel.ChildTable.TableName)), "Columns"), Const (ccol.ColumnName)));
-
-                               // relation field
-                               string fieldName = "__relation" + relName;
-                               m.Statements.Add (Let (FieldRef (fieldName), New (typeof (DataRelation),
-                                       Const (rel.RelationName),
-                                       NewArray (typeof (DataColumn), pcols.ToArray (typeof (CodeExpression)) as CodeExpression []),
-                                       NewArray (typeof (DataColumn), ccols.ToArray (typeof (CodeExpression)) as CodeExpression []),
-                                       Const (false)
-                                       )));
-                               m.Statements.Add (Let (PropRef (FieldRef (fieldName), "Nested"), Const (rel.Nested)));
-                               m.Statements.Add (MethodInvoke (PropRef ("Relations"), "Add", FieldRef (fieldName)));
-                       }
-
-                       return m;
-               }
-
-               private void CreateUniqueKeyStatements (CodeMemberMethod m, UniqueConstraint uc, string tableField)
-               {
-                       ArrayList al = new ArrayList ();
-                       foreach (DataColumn col in uc.Columns)
-                               al.Add (IndexerRef (PropRef (FieldRef (tableField), "Columns"), Const (col.ColumnName)));
-
-                       m.Statements.Add (Let (Local ("uc"), New (
-                               typeof (UniqueConstraint),
-                               Const (uc.ConstraintName),
-                               NewArray (
-                                       typeof (DataColumn),
-                                       al.ToArray (typeof (CodeExpression)) as CodeExpression []),
-                               Const (uc.IsPrimaryKey))));
-                       m.Statements.Add (MethodInvoke (PropRef (FieldRef (tableField), "Constraints"), "Add", Local ("uc")));
-               }
-
-               private void CreateForeignKeyStatements (CodeMemberMethod m,ForeignKeyConstraint fkc, string tableField, string rtableField)
-               {
-                       ArrayList pcols = new ArrayList ();
-                       foreach (DataColumn col in fkc.RelatedColumns)
-                               pcols.Add (IndexerRef (PropRef (FieldRef (rtableField), "Columns"), Const (col.ColumnName)));
-
-                       ArrayList ccols = new ArrayList ();
-                       foreach (DataColumn col in fkc.Columns)
-                               ccols.Add (IndexerRef (PropRef (FieldRef (tableField), "Columns"), Const (col.ColumnName)));
-
-                       m.Statements.Add (Let (Local ("fkc"), New (
-                               typeof (ForeignKeyConstraint),
-                               Const (fkc.ConstraintName),
-                               NewArray (
-                                       typeof (DataColumn),
-                                       pcols.ToArray (typeof (CodeExpression)) as CodeExpression []),
-                               NewArray (
-                                       typeof (DataColumn),
-                                       ccols.ToArray (typeof (CodeExpression)) as CodeExpression []))));
-
-                       m.Statements.Add (Let (
-                               PropRef (Local ("fkc"), "AcceptRejectRule"),
-                               FieldRef (TypeRefExp (typeof (AcceptRejectRule)), Enum.GetName (typeof (AcceptRejectRule), fkc.AcceptRejectRule))));
-                       m.Statements.Add (Let (
-                               PropRef (Local ("fkc"), "DeleteRule"),
-                               FieldRef (TypeRefExp (typeof (Rule)), Enum.GetName (typeof (Rule), fkc.DeleteRule))));
-                       m.Statements.Add (Let (
-                               PropRef (Local ("fkc"), "UpdateRule"),
-                               FieldRef (TypeRefExp (typeof (Rule)), Enum.GetName (typeof (Rule), fkc.UpdateRule))));
-
-                       m.Statements.Add (MethodInvoke (PropRef (FieldRef (tableField), "Constraints"), "Add", Local ("fkc")));
-               }
-
-               private CodeMemberMethod CreateDataSetInitializeFields ()
-               {
-                       CodeMemberMethod m = new CodeMemberMethod ();
-                       m.Attributes = MemberAttributes.Assembly;
-                       m.Name = "InitializeFields";
-
-                       foreach (DataTable dt in ds.Tables)
-                               m.Statements.Add (Eval (MethodInvoke (FieldRef ("__table" + opts.TableMemberName (dt.TableName)), "InitializeFields")));
-
-                       foreach (DataRelation rel in ds.Relations)
-                               m.Statements.Add (Let (FieldRef ("__relation" + opts.RelationName (rel.RelationName)), IndexerRef (PropRef ("Relations"), Const (rel.RelationName))));
-
-                       return m;
-               }
-
-               private CodeMemberMethod CreateDataSetSchemaChanged ()
-               {
-                       CodeMemberMethod m = new CodeMemberMethod ();
-                       m.Name = "SchemaChanged";
-                       m.Parameters.Add (Param (typeof (object), "sender"));
-                       m.Parameters.Add (Param (typeof (CollectionChangeEventArgs), "e"));
-
-                       m.Statements.Add (
-                               new CodeConditionStatement (
-                                       EqualsValue (
-                                               PropRef (ParamRef ("e"), "Action"),
-                                               FieldRef (TypeRefExp (typeof (CollectionChangeAction)), "Remove")),
-                                       new CodeStatement [] { Eval (MethodInvoke ("InitializeFields")) },
-                                       new CodeStatement [] {}));
-                       return m;
-               }
-
-               private void CreateDataSetTableMembers (CodeTypeDeclaration dsType, DataTable table)
-               {
-                       string tableTypeName = opts.TableTypeName (table.TableName);
-                       string tableVarName = opts.TableMemberName (table.TableName);
-
-                       CodeMemberField privTable = new CodeMemberField ();
-                       privTable.Type = TypeRef (tableTypeName);
-                       privTable.Name = "__table" + tableVarName;
-                       dsType.Members.Add (privTable);
-
-                       CodeMemberProperty pubTable = new CodeMemberProperty ();
-                       pubTable.Type = TypeRef (tableTypeName);
-                       pubTable.Attributes = MemberAttributes.Public;
-                       pubTable.Name = tableVarName == table.TableName ? "_"+tableVarName : tableVarName;
-                       pubTable.HasSet = false;
-                       // Code: return __table[foo];
-                       pubTable.GetStatements.Add (Return (FieldRef ("__table" + tableVarName)));
-
-                       dsType.Members.Add (pubTable);
-
-               }
-
-               private void CreateDataSetRelationMembers (CodeTypeDeclaration dsType, DataRelation relation)
-               {
-                       string relName = opts.RelationName (relation.RelationName);
-                       string fieldName = "__relation" + relName;
-
-                       CodeMemberField field = new CodeMemberField ();
-                       field.Type = TypeRef (typeof (DataRelation));
-                       field.Name = fieldName;
-                       dsType.Members.Add (field);
-
-                       // This is not supported in MS.NET
-                       CodeMemberProperty prop = new CodeMemberProperty ();
-                       prop.Type = TypeRef (typeof (DataRelation));
-                       prop.Attributes = MemberAttributes.Public;
-                       prop.Name = relName;
-                       prop.HasSet = false;
-                       // Code: return __relation[foo_bar];
-                       prop.GetStatements.Add (Return (FieldRef (fieldName)));
-                       dsType.Members.Add (prop);
-               }
-
-#endregion
-
-
-
-#region DataTable class
-
-               private CodeTypeDeclaration GenerateDataTableType (DataTable dt)
-               {
-                       CodeTypeDeclaration t = new CodeTypeDeclaration ();
-                       t.Name = opts.TableTypeName (dt.TableName);
-                       t.BaseTypes.Add (TypeRef (typeof (DataTable)));
-                       t.BaseTypes.Add (TypeRef (typeof (IEnumerable)));
-
-                       t.Members.Add (CreateTableCtor1 (dt));
-                       t.Members.Add (CreateTableCtor2 (dt));
-
-                       t.Members.Add (CreateTableCount (dt));
-                       t.Members.Add (CreateTableIndexer (dt));
-
-                       t.Members.Add (CreateTableInitializeClass (dt));
-                       t.Members.Add (CreateTableInitializeFields (dt));
-
-                       t.Members.Add (CreateTableGetEnumerator (dt));
-                       t.Members.Add (CreateTableClone (dt));
-                       t.Members.Add (CreateTableCreateInstance (dt));
-
-                       t.Members.Add (CreateTableAddRow1 (dt));
-                       t.Members.Add (CreateTableAddRow2 (dt));
-                       t.Members.Add (CreateTableNewRow (dt));
-                       t.Members.Add (CreateTableNewRowFromBuilder (dt));
-                       t.Members.Add (CreateTableRemoveRow (dt));
-                       t.Members.Add (CreateTableGetRowType (dt));
-
-                       t.Members.Add (CreateTableEventStarter (dt, "Changing"));
-                       t.Members.Add (CreateTableEventStarter (dt, "Changed"));
-                       t.Members.Add (CreateTableEventStarter (dt, "Deleting"));
-                       t.Members.Add (CreateTableEventStarter (dt, "Deleted"));
-
-                       // events
-                       t.Members.Add (CreateTableEvent (dt, "RowChanging"));
-                       t.Members.Add (CreateTableEvent (dt, "RowChanged"));
-                       t.Members.Add (CreateTableEvent (dt, "RowDeleting"));
-                       t.Members.Add (CreateTableEvent (dt, "RowDeleted"));
-
-                       // column members
-                       foreach (DataColumn col in dt.Columns) {
-                               t.Members.Add (CreateTableColumnField (dt, col));
-                               t.Members.Add (CreateTableColumnProperty (dt, col));
-                       }
-
-                       return t;
-               }
-
-               // Code:
-               //  internal [foo]DataTable () : base ("[foo]")
-               //  {
-               //    InitializeClass ();
-               //  }
-               private CodeConstructor CreateTableCtor1 (DataTable dt)
-               {
-                       CodeConstructor c = new CodeConstructor ();
-                       c.Attributes = MemberAttributes.Assembly;
-                       c.BaseConstructorArgs.Add (Const (dt.TableName));
-                       c.Statements.Add (Eval (MethodInvoke ("InitializeClass")));
-                       c.Statements.Add (Eval (MethodInvoke ("InitializeFields")));
-                       return c;
-               }
-
-               // Code:
-               //  internal [foo]DataTable (DataTable table) : base (table.TableName)
-               //  {
-               //    // TODO: implement
-               //    throw new NotImplementedException ();
-               //  }
-               private CodeConstructor CreateTableCtor2 (DataTable dt)
-               {
-                       CodeConstructor c = new CodeConstructor ();
-                       c.Attributes = MemberAttributes.Assembly;
-                       c.Parameters.Add (Param (typeof (DataTable), GetRowTableFieldName (dt)));
-                       c.BaseConstructorArgs.Add (PropRef (ParamRef (GetRowTableFieldName (dt)), "TableName"));
-                       // TODO: implement
-                       c.Statements.Add (Comment ("TODO: implement"));
-                       c.Statements.Add (Throw (New (typeof (NotImplementedException))));
-                       return c;
-               }
-
-               private CodeMemberMethod CreateTableInitializeClass (DataTable dt)
-               {
-                       CodeMemberMethod m = new CodeMemberMethod ();
-                       m.Name = "InitializeClass";
-                       foreach (DataColumn col in dt.Columns) {
-                               m.Statements.Add (Eval (MethodInvoke (
-                                       PropRef ("Columns"),
-                                       "Add",
-                                       New (typeof (DataColumn),
-                                               Const (col.ColumnName),
-                                               new CodeTypeOfExpression (col.DataType)
-                                               ))));
-                       }
-                       return m;
-               }
-
-               private CodeMemberMethod CreateTableInitializeFields (DataTable dt)
-               {
-                       CodeMemberMethod m = new CodeMemberMethod ();
-                       m.Name = "InitializeFields";
-                       m.Attributes = MemberAttributes.Assembly;
-
-                       string colRef;
-                       foreach (DataColumn col in dt.Columns) {
-                               colRef = String.Format("__column{0}", opts.TableColName (col.ColumnName));
-
-                               m.Statements.Add (Let (FieldRef (colRef), IndexerRef (PropRef ("Columns"), Const (col.ColumnName))));
-                               if (!col.AllowDBNull)
-                                       m.Statements.Add (Let (FieldRef (PropRef (colRef), "AllowDBNull"), Const (col.AllowDBNull)));
-                               if (col.DefaultValue != null && col.DefaultValue.GetType() != typeof(System.DBNull))
-                                       m.Statements.Add (Let (FieldRef (PropRef (colRef), "DefaultValue"), Const (col.DefaultValue)));
-                               if (col.AutoIncrement)
-                                       m.Statements.Add (Let (FieldRef (PropRef (colRef), "AutoIncrement"), Const (col.AutoIncrement)));
-                               if (col.AutoIncrementSeed != 0)
-                                       m.Statements.Add (Let (FieldRef (PropRef (colRef), "AutoIncrementSeed"), Const (col.AutoIncrementSeed)));
-                               if (col.AutoIncrementStep != 1)
-                                       m.Statements.Add (Let (FieldRef (PropRef (colRef), "AutoIncrementStep"), Const (col.AutoIncrementStep)));
-                               if (col.ReadOnly)
-                                       m.Statements.Add (Let (FieldRef (PropRef (colRef), "ReadOnly"), Const (col.ReadOnly)));
-                       }
-                       return m;
-               }
-
-               private CodeMemberMethod CreateTableClone (DataTable dt)
-               {
-                       CodeMemberMethod m = new CodeMemberMethod ();
-                       m.Name = "Clone";
-                       m.Attributes = MemberAttributes.Public | MemberAttributes.Override;
-                       m.ReturnType = TypeRef (typeof (DataTable));
-                       string typeName = opts.TableTypeName (dt.TableName);
-                       m.Statements.Add (
-                               VarDecl (typeName, "t", Cast (typeName, MethodInvoke (Base (), "Clone"))));
-                       m.Statements.Add (Eval (MethodInvoke (Local ("t"), "InitializeFields")));
-                       m.Statements.Add (Return (Local ("t")));
-                       return m;
-               }
-
-               private CodeMemberMethod CreateTableGetEnumerator (DataTable dt)
-               {
-                       CodeMemberMethod m = new CodeMemberMethod ();
-                       m.Name = "GetEnumerator";
-                       m.Attributes = MemberAttributes.Public;
-                       m.ReturnType = TypeRef (typeof (IEnumerator));
-                       m.Statements.Add (Return (MethodInvoke (PropRef ("Rows"), "GetEnumerator")));
-                       m.ImplementationTypes.Add (TypeRef (typeof (IEnumerable)));
-                       return m;
-               }
-
-               private CodeMemberMethod CreateTableCreateInstance (DataTable dt)
-               {
-                       CodeMemberMethod m = new CodeMemberMethod ();
-                       m.Name = "CreateInstance";
-                       m.Attributes = MemberAttributes.Family | MemberAttributes.Override;
-                       m.ReturnType = TypeRef (typeof (DataTable));
-                       m.Statements.Add (Return (New (opts.TableTypeName (dt.TableName))));
-                       return m;
-               }
-
-               private CodeMemberField CreateTableColumnField (DataTable dt, DataColumn col)
-               {
-                       CodeMemberField f = new CodeMemberField ();
-                       f.Name = "__column" + opts.ColumnName (col.ColumnName);
-                       f.Type = TypeRef (typeof (DataColumn));
-                       return f;
-               }
-
-               private CodeMemberProperty CreateTableColumnProperty (DataTable dt, DataColumn col)
-               {
-                       string name = opts.ColumnName (col.ColumnName);
-                       CodeMemberProperty p = new CodeMemberProperty ();
-                       p.Name = name + "Column";
-                       p.Attributes = MemberAttributes.Assembly;
-                       p.Type = TypeRef (typeof (DataColumn));
-                       p.HasSet = false;
-                       p.GetStatements.Add (Return (FieldRef ("__column" + name)));
-                       return p;
-               }
-
-               private CodeMemberProperty CreateTableCount (DataTable dt)
-               {
-                       CodeMemberProperty p = new CodeMemberProperty ();
-                       p.Name = "Count";
-                       p.Attributes = MemberAttributes.Public;
-                       p.Type = TypeRef (typeof (int));
-                       p.HasSet = false;
-                       p.GetStatements.Add (Return (PropRef (PropRef ("Rows"), "Count")));
-                       return p;
-               }
-
-               private CodeMemberProperty CreateTableIndexer (DataTable dt)
-               {
-                       string rowName = opts.RowName (dt.TableName);
-                       CodeMemberProperty ix = new CodeMemberProperty ();
-                       ix.Name = "Item"; // indexer
-                       ix.Attributes = MemberAttributes.Public;
-                       ix.Type = TypeRef (rowName);
-                       ix.Parameters.Add (Param (typeof (int), "i"));
-                       ix.HasSet = false;
-                       ix.GetStatements.Add (Return (Cast (rowName, IndexerRef (PropRef ("Rows"), ParamRef ("i")))));
-                       return ix;
-               }
-
-               private CodeMemberMethod CreateTableAddRow1 (DataTable dt)
-               {
-                       CodeMemberMethod m = new CodeMemberMethod ();
-                       string rowType = opts.RowName (dt.TableName);
-                       m.Name = "Add" + rowType;
-                       m.Attributes = MemberAttributes.Public;
-                       m.Parameters.Add (Param (TypeRef (rowType), "row"));
-                       m.Statements.Add (Eval (MethodInvoke (PropRef ("Rows"), "Add", ParamRef ("row"))));
-                       return m;
-               }
-
-               private CodeMemberMethod CreateTableAddRow2 (DataTable dt)
-               {
-                       CodeMemberMethod m = new CodeMemberMethod ();
-                       string rowType = opts.RowName (dt.TableName);
-                       m.Name = "Add" + rowType;
-                       m.ReturnType = TypeRef (rowType);
-                       m.Attributes = MemberAttributes.Public;
-
-                       m.Statements.Add (VarDecl (rowType, "row", MethodInvoke ("New" + rowType)));
-
-                       foreach (DataColumn col in dt.Columns) {
-                               if (col.ColumnMapping == MappingType.Hidden) {
-                                       foreach (DataRelation r in dt.DataSet.Relations) {
-                                               if (r.ChildTable == dt) {
-                                                       // parameter
-                                                       string paramType = opts.RowName (r.ParentTable.TableName);
-                                                       string paramName = paramType;
-                                                       m.Parameters.Add (Param (paramType, paramName));
-                                                       // CODE: SetParentRow (fooRow, DataSet.Relations ["foo_bar"]);
-                                                       m.Statements.Add (Eval (MethodInvoke (Local ("row"), "SetParentRow", ParamRef (paramName), IndexerRef (PropRef (PropRef ("DataSet"), "Relations"), Const (r.RelationName)))));
-                                                       break;
-                                               }
-                                       }
-                               }
-                               else {
-                                       // parameter
-                                       string paramName = opts.ColumnName (col.ColumnName);
-                                       m.Parameters.Add (Param (col.DataType, paramName));
-                                       // row ["foo"] = foo;
-                                       m.Statements.Add (Let (IndexerRef (Local ("row"), Const (paramName)), ParamRef (paramName)));
-                               }
-                       }
-
-                       // Rows.Add (row);
-                       m.Statements.Add (MethodInvoke (PropRef ("Rows"), "Add", Local ("row")));
-                       m.Statements.Add (Return (Local ("row")));
-
-                       return m;
-               }
-
-               private CodeMemberMethod CreateTableNewRow (DataTable dt)
-               {
-                       CodeMemberMethod m = new CodeMemberMethod ();
-                       string rowType = opts.RowName (dt.TableName);
-                       m.Name = "New" + rowType;
-                       m.ReturnType = TypeRef (rowType);
-                       m.Attributes = MemberAttributes.Public;
-                       m.Statements.Add (Return (Cast (rowType, MethodInvoke ("NewRow"))));
-                       return m;
-               }
-
-               private CodeMemberMethod CreateTableNewRowFromBuilder (DataTable dt)
-               {
-                       CodeMemberMethod m = new CodeMemberMethod ();
-                       m.Name = "NewRowFromBuilder";
-                       m.Attributes = MemberAttributes.Family | MemberAttributes.Override;
-                       m.ReturnType = TypeRef (typeof (DataRow));
-                       m.Parameters.Add (Param (typeof (DataRowBuilder), "builder"));
-                       m.Statements.Add (Return (New (opts.RowName (dt.TableName), ParamRef ("builder"))));
-                       return m;
-               }
-
-               private CodeMemberMethod CreateTableRemoveRow (DataTable dt)
-               {
-                       CodeMemberMethod m = new CodeMemberMethod ();
-                       string rowType = opts.RowName (dt.TableName);
-                       m.Name = "Remove" + rowType;
-                       m.Attributes = MemberAttributes.Public;
-                       m.Parameters.Add (Param (TypeRef (rowType), "row"));
-                       m.Statements.Add (Eval (MethodInvoke (PropRef ("Rows"), "Remove", ParamRef ("row"))));
-                       return m;
-               }
-
-               private CodeMemberMethod CreateTableGetRowType (DataTable dt)
-               {
-                       CodeMemberMethod m = new CodeMemberMethod ();
-                       m.Name = "GetRowType";
-                       m.Attributes = MemberAttributes.Family | MemberAttributes.Override;
-                       m.ReturnType = TypeRef (typeof (Type));
-                       m.Statements.Add (Return (new CodeTypeOfExpression (opts.RowName (dt.TableName))));
-                       return m;
-               }
-
-               private CodeMemberMethod CreateTableEventStarter (DataTable dt, string type)
-               {
-                       CodeMemberMethod m = new CodeMemberMethod ();
-                       m.Name = "OnRow" + type;
-                       m.Attributes = MemberAttributes.Family | MemberAttributes.Override;
-                       m.Parameters.Add (Param (typeof (DataRowChangeEventArgs), "e"));
-
-                       m.Statements.Add (Eval (MethodInvoke (
-                                       Base (),
-                                       m.Name,
-                                       ParamRef ("e"))));
-                       string eventName = opts.TableMemberName (dt.TableName) + "Row" + type;
-                       CodeStatement trueStmt = Eval (
-                               new CodeDelegateInvokeExpression(
-                                       new CodeEventReferenceExpression (This (), eventName),
-                                       This (), 
-                                       New (
-                                               opts.EventArgsName (dt.TableName),
-                                               Cast (opts.RowName (dt.TableName), PropRef (ParamRef ("e"), "Row")),
-                                               PropRef (ParamRef ("e"), "Action"))));
-
-                       m.Statements.Add (
-                               new CodeConditionStatement (
-                                       Inequals (EventRef (eventName), Const (null)),
-                                       new CodeStatement [] {trueStmt},
-                                       new CodeStatement [] {}));
-
-                       return m;
-               }
-
-               private CodeMemberEvent CreateTableEvent (DataTable dt, string nameSuffix)
-               {
-                       CodeMemberEvent cme = new CodeMemberEvent ();
-                       cme.Attributes = MemberAttributes.Public;
-                       cme.Name = opts.TableMemberName (dt.TableName) + nameSuffix;
-                       cme.Type = TypeRef (opts.TableDelegateName (dt.TableName));
-                       return cme;
-               }
-
-#endregion
-
-
-
-#region Row class
-
-               public CodeTypeDeclaration GenerateDataRowType (DataTable dt)
-               {
-                       CodeTypeDeclaration t = new CodeTypeDeclaration ();
-                       t.Name = opts.RowName (dt.TableName);
-                       t.BaseTypes.Add (TypeRef (typeof (DataRow)));
-
-                       t.Members.Add (CreateRowCtor (dt));
-
-                       t.Members.Add (CreateRowTableField (dt));
-
-                       foreach (DataColumn col in dt.Columns) {
-                               if (col.ColumnMapping != MappingType.Hidden) {
-                                       t.Members.Add (CreateRowColumnProperty (dt, col));
-                                       t.Members.Add (CreateRowColumnIsNull (dt, col));
-                                       t.Members.Add (CreateRowColumnSetNull (dt, col));
-                               }
-                       }
-
-                       foreach (DataRelation rel in dt.ParentRelations)
-                               t.Members.Add (CreateRowParentRowProperty (dt, rel));
-                       foreach (DataRelation rel in dt.ChildRelations)
-                               t.Members.Add (CreateRowGetChildRows (dt, rel));
-
-                       return t;
-               }
-
-               private CodeConstructor CreateRowCtor (DataTable dt)
-               {
-                       CodeConstructor c = new CodeConstructor ();
-                       c.Attributes = MemberAttributes.Assembly;
-                       c.Parameters.Add (Param (typeof (DataRowBuilder), "builder"));
-                       c.BaseConstructorArgs.Add (ParamRef ("builder"));
-                       c.Statements.Add (Let (FieldRef (GetRowTableFieldName (dt)), Cast (
-                               opts.TableTypeName (dt.TableName),
-                               PropRef ("Table"))));
-                       return c;
-               }
-               
-               private string GetRowTableFieldName (DataTable dt)
-               {
-                       return "table" + dt.TableName;
-               }
-               private CodeMemberField CreateRowTableField (DataTable dt)
-               {
-                       CodeMemberField f = new CodeMemberField ();
-                       f.Name = GetRowTableFieldName (dt);
-                       f.Type = TypeRef (opts.TableTypeName (dt.TableName));
-                       return f;
-               }
-
-               private CodeMemberProperty CreateRowColumnProperty (DataTable dt, DataColumn col)
-               {
-                       CodeMemberProperty p = new CodeMemberProperty ();
-                       p.Name = opts.ColumnName (col.ColumnName);
-                       p.Type = TypeRef (col.DataType);
-                       p.Attributes = MemberAttributes.Public;
-
-                       // This part should be better than MS code output.
-                       // Code:
-                       //  object ret = this [col];
-                       //  if (ret == DBNull.Value)
-                       //    throw new StrongTypingException ()
-                       //  else
-                       //    return (type) ret;
-                       p.GetStatements.Add (VarDecl (typeof (object), "ret",
-                               IndexerRef (PropRef 
-                                       (PropRef (GetRowTableFieldName (dt)), 
-                                       opts.TableColName (col.ColumnName) + "Column"))));
-                       p.GetStatements.Add (new CodeConditionStatement (
-                               Equals (
-                                       Local ("ret"),
-                                       PropRef (TypeRefExp (typeof (DBNull)), "Value")),
-                               new CodeStatement [] {
-                                       Throw (New (typeof (StrongTypingException), Const ("Cannot get strong typed value since it is DB null."), Const (null))) },
-                               new CodeStatement [] {
-                                       Return (Cast (col.DataType, Local ("ret"))) }));
-
-                       p.SetStatements.Add (Let (IndexerRef (PropRef (PropRef (GetRowTableFieldName (dt)), opts.TableColName (col.ColumnName) + "Column")), new CodePropertySetValueReferenceExpression ()));
-
-                       return p;
-               }
-
-               private CodeMemberMethod CreateRowColumnIsNull (DataTable dt, DataColumn col)
-               {
-                       CodeMemberMethod m = new CodeMemberMethod ();
-                       m.Name = "Is" + opts.ColumnName (col.ColumnName) + "Null";
-                       m.Attributes = MemberAttributes.Public;
-                       m.ReturnType = TypeRef (typeof (bool));
-                       m.Statements.Add (Return (MethodInvoke (
-                               "IsNull",
-                               // table[foo].[bar]Column
-                               PropRef (
-                                       PropRef (GetRowTableFieldName (dt)), 
-                                       opts.TableColName (col.ColumnName) + "Column"))));
-                       return m;
-               }
-
-               private CodeMemberMethod CreateRowColumnSetNull (DataTable dt, DataColumn col)
-               {
-                       CodeMemberMethod m = new CodeMemberMethod ();
-                       m.Name = "Set" + opts.ColumnName (col.ColumnName) + "Null";
-                       m.Attributes = MemberAttributes.Public;
-                       m.Statements.Add (Let (IndexerRef (
-                               PropRef (
-                                       PropRef (GetRowTableFieldName (dt)), 
-                                       opts.TableColName (col.ColumnName) + "Column")),
-                               PropRef (TypeRefExp (typeof (DBNull)), "Value")));
-
-                       return m;
-               }
-
-               private CodeMemberProperty CreateRowParentRowProperty (DataTable dt, DataRelation rel)
-               {
-                       CodeMemberProperty p = new CodeMemberProperty ();
-                       p.Name = opts.TableMemberName (rel.ParentTable.TableName) + "Row" +
-                               (rel.ParentTable.TableName == rel.ChildTable.TableName ? "Parent" : String.Empty);
-                       p.Attributes = MemberAttributes.Public;
-                       p.Type = TypeRef (opts.RowName (rel.ParentTable.TableName));
-                       p.GetStatements.Add (Return (Cast (p.Type, MethodInvoke (
-                               "GetParentRow",
-                               IndexerRef (
-                                       PropRef (
-                                               PropRef (
-                                                       PropRef ("Table"),
-                                                       "DataSet"),
-                                               "Relations"),
-                                       Const (rel.RelationName))))));
-                       p.SetStatements.Add (Eval (MethodInvoke (
-                               "SetParentRow",
-                               new CodePropertySetValueReferenceExpression (),
-                               IndexerRef (
-                                       PropRef (
-                                               PropRef (
-                                                       PropRef ("Table"),
-                                                       "DataSet"),
-                                               "Relations"),
-                                       Const (rel.RelationName)))));
-
-                       return p;
-               }
-
-               private CodeMemberMethod CreateRowGetChildRows (DataTable dt, DataRelation rel)
-               {
-                       CodeMemberMethod m = new CodeMemberMethod ();
-                       m.Name = "Get" + opts.TableMemberName (rel.ChildTable.TableName) + "Rows";
-                       m.Attributes = MemberAttributes.Public;
-                       m.ReturnType = new CodeTypeReference (opts.RowName (rel.ChildTable.TableName), 1);
-                       m.Statements.Add (Return (Cast (m.ReturnType, MethodInvoke (
-                               "GetChildRows",
-                               IndexerRef (
-                                       PropRef (
-                                               PropRef (
-                                                       PropRef ("Table"),
-                                                       "DataSet"),
-                                               "Relations"),
-                                       Const (rel.RelationName))))));
-                       return m;
-               }
-
-#endregion
-
-
-#region Event class
-
-               // Code:
-               //  public class [foo]ChangeEventArgs : EventArgs
-               //  {
-               //    private [foo]Row eventRow;
-               //    private DataRowAction eventAction;
-               //    (.ctor())
-               //    (Row)
-               //    (Action)
-               //  }
-               private CodeTypeDeclaration GenerateEventType (DataTable dt)
-               {
-                       CodeTypeDeclaration t = new CodeTypeDeclaration ();
-                       t.Name = opts.EventArgsName (dt.TableName);
-                       t.BaseTypes.Add (TypeRef (typeof (EventArgs)));
-                       t.Attributes = MemberAttributes.Public;
-
-                       t.Members.Add (
-                               new CodeMemberField (
-                                       TypeRef (opts.RowName (dt.TableName)),
-                                       "eventRow"));
-                       t.Members.Add (
-                               new CodeMemberField (
-                                       TypeRef (typeof (DataRowAction)), "eventAction"));
-                       t.Members.Add (CreateEventCtor (dt));
-
-                       t.Members.Add (CreateEventRow (dt));
-
-                       t.Members.Add (CreateEventAction (dt));
-
-                       return t;
-               }
-
-               // Code:
-               //  public [foo]RowChangeEventArgs ([foo]Row r, DataRowAction a)
-               //  {
-               //    eventRow = r;
-               //    eventAction = a;
-               //  }
-               private CodeConstructor CreateEventCtor (DataTable dt)
-               {
-                       CodeConstructor c = new CodeConstructor ();
-                       c.Attributes = MemberAttributes.Public;
-                       c.Parameters.Add (Param (TypeRef (opts.RowName (dt.TableName)), "r"));
-                       c.Parameters.Add (Param (TypeRef (typeof (DataRowAction)), "a"));
-                       c.Statements.Add (Let (FieldRef ("eventRow"), ParamRef ("r")));
-                       c.Statements.Add (Let (FieldRef ("eventAction"), ParamRef ("a")));
-
-                       return c;
-               }
-
-               // Code:
-               //  public [foo]Row Row {
-               //   get { return eventRow; }
-               // }
-               private CodeMemberProperty CreateEventRow (DataTable dt)
-               {
-                       CodeMemberProperty p = new CodeMemberProperty ();
-                       p.Name = "Row";
-                       p.Attributes = MemberAttributes.Public | MemberAttributes.Final;
-                       p.Type = TypeRef (opts.RowName (dt.TableName));
-                       p.HasSet = false;
-                       p.GetStatements.Add (Return (FieldRef ("eventRow")));
-                       return p;
-               }
-
-               // Code:
-               //  public DataRowAction Action {
-               //   get { return eventAction; }
-               // }
-               private CodeMemberProperty CreateEventAction (DataTable dt)
-               {
-                       CodeMemberProperty p = new CodeMemberProperty ();
-                       p.Name = "Action";
-                       p.Attributes = MemberAttributes.Public | MemberAttributes.Final;
-                       p.Type = TypeRef (typeof (DataRowAction));
-                       p.HasSet = false;
-                       p.GetStatements.Add (Return (FieldRef ("eventAction")));
-                       return p;
-               }
-
-#endregion
-
-#region Table Adapter class
-               
-               private CodeTypeDeclaration GenerateTableAdapterType (TableAdapterSchemaInfo taInfo)
-               {
-                       CodeTypeDeclaration t = new CodeTypeDeclaration ();
-                       t.Name = opts.TableAdapterName (taInfo.Name);
-                       t.BaseTypes.Add (TypeRef (taInfo.BaseClass));
-               
-                       t.Members.Add (CreateTableAdapterDefaultCtor ());
-
-                       // table adapter fields/properties
-                       CreateDBAdapterFieldAndProperty (t, taInfo.Adapter);
-                       CreateDBConnectionFieldAndProperty (t, taInfo.Connection);
-                       
-                       DbCommand cmd = null;
-                       if (taInfo.Commands.Count > 0)
-                               cmd = ((DbCommandInfo)taInfo.Commands[0]).Command;
-                       else
-                               cmd = taInfo.Provider.CreateCommand ();
-                       CreateDBCommandCollectionFieldAndProperty (t, cmd);
-                       CreateAdapterClearBeforeFillFieldAndProperty (t);
-
-                       CreateAdapterInitializeMethod (t, taInfo);
-                       CreateConnectionInitializeMethod (t, taInfo);
-                       CreateCommandCollectionInitializeMethod (t, taInfo);
-
-                       CreateDbSourceMethods (t, taInfo);
-                       if (taInfo.ShortCommands)
-                               CreateShortCommandMethods (t, taInfo);
-                       
-                       return t;
-               }
-               
-               private CodeConstructor CreateTableAdapterDefaultCtor ()
-               {
-                       CodeConstructor ctor = new CodeConstructor ();
-                       ctor.Attributes = MemberAttributes.Public;
-                       ctor.Statements.Add (Let (PropRef ("ClearBeforeFill"), Const (true)));
-                       
-                       return ctor;
-               }       
-
-               private void CreateDBAdapterFieldAndProperty (CodeTypeDeclaration t, DbDataAdapter adapter)
-               {
-                       CodeExpression expr;
-                       CodeStatement setStmt;
-                       CodeStatement stmt;
-                       CodeMemberField f = new CodeMemberField ();
-                       f.Name = "_adapter";
-                       f.Type = TypeRef (adapter.GetType ());
-                       t.Members.Add (f);
-                       
-                       CodeMemberProperty p = new CodeMemberProperty ();
-                       p.Name = "Adapter";
-                       p.Attributes = MemberAttributes.Private;
-                       p.Type = f.Type;
-                       p.HasSet = false;
-
-                       expr = FieldRef ("_adapter");
-                       setStmt = Eval (MethodInvoke ("InitAdapter"));
-                       stmt = new CodeConditionStatement (Equals (expr, Const (null)),
-                                                          new CodeStatement [] {setStmt},
-                                                          new CodeStatement [] {});
-                       p.GetStatements.Add (stmt);
-                       p.GetStatements.Add (Return (expr));
-                       t.Members.Add (p);
-               }
-               
-               private void CreateDBConnectionFieldAndProperty (CodeTypeDeclaration t, DbConnection conn)
-               {
-                       CodeExpression expr;
-                       CodeStatement setStmt;
-                       CodeStatement stmt;
-                       CodeMemberField f = new CodeMemberField ();
-                       f.Name = "_connection";
-                       f.Type = TypeRef (conn.GetType ());
-                       t.Members.Add (f);
-
-                       CodeMemberProperty p = new CodeMemberProperty ();
-                       p.Name = "Connection";
-                       p.Attributes = MemberAttributes.Assembly;
-                       p.Type = f.Type;
-
-                       expr = FieldRef ("_connection");
-                       setStmt = Eval (MethodInvoke ("InitConnection"));
-                       stmt = new CodeConditionStatement (Equals (expr, Const (null)),
-                                                          new CodeStatement [] {setStmt},
-                                                          new CodeStatement [] {});
-                       p.GetStatements.Add (stmt);
-                       p.GetStatements.Add (Return (expr));
-                       p.SetStatements.Add (Let (expr, new CodePropertySetValueReferenceExpression()));
-
-                       // update connection in Insert/Delete/Update commands of adapter
-                                               
-                       // insert command
-                       string cmdStr = "InsertCommand";
-                       string connStr = "Connection";
-                       setStmt = null;
-                       stmt = null;
-                       expr = null;
-
-                       expr = PropRef (PropRef ("Adapter"), cmdStr);
-                       setStmt = Let (PropRef (expr, connStr), new CodePropertySetValueReferenceExpression());
-                       stmt = new CodeConditionStatement (Inequals (expr, Const (null)),
-                                                          new CodeStatement [] {setStmt},
-                                                          new CodeStatement [] {});                    
-                       p.SetStatements.Add (stmt);
-
-                       // delete command
-                       setStmt = null;
-                       stmt = null;
-                       expr = null;
-                       
-                       cmdStr = "DeleteCommand";
-                       expr = PropRef (PropRef ("Adapter"), cmdStr);
-                       setStmt = Let (PropRef (expr, connStr), new CodePropertySetValueReferenceExpression());
-                       stmt = new CodeConditionStatement (Inequals (expr, Const (null)),
-                                                          new CodeStatement [] {setStmt}, new CodeStatement [] {});
-                       p.SetStatements.Add (stmt);
-
-                       // update command
-                       setStmt = null;
-                       stmt = null;
-
-                       cmdStr = "UpdateCommand";
-                       expr = PropRef (PropRef ("Adapter"), cmdStr);                   
-                       setStmt = Let (PropRef (expr, connStr), new CodePropertySetValueReferenceExpression());
-                       stmt = new CodeConditionStatement (Inequals (expr, Const (null)),
-                                                          new CodeStatement [] {setStmt}, new CodeStatement [] {});
-                       p.SetStatements.Add (stmt);
-
-                       // iterate through command collection and update it
-                       setStmt = null;
-                       expr = null;
-                       stmt = null;
-                       setStmt = VarDecl (typeof (int), "i", Const (0));
-                       expr = LessThan (Local ("i"), PropRef (PropRef ("CommandCollection"), "Length"));
-                       stmt = Let (Local ("i"), Compute (Local ("i"), Const (1), CodeBinaryOperatorType.Add));
-                       
-                       // statements to execute in the loop
-                       CodeExpression expr1 = IndexerRef (PropRef ("CommandCollection"), Local ("i"));
-                       CodeStatement setStmt1 = Let (PropRef (expr1, "Connection"), new CodePropertySetValueReferenceExpression());
-                       CodeStatement stmt1 = new CodeConditionStatement (Inequals (expr1, Const (null)),
-                                                          new CodeStatement [] {setStmt1}, new CodeStatement [] {});
-                       CodeIterationStatement forLoop = new CodeIterationStatement (setStmt, expr, stmt,
-                                                                                    new CodeStatement[] {stmt1});
-                       p.SetStatements.Add (forLoop);                                          
-                       t.Members.Add (p);
-               }
-
-               private void CreateDBCommandCollectionFieldAndProperty (CodeTypeDeclaration t, DbCommand cmd)
-               {
-                       CodeExpression expr;
-                       CodeStatement setStmt;
-                       CodeStatement stmt;
-                       CodeMemberField f = new CodeMemberField ();
-                       f.Name = "_commandCollection";
-                       f.Type = TypeRefArray (cmd.GetType (), 1);
-                       t.Members.Add (f);
-                       
-                       CodeMemberProperty p = new CodeMemberProperty ();
-                       p.Name = "CommandCollection";
-                       p.Attributes = MemberAttributes.Family;
-                       p.Type = f.Type;
-                       p.HasSet = false;
-
-                       expr = FieldRef ("_commandCollection");
-                       setStmt = Eval (MethodInvoke ("InitCommandCollection"));
-                       stmt = new CodeConditionStatement (Equals (expr, Const (null)),
-                                                          new CodeStatement [] {setStmt},
-                                                          new CodeStatement [] {});
-                       p.GetStatements.Add (stmt);
-                       p.GetStatements.Add (Return (expr));
-                       t.Members.Add (p);
-               }
-
-               private void CreateAdapterClearBeforeFillFieldAndProperty (CodeTypeDeclaration t)
-               {
-                       CodeMemberField f = new CodeMemberField ();
-                       f.Name = "_clearBeforeFill";
-                       f.Type = TypeRef (typeof (bool));
-                       t.Members.Add (f);
-                       
-                       CodeMemberProperty p = new CodeMemberProperty ();
-                       p.Name = "ClearBeforeFill";
-                       p.Attributes = MemberAttributes.Public;
-                       p.Type = f.Type;
-                       p.SetStatements.Add (Let (FieldRef ("_clearBeforeFill"), 
-                                                 new CodePropertySetValueReferenceExpression()));
-                       p.GetStatements.Add (Return (FieldRef ("_clearBeforeFill")));
-                       t.Members.Add (p);
-               }
-
-               private void CreateAdapterInitializeMethod (CodeTypeDeclaration t, TableAdapterSchemaInfo taInfo)
-               {
-                       CodeMemberMethod m = new CodeMemberMethod ();
-                       m.Name = "InitAdapter";
-                       m.Attributes = MemberAttributes.Private;
-                       
-                       // code statements
-                       CodeExpression expr;
-                       CodeStatement stmt;
-                       
-                       // initialize adapter
-                       expr = FieldRef ("_adapter");
-                       stmt = Let (expr, New (taInfo.Adapter.GetType ()));
-                       m.Statements.Add (stmt);
-                       
-                       // populate tableMapping
-                       stmt = VarDecl (typeof (DataTableMapping), "tableMapping", null);
-                       m.Statements.Add (stmt);
-                       foreach (DataTableMapping tblMap in taInfo.Adapter.TableMappings) {
-                               expr = Local ("tableMapping");
-                               stmt = Let (expr, New (tblMap.GetType ()));
-                               m.Statements.Add (stmt);
-                               
-                               stmt = Let (PropRef (expr, "SourceTable"), Const (tblMap.SourceTable));
-                               m.Statements.Add (stmt);
-                               
-                               stmt = Let (PropRef (expr, "DataSetTable"), Const (tblMap.DataSetTable));
-                               m.Statements.Add (stmt);
-                               
-                               foreach (DataColumnMapping colMap in tblMap.ColumnMappings) { 
-                                       stmt = Eval (MethodInvoke (PropRef (expr, "ColumnMappings"), "Add", 
-                                                                  new CodeExpression [] {Const (colMap.SourceColumn), Const (colMap.DataSetColumn)}));
-                                       m.Statements.Add (stmt);
-                               }
-                               expr = PropRef (FieldRef ("_adapter"), "TableMappings");
-                               stmt = Eval (MethodInvoke (expr, "Add", Local ("tableMapping")));
-                               m.Statements.Add (stmt);
-                       }
-                       // Generate code for adapter's deletecommand
-                       expr = PropRef (FieldRef ("_adapter"), "DeleteCommand");
-                       DbCommand cmd = taInfo.Adapter.DeleteCommand;
-                       AddDbCommandStatements (m, expr, cmd);
-
-                       // Generate code for adapter's insertcommand
-                       expr = PropRef (FieldRef ("_adapter"), "InsertCommand");
-                       cmd = taInfo.Adapter.InsertCommand;
-                       AddDbCommandStatements (m, expr, cmd);
-
-                       // Generate code for adapter's updatecommand
-                       expr = PropRef (FieldRef ("_adapter"), "UpdateCommand");
-                       cmd = taInfo.Adapter.UpdateCommand;
-                       AddDbCommandStatements (m, expr, cmd);
-
-                       t.Members.Add (m);
-               }
-               
-               private void AddDbCommandStatements (CodeMemberMethod m, 
-                                                    CodeExpression expr, 
-                                                    DbCommand cmd)
-               {
-                       if (cmd == null)
-                               return;
-                       
-                       CodeExpression expr1;
-                       CodeStatement stmt = Let (expr, New (cmd.GetType ()));
-                       m.Statements.Add (stmt);
-                       
-                       stmt = Let (PropRef (expr,"Connection"), PropRef ("Connection"));
-                       m.Statements.Add (stmt);
-                       stmt = Let (PropRef (expr, "CommandText"), Const (cmd.CommandText));
-                       m.Statements.Add (stmt);
-                       expr1 = PropRef (Local(typeof (CommandType).FullName), cmd.CommandType.ToString ());
-                       stmt = Let (PropRef (expr, "CommandType"), expr1);
-                       m.Statements.Add (stmt);
-                       
-                       expr1 = PropRef (expr, "Parameters");
-                       foreach (DbParameter param in cmd.Parameters) {
-                               AddDbParameterStatements (m, expr1, param);
-                       }
-               }
-               
-               private void AddDbParameterStatements (CodeMemberMethod m, 
-                                                      CodeExpression expr, 
-                                                      DbParameter param)
-               {
-                       object dbType = param.FrameworkDbType;
-                       string srcColumn = null;
-                       
-                       if (param.SourceColumn != String.Empty)
-                               srcColumn = param.SourceColumn;
-                       
-                       CodeExpression[] args = new CodeExpression[] {
-                               Const (param.ParameterName),
-                               PropRef (Local(dbType.GetType().FullName), dbType.ToString ()), 
-                               Const (param.Size),
-                               PropRef(Local(typeof (ParameterDirection).FullName), param.Direction.ToString ()),
-                               Const (param.IsNullable),
-                               Const (((IDbDataParameter)param).Precision),
-                               Const (((IDbDataParameter)param).Scale),
-                               Const (srcColumn),
-                               PropRef (Local (typeof (DataRowVersion).FullName), param.SourceVersion.ToString ()),
-                               /* Const (param.SourceColumnNullMapping), */ // TODO: Investigate with other providers
-                               Const (param.Value)
-                       };
-                       m.Statements.Add (Eval (MethodInvoke (expr, "Add", New (param.GetType (), args))));
-               }
-               private void CreateConnectionInitializeMethod (CodeTypeDeclaration t, 
-                                                              TableAdapterSchemaInfo taInfo)
-               {
-                       CodeMemberMethod m = new CodeMemberMethod ();
-                       m.Name = "InitConnection";
-                       m.Attributes = MemberAttributes.Private;
-                       
-                       // code statements
-                       CodeExpression expr, expr1;
-                       CodeStatement stmt;
-                       
-                       // initialize connection
-                       expr = FieldRef ("_connection");
-                       stmt = Let (expr, New (taInfo.Connection.GetType ()));
-                       m.Statements.Add (stmt);
-                       
-                       // assign connection string
-                       expr = PropRef (FieldRef ("_connection"), "ConnectionString");
-                       expr1 = IndexerRef (PropRef (Local (typeof (System.Configuration.ConfigurationManager).ToString()), "ConnectionStrings"), 
-                                           Const (taInfo.ConnectionString));
-                       stmt = Let (expr, PropRef (expr1, "ConnectionString"));
-                       m.Statements.Add (stmt);
-                       
-                       t.Members.Add (m);
-               }
-               
-               private void CreateCommandCollectionInitializeMethod (CodeTypeDeclaration t, 
-                                                                     TableAdapterSchemaInfo taInfo)
-               {
-                       //string tmp = null;
-                       Type type;
-                       CodeMemberMethod m = new CodeMemberMethod ();
-                       m.Name = "InitCommandCollection";
-                       m.Attributes = MemberAttributes.Private;
-                       
-                       // code statements
-                       CodeExpression expr, expr1;
-                       CodeStatement stmt;
-                       
-                       type = ((DbCommandInfo)taInfo.Commands[0]).Command.GetType();
-                       
-                       // initialize connection
-                       expr = FieldRef ("_commandCollection");
-                       stmt = Let (expr, NewArray (type, taInfo.Commands.Count));
-                       m.Statements.Add (stmt);
-                       
-                       // loop through the collection and generate the code
-                       for (int idx = 0; idx < taInfo.Commands.Count; idx++) {
-                               DbCommand cmd = ((DbCommandInfo)taInfo.Commands[idx]).Command;
-                               // Allocate
-                               expr1 = IndexerRef (expr, Const (idx));
-                               stmt = Let (expr1, New (type));
-                               m.Statements.Add (stmt);
-                               
-                               // Initialize cmd members
-                               stmt = Let (PropRef (expr1, "Connection"), PropRef ("Connection"));
-                               m.Statements.Add (stmt);
-                               stmt = Let (PropRef (expr1, "CommandText"), Const (cmd.CommandText));
-                               m.Statements.Add (stmt);
-                               stmt = Let (PropRef (expr1, "CommandType"), 
-                                           PropRef (Local(typeof (CommandType).FullName), cmd.CommandType.ToString ()));
-                               m.Statements.Add (stmt);
-                               expr1 = PropRef (expr1, "Parameters");
-                               foreach (DbParameter param in cmd.Parameters) {
-                                       AddDbParameterStatements (m, expr1, param);
-                               }
-                       }               
-                       t.Members.Add (m);
-               }
-               
-               private void CreateDbSourceMethods (CodeTypeDeclaration t, 
-                                                   TableAdapterSchemaInfo taInfo)
-               {
-                       string tmp = null;
-                       CodeMemberMethod m = null;
-                       CodeExpression expr, expr1, expr2;
-                       CodeStatement stmt;
-                       string tmpScalarVal = null;
-                       
-                       expr = PropRef (PropRef ("Adapter"), "SelectCommand");
-                       // loop through the collection and generate the code
-                       for (int idx = 0; idx < taInfo.Commands.Count; idx++) {
-                               DbCommandInfo cmdInfo = (DbCommandInfo)taInfo.Commands[idx];
-                               
-                               foreach (DbSourceMethodInfo mInfo in cmdInfo.Methods) {
-                                       //Console.WriteLine ("Generating code for {0} method", mInfo.Name);
-                                       
-                                       // TODO: Add support for Fill methods
-                                       if (mInfo.MethodType == GenerateMethodsType.Fill)
-                                               continue;
-                                       
-                                       m = new CodeMemberMethod ();
-                                       m.Name = mInfo.Name;
-                                       
-                                       stmt = Let (expr, IndexerRef (PropRef ("CommandCollection"), Const (idx)));
-                                       m.Statements.Add (stmt);
-                                       
-                                       switch ((MemberAttributes) Enum.Parse (typeof (MemberAttributes), mInfo.Modifier)) {
-                                               case MemberAttributes.Public:
-                                                       m.Attributes = MemberAttributes.Public;
-                                                       break;
-
-                                               case MemberAttributes.Private:
-                                                       m.Attributes = MemberAttributes.Private;
-                                                       break;
-                                               
-                                               case MemberAttributes.Assembly:
-                                                       m.Attributes = MemberAttributes.Assembly;
-                                                       break;
-                                               
-                                               case MemberAttributes.Family:
-                                                       m.Attributes = MemberAttributes.Family;
-                                                       break;
-                                       }
-                                       //Console.WriteLine ("QueryType: {0}", mInfo.QueryType);
-                                       QueryType qType = (QueryType) Enum.Parse (typeof (QueryType), mInfo.QueryType);
-                                       switch (qType) {
-                                               case QueryType.Scalar:
-                                               case QueryType.NoData:
-                                                       // executes non query and returns status
-                                                       m.ReturnType = TypeRef (typeof (int));
-                                                       AddGeneratedMethodParametersAndStatements (m, expr, cmdInfo.Command);
-                                               
-                                                       // store connection state
-                                                       tmp = typeof (System.Data.ConnectionState).FullName;
-                                                       expr1 = PropRef (Local ("command"), "Connection");
-                                                       expr2 = PropRef (PropRef (Local ("System"), "Data"), "ConnectionState");
-                                                       stmt = VarDecl (tmp, "previousConnectionState", PropRef (expr1, "State"));
-                                                       m.Statements.Add (stmt);
-                                                       
-                                                       // Open connection, if its not already
-                                                       CodeExpression expr3 = BitOps (PropRef (expr1, "State"), PropRef (expr2, "Open"),
-                                                                                  CodeBinaryOperatorType.BitwiseAnd);
-                                                       stmt = new CodeConditionStatement (Inequals (expr3, PropRef (expr2, "Open")), 
-                                                                                                         new CodeStatement[] {Eval (MethodInvoke (expr1, "Open", 
-                                                                                                                                                                       new CodeExpression[] {}))},
-                                                                                                         new CodeStatement[] {});
-                                                       m.Statements.Add (stmt);
-                                               
-                                                       // declare return variable and execute query
-                                                       CodeTryCatchFinallyStatement try1 = new CodeTryCatchFinallyStatement ();
-                                               
-                                                       if (qType == QueryType.NoData) {
-                                                               m.Statements.Add (VarDecl (typeof (int), "returnValue", null));
-                                                               expr3 = MethodInvoke (Local ("command"), "ExecuteNonQuery", new CodeExpression[] {});
-                                                       } else {
-                                                               tmpScalarVal = mInfo.ScalarCallRetval.Substring (0, mInfo.ScalarCallRetval.IndexOf (','));
-                                                               m.Statements.Add (VarDecl (TypeRef (tmpScalarVal).BaseType, "returnValue", null));
-                                                               expr3 = MethodInvoke (Local ("command"), "ExecuteScalar", new CodeExpression[] {});
-                                                       }
-                                               
-                                                       // Execute query
-                                                       try1.TryStatements.Add (Let (Local ("returnValue"), expr3));
-                                                       
-                                                       // fill finally block
-                                                       stmt = new CodeConditionStatement (Equals (Local ("previousConnectionState"), PropRef (expr2, "Closed")), 
-                                                                                                                               new CodeStatement[] {Eval (MethodInvoke (expr1, "Close", 
-                                                                                                                                                                       new CodeExpression[] {}))},
-                                                                                                                               new CodeStatement[] {});
-                                                       try1.FinallyStatements.Add (stmt);
-                                                       m.Statements.Add (try1);
-                                               
-                                                       // return the value
-                                                       if (qType == QueryType.NoData) {
-                                                               m.Statements.Add (Return (Local ("returnValue")));
-                                                       } else {
-                                                               expr2 = Equals (Local ("returnValue"), Const (null));
-                                                               expr3 = Equals (MethodInvoke (Local ("returnValue"), "GetType", new CodeExpression[] {}), 
-                                                                               TypeOfRef ("System.DBNull"));
-                                                               stmt = new CodeConditionStatement (BooleanOps (expr2, expr3, CodeBinaryOperatorType.BooleanOr), 
-                                                                                                       new CodeStatement[] {Return (Const (null))},
-                                                                                                                                       new CodeStatement[] {Return (Cast (tmpScalarVal, Local ("returnValue")))});
-                                                               m.Statements.Add (stmt);
-                                                       }
-                                               
-                                                       break;
-
-                                               case QueryType.Rowset:
-                                                       // returns DataTable
-                                                       // TODO: Handle multiple DataTables
-                                                       tmp = opts.DataSetName (ds.DataSetName) + "." + opts.TableTypeName (ds.Tables[0].TableName);
-                                                       m.ReturnType = TypeRef (tmp);
-
-                                                       AddGeneratedMethodParametersAndStatements (m, expr, cmdInfo.Command);
-                                                       stmt = VarDecl (tmp, "dataTable", New (tmp));
-                                                       m.Statements.Add (stmt);
-
-                                                       // fill datatable
-                                                       expr = PropRef ("Adapter");
-                                                       stmt = Eval (MethodInvoke (expr, "Fill", Local ("dataTable")));
-                                                       m.Statements.Add (stmt);
-
-                                                       // return statement
-                                                       m.Statements.Add (Return (Local ("dataTable")));
-                                                       break;
-                                       }
-                                       t.Members.Add (m);
-                               }                       
-                       }
-               }
-               
-               private void AddGeneratedMethodParametersAndStatements (CodeMemberMethod m, 
-                                                                       CodeExpression expr,
-                                                                       DbCommand cmd)
-               {
-                       CodeStatement stmt;
-                       CodeExpression expr1;
-                       int idx = 0;
-                       string tmp;
-
-                       foreach (DbParameter param in cmd.Parameters) {
-                               if (param.Direction != ParameterDirection.ReturnValue) {
-                                       if (param.ParameterName[0] == '@')
-                                               tmp = param.ParameterName.Substring (1);
-                                       else
-                                               tmp = param.ParameterName;
-                                       if (param.SystemType != null)
-                                               m.Parameters.Add (Param (TypeRef(param.SystemType), tmp));
-                                       expr1 = IndexerRef (PropRef (expr, "Parameters"), Const (idx));
-                                       stmt = Let (expr1, ParamRef (tmp));
-                                       m.Statements.Add (stmt);
-                               }
-                               idx++;
-                       }
-               }
-               
-               private void CreateShortCommandMethods (CodeTypeDeclaration t, TableAdapterSchemaInfo taInfo)
-               {
-                       
-               }
-               
-#endregion
-
-       }
-       
-}
-
-
-/* =========================================================
-
-
-MonoDataSetGenerator API notes
-
-
-** generator API:
-       CreateDataSetClasses (
-               DataSet ds,
-               CodeNamespace cns,
-               ICodeGenerator gen,
-               GeneratorOptions options)
-
-** classes:
-
-*** Code naming method delegate
-
-       public delegate string CodeNamingMethod (string sourceName);
-
-       It is used in CodeGeneratorOptions (describled immediately below).
-
-
-
-*** Generator Options
-
-       public bool MakeClassesInsideDataSet
-               indicates whether classes and delegates other than DataSet
-               itself are "contained" in the DataSet class or not.
-
-       public CodeNamingMethod CreateDataSetName;
-       public CodeNamingMethod CreateTableTypeName;
-       public CodeNamingMethod CreateTableMemberName;
-       public CodeNamingMethod CreateColumnName;
-       public CodeNamingMethod CreateRowName;
-       public CodeNamingMethod CreateRelationName;
-       public CodeNamingMethod CreateTableDelegateName;
-       public CodeNamingMethod CreateEventArgsName;
-               Custom methods each of that returns type or member name.
-
-               By default, they are set as to useTypedDataSetGenerator.
-               CreateIdName() with modifications listed as below:
-
-               DataSetName: as is
-               TableTypeName: "DataTable" suffix
-               TableMemberName: as is
-               ColumnName: as is
-               RowName: "Row" suffix
-               RelationName: (TBD; maybe had better have another delegate type)
-               DelegateName: "RowChangedEventHandler" suffix
-               EventArgsName: "RowChangedEventArgs" suffix
-
-** Auto Generated classes
-
-1. Custom DataSet class 
-
-       class name = dataset name, encoded by options.CreateDataSetName().
-
-*** .ctor
-
-       public default .ctor()
-               "initialize" class.
-               set custom delegate on Tables.CollectionChanged
-               set custom delegate on Relations.CollectionChanged
-
-       runtime serialization .ctor()
-               TBD
-
-*** public members
-
-       data tables: [foo]DataTable foo { return this.table[foo]; }
-
-       Clone()
-               init variables on new dataset.
-
-*** protected members
-
-       ShouldSerializeTables()
-               returns false, while default DataSet returns true.
-       ShouldSerializeRelations()
-               returns false, while default DataSet returns true.
-
-       ReadXmlSerializable() ... similar to runtime serialization
-               TBD
-
-       GetSchemaSerializable()
-               Write its schema to temporary MemoryStream
-               Read XML schema from the stream
-
-*** internal members
-
-       "init variables"
-               set member fields (tables, relations)
-               call members' "init variables"
-
-       "init class"
-               set DataSetName, Prefix, Namespace, Locale, CaseSensitive, EnforceConstraints
-               for each table
-                       allocate table[foo] 
-                       Tables.Add() 
-                       create FKC: new FKC([rel], new DataColumn [] {table[foo].[keyColumnName]Column}, new DataColumn [] {table[child].[childColName]Column}
-               fill Rule properties.
-               allocate relation[rel] and fill Nested, then Relations.Add()
-
-*** private members
-
-       data tables: [foo]DataTable table[foo];
-
-       data relations: DataRelation relation[rel];
-
-       ShouldSerialize[foo]
-
-
-
-2. Custom DataTable classes for each DataTable
-
-       This class is created under the dataset.
-
-*** internal members
-
-       .ctor() : base("[foo]")
-               initialize class
-
-       .ctor(DataTable)
-               wtf?
-
-       DataColumn [bar]Column { return column[bar]; }
-
-       "init variables"()
-               fill each column fields
-
-*** public members
-
-       int Count { rowcount }
-
-       this [int index] { row [i]; }
-
-       event [foo]RowChangedEventHandler [foo]RowChanged
-       event [foo]RowChangedEventHandler [foo]RowChanging
-       event [foo]RowChangedEventHandler [foo]RowDeleted
-       event [foo]RowChangedEventHandler [foo]RowDeleting
-
-       void Add[foo]Row ([foo]Row row) { Rows.Add (row); }
-
-       [foo]Row Add[foo]Row ([columnType] [columnName])
-               create new [foo]row.
-               set members
-               Rows.Add ()
-               // where
-               //      non-relation-children are just created as column type
-               //      relation-children are typeof fooRow[]
-
-       GetEnumerator() { Rows.GetEnumerator (); }
-
-       override DataTable Clone()
-               "init variables"
-
-       [foo]Row New[foo]Row()
-
-       void Remove[foo]Row([foo]Row)
-
-       //for each ChildRelations
-       [bar]Row [] Get[foo_bar]Rows ()
-
-*** protected members
-
-       override DataTable CreateInstance() { return new }
-
-       override DataRow NewRowFromBuilder(DataRowBuilder)
-
-       override Type GetRowType()
-
-       override void OnRowChanged(DataRowChangedEventArgs)
-               base.()
-               check this event [foo]RowChanged.
-
-       override void OnRowChanging(DataRowChangedEventArgs)
-       override void OnRowDeleted(DataRowChangedEventArgs)
-       override void OnRowDeleting(DataRowChangedEventArgs)
-       ... as well
-
-*** private members
-
-       "initialize class"
-               for each columns {
-                       column[bar] = new DataColumn (...);
-                       Columns.Add()
-               }
-
-       DataColumn [bar]Column
-
-3. Custom DataRow classses
-
-*** public members
-
-       for simple members:
-
-               [bar_type] [bar] {
-                       get { try { } catch { throw StrongTypingException(); }
-                       set { this [[foo]Table.[bar]Column] = value; }
-
-               bool Is[bar]Null ()
-                       IsNull ([foo]Table.[bar]Column);
-
-               void Set[bar]Null ()
-
-       if the table is parent of some relations
-
-               public [child]Row [] Get[child]Rows()
-
-*** internal members
-
-       .ctor(DataRowBuilder) : base.()
-               table[foo] = Table;
-
-*** private members
-
-       [foo]DataTable table[foo]
-
-
-4. Custom DataRowChangeEvent classes
-
-*** private members
-
-       [foo]Row eventRow
-       DataRowAction eventAction
-
-*** public members
-
-       .ctor([foo]Row row, DataRowAction action)
-
-       [foo]Row Row
-
-       DataRowAction Action
-
-
-
-5. public Table RowChangedEventHandler delegates
-
-       [foo]RowChangedEventHandler(object, [foo]RowChangedEvent e)
-
-
-======================================================== */
diff --git a/mcs/class/System.Data/System.Data/DBConcurrencyException.cs b/mcs/class/System.Data/System.Data/DBConcurrencyException.cs
deleted file mode 100644 (file)
index 4c3b363..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-//
-// System.Data.DBConcurrencyException.cs
-//
-// Author: Duncan Mak  (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System.Data
-{
-       [Serializable]
-       public sealed class DBConcurrencyException : SystemException
-       {
-               DataRow [] rows;
-
-               #region Constructors
-
-               public DBConcurrencyException ()
-                       : base ("Concurrency violation.")
-               {
-               }
-
-               public DBConcurrencyException (string message)
-                       : base (message)
-               {
-               }
-
-               public DBConcurrencyException (string message, Exception inner)
-                       : base (message, inner)
-               {
-               }
-
-               public
-               DBConcurrencyException (string message, Exception inner, DataRow[] dataRows)
-                       : base (message, inner)
-               {
-                       rows = dataRows;
-               }
-
-               private DBConcurrencyException (SerializationInfo si, StreamingContext sc) : base(si, sc)
-               {
-               }
-
-               #endregion // Constructors
-
-               #region Properties
-
-               public DataRow Row {
-                       get {
-                               if (rows != null)
-                                       return rows [0];
-                               return null;
-                       }
-                       set { rows = new DataRow [] { value };}
-               }
-
-               public int RowCount {
-                       get {
-                               if (rows != null)
-                                       return rows.Length;
-                               return 0;
-                       }
-               }
-
-               #endregion // Properties
-
-               #region Methods
-
-               [MonoTODO]
-               public void CopyToRows (DataRow [] array)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               public void CopyToRows (DataRow [] array, int arrayIndex)
-               {
-                       throw new NotImplementedException ();
-               }
-               public override void GetObjectData (SerializationInfo si, StreamingContext context)
-               {
-                       if (si == null)
-                               throw new ArgumentNullException ("si");
-
-                       base.GetObjectData (si, context);
-               }
-
-               #endregion // Methods
-       }
-}
diff --git a/mcs/class/System.Data/System.Data/DataCategoryAttribute.cs b/mcs/class/System.Data/System.Data/DataCategoryAttribute.cs
deleted file mode 100644 (file)
index 5b1b475..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-// 
-// System.Data/DataCategoryAttribute.cs
-//
-// Author:
-//   Tim Coleman (tim@timcoleman.com)
-//
-// Copyright (C) Tim Coleman, 2002
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.ComponentModel;
-
-namespace System.Data {
-       [AttributeUsage (AttributeTargets.All)]
-       internal sealed class DataCategoryAttribute : CategoryAttribute
-       {
-               #region Fields
-
-//             string category;
-
-               #endregion // Fields
-
-               #region Constructors
-
-               public DataCategoryAttribute (string category)
-               {
-//                     this.category = category; 
-               }
-
-               #endregion // Constructors
-
-               #region Methods
-
-               [MonoTODO]
-               protected override string GetLocalizedString (string value)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               #endregion // Methods
-       }
-}
diff --git a/mcs/class/System.Data/System.Data/DataColumn.cs b/mcs/class/System.Data/System.Data/DataColumn.cs
deleted file mode 100644 (file)
index 1631f10..0000000
+++ /dev/null
@@ -1,877 +0,0 @@
-//\r
-// System.Data.DataColumn.cs\r
-//\r
-// Author:\r
-//   Franklin Wise (gracenote@earthlink.net)\r
-//   Christopher Podurgiel (cpodurgiel@msn.com)\r
-//   Rodrigo Moya (rodrigo@ximian.com)\r
-//   Daniel Morgan (danmorg@sc.rr.com)\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// (C) Copyright 2002, Franklin Wise\r
-// (C) Chris Podurgiel\r
-// (C) Ximian, Inc 2002\r
-// Copyright (C) Tim Coleman, 2002\r
-// Copyright (C) Daniel Morgan, 2002, 2003\r
-//\r
-\r
-//\r
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)\r
-// Copyright (C) 2011 Xamarin Inc (http://www.xamarin.com)\r
-//\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-//\r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-//\r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
-//\r
-\r
-using System;\r
-using System.ComponentModel;\r
-using System.Reflection;\r
-using System.Collections;\r
-using System.Data.Common;\r
-using System.Data.SqlTypes;\r
-using System.Globalization;\r
-using Mono.Data.SqlExpressions;\r
-\r
-namespace System.Data {\r
-       internal delegate void DelegateColumnValueChange (DataColumn column, DataRow row, object proposedValue);\r
-\r
-       /// <summary>\r
-       /// Summary description for DataColumn.\r
-       /// </summary>\r
-\r
-       [Editor ("Microsoft.VSDesigner.Data.Design.DataColumnEditor, " + Consts.AssemblyMicrosoft_VSDesigner,\r
-                "System.Drawing.Design.UITypeEditor, " + Consts.AssemblySystem_Drawing)]\r
-       [ToolboxItem (false)]\r
-       [DefaultProperty ("ColumnName")]\r
-       [DesignTimeVisible (false)]\r
-       public class DataColumn : MarshalByValueComponent {\r
-#region Events\r
-               EventHandlerList _eventHandlers = new EventHandlerList ();\r
-\r
-               //used for constraint validation\r
-               //if an exception is fired during this event the change should be canceled\r
-               //[MonoTODO]\r
-               //internal event DelegateColumnValueChange ValidateColumnValueChange;\r
-\r
-               //used for FK Constraint Cascading rules\r
-               //[MonoTODO]\r
-               //internal event DelegateColumnValueChange ColumnValueChanging;\r
-\r
-               static readonly object _propertyChangedKey = new object ();\r
-               internal event PropertyChangedEventHandler PropertyChanged {\r
-                       add { _eventHandlers.AddHandler (_propertyChangedKey, value); }\r
-                       remove { _eventHandlers.RemoveHandler (_propertyChangedKey, value); }\r
-               }\r
-\r
-               #endregion //Events\r
-\r
-               #region Fields\r
-\r
-               private bool _allowDBNull = true;\r
-               private bool _autoIncrement;\r
-               private long _autoIncrementSeed;\r
-               private long _autoIncrementStep = 1;\r
-               private long _nextAutoIncrementValue;\r
-               private string _caption;\r
-               private MappingType _columnMapping;\r
-               private string _columnName = String.Empty;\r
-               private object _defaultValue = GetDefaultValueForType (null);\r
-               private string _expression;\r
-               private IExpression _compiledExpression;\r
-               private PropertyCollection _extendedProperties = new PropertyCollection ();\r
-               private int _maxLength = -1; //-1 represents no length limit\r
-               private string _nameSpace;\r
-               private int _ordinal = -1; //-1 represents not part of a collection\r
-               private string _prefix = String.Empty;\r
-               private bool _readOnly;\r
-               private DataTable _table;\r
-               private bool _unique;\r
-               private DataContainer _dataContainer;\r
-\r
-               #endregion // Fields\r
-\r
-               #region Constructors\r
-\r
-               public DataColumn ()\r
-                       : this (String.Empty, typeof (string), String.Empty, MappingType.Element)\r
-               {\r
-               }\r
-\r
-               //TODO: Ctor init vars directly\r
-               public DataColumn (string columnName)\r
-                       : this (columnName, typeof (string), String.Empty, MappingType.Element)\r
-               {\r
-               }\r
-\r
-               public DataColumn (string columnName, Type dataType)\r
-                       : this (columnName, dataType, String.Empty, MappingType.Element)\r
-               {\r
-               }\r
-\r
-               public DataColumn (string columnName, Type dataType, string expr)\r
-                       : this (columnName, dataType, expr, MappingType.Element)\r
-               {\r
-               }\r
-\r
-               public DataColumn (string columnName, Type dataType, string expr, MappingType type)\r
-               {\r
-                       ColumnName = columnName == null ? String.Empty : columnName;\r
-\r
-                       if (dataType == null)\r
-                               throw new ArgumentNullException ("dataType");\r
-\r
-                       DataType = dataType;\r
-                       Expression = expr == null ? String.Empty : expr;\r
-                       ColumnMapping = type;\r
-               }\r
-               #endregion\r
-\r
-               #region Properties\r
-\r
-               internal object this [int index] {\r
-                       get { return DataContainer [index]; }\r
-                       set {\r
-                               if (!(value == null && AutoIncrement)) {\r
-                                       try {\r
-                                               DataContainer [index] = value;\r
-                                       } catch(Exception e) {\r
-                                               throw new ArgumentException (\r
-                                                       String.Format (\r
-                                                               "{0}. Couldn't store <{1}> in Column named '{2}'. Expected type is {3}.",\r
-                                                               e.Message, value, ColumnName, DataType.Name),\r
-                                                       e);\r
-                                       }\r
-                               }\r
-\r
-                               if (AutoIncrement && !DataContainer.IsNull (index)) {\r
-                                       long value64 = Convert.ToInt64 (value);\r
-                                       UpdateAutoIncrementValue (value64);\r
-                               }\r
-                       }\r
-               }\r
-\r
-               DataSetDateTime _datetimeMode = DataSetDateTime.UnspecifiedLocal;\r
-               [DefaultValue (DataSetDateTime.UnspecifiedLocal)]\r
-               [RefreshProperties (RefreshProperties.All)]\r
-               public DataSetDateTime DateTimeMode {\r
-                       get { return _datetimeMode; }\r
-                       set {\r
-                               if (DataType != typeof (DateTime))\r
-                                       throw new InvalidOperationException ("The DateTimeMode can be set only on DataColumns of type DateTime.");\r
-\r
-                               if (!Enum.IsDefined (typeof (DataSetDateTime), value))\r
-                                       throw new InvalidEnumArgumentException (\r
-                                               string.Format (\r
-                                                       CultureInfo.InvariantCulture, "The {0} enumeration value, {1}, is invalid",\r
-                                                       typeof (DataSetDateTime).Name, value));\r
-\r
-                               if (_datetimeMode == value)\r
-                                       return;\r
-                               if (_table == null || _table.Rows.Count == 0) {\r
-                                       _datetimeMode = value;\r
-                                       return;\r
-                               }\r
-                               if ((_datetimeMode == DataSetDateTime.Unspecified || _datetimeMode == DataSetDateTime.UnspecifiedLocal)\r
-                                       && (value == DataSetDateTime.Unspecified || value == DataSetDateTime.UnspecifiedLocal)) {\r
-                                       _datetimeMode = value;\r
-                                       return;\r
-                               }\r
-\r
-                               throw new InvalidOperationException (\r
-                                       String.Format ("Cannot change DateTimeMode from '{0}' to '{1}' once the table has data.",\r
-                                                      _datetimeMode, value));\r
-                       }\r
-               }\r
-\r
-               [DataCategory ("Data")]\r
-               [DefaultValue (true)]\r
-               public bool AllowDBNull {\r
-                       get { return _allowDBNull; }\r
-                       set {\r
-                               if (!value && null != _table) {\r
-                                       for (int r = 0; r < _table.Rows.Count; r++) {\r
-                                               DataRow row = _table.Rows [r];\r
-                                               DataRowVersion version = row.HasVersion (DataRowVersion.Default) ?\r
-                                                       DataRowVersion.Default : DataRowVersion.Original;\r
-                                               if (row.IsNull (this, version))\r
-                                                       throw new DataException ("Column '" + ColumnName + "' has null values in it.");\r
-                                               //TODO: do we also check different versions of the row??\r
-                                       }\r
-                               }\r
-\r
-                               _allowDBNull = value;\r
-                       }\r
-               }\r
-\r
-               /// <summary>\r
-               /// Gets or sets a value indicating whether the column automatically increments the value of the column for new rows added to the table.\r
-               /// </summary>\r
-               /// <remarks>\r
-               ///             If the type of this column is not Int16, Int32, or Int64 when this property is set,\r
-               ///             the DataType property is coerced to Int32. An exception is generated if this is a computed column\r
-               ///             (that is, the Expression property is set.) The incremented value is used only if the row's value for this column,\r
-               ///             when added to the columns collection, is equal to the default value.\r
-               ///     </remarks>\r
-               [DataCategory ("Data")]\r
-               [DefaultValue (false)]\r
-               [RefreshProperties (RefreshProperties.All)]\r
-               public bool AutoIncrement {\r
-                       get { return _autoIncrement; }\r
-                       set {\r
-                               if (value) {\r
-                                       //Can't be true if this is a computed column\r
-                                       if (Expression != string.Empty)\r
-                                               throw new ArgumentException ("Can not Auto Increment a computed column.");\r
-\r
-                                       if (DefaultValue != DBNull.Value)\r
-                                               throw new ArgumentException ("Can not set AutoIncrement while default value exists for this column.");\r
-\r
-                                       if (!CanAutoIncrement (DataType))\r
-                                               DataType = typeof (Int32);\r
-                               }\r
-\r
-                               if (_table != null)\r
-                                       _table.Columns.UpdateAutoIncrement (this, value);\r
-                               _autoIncrement = value;\r
-                       }\r
-               }\r
-\r
-               [DataCategory ("Data")]\r
-               [DefaultValue (0)]\r
-               public long AutoIncrementSeed {\r
-                       get { return _autoIncrementSeed; }\r
-                       set {\r
-                               _autoIncrementSeed = value;\r
-                               _nextAutoIncrementValue = _autoIncrementSeed;\r
-                       }\r
-               }\r
-\r
-               [DataCategory ("Data")]\r
-               [DefaultValue (1)]\r
-               public long AutoIncrementStep {\r
-                       get { return _autoIncrementStep; }\r
-                       set { _autoIncrementStep = value; }\r
-               }\r
-\r
-               internal void UpdateAutoIncrementValue (long value64)\r
-               {\r
-                       if (_autoIncrementStep > 0) {\r
-                               if (value64 >= _nextAutoIncrementValue) {\r
-                                       _nextAutoIncrementValue = value64;\r
-                                       AutoIncrementValue ();\r
-                               }\r
-                       } else if (value64 <= _nextAutoIncrementValue) {\r
-                               _nextAutoIncrementValue = value64;\r
-                               AutoIncrementValue ();\r
-                       }\r
-               }\r
-\r
-               internal long AutoIncrementValue ()\r
-               {\r
-                       long currentValue = _nextAutoIncrementValue;\r
-                       _nextAutoIncrementValue += AutoIncrementStep;\r
-                       return currentValue;\r
-               }\r
-\r
-               internal long GetAutoIncrementValue ()\r
-               {\r
-                       return _nextAutoIncrementValue;\r
-               }\r
-\r
-               internal void SetDefaultValue (int index)\r
-               {\r
-                       if (AutoIncrement)\r
-                               this [index] = _nextAutoIncrementValue;\r
-                       else\r
-                               DataContainer.CopyValue (Table.DefaultValuesRowIndex, index);\r
-               }\r
-\r
-               [DataCategory ("Data")]\r
-               public string Caption {\r
-                       get { return _caption == null ? ColumnName : _caption; }\r
-                       set { _caption = value == null ? String.Empty : value; }\r
-               }\r
-\r
-               [DefaultValue (MappingType.Element)]\r
-               public virtual MappingType ColumnMapping {\r
-                       get { return _columnMapping; }\r
-                       set { _columnMapping = value; }\r
-               }\r
-\r
-               [DataCategory ("Data")]\r
-               [RefreshProperties (RefreshProperties.All)]\r
-               [DefaultValue ("")]\r
-               public string ColumnName {\r
-                       get { return _columnName; }\r
-                       set {\r
-                               if (value == null)\r
-                                       value = String.Empty;\r
-\r
-                               CultureInfo info = Table != null ? Table.Locale : CultureInfo.CurrentCulture;\r
-                               if (String.Compare (value, _columnName, true, info) != 0) {\r
-                                       if (Table != null) {\r
-                                               if (value.Length == 0)\r
-                                                       throw new ArgumentException ("ColumnName is required when it is part of a DataTable.");\r
-\r
-                                               Table.Columns.RegisterName (value, this);\r
-                                               if (_columnName.Length > 0)\r
-                                                       Table.Columns.UnregisterName (_columnName);\r
-                                       }\r
-\r
-                                       RaisePropertyChanging ("ColumnName");\r
-                                       _columnName = value;\r
-\r
-                                       if (Table != null)\r
-                                               Table.ResetPropertyDescriptorsCache ();\r
-                               } else if (String.Compare (value, _columnName, false, info) != 0) {\r
-                                       RaisePropertyChanging ("ColumnName");\r
-                                       _columnName = value;\r
-\r
-                                       if (Table != null)\r
-                                               Table.ResetPropertyDescriptorsCache ();\r
-                               }\r
-                       }\r
-               }\r
-\r
-               [DataCategory ("Data")]\r
-               [DefaultValue (typeof (string))]\r
-               [RefreshProperties (RefreshProperties.All)]\r
-               [TypeConverterAttribute (typeof (ColumnTypeConverter))]\r
-               public Type DataType {\r
-                       get { return DataContainer.Type; }\r
-                       set {\r
-                               if (value == null)\r
-                                       return;\r
-\r
-                               if (_dataContainer != null) {\r
-                                       if (value == _dataContainer.Type)\r
-                                               return;\r
-\r
-                                       // check if data already exists can we change the datatype\r
-                                       if (_dataContainer.Capacity > 0)\r
-                                               throw new ArgumentException ("The column already has data stored.");\r
-                               }\r
-\r
-                               if (null != GetParentRelation () || null != GetChildRelation ())\r
-                                       throw new InvalidConstraintException ("Cannot change datatype when column is part of a relation");\r
-\r
-                               Type prevType = _dataContainer != null ? _dataContainer.Type : null; // current\r
-\r
-                               if (_dataContainer != null && _dataContainer.Type == typeof (DateTime))\r
-                                       _datetimeMode = DataSetDateTime.UnspecifiedLocal;\r
-                               _dataContainer = DataContainer.Create (value, this);\r
-\r
-                               //Check AutoIncrement status, make compatible datatype\r
-                               if(AutoIncrement == true) {\r
-                                       // we want to check that the datatype is supported?                                     \r
-                                       if (!CanAutoIncrement (value))\r
-                                               AutoIncrement = false;\r
-                               }\r
-\r
-                               if (DefaultValue != GetDefaultValueForType (prevType))\r
-                                       SetDefaultValue (DefaultValue, true);\r
-                               else\r
-                                       _defaultValue = GetDefaultValueForType (DataType);\r
-                       }\r
-               }\r
-\r
-               /// <summary>\r
-               ///\r
-               /// </summary>\r
-               /// <remarks>When AutoIncrement is set to true, there can be no default value.</remarks>\r
-               /// <exception cref="System.InvalidCastException"></exception>\r
-               /// <exception cref="System.ArgumentException"></exception>\r
-               [DataCategory ("Data")]\r
-               [TypeConverterAttribute (typeof (System.Data.DefaultValueTypeConverter))]\r
-               public object DefaultValue {\r
-                       get { return _defaultValue; }\r
-\r
-                       set {\r
-                               if (AutoIncrement)\r
-                                       throw new ArgumentException ("Can not set default value while AutoIncrement is true on this column.");\r
-                               SetDefaultValue (value, false);\r
-                       }\r
-               }\r
-\r
-               void SetDefaultValue (object value, bool forcedTypeCheck)\r
-               {\r
-                       if (forcedTypeCheck || !this._defaultValue.Equals (value)) {\r
-                               if (value == null || value == DBNull.Value)\r
-                                       _defaultValue = GetDefaultValueForType (DataType);\r
-                               else if (DataType.IsInstanceOfType (value))\r
-                                       _defaultValue = value;\r
-                               else\r
-                                       try {\r
-                                               _defaultValue = Convert.ChangeType (value, DataType);\r
-                                       } catch (InvalidCastException) {\r
-                                               string msg = String.Format ("Default Value of type '{0}' is not compatible with column type '{1}'", value.GetType (), DataType);\r
-                                               throw new DataException (msg);\r
-                                       }\r
-                       }\r
-\r
-                       // store default value in the table if already belongs to\r
-                       if (Table != null && Table.DefaultValuesRowIndex != -1)\r
-                               DataContainer [Table.DefaultValuesRowIndex] = _defaultValue;\r
-               }\r
-\r
-               [DataCategory ("Data")]\r
-               [DefaultValue ("")]\r
-               [RefreshProperties (RefreshProperties.All)]\r
-               public string Expression {\r
-                       get { return _expression; }\r
-                       set {\r
-                               if (value == null || value.Trim () == string.Empty)\r
-                                       value = String.Empty;\r
-\r
-                               CompileExpression (value);\r
-                               _expression = value;\r
-                       }\r
-               }\r
-\r
-               internal void CompileExpression ()\r
-               {\r
-                       CompileExpression (_expression);\r
-               }\r
-\r
-               internal void CompileExpression (string expression)\r
-               {\r
-                       if (expression != String.Empty) {\r
-                               if (AutoIncrement || Unique)\r
-                                       throw new ArgumentException ("Cannot create an expression on a column that has AutoIncrement or Unique.");\r
-\r
-                               if (Table != null) {\r
-                                       for (int i = 0; i < Table.Constraints.Count; i++) {\r
-                                               if (Table.Constraints [i].IsColumnContained (this))\r
-                                                       throw new ArgumentException (\r
-                                                               String.Format (\r
-                                                                       "Cannot set Expression property on column {0}, because it is a part of a constraint.",\r
-                                                                       ColumnName));\r
-                                       }\r
-                               }\r
-\r
-                               Parser parser = new Parser ();\r
-                               IExpression compiledExpression = parser.Compile (expression);\r
-\r
-                               if (Table != null) {\r
-                                       if (compiledExpression.DependsOn (this))\r
-                                               throw new ArgumentException ("Cannot set Expression property due to circular reference in the expression.");\r
-                                       // Check if expression is ok\r
-                                       if (Table.Rows.Count == 0)\r
-                                               compiledExpression.Eval (Table.NewRow ());\r
-                                       else\r
-                                               compiledExpression.Eval (Table.Rows [0]);\r
-                               }\r
-                               ReadOnly = true;\r
-                               _compiledExpression = compiledExpression;\r
-                       } else {\r
-                               _compiledExpression = null;\r
-                               if (Table != null) {\r
-                                       int defaultValuesRowIndex = Table.DefaultValuesRowIndex;\r
-                                       if (defaultValuesRowIndex != -1)\r
-                                               DataContainer.FillValues (defaultValuesRowIndex);\r
-                               }\r
-                       }\r
-               }\r
-\r
-               internal IExpression CompiledExpression {\r
-                       get { return _compiledExpression; }\r
-               }\r
-\r
-               [Browsable (false)]\r
-               [DataCategory ("Data")]\r
-               public PropertyCollection ExtendedProperties {\r
-                       get { return _extendedProperties; }\r
-                       internal set { _extendedProperties = value; }\r
-               }\r
-\r
-               [DataCategory ("Data")]\r
-               [DefaultValue (-1)] //Default == -1 no max length\r
-               public int MaxLength {\r
-                       get { return _maxLength; }\r
-                       set {\r
-                               if (value >= 0 && _columnMapping == MappingType.SimpleContent)\r
-                                       throw new ArgumentException (\r
-                                               String.Format (\r
-                                                       "Cannot set MaxLength property on '{0}' column which is mapped to SimpleContent.",\r
-                                                       ColumnName));\r
-                               //only applies to string columns\r
-                               _maxLength = value;\r
-                       }\r
-               }\r
-\r
-               [DataCategory ("Data")]\r
-               public string Namespace {\r
-                       get {\r
-                               if (_nameSpace != null)\r
-                                       return _nameSpace;\r
-                               if (Table != null && _columnMapping != MappingType.Attribute)\r
-                                       return Table.Namespace;\r
-                               return String.Empty;\r
-                       }\r
-                       set { _nameSpace = value; }\r
-               }\r
-\r
-               //Need a good way to set the Ordinal when the column is added to a columnCollection.\r
-               [Browsable (false)]\r
-               [DataCategory ("Data")]\r
-               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]\r
-               public int Ordinal {\r
-                       get { return _ordinal; }\r
-                       internal set { _ordinal = value; }\r
-               }\r
-\r
-               public void SetOrdinal (int ordinal)\r
-               {\r
-                       if (_ordinal == -1)\r
-                               throw new ArgumentException ("Column must belong to a table.");\r
-                       _table.Columns.MoveColumn (_ordinal, ordinal);\r
-                       _ordinal = ordinal;\r
-               }\r
-\r
-               [DataCategory ("Data")]\r
-               [DefaultValue ("")]\r
-               public string Prefix {\r
-                       get { return _prefix; }\r
-                       set { _prefix = value == null ? String.Empty : value; }\r
-               }\r
-\r
-               [DataCategory ("Data")]\r
-               [DefaultValue (false)]\r
-               public bool ReadOnly {\r
-                       get { return _readOnly; }\r
-                       set { _readOnly = value; }\r
-               }\r
-\r
-               [Browsable (false)]\r
-               [DataCategory ("Data")]\r
-               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]\r
-               public DataTable Table {\r
-                       get { return _table; }\r
-                       internal set { _table = value; }\r
-               }\r
-\r
-               [DataCategory ("Data")]\r
-               [DefaultValue (false)]\r
-               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]\r
-               public bool Unique {\r
-                       get { return _unique; }\r
-                       set {\r
-                               if (_unique == value)\r
-                                       return;\r
-\r
-                               // Set the property value, so that when adding/removing the constraint\r
-                               // we dont run into recursive issues.\r
-                               _unique = value;\r
-\r
-                               if (_table == null)\r
-                                       return;\r
-\r
-                               try {\r
-                                       if (value) {\r
-                                               if (Expression != null && Expression != String.Empty)\r
-                                                       throw new ArgumentException ("Cannot change Unique property for the expression column.");\r
-\r
-                                               _table.Constraints.Add (null, this, false);\r
-                                       } else {\r
-\r
-                                               UniqueConstraint uc = UniqueConstraint.GetUniqueConstraintForColumnSet (\r
-                                                       _table.Constraints, new DataColumn[] {this});\r
-                                               _table.Constraints.Remove (uc);\r
-                                       }\r
-                               } catch (Exception e) {\r
-                                       _unique = !value;\r
-                                       throw e;\r
-                               }\r
-                       }\r
-               }\r
-\r
-               internal DataContainer DataContainer {\r
-                       get { return _dataContainer; }\r
-               }\r
-\r
-               internal static bool CanAutoIncrement (Type type)\r
-               {\r
-                       switch (Type.GetTypeCode (type)) {\r
-                               case TypeCode.Int16:\r
-                               case TypeCode.Int32:\r
-                               case TypeCode.Int64:\r
-                               case TypeCode.Decimal:\r
-                                       return true;\r
-                       }\r
-\r
-                       return false;\r
-               }\r
-\r
-               #endregion // Properties\r
-\r
-               #region Methods\r
-\r
-               [MonoTODO]\r
-               internal DataColumn Clone ()\r
-               {\r
-                       DataColumn copy = new DataColumn ();\r
-\r
-                       // Copy all the properties of column\r
-                       copy._allowDBNull = _allowDBNull;\r
-                       copy._autoIncrement = _autoIncrement;\r
-                       copy._autoIncrementSeed = _autoIncrementSeed;\r
-                       copy._autoIncrementStep = _autoIncrementStep;\r
-                       copy._caption = _caption;\r
-                       copy._columnMapping = _columnMapping;\r
-                       copy._columnName = _columnName;\r
-                       //Copy.Container\r
-                       copy.DataType = DataType;\r
-                       copy._defaultValue = _defaultValue;\r
-                       // Do not use the Expression property to set the expression, the caller of Clone \r
-                       // must explicitly call CompileExpression on the returned DataColumn to update compiledExpression (if any).\r
-                       copy._expression = _expression;\r
-                       //Copy.ExtendedProperties\r
-                       foreach (object key in _extendedProperties.Keys)\r
-                               copy.ExtendedProperties.Add (key, ExtendedProperties[key]);\r
-                       copy._maxLength = _maxLength;\r
-                       copy._nameSpace = _nameSpace;\r
-                       copy._prefix = _prefix;\r
-                       copy._readOnly = _readOnly;\r
-                       //Copy.Site\r
-                       //we do not copy the unique value - it will be copyied when copying the constraints.\r
-                       //Copy.Unique = Column.Unique;\r
-                       if (DataType == typeof (DateTime))\r
-                               copy.DateTimeMode = _datetimeMode;\r
-\r
-                       return copy;\r
-               }\r
-\r
-               /// <summary>\r
-               ///  Sets unique true whithout creating Constraint\r
-               /// </summary>\r
-               internal void SetUnique ()\r
-               {\r
-                       _unique = true;\r
-               }\r
-\r
-               [MonoTODO]\r
-               internal void AssertCanAddToCollection ()\r
-               {\r
-                       //Check if Default Value is set and AutoInc is set\r
-               }\r
-\r
-               [MonoTODO]\r
-               protected internal void CheckNotAllowNull ()\r
-               {\r
-                       throw new NotImplementedException ();\r
-               }\r
-\r
-               [MonoTODO]\r
-               protected void CheckUnique ()\r
-               {\r
-                       throw new NotImplementedException ();\r
-               }\r
-\r
-               protected internal virtual void\r
-               OnPropertyChanging (PropertyChangedEventArgs pcevent)\r
-               {\r
-                       PropertyChangedEventHandler eh = _eventHandlers [_propertyChangedKey] as PropertyChangedEventHandler;\r
-\r
-                       if (eh != null)\r
-                               eh (this, pcevent);\r
-               }\r
-\r
-               protected internal void RaisePropertyChanging (string name)\r
-               {\r
-                       PropertyChangedEventArgs e = new PropertyChangedEventArgs (name);\r
-                       OnPropertyChanging (e);\r
-               }\r
-\r
-               /// <summary>\r
-               /// Gets the Expression of the column, if one exists.\r
-               /// </summary>\r
-               /// <returns>The Expression value, if the property is set;\r
-               /// otherwise, the ColumnName property.</returns>\r
-               public override string ToString ()\r
-               {\r
-                       if (_expression != string.Empty)\r
-                               return ColumnName + " + " + _expression;\r
-\r
-                       return ColumnName;\r
-               }\r
-\r
-               internal void SetTable (DataTable table)\r
-               {\r
-                       if(_table != null)\r
-                               throw new ArgumentException ("The column already belongs to a different table");\r
-\r
-                       _table = table;\r
-                       // this will get called by DataTable\r
-                       // and DataColumnCollection\r
-                       if (_unique) {\r
-                               // if the DataColumn is marked as Unique and then\r
-                               // added to a DataTable , then a UniqueConstraint\r
-                               // should be created\r
-                               UniqueConstraint uc = new UniqueConstraint (this);\r
-                               _table.Constraints.Add (uc);\r
-                       }\r
-\r
-                       // allocate space in the column data container\r
-                       DataContainer.Capacity = _table.RecordCache.CurrentCapacity;\r
-\r
-                       int defaultValuesRowIndex = _table.DefaultValuesRowIndex;\r
-                       if (defaultValuesRowIndex != -1) {\r
-                               // store default value in the table\r
-                               DataContainer [defaultValuesRowIndex] = _defaultValue;\r
-                               // Set all the values in data container to default\r
-                               // it's cheaper that raise event on each row.\r
-                               DataContainer.FillValues (defaultValuesRowIndex);\r
-                       }\r
-               }\r
-\r
-               // Returns true if all the same collumns are in columnSet and compareSet\r
-               internal static bool AreColumnSetsTheSame (DataColumn [] columnSet, DataColumn [] compareSet)\r
-               {\r
-                       if (null == columnSet && null == compareSet)\r
-                               return true;\r
-\r
-                       if (null == columnSet || null == compareSet)\r
-                               return false;\r
-\r
-                       if (columnSet.Length != compareSet.Length)\r
-                               return false;\r
-\r
-                       foreach (DataColumn col in columnSet) {\r
-                               bool matchFound = false;\r
-                               foreach (DataColumn compare in compareSet) {\r
-                                       if (col == compare)\r
-                                               matchFound = true;\r
-                               }\r
-                               if (!matchFound)\r
-                                       return false;\r
-                       }\r
-                       return true;\r
-               }\r
-\r
-               internal int CompareValues (int index1, int index2)\r
-               {\r
-                       return DataContainer.CompareValues (index1, index2);\r
-               }\r
-\r
-               /// <summary>\r
-               ///     Returns the data relation, which contains this column.\r
-               ///     This searches in current table's parent relations.\r
-               /// <summary>\r
-               /// <returns>\r
-               ///     DataRelation if found otherwise null.\r
-               /// </returns>\r
-               private DataRelation GetParentRelation ()\r
-               {\r
-                       if (_table == null)\r
-                               return null;\r
-                       foreach (DataRelation rel in _table.ParentRelations)\r
-                               if (rel.Contains (this))\r
-                                       return rel;\r
-                       return null;\r
-               }\r
-\r
-\r
-               /// <summary>\r
-               ///     Returns the data relation, which contains this column.\r
-               ///     This searches in current table's child relations.\r
-               /// <summary>\r
-               /// <returns>\r
-               ///     DataRelation if found otherwise null.\r
-               /// </returns>\r
-               private DataRelation GetChildRelation ()\r
-               {\r
-                       if (_table == null)\r
-                               return null;\r
-                       foreach (DataRelation rel in _table.ChildRelations)\r
-                               if (rel.Contains (this))\r
-                                       return rel;\r
-                       return null;\r
-               }\r
-\r
-               internal void ResetColumnInfo ()\r
-               {\r
-                       _ordinal = -1;\r
-                       _table = null;\r
-                       if (_compiledExpression != null)\r
-                               _compiledExpression.ResetExpression ();\r
-               }\r
-\r
-               internal bool DataTypeMatches (DataColumn col)\r
-               {\r
-                       if (DataType != col.DataType)\r
-                               return false;\r
-                       if (DataType != typeof (DateTime))\r
-                               return true;\r
-\r
-                       if (DateTimeMode == col.DateTimeMode)\r
-                               return true;\r
-\r
-                       if (DateTimeMode == DataSetDateTime.Local || DateTimeMode == DataSetDateTime.Utc)\r
-                               return false;\r
-\r
-                       if (col.DateTimeMode == DataSetDateTime.Local || col.DateTimeMode == DataSetDateTime.Utc)\r
-                               return false;\r
-                       return true;\r
-               }\r
-\r
-               internal static object GetDefaultValueForType (Type type)\r
-               {\r
-                       if (type == null)\r
-                               return DBNull.Value;\r
-                       if (type.Namespace == "System.Data.SqlTypes" && type.Assembly == typeof (DataColumn).Assembly) {\r
-                               // For SqlXxx types, set SqlXxx.Null instead of DBNull.Value.\r
-                               if (type == typeof (SqlBinary))\r
-                                       return SqlBinary.Null;\r
-                               if (type == typeof (SqlBoolean))\r
-                                       return SqlBoolean.Null;\r
-                               if (type == typeof (SqlByte))\r
-                                       return SqlByte.Null;\r
-                               if (type == typeof (SqlBytes))\r
-                                       return SqlBytes.Null;\r
-                               if (type == typeof (SqlChars))\r
-                                       return SqlChars.Null;\r
-                               if (type == typeof (SqlDateTime))\r
-                                       return SqlDateTime.Null;\r
-                               if (type == typeof (SqlDecimal))\r
-                                       return SqlDecimal.Null;\r
-                               if (type == typeof (SqlDouble))\r
-                                       return SqlDouble.Null;\r
-                               if (type == typeof (SqlGuid))\r
-                                       return SqlGuid.Null;\r
-                               if (type == typeof (SqlInt16))\r
-                                       return SqlInt16.Null;\r
-                               if (type == typeof (SqlInt32))\r
-                                       return SqlInt32.Null;\r
-                               if (type == typeof (SqlInt64))\r
-                                       return SqlInt64.Null;\r
-                               if (type == typeof (SqlMoney))\r
-                                       return SqlMoney.Null;\r
-                               if (type == typeof (SqlSingle))\r
-                                       return SqlSingle.Null;\r
-                               if (type == typeof (SqlString))\r
-                                       return SqlString.Null;\r
-                               if (type == typeof (SqlXml))\r
-                                       return SqlXml.Null;\r
-                       }\r
-                       return DBNull.Value;\r
-               }\r
-\r
-               #endregion // Methods\r
-       }\r
-}\r
diff --git a/mcs/class/System.Data/System.Data/DataColumnChangeEventArgs.cs b/mcs/class/System.Data/System.Data/DataColumnChangeEventArgs.cs
deleted file mode 100644 (file)
index ace6455..0000000
+++ /dev/null
@@ -1,123 +0,0 @@
-//
-// System.Data.DataColumnChangeEventArgs.cs
-//
-// Author:
-//   Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace System.Data
-{
-       /// <summary>
-       /// Provides data for the ColumnChanging event.
-       /// </summary>
-       public class DataColumnChangeEventArgs : EventArgs
-       {
-               #region Fields
-
-               private DataColumn _column = null;
-               private DataRow _row = null;
-               private object _proposedValue = null;
-
-               #endregion // Fields
-
-               #region Constructors
-
-               /// <summary>
-               /// Initializes a new instance of the DataColumnChangeEventArgs class.
-               /// </summary>
-               /// <param name="row"></param>
-               /// <param name="column"></param>
-               /// <param name="value"></param>
-               public DataColumnChangeEventArgs(DataRow row, DataColumn column, object value)
-               {
-                       Initialize(row, column, value);
-               }
-
-               internal DataColumnChangeEventArgs()
-               {
-               }
-
-               #endregion // Constructors
-
-               #region Properties
-
-               /// <summary>
-               /// Gets the DataColumn with a changing value.
-               /// </summary>
-               public DataColumn Column 
-               {
-                       get
-                       {
-                               return _column;
-                       }
-               }
-
-
-               /// <summary>
-               /// Gets or sets the proposed new value for the column.
-               /// </summary>
-               public object ProposedValue 
-               {
-                       get
-                       {
-                               return _proposedValue;
-                       }
-                       set
-                       {
-                               _proposedValue = value;
-                       }
-               }
-
-
-               /// <summary>
-               /// Gets the DataRow of the column with a changing value.
-               /// </summary>
-               public DataRow Row 
-               {
-                       get
-                       {
-                               return _row;
-                       }
-               }
-
-               #endregion // Properties
-
-               #region Methods
-
-               internal void Initialize(DataRow row, DataColumn column, object value)
-               {
-                       _column = column;
-                       _row = row;
-                       _proposedValue = value;
-               }
-       
-               #endregion // Methods
-       }
-}
diff --git a/mcs/class/System.Data/System.Data/DataColumnChangeEventHandler.cs b/mcs/class/System.Data/System.Data/DataColumnChangeEventHandler.cs
deleted file mode 100644 (file)
index 3cb3c82..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-//
-// System.Data.DataColumnChangeEventHandler.cs
-//
-// Author:
-//   Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System.Data
-{
-       /// <summary>
-       /// Represents the method that will handle the the ColumnChanging event.
-       /// </summary>
-       public delegate void DataColumnChangeEventHandler(object sender, DataColumnChangeEventArgs e);
-
-}
\ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/DataColumnCollection.cs b/mcs/class/System.Data/System.Data/DataColumnCollection.cs
deleted file mode 100644 (file)
index f3e337a..0000000
+++ /dev/null
@@ -1,670 +0,0 @@
-//
-// System.Data.DataColumnCollection.cs
-//
-// Author:
-//   Christopher Podurgiel (cpodurgiel@msn.com)
-//   Stuart Caborn     <stuart.caborn@virgin.net>
-//   Tim Coleman (tim@timcoleman.com)
-//
-// (C) Chris Podurgiel
-// Copyright (C) Tim Coleman, 2002
-// Copyright (C) Daniel Morgan, 2003
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Text;
-using System.Collections;
-using System.ComponentModel;
-
-namespace System.Data {
-
-       internal class Doublet
-       {
-               public Doublet (int count, string columnname)
-               {
-                       this.count = count;
-                       this.columnNames.Add (columnname);
-               }
-               // Number of case insensitive column name
-               public int count;
-               // Array of exact column names
-               public ArrayList columnNames = new ArrayList ();
-       }
-
-       [Editor ("Microsoft.VSDesigner.Data.Design.ColumnsCollectionEditor, " + Consts.AssemblyMicrosoft_VSDesigner,
-                "System.Drawing.Design.UITypeEditor, " + Consts.AssemblySystem_Drawing)]
-       [DefaultEvent ("CollectionChanged")]
-       public
-       sealed
-       class DataColumnCollection : InternalDataCollectionBase {
-               //This hashtable maps between unique case insensetive column name to a doublet containing column ref and column count
-               private Hashtable columnNameCount = new Hashtable (StringComparer.OrdinalIgnoreCase);
-               //This hashtable maps between column name to DataColumn object.
-               private Hashtable columnFromName = new Hashtable ();
-               //This ArrayList contains the auto-increment columns names
-               private ArrayList autoIncrement = new ArrayList ();
-               //This holds the next index to use for default column name.
-               private int defaultColumnIndex = 1;
-               //table should be the DataTable this DataColumnCollection belongs to.
-               private DataTable parentTable = null;
-               // Keep reference to most recent columns passed to AddRange()
-               // so that they can be added when EndInit() is called.
-               DataColumn [] _mostRecentColumns = null;
-
-               static readonly string ColumnPrefix = "Column";
-
-               // Internal Constructor.  This Class can only be created from other classes in this assembly.
-               internal DataColumnCollection (DataTable table)
-               {
-                       parentTable = table;
-               }
-
-               /// <summary>
-               /// Gets the DataColumn from the collection at the specified index.
-               /// </summary>
-               public
-               DataColumn this [int index] {
-                       get {
-                               if (index < 0 || index >= base.List.Count)
-                                       throw new IndexOutOfRangeException ("Cannot find column " + index + ".");
-                               return (DataColumn) base.List [index];
-                       }
-               }
-
-               /// <summary>
-               /// Gets the DataColumn from the collection with the specified name.
-               /// </summary>
-               public
-               DataColumn this [string name] {
-                       get {
-                               if (name == null)
-                                       throw new ArgumentNullException ("name");
-
-                               DataColumn dc = columnFromName [name] as DataColumn;
-                               if (dc != null)
-                                       return dc;
-
-                               int tmp = IndexOf (name, true);
-                               return tmp == -1 ? null : (DataColumn) base.List [tmp];
-                       }
-               }
-
-               /// <summary>
-               /// Gets a list of the DataColumnCollection items.
-               /// </summary>
-               protected override ArrayList List {
-                       get { return base.List; }
-               }
-
-               internal ArrayList AutoIncrmentColumns {
-                       get { return autoIncrement; }
-               }
-
-               //Add Logic
-               //
-               //Changing Event
-               //DefaultValue set and AutoInc set check
-               //?Validate Expression??
-               //Name check and creation
-               //Set Table
-               //Check Unique if true then add a unique constraint
-               //?Notify Rows of new column ?
-               //Add to collection
-               //Changed Event
-
-               /// <summary>
-               /// Creates and adds a DataColumn object to the DataColumnCollection.
-               /// </summary>
-               /// <returns></returns>
-               public
-               DataColumn Add ()
-               {
-                       DataColumn column = new DataColumn (null);
-                       Add (column);
-                       return column;
-               }
-
-               public void CopyTo (DataColumn [] array, int index)
-               {
-                       CopyTo ((Array) array, index);
-               }
-
-               internal void RegisterName (string name, DataColumn column)
-               {
-                       try {
-                               columnFromName.Add (name, column);
-                       } catch (ArgumentException) {
-                               throw new DuplicateNameException ("A DataColumn named '" + name + "' already belongs to this DataTable.");
-                       }
-
-                       // Get existing doublet
-                       Doublet d = (Doublet) columnNameCount [name];
-                       if (d != null) {
-                               // Add reference count
-                               d.count++;
-                               // Add a new name
-                               d.columnNames.Add (name);
-                       } else {
-                               // no existing doublet
-                               // create one
-                               d = new Doublet (1, name);
-                               columnNameCount [name] = d;
-                       }
-
-                       if (name.Length <= ColumnPrefix.Length || !name.StartsWith (ColumnPrefix, StringComparison.Ordinal))
-                               return;
-
-                       if (name == MakeName (defaultColumnIndex + 1)) {
-                               do {
-                                       defaultColumnIndex++;
-                               } while (Contains (MakeName (defaultColumnIndex + 1)));
-                       }
-               }
-
-               internal void UnregisterName (string name)
-               {
-                       if (columnFromName.Contains (name))
-                               columnFromName.Remove (name);
-
-                       // Get the existing doublet
-                       Doublet d = (Doublet) columnNameCount [name];
-                       if (d != null) {
-                               // decrease reference count
-                               d.count--;
-                               d.columnNames.Remove (name);
-                               // remove doublet if no more references
-                               if (d.count == 0)
-                                       columnNameCount.Remove (name);
-                       }
-
-                       if (name.StartsWith(ColumnPrefix) && name == MakeName(defaultColumnIndex - 1)) {
-                               do {
-                                       defaultColumnIndex--;
-                               } while (!Contains (MakeName (defaultColumnIndex - 1)) && defaultColumnIndex > 1);
-                       }
-               }
-
-               private string GetNextDefaultColumnName ()
-               {
-                       string defColumnName = MakeName (defaultColumnIndex);
-                       for (int index = defaultColumnIndex + 1; Contains (defColumnName); ++index) {
-                               defColumnName = MakeName (index);
-                               defaultColumnIndex++;
-                       }
-                       defaultColumnIndex++;
-                       return defColumnName;
-               }
-
-               static readonly string[] TenColumns = { "Column0", "Column1", "Column2", "Column3", "Column4", "Column5", "Column6", "Column7", "Column8", "Column9" };
-
-               static string MakeName (int index)
-               {
-                       if (index < 10)
-                               return TenColumns [index];
-                       return String.Concat (ColumnPrefix, index.ToString());
-               }
-
-               /// <summary>
-               /// Creates and adds the specified DataColumn object to the DataColumnCollection.
-               /// </summary>
-               /// <param name="column">The DataColumn to add.</param>
-               public void Add (DataColumn column)
-               {
-                       if (column == null)
-                               throw new ArgumentNullException ("column", "'column' argument cannot be null.");
-
-
-                       if (column.ColumnName.Length == 0) {
-                               column.ColumnName = GetNextDefaultColumnName ();
-                       }
-
-//                     if (Contains(column.ColumnName))
-//                             throw new DuplicateNameException("A DataColumn named '" + column.ColumnName + "' already belongs to this DataTable.");
-
-                       if (column.Table != null)
-                               throw new ArgumentException ("Column '" + column.ColumnName + "' already belongs to this or another DataTable.");
-
-                       column.SetTable (parentTable);
-                       RegisterName (column.ColumnName, column);
-                       int ordinal = base.List.Add (column);
-
-                       column.Ordinal = ordinal;
-
-                       // Check if the Column Expression is ok
-                       if (column.CompiledExpression != null)
-                               if (parentTable.Rows.Count == 0)
-                                       column.CompiledExpression.Eval (parentTable.NewRow());
-                               else
-                                       column.CompiledExpression.Eval (parentTable.Rows[0]);
-
-                       // if table already has rows we need to allocate space
-                       // in the column data container
-                       if (parentTable.Rows.Count > 0)
-                               column.DataContainer.Capacity = parentTable.RecordCache.CurrentCapacity;
-
-                       if (column.AutoIncrement) {
-                               DataRowCollection rows = column.Table.Rows;
-                               for (int i = 0; i < rows.Count; i++)
-                                       rows [i] [ordinal] = column.AutoIncrementValue ();
-                       }
-
-                       if (column.AutoIncrement)
-                               autoIncrement.Add (column);
-
-                       column.PropertyChanged += new PropertyChangedEventHandler (ColumnPropertyChanged);
-
-                       OnCollectionChanged (new CollectionChangeEventArgs(CollectionChangeAction.Add, column));
-               }
-
-               /// <summary>
-               /// Creates and adds a DataColumn object with the specified name to the DataColumnCollection.
-               /// </summary>
-               /// <param name="columnName">The name of the column.</param>
-               /// <returns>The newly created DataColumn.</returns>
-               public
-               DataColumn Add (string columnName)
-               {
-                       DataColumn column = new DataColumn (columnName);
-                       Add (column);
-                       return column;
-               }
-
-               /// <summary>
-               /// Creates and adds a DataColumn object with the specified name and type to the DataColumnCollection.
-               /// </summary>
-               /// <param name="columnName">The ColumnName to use when cretaing the column.</param>
-               /// <param name="type">The DataType of the new column.</param>
-               /// <returns>The newly created DataColumn.</returns>
-               public
-               DataColumn Add (string columnName, Type type)
-               {
-                       if (columnName == null || columnName == "")
-                               columnName = GetNextDefaultColumnName ();
-
-                       DataColumn column = new DataColumn (columnName, type);
-                       Add (column);
-                       return column;
-               }
-
-               /// <summary>
-               /// Creates and adds a DataColumn object with the specified name, type, and expression to the DataColumnCollection.
-               /// </summary>
-               /// <param name="columnName">The name to use when creating the column.</param>
-               /// <param name="type">The DataType of the new column.</param>
-               /// <param name="expression">The expression to assign to the Expression property.</param>
-               /// <returns>The newly created DataColumn.</returns>
-               public
-               DataColumn Add (string columnName, Type type, string expression)
-               {
-                       if (columnName == null || columnName == "")
-                               columnName = GetNextDefaultColumnName ();
-
-                       DataColumn column = new DataColumn (columnName, type, expression);
-                       Add (column);
-                       return column;
-               }
-
-               /// <summary>
-               /// Copies the elements of the specified DataColumn array to the end of the collection.
-               /// </summary>
-               /// <param name="columns">The array of DataColumn objects to add to the collection.</param>
-               public void AddRange (DataColumn [] columns)
-               {
-                       if (parentTable.InitInProgress){
-                               _mostRecentColumns = columns;
-                               return;
-                       }
-
-                       if (columns == null)
-                               return;
-
-                       foreach (DataColumn column in columns){
-                               if (column == null)
-                                       continue;
-                               Add(column);
-                       }
-               }
-
-               private string GetColumnDependency (DataColumn column)
-               {
-
-                       foreach (DataRelation rel in parentTable.ParentRelations)
-                               if (Array.IndexOf (rel.ChildColumns, column) != -1)
-                                       return String.Format (" child key for relationship {0}.", rel.RelationName);
-                       foreach (DataRelation rel in parentTable.ChildRelations)
-                               if (Array.IndexOf (rel.ParentColumns, column) != -1)
-                                       return String.Format (" parent key for relationship {0}.", rel.RelationName);
-
-                       foreach (Constraint c in parentTable.Constraints)
-                               if (c.IsColumnContained (column))
-                                       return String.Format (" constraint {0} on the table {1}.",
-                                                       c.ConstraintName, parentTable);
-
-
-                       // check if the foreign-key constraint on any table in the dataset refers to this column.
-                       // though a forignkeyconstraint automatically creates a uniquecontrainton the parent
-                       // table and would fail above, but we still need to check, as it is legal to manually remove
-                       // the constraint on the parent table.
-                       if (parentTable.DataSet != null)
-                               foreach (DataTable table in parentTable.DataSet.Tables)
-                                       foreach (Constraint c in table.Constraints)
-                                               if (c is ForeignKeyConstraint && c.IsColumnContained(column))
-                                                       return String.Format (
-                                                               " constraint {0} on the table {1}.", c.ConstraintName, table.TableName);
-
-                       foreach (DataColumn col in this)
-                               if (col.CompiledExpression != null && col.CompiledExpression.DependsOn (column))
-                                       return  col.Expression;
-                       return String.Empty;
-               }
-
-               /// <summary>
-               /// Checks whether a given column can be removed from the collection.
-               /// </summary>
-               /// <param name="column">A DataColumn in the collection.</param>
-               /// <returns>true if the column can be removed; otherwise, false.</returns>
-               public bool CanRemove (DataColumn column)
-               {
-                       if (column == null || column.Table != parentTable || GetColumnDependency (column) != String.Empty)
-                               return false;
-                       return true;
-               }
-
-               /// <summary>
-               /// Clears the collection of any columns.
-               /// </summary>
-               public void Clear ()
-               {
-                       CollectionChangeEventArgs e = new CollectionChangeEventArgs(CollectionChangeAction.Refresh, this);
-
-                       // its not necessary to check if each column in the collection can removed.
-                       // Can simply check, if there are any constraints/relations related to the table,
-                       // in which case, throw an exception.
-                       // Also, shudnt check for expression columns since all the columns in the table
-                       // are being removed.
-                       if (parentTable.Constraints.Count != 0 ||
-                           parentTable.ParentRelations.Count != 0 ||
-                           parentTable.ChildRelations.Count != 0)
-                               foreach (DataColumn col in this) {
-                                       string s = GetColumnDependency (col);
-                                       if (s != String.Empty)
-                                               throw new ArgumentException ("Cannot remove this column, because it is part of the" + s);
-                               }
-
-                       if (parentTable.DataSet != null)
-                               foreach (DataTable table in parentTable.DataSet.Tables)
-                                       foreach (Constraint c in table.Constraints) {
-                                               if (!(c is ForeignKeyConstraint) ||
-                                                   ((ForeignKeyConstraint) c).RelatedTable != parentTable)
-                                                       continue;
-                                               throw new ArgumentException (
-                                                       String.Format (
-                                                               "Cannot remove this column, because it is part of the constraint {0} on the table {1}",
-                                                               c.ConstraintName, table.TableName));
-                                       }
-
-                       foreach (DataColumn col in this)
-                               col.ResetColumnInfo ();
-
-                       columnFromName.Clear ();
-                       autoIncrement.Clear ();
-                       columnNameCount.Clear ();
-                       base.List.Clear ();
-                       defaultColumnIndex = 1;
-                       OnCollectionChanged (e);
-               }
-
-               /// <summary>
-               /// Checks whether the collection contains a column with the specified name.
-               /// </summary>
-               /// <param name="name">The ColumnName of the column to check for.</param>
-               /// <returns>true if a column exists with this name; otherwise, false.</returns>
-               public bool Contains (string name)
-               {
-                       if (columnFromName.Contains (name))
-                               return true;
-
-                       return (IndexOf (name, false) != -1);
-               }
-
-               /// <summary>
-               /// Gets the index of a column specified by name.
-               /// </summary>
-               /// <param name="column">The name of the column to return.</param>
-               /// <returns>The index of the column specified by column if it is found; otherwise, -1.</returns>
-               public
-               int IndexOf (DataColumn column)
-               {
-                       if (column == null)
-                               return -1;
-                       return base.List.IndexOf (column);
-               }
-
-               /// <summary>
-               /// Gets the index of the column with the given name (the name is not case sensitive).
-               /// </summary>
-               /// <param name="columnName">The name of the column to find.</param>
-               /// <returns>The zero-based index of the column with the specified name, or -1 if the column doesn't exist in the collection.</returns>
-               public int IndexOf (string columnName)
-               {
-                       if (columnName == null)
-                               return -1;
-                       DataColumn dc = columnFromName [columnName] as DataColumn;
-
-                       if (dc != null)
-                               return IndexOf (dc);
-
-                       return IndexOf (columnName, false);
-               }
-
-               /// <summary>
-               /// Raises the OnCollectionChanged event.
-               /// </summary>
-               /// <param name="ccevent">A CollectionChangeEventArgs that contains the event data.</param>
-               internal
-               void OnCollectionChanged (CollectionChangeEventArgs ccevent)
-               {
-                       parentTable.ResetPropertyDescriptorsCache ();
-                       if (CollectionChanged != null)
-                               CollectionChanged (this, ccevent);
-               }
-
-               /// <summary>
-               /// Raises the OnCollectionChanging event.
-               /// </summary>
-               /// <param name="ccevent">A CollectionChangeEventArgs that contains the event data.</param>
-               internal
-               void OnCollectionChanging (CollectionChangeEventArgs ccevent)
-               {
-                       if (CollectionChanged != null) {
-                               //FIXME: this is not right
-                               //CollectionChanged(this, ccevent);
-                               throw new NotImplementedException();
-                       }
-               }
-
-               /// <summary>
-               /// Removes the specified DataColumn object from the collection.
-               /// </summary>
-               /// <param name="column">The DataColumn to remove.</param>
-               public void Remove (DataColumn column)
-               {
-                       if (column == null)
-                               throw new ArgumentNullException ("column", "'column' argument cannot be null.");
-
-                       if (!Contains (column.ColumnName))
-                               throw new ArgumentException ("Cannot remove a column that doesn't belong to this table.");
-
-                       string dependency = GetColumnDependency (column);
-                       if (dependency != String.Empty)
-                               throw new ArgumentException ("Cannot remove this column, because it is part of " + dependency);
-
-                       CollectionChangeEventArgs e = new CollectionChangeEventArgs (CollectionChangeAction.Remove, column);
-
-                       int ordinal = column.Ordinal;
-                       UnregisterName (column.ColumnName);
-                       base.List.Remove (column);
-
-                       // Reset column info
-                       column.ResetColumnInfo ();
-
-                       //Update the ordinals
-                       for( int i = ordinal ; i < this.Count ; i ++ )
-                               this[i].Ordinal = i;
-
-                       if (parentTable != null)
-                               parentTable.OnRemoveColumn (column);
-
-                       if (column.AutoIncrement)
-                               autoIncrement.Remove (column);
-
-                       column.PropertyChanged -= new PropertyChangedEventHandler (ColumnPropertyChanged);
-
-                       OnCollectionChanged (e);
-               }
-
-               /// <summary>
-               /// Removes the DataColumn object with the specified name from the collection.
-               /// </summary>
-               /// <param name="name">The name of the column to remove.</param>
-               public void Remove (string name)
-               {
-                       DataColumn column = this [name];
-
-                       if (column == null)
-                               throw new ArgumentException ("Column '" + name + "' does not belong to table " + ( parentTable == null ? "" : parentTable.TableName ) + ".");
-                       Remove (column);
-               }
-
-               /// <summary>
-               /// Removes the column at the specified index from the collection.
-               /// </summary>
-               /// <param name="index">The index of the column to remove.</param>
-               public void RemoveAt (int index)
-               {
-                       if (Count <= index)
-                               throw new IndexOutOfRangeException ("Cannot find column " + index + ".");
-
-                       DataColumn column = this [index];
-                       Remove (column);
-               }
-
-               // Helper AddRange() - Call this function when EndInit is called
-               internal void PostAddRange ()
-               {
-                       if (_mostRecentColumns == null)
-                               return;
-
-                       foreach (DataColumn column in _mostRecentColumns){
-                               if (column == null)
-                                       continue;
-                               Add (column);
-                       }
-                       _mostRecentColumns = null;
-               }
-
-               internal void UpdateAutoIncrement (DataColumn col,bool isAutoIncrement)
-               {
-                       if (isAutoIncrement) {
-                               if (!autoIncrement.Contains (col))
-                                       autoIncrement.Add (col);
-                       } else {
-                               if (autoIncrement.Contains (col))
-                                       autoIncrement.Remove (col);
-                       }
-               }
-
-               private int IndexOf (string name, bool error)
-               {
-                       // exact case matching has already be done by the caller
-                       // Get existing doublet
-                       Doublet d = (Doublet) columnNameCount [name];
-                       if (d != null) {
-                               if (d.count == 1) {
-                                       // There's only one
-                                       // return index of the column from the only column name of the doublet
-                                       return base.List.IndexOf (columnFromName [d.columnNames [0]]);
-                               } else if (d.count > 1 && error) {
-                                       // there's more than one, exception!
-                                       throw new ArgumentException ("There is no match for '" + name + "' in the same case and there are multiple matches in different case.");
-                               } else {
-                                       return -1;
-                               }
-                       }
-                       return -1;
-               }
-
-               #region Events
-
-               /// <summary>
-               /// Occurs when the columns collection changes, either by adding or removing a column.
-               /// </summary>
-               [ResDescriptionAttribute ("Occurs whenever this collection's membership changes.")]
-               public event CollectionChangeEventHandler CollectionChanged;
-
-               internal event CollectionChangeEventHandler CollectionMetaDataChanged;
-               #endregion
-
-               private void OnCollectionMetaDataChanged (CollectionChangeEventArgs ccevent)
-               {
-                       parentTable.ResetPropertyDescriptorsCache ();
-                       if (CollectionMetaDataChanged != null)
-                               CollectionMetaDataChanged (this, ccevent);
-               }
-
-               private void ColumnPropertyChanged (object sender, PropertyChangedEventArgs args)
-               {
-                       OnCollectionMetaDataChanged (new CollectionChangeEventArgs(CollectionChangeAction.Refresh, sender));
-               }
-
-               internal void MoveColumn (int oldOrdinal, int newOrdinal)
-               {
-                       if (newOrdinal == -1 || newOrdinal > this.Count)
-                               throw new ArgumentOutOfRangeException ("ordinal", "Ordinal '" + newOrdinal + "' exceeds the maximum number.");
-                       if (oldOrdinal == newOrdinal)
-                               return;
-
-                       int start = newOrdinal > oldOrdinal ? oldOrdinal : newOrdinal;
-                       int end = newOrdinal > oldOrdinal ?  newOrdinal : oldOrdinal;
-                       int direction = newOrdinal > oldOrdinal ? 1 : (-1);
-                       
-                       // swap ordinals as per direction of column movement
-                       if (direction < 0) {
-                               start = start + end;
-                               end = start - end;
-                               start -= end;
-                       }
-
-                       DataColumn currColumn = this [start];
-                       for (int i = start; (direction>0 ? i<end : i>end); i += direction) {
-                               List [i] = List [i+direction];
-                               ((DataColumn) List [i]).Ordinal = i;
-                       }
-                       List [end] = currColumn;
-                       currColumn.Ordinal = end;
-               }
-       }
-}
diff --git a/mcs/class/System.Data/System.Data/DataColumnPropertyDescriptor.cs b/mcs/class/System.Data/System.Data/DataColumnPropertyDescriptor.cs
deleted file mode 100644 (file)
index 50e2491..0000000
+++ /dev/null
@@ -1,169 +0,0 @@
-//
-// System.Data.DataColumnPropertyDescriptor.cs
-//
-// Author:
-//   Daniel Morgan <danmorg@sc.rr.com>
-//
-// (c) copyright 2002 Daniel Morgan
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Data.Common;
-using System.ComponentModel;
-using System.Reflection;
-
-namespace System.Data 
-{
-       internal class DataColumnPropertyDescriptor : PropertyDescriptor 
-       {
-               private bool readOnly = true;
-               private Type componentType = null;
-               private Type propertyType = null;
-               private bool browsable = true;
-
-               //private PropertyInfo prop = null;
-               private int columnIndex = 0;
-
-               public DataColumnPropertyDescriptor (string name, int columnIndex, Attribute [] attrs)
-                       : base (name, attrs) 
-               {
-                       this.columnIndex = columnIndex;
-               }
-
-               public DataColumnPropertyDescriptor (DataColumn dc)
-                       : base (dc.ColumnName, null) 
-               {
-                       this.columnIndex = dc.Ordinal;
-                       this.componentType = typeof(DataRowView);
-                       this.propertyType = dc.DataType;
-                       this.readOnly = dc.ReadOnly;
-               }
-
-               public void SetReadOnly (bool value) 
-               {
-                       readOnly = value;
-               }
-               
-               public void SetComponentType (Type type) 
-               {
-                       componentType = type;
-               }
-
-               public void SetPropertyType (Type type) 
-               {
-                       propertyType = type;
-               }
-
-               public void SetBrowsable (bool browsable)
-               {
-                       this.browsable = browsable;
-               }
-
-               public override object GetValue (object component) 
-               {
-                       // FIXME: what is the correct way to Get a Value?
-                       if(componentType == typeof(DataRowView) && component is DataRowView) {
-                               DataRowView drv = (DataRowView) component;
-                               return drv[base.Name];
-                       }
-                       else if(componentType == typeof(DbDataRecord) && component is DbDataRecord) {
-                               DbDataRecord dr = (DbDataRecord) component;
-                               return dr[columnIndex];
-                       }
-                       throw new InvalidOperationException();
-
-                       /*
-                       if (prop == null)
-                               prop = GetPropertyInfo ();              
-                                                       
-                       // FIXME: should I allow multiple parameters?                                                                                   
-                       object[] parms = new object[1];
-                       parms[0] = base.Name;
-                       return prop.GetValue (component, parms);
-                       */
-               }
-
-               public override void SetValue(object component, object value) 
-               {
-                       DataRowView drv = (DataRowView) component;
-                       drv[base.Name] = value;
-                       /*
-                       if (prop == null)
-                               prop = GetPropertyInfo ();              
-
-                       if (readOnly == true) {
-                               // FIXME: what really happens if read only?
-                               throw new Exception("Property is ReadOnly");
-                       }
-                       
-                       // FIXME: should I allow multiple parameters?
-                       object[] parms = new Object[1];
-                       parms[0] = base.Name;
-                       prop.SetValue (component, value, parms);
-                       */
-               }
-
-               [MonoTODO]
-               public override void ResetValue(object component) 
-               {
-                       // FIXME:
-               }
-
-               [MonoTODO]
-               public override bool CanResetValue(object component) 
-               {
-                       return false; // FIXEME
-               }
-
-               [MonoTODO]
-               public override bool ShouldSerializeValue(object component) 
-               {
-                       return false;
-               }
-
-               public override Type ComponentType {
-                       get {
-                               return componentType;
-                       }
-               }
-
-               public override bool IsReadOnly {
-                       get {
-                               return readOnly;        
-                       }
-               }
-
-               public override bool IsBrowsable {
-                       get { return browsable && base.IsBrowsable; }
-               }
-
-               public override Type PropertyType {
-                       get {
-                               return propertyType;
-                       }
-               }
-       }
-}
diff --git a/mcs/class/System.Data/System.Data/DataException.cs b/mcs/class/System.Data/System.Data/DataException.cs
deleted file mode 100644 (file)
index c56c06e..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-//
-// System.Data.DataException.cs
-//
-// Author: Duncan Mak  (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System.Data
-{
-       [Serializable]
-       public class DataException : SystemException
-       {
-               public DataException ()
-                       : base (Locale.GetText ("A Data exception has occurred"))
-               {
-               }
-
-               public DataException (string s) : base (s)
-               {
-               }
-
-               protected DataException (SerializationInfo info, StreamingContext context)
-                       : base (info, context)
-               {
-               }
-
-               public DataException (string s, Exception innerException)
-                       : base (s, innerException)
-               {
-               }
-       }
-}
diff --git a/mcs/class/System.Data/System.Data/DataRelation.cs b/mcs/class/System.Data/System.Data/DataRelation.cs
deleted file mode 100644 (file)
index 8171565..0000000
+++ /dev/null
@@ -1,395 +0,0 @@
-//
-// System.Data.DataRelation.cs
-//
-// Author:
-//   Daniel Morgan <danmorg@sc.rr.com>
-//   Alan Tam Siu Lung <Tam@SiuLung.com>
-//   Tim Coleman <tim@timcoleman.com>
-//
-// (C) 2002 Daniel Morgan
-// (C) 2002 Ximian, Inc.
-// Copyright (C) Tim Coleman, 2003
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.ComponentModel;
-using System.Runtime.Serialization;
-
-namespace System.Data
-{
-       /// <summary>
-       /// DataRelation is used for a parent/child relationship
-       /// between two DataTable objects
-       /// </summary>
-       [Editor ("Microsoft.VSDesigner.Data.Design.DataRelationEditor, " + Consts.AssemblyMicrosoft_VSDesigner,
-                "System.Drawing.Design.UITypeEditor, " + Consts.AssemblySystem_Drawing)]
-       [DefaultProperty ("RelationName")]
-       [TypeConverterAttribute (typeof (RelationshipConverter))]
-       public class DataRelation {
-               private DataSet dataSet;
-               private string relationName;
-               private UniqueConstraint parentKeyConstraint;
-               private ForeignKeyConstraint childKeyConstraint;
-               private DataColumn [] parentColumns;
-               private DataColumn [] childColumns;
-               private bool nested;
-               internal bool createConstraints = true;
-               private bool initFinished;
-               private PropertyCollection extendedProperties;
-               private PropertyChangedEventHandler onPropertyChangingDelegate;
-
-               string _relationName;
-               string _parentTableName;
-               string _childTableName;
-               string [] _parentColumnNames;
-               string [] _childColumnNames;
-               bool _nested;
-               bool initInProgress = false;
-               string _parentTableNameSpace = String.Empty;
-               string _childTableNameSpace = String.Empty;
-
-               #region Constructors
-
-               public DataRelation (string relationName, DataColumn parentColumn, DataColumn childColumn)
-                       : this (relationName, parentColumn, childColumn, true)
-               {
-               }
-
-               public DataRelation (string relationName, DataColumn [] parentColumns, DataColumn [] childColumns)
-                       : this (relationName, parentColumns, childColumns, true)
-               {
-               }
-
-               public DataRelation (string relationName, DataColumn parentColumn, DataColumn childColumn, bool createConstraints)
-                       : this (relationName, new DataColumn[] { parentColumn }, new DataColumn [] { childColumn }, createConstraints)
-               {
-               }
-
-               public DataRelation (string relationName, DataColumn [] parentColumns, DataColumn [] childColumns, bool createConstraints)
-               {
-                       this.extendedProperties = new PropertyCollection ();
-                       this.relationName = relationName == null ? string.Empty : relationName;
-                       if (parentColumns == null)
-                               throw new ArgumentNullException ("parentColumns");
-                       this.parentColumns = parentColumns;
-                       if (childColumns == null)
-                               throw new ArgumentNullException ("childColumns");
-                       this.childColumns = childColumns;
-                       this.createConstraints = createConstraints;
-                       if (parentColumns.Length != childColumns.Length)
-                               throw new ArgumentException ("ParentColumns and ChildColumns should be the same length");
-                       DataTable parentTable = parentColumns [0].Table;
-                       DataTable childTable = childColumns [0].Table;
-                       if (parentTable.DataSet != childTable.DataSet)
-                               throw new InvalidConstraintException ();
-                       foreach (DataColumn column in parentColumns)
-                               if (column.Table != parentTable)
-                                       throw new InvalidConstraintException ();
-                       foreach (DataColumn column in childColumns)
-                               if (column.Table != childTable)
-                                       throw new InvalidConstraintException ();
-
-                       for (int i = 0; i < ChildColumns.Length; i++)
-                               if (!parentColumns [i].DataTypeMatches (childColumns [i]))
-                                       throw new InvalidConstraintException (
-                                               "Parent Columns and Child Columns don't have matching column types");
-               }
-
-               [Browsable (false)]
-               public DataRelation (string relationName, string parentTableName, string childTableName, string [] parentColumnNames, string[] childColumnNames, bool nested)
-               {
-                       _relationName = relationName;
-                       _parentTableName = parentTableName;
-                       _childTableName = childTableName;
-                       _parentColumnNames = parentColumnNames;
-                       _childColumnNames = childColumnNames;
-                       _nested = nested;
-                       InitInProgress = true;
-               }
-
-               [Browsable (false)]
-               public DataRelation (string relationName, string parentTableName,
-                                    string parentTableNamespace, string childTableName,
-                                    string childTableNamespace, string[] parentColumnNames,
-                                    string[] childColumnNames, bool nested)
-               {
-                       _relationName = relationName;
-                       _parentTableName = parentTableName;
-                       _parentTableNameSpace = parentTableNamespace;
-                       _childTableName = childTableName;
-                       _childTableNameSpace = childTableNamespace;
-                       _parentColumnNames = parentColumnNames;
-                       _childColumnNames = childColumnNames;
-                       _nested = nested;
-                       InitInProgress = true;
-               }
-
-               internal bool InitInProgress {
-                       get { return initInProgress; }
-                       set { initInProgress = value; }
-               }
-
-               internal void FinishInit (DataSet ds)
-               {
-                       if (!ds.Tables.Contains (_parentTableName) || !ds.Tables.Contains (_childTableName))
-                               throw new InvalidOperationException ();
-
-                       if (_parentColumnNames.Length != _childColumnNames.Length)
-                               throw new InvalidOperationException ();
-
-                       DataTable parent = ds.Tables [_parentTableName];
-                       DataTable child = ds.Tables [_childTableName];
-
-                       parentColumns = new DataColumn [_parentColumnNames.Length];
-                       childColumns = new DataColumn [_childColumnNames.Length];
-
-                       for (int i = 0; i < _parentColumnNames.Length; ++i) {
-                               if (!parent.Columns.Contains (_parentColumnNames [i]))
-                                       throw new InvalidOperationException ();
-                               parentColumns [i] = parent.Columns [_parentColumnNames [i]];
-                               if (!child.Columns.Contains (_childColumnNames [i]))
-                                       throw new InvalidOperationException ();
-                               childColumns [i] = child.Columns [_childColumnNames [i]];
-                       }
-
-                       this.RelationName = _relationName;
-                       this.Nested = _nested;
-                       this.initFinished = true;
-                       this.extendedProperties = new PropertyCollection ();
-                       InitInProgress = false;
-                       if (_parentTableNameSpace != String.Empty)
-                               parent.Namespace = _parentTableNameSpace;
-                       if (_childTableNameSpace != String.Empty)
-                               child.Namespace = _childTableNameSpace;
-               }
-
-               #endregion // Constructors
-
-               #region Properties
-
-               [DataCategory ("Data")]
-               public virtual DataColumn [] ChildColumns {
-                       get { return childColumns; }
-               }
-
-               public virtual ForeignKeyConstraint ChildKeyConstraint {
-                       get { return childKeyConstraint; }
-               }
-
-               internal void SetChildKeyConstraint (ForeignKeyConstraint foreignKeyConstraint)
-               {
-                       childKeyConstraint = foreignKeyConstraint;
-               }
-
-               public virtual DataTable ChildTable {
-                       get { return childColumns [0].Table; }
-               }
-
-               [Browsable (false)]
-               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
-               public virtual DataSet DataSet {
-                       get { return childColumns [0].Table.DataSet; }
-               }
-
-               [Browsable (false)]
-               [DataCategory ("Data")]
-               public PropertyCollection ExtendedProperties {
-                       get {
-                               if (extendedProperties == null)
-                                       extendedProperties = new PropertyCollection();
-                               return extendedProperties;
-                       }
-               }
-
-               [DataCategory ("Data")]
-               [DefaultValue (false)]
-               public virtual bool Nested {
-                       get { return nested; }
-                       set { nested = value; }
-               }
-
-               [DataCategory ("Data")]
-               public virtual DataColumn[] ParentColumns {
-                       get { return parentColumns; }
-               }
-
-               public virtual UniqueConstraint ParentKeyConstraint {
-                       get { return parentKeyConstraint; }
-               }
-
-               internal void SetParentKeyConstraint (UniqueConstraint uniqueConstraint)
-               {
-                       parentKeyConstraint = uniqueConstraint;
-               }
-
-               internal void SetDataSet (DataSet ds)
-               {
-                       dataSet = ds;
-               }
-
-               public virtual DataTable ParentTable {
-                       get { return parentColumns [0].Table; }
-               }
-
-               [DataCategory ("Data")]
-               [DefaultValue ("")]
-               public virtual string RelationName {
-                       get { return relationName; }
-                       set { relationName = value; }
-               }
-
-               #endregion // Properties
-
-               #region Methods
-
-               protected void CheckStateForProperty ()
-               {
-                       // TODO: check consistency of constraints
-                       DataTable parentTable = parentColumns [0].Table;
-                       DataTable childTable = childColumns [0].Table;
-                       if (parentTable.DataSet != childTable.DataSet)
-                               throw new DataException ();
-                       bool allColumnsEqual = false;
-                       for (int colCnt = 0; colCnt < parentColumns.Length; ++colCnt) {
-                               if (!parentColumns [colCnt].DataType.Equals (childColumns [colCnt].DataType))
-                                       throw new DataException ();
-                               if (parentColumns [colCnt] != childColumns [colCnt])
-                                       allColumnsEqual = false;
-                       }
-                       if (allColumnsEqual)
-                               throw new DataException ();
-               }
-
-               protected internal void OnPropertyChanging (PropertyChangedEventArgs pcevent)
-               {
-                       if (onPropertyChangingDelegate != null)
-                               onPropertyChangingDelegate (this, pcevent);
-               }
-
-               protected internal void RaisePropertyChanging (string name)
-               {
-                       OnPropertyChanging(new PropertyChangedEventArgs(name));
-               }
-
-               public override string ToString ()
-               {
-                       return relationName;
-               }
-
-               internal void UpdateConstraints ()
-               {
-                       if (initFinished || ! createConstraints)
-                               return;
-
-                       ForeignKeyConstraint    foreignKeyConstraint    = null;
-                       UniqueConstraint        uniqueConstraint        = null;
-
-                       foreignKeyConstraint    = FindForeignKey (ChildTable.Constraints);
-                       uniqueConstraint        = FindUniqueConstraint (ParentTable.Constraints);
-
-                       // if we did not find the unique constraint in the parent table.
-                       // we generate new uniqueConstraint and add it to the parent table.
-                       if (uniqueConstraint == null) {
-                               uniqueConstraint = new UniqueConstraint (ParentColumns, false);
-                               ParentTable.Constraints.Add (uniqueConstraint);
-                       }
-
-                       // if we did not find the foreign key constraint in the parent table.
-                       // we generate new foreignKeyConstraint and add it to the parent table.
-                       if (foreignKeyConstraint == null) {
-                               foreignKeyConstraint = new ForeignKeyConstraint (RelationName,
-                                                                                ParentColumns,
-                                                                                ChildColumns);
-                               ChildTable.Constraints.Add (foreignKeyConstraint);
-                       }
-
-                       SetParentKeyConstraint (uniqueConstraint);
-                       SetChildKeyConstraint (foreignKeyConstraint);
-               }
-
-               private static bool CompareDataColumns (DataColumn [] dc1, DataColumn [] dc2)
-               {
-                       if (dc1.Length != dc2.Length)
-                               return false;
-
-                       for (int columnCnt = 0; columnCnt < dc1.Length; ++columnCnt){
-                               if (dc1 [columnCnt] != dc2 [columnCnt])
-                                       return false;
-                       }
-                       return true;
-               }
-
-               private ForeignKeyConstraint FindForeignKey (ConstraintCollection cl)
-               {
-                       ForeignKeyConstraint fkc = null;
-                       foreach (Constraint o in cl) {
-                               if (! (o is ForeignKeyConstraint))
-                                       continue;
-                               fkc = (ForeignKeyConstraint) o;
-                               /* Check ChildColumns & ParentColumns */
-                               if (CompareDataColumns (ChildColumns, fkc.Columns) &&
-                                   CompareDataColumns (ParentColumns, fkc.RelatedColumns))
-                                       return fkc;
-                       }
-                       return null;
-               }
-
-               private UniqueConstraint FindUniqueConstraint (ConstraintCollection cl)
-               {
-                       UniqueConstraint uc = null;
-                       // find if the unique constraint already exists in the parent table.
-                       foreach (Constraint o in cl){
-                               if (! (o is UniqueConstraint))
-                                       continue;
-                               uc = (UniqueConstraint) o;
-                               //Check in ParentColumns
-                               if (CompareDataColumns (ParentColumns, uc.Columns))
-                                       return uc;
-                       }
-                       return null;
-               }
-
-               /// <summary>
-               ///     Check whether the given column is part of this relation.
-               /// <summary>
-               /// <returns>
-               ///     true if the column is part of this relation, otherwise false.
-               /// </returns>
-               internal bool Contains (DataColumn column)
-               {
-                       foreach (DataColumn col in ParentColumns)
-                               if (col == column)
-                                       return true;
-
-                       foreach (DataColumn col in ChildColumns)
-                               if (col == column)
-                                       return true;
-                       return false;
-               }
-
-               #endregion // Methods
-       }
-}
diff --git a/mcs/class/System.Data/System.Data/DataRelationCollection.cs b/mcs/class/System.Data/System.Data/DataRelationCollection.cs
deleted file mode 100644 (file)
index 1b5d6ff..0000000
+++ /dev/null
@@ -1,667 +0,0 @@
-//
-// System.Data.DataRelationCollection.cs
-//
-// Author:
-//   Christopher Podurgiel (cpodurgiel@msn.com)
-//   Daniel Morgan <danmorg@sc.rr.com>
-//   Tim Coleman (tim@timcoleman.com)
-//   Alan Tam Siu Lung <Tam@SiuLung.com>
-//
-// (C) Chris Podurgiel
-// (C) 2002 Daniel Morgan
-// Copyright (C) Tim Coleman, 2002
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections;
-using System.ComponentModel;
-
-using System.Runtime.Serialization;
-
-namespace System.Data {
-       /// <summary>
-       /// Represents the collection of DataRelation objects for this DataSet.
-       /// </summary>
-       [Editor ("Microsoft.VSDesigner.Data.Design.DataRelationCollectionEditor, " + Consts.AssemblyMicrosoft_VSDesigner,
-                "System.Drawing.Design.UITypeEditor, " + Consts.AssemblySystem_Drawing)]
-       [DefaultEvent ("CollectionChanged")]
-       [DefaultProperty ("Table")]
-       public abstract partial class DataRelationCollection : InternalDataCollectionBase {
-               /// <summary>
-               /// Summary description for DataTableRelationCollection.
-               /// </summary>
-               internal partial class DataSetRelationCollection : DataRelationCollection {
-                       private DataSet dataSet;
-                       DataRelation [] mostRecentRelations;
-
-                       /// <summary>
-                       /// Initializes a new instance of the DataSetRelationCollection class.
-                       /// </summary>
-                       internal DataSetRelationCollection (DataSet dataSet)
-                       {
-                               this.dataSet = dataSet;
-                       }
-
-                       protected override DataSet GetDataSet ()
-                       {
-                               return dataSet;
-                       }
-
-                       /// <summary>
-                       /// Performs verification on the table.
-                       /// </summary>
-                       /// <param name="relation">The relation to check.</param>
-                       protected override void AddCore (DataRelation relation)
-                       {
-                               if (relation.ChildTable.DataSet != dataSet || relation.ParentTable.DataSet != dataSet)
-                                  throw new DataException ();
-
-                               base.AddCore (relation);
-                               relation.ParentTable.ChildRelations.Add (relation);
-                               relation.ChildTable.ParentRelations.Add (relation);
-                               relation.SetDataSet (dataSet);
-                               relation.UpdateConstraints ();
-                       }
-
-                       protected override void RemoveCore (DataRelation relation)
-                       {
-                               base.RemoveCore (relation);
-                               relation.SetDataSet (null);
-                               relation.ParentTable.ChildRelations.Remove (relation);
-                               relation.ChildTable.ParentRelations.Remove (relation);
-                               relation.SetParentKeyConstraint (null);
-                               relation.SetChildKeyConstraint (null);
-                       }
-
-                       public override void AddRange (DataRelation [] relations)
-                       {
-                               if (relations == null)
-                                       return;
-
-                               if (dataSet != null && dataSet.InitInProgress){
-                                       mostRecentRelations = relations;
-                                       return;
-                               }
-
-                               foreach (DataRelation rel in relations){
-                                       if (rel == null)
-                                               continue;
-                                       Add (rel);
-                               }
-                       }
-
-                       internal override void PostAddRange ()
-                       {
-                               if (mostRecentRelations == null)
-                                       return;
-
-                               foreach (DataRelation rel in mostRecentRelations){
-                                       if (rel == null)
-                                               continue;
-                                       if (rel.InitInProgress)
-                                               rel.FinishInit (dataSet);
-                                       Add (rel);
-                               }
-                               mostRecentRelations = null;
-                       }
-
-                       protected override ArrayList List {
-                               get { return base.List; }
-                       }
-
-                       public override DataRelation this [string name] {
-                               get {
-                                       int index = IndexOf (name, true);
-                                       return index < 0 ? null : (DataRelation) List [index];
-                               }
-                       }
-
-                       /// <summary>
-                       /// Gets the DataRelation object at the specified index.
-                       /// </summary>
-                       public override DataRelation this [int index] {
-                               get {
-                                       if (index < 0 || index >= List.Count)
-                                               throw new IndexOutOfRangeException (String.Format ("Cannot find relation {0}.", index));
-
-                                       return (DataRelation) List [index];
-                               }
-                       }
-               }
-
-               /// <summary>
-               /// Summary description for DataTableRelationCollection.
-               /// </summary>
-               internal class DataTableRelationCollection : DataRelationCollection {
-                       private DataTable dataTable;
-
-                       /// <summary>
-                       /// Initializes a new instance of the DataTableRelationCollection class.
-                       /// </summary>
-                       internal DataTableRelationCollection (DataTable dataTable)
-                       {
-                               this.dataTable = dataTable;
-                       }
-
-                       protected override DataSet GetDataSet ()
-                       {
-                               return dataTable.DataSet;
-                       }
-
-                       public override DataRelation this [string name] {
-                               get {
-                                       int index = IndexOf (name, true);
-                                       return index < 0 ? null : (DataRelation) List [index];
-                               }
-                       }
-
-                       /// <summary>
-                       /// Gets the DataRelation object at the specified index.
-                       /// </summary>
-                       public override DataRelation this [int index] {
-                               get {
-                                       if (index < 0 || index >= List.Count)
-                                               throw new IndexOutOfRangeException (String.Format ("Cannot find relation {0}.", index));
-
-                                       return (DataRelation) List [index];
-                               }
-                       }
-
-                       /// <summary>
-                       /// Performs verification on the table.
-                       /// </summary>
-                       /// <param name="relation">The relation to check.</param>
-                       protected override void AddCore (DataRelation relation)
-                       {
-                               if (dataTable.ParentRelations == this && relation.ChildTable != dataTable)
-                                       throw new ArgumentException ("Cannot add a relation to this table's " +
-                                                                    "ParentRelations where this table is not" +
-                                                                    " the Child table.");
-
-                               if (dataTable.ChildRelations == this && relation.ParentTable != dataTable)
-                                       throw new ArgumentException("Cannot add a relation to this table's " +
-                                                                   "ChildRelations where this table is not" +
-                                                                   " the Parent table.");
-
-                               dataTable.DataSet.Relations.Add (relation);
-                               base.AddCore (relation);
-                       }
-
-                       protected override void RemoveCore (DataRelation relation)
-                       {
-                               relation.DataSet.Relations.Remove(relation);
-                               base.RemoveCore (relation);
-                       }
-
-                       protected override ArrayList List {
-                               get { return base.List; }
-                       }
-               }
-
-               private DataRelation inTransition;
-               int index;
-
-
-               /// <summary>
-               /// Initializes a new instance of the DataRelationCollection class.
-               /// </summary>
-               protected DataRelationCollection ()
-               {
-                       inTransition = null;
-               }
-
-               /// <summary>
-               /// Gets the DataRelation object specified by name.
-               /// </summary>
-               public abstract DataRelation this [string name] {
-                       get;
-               }
-
-               /// <summary>
-               /// Gets the DataRelation object at the specified index.
-               /// </summary>
-               public abstract DataRelation this [int index] {
-                       get;
-               }
-
-
-               #region Add Methods
-               private string GetNextDefaultRelationName ()
-               {
-                       int index = 1;
-                       string defRelationName = "Relation" + index;
-                       for (; Contains (defRelationName); ++index)
-                               defRelationName = "Relation" + index;
-                       return defRelationName;
-               }
-
-               /// <summary>
-               /// Adds a DataRelation to the DataRelationCollection.
-               /// </summary>
-               /// <param name="relation">The DataRelation to add to the collection.</param>
-               public void Add (DataRelation relation)
-               {
-                       // To prevent endless recursion
-                       if (inTransition == relation)
-                               return;
-
-                       inTransition = relation;
-
-                       try {
-                               CollectionChangeEventArgs e = new CollectionChangeEventArgs (CollectionChangeAction.Add, relation);
-                               OnCollectionChanging (e);
-
-                               this.AddCore (relation);
-                               if (relation.RelationName == string.Empty)
-                                       relation.RelationName = GenerateRelationName ();
-
-                               relation.ParentTable.ResetPropertyDescriptorsCache ();
-                               relation.ChildTable.ResetPropertyDescriptorsCache ();
-
-                               e = new CollectionChangeEventArgs (CollectionChangeAction.Add, relation);
-                               OnCollectionChanged (e);
-                       } finally {
-                               inTransition = null;
-                       }
-               }
-
-               private string GenerateRelationName ()
-               {
-                       index++;
-                       return "Relation" + index;
-               }
-
-               /// <summary>
-               /// Creates a relation given the parameters and adds it to the collection. The name is defaulted.
-               /// An ArgumentException is generated if this relation already belongs to this collection or belongs to another collection.
-               /// An InvalidConstraintException is generated if the relation can't be created based on the parameters.
-               /// The CollectionChanged event is fired if it succeeds.
-               /// </summary>
-               /// <param name="parentColumn">parent column of relation.</param>
-               /// <param name="childColumn">child column of relation.</param>
-               /// <returns>The created DataRelation.</returns>
-               public virtual DataRelation Add (DataColumn parentColumn, DataColumn childColumn)
-               {
-                       DataRelation dataRelation = new DataRelation (GetNextDefaultRelationName (), parentColumn, childColumn);
-                       Add (dataRelation);
-                       return dataRelation;
-               }
-
-               /// <summary>
-               /// Creates a relation given the parameters and adds it to the collection. The name is defaulted.
-               /// An ArgumentException is generated if this relation already belongs to this collection or belongs to another collection.
-               /// An InvalidConstraintException is generated if the relation can't be created based on the parameters.
-               /// The CollectionChanged event is raised if it succeeds.
-               /// </summary>
-               /// <param name="parentColumns">An array of parent DataColumn objects.</param>
-               /// <param name="childColumns">An array of child DataColumn objects.</param>
-               /// <returns>The created DataRelation.</returns>
-               public virtual DataRelation Add (DataColumn [] parentColumns, DataColumn [] childColumns)
-               {
-                       DataRelation dataRelation = new DataRelation (GetNextDefaultRelationName (), parentColumns, childColumns);
-                       Add (dataRelation);
-                       return dataRelation;
-               }
-
-               /// <summary>
-               /// Creates a relation given the parameters and adds it to the collection.
-               /// An ArgumentException is generated if this relation already belongs to this collection or belongs to another collection.
-               /// A DuplicateNameException is generated if this collection already has a relation with the same name (case insensitive).
-               /// An InvalidConstraintException is generated if the relation can't be created based on the parameters.
-               /// The CollectionChanged event is raised if it succeeds.
-               /// </summary>
-               /// <param name="name">The name of the relation.</param>
-               /// <param name="parentColumn">parent column of relation.</param>
-               /// <returns>The created DataRelation.</returns>
-               /// <returns></returns>
-               public virtual DataRelation Add (string name, DataColumn parentColumn, DataColumn childColumn)
-               {
-                       //If no name was supplied, give it a default name.
-                       if (name == null || name == "")
-                               name = GetNextDefaultRelationName ();
-
-                       DataRelation dataRelation = new DataRelation (name, parentColumn, childColumn);
-                       Add (dataRelation);
-                       return dataRelation;
-               }
-
-               /// <summary>
-               /// Creates a DataRelation with the specified name, and arrays of parent and child columns, and adds it to the collection.
-               /// </summary>
-               /// <param name="name">The name of the DataRelation to create.</param>
-               /// <param name="parentColumns">An array of parent DataColumn objects.</param>
-               /// <param name="childColumns">An array of child DataColumn objects.</param>
-               /// <returns>The created DataRelation.</returns>
-               public virtual DataRelation Add (string name, DataColumn [] parentColumns, DataColumn [] childColumns)
-               {
-                       //If no name was supplied, give it a default name.
-                       if (name == null || name == "")
-                               name = GetNextDefaultRelationName ();
-
-                       DataRelation dataRelation = new DataRelation (name, parentColumns, childColumns);
-                       Add (dataRelation);
-                       return dataRelation;
-               }
-
-               /// <summary>
-               /// Creates a relation given the parameters and adds it to the collection.
-               /// An ArgumentException is generated if this relation already belongs to this collection or belongs to another collection.
-               /// A DuplicateNameException is generated if this collection already has a relation with the same name (case insensitive).
-               /// An InvalidConstraintException is generated if the relation can't be created based on the parameters.
-               /// The CollectionChanged event is raised if it succeeds.
-               /// </summary>
-               /// <param name="name">The name of the relation.</param>
-               /// <param name="parentColumn">parent column of relation.</param>
-               /// <param name="childColumn">child column of relation.</param>
-               /// <param name="createConstraints">true to create constraints; otherwise false. (default is true)</param>
-               /// <returns>The created DataRelation.</returns>
-               public virtual DataRelation Add(string name, DataColumn parentColumn, DataColumn childColumn, bool createConstraints)
-               {
-                       //If no name was supplied, give it a default name.
-                       if (name == null || name == "")
-                               name = GetNextDefaultRelationName ();
-
-                       DataRelation dataRelation = new DataRelation (name, parentColumn, childColumn, createConstraints);
-                       Add (dataRelation);
-                       return dataRelation;
-               }
-
-               /// <summary>
-               /// Creates a DataRelation with the specified name, arrays of parent and child columns,
-               /// and value specifying whether to create a constraint, and adds it to the collection.
-               /// </summary>
-               /// <param name="name">The name of the DataRelation to create.</param>
-               /// <param name="parentColumns">An array of parent DataColumn objects.</param>
-               /// <param name="childColumns">An array of child DataColumn objects.</param>
-               /// <param name="createConstraints">true to create a constraint; otherwise false.</param>
-               /// <returns>The created DataRelation.</returns>
-               public virtual DataRelation Add (string name, DataColumn [] parentColumns, DataColumn [] childColumns, bool createConstraints)
-               {
-                       //If no name was supplied, give it a default name.
-                       if (name == null || name == "")
-                               name = GetNextDefaultRelationName ();
-
-                       DataRelation dataRelation = new DataRelation (name, parentColumns, childColumns, createConstraints);
-                       Add (dataRelation);
-                       return dataRelation;
-               }
-               #endregion
-
-               /// <summary>
-               /// Adds to the list
-               /// </summary>
-               /// <param name="relation">The relation to check.</param>
-               protected virtual void AddCore (DataRelation relation)
-               {
-                       if (relation == null)
-                               //TODO: Issue a good exception message.
-                               throw new ArgumentNullException();
-
-                       if(List.IndexOf (relation) != -1)
-                               //TODO: Issue a good exception message.
-                               throw new ArgumentException();
-
-                       // check if the collection has a relation with the same name.
-                       int tmp = IndexOf (relation.RelationName);
-                       // if we found a relation with same name we have to check
-                       // that it is the same case.
-                       // indexof can return a table with different case letters.
-                       if (tmp != -1 && relation.RelationName == this [tmp].RelationName)
-                               throw new DuplicateNameException("A DataRelation named '" + relation.RelationName + "' already belongs to this DataSet.");
-
-                       // check whether the relation exists between the columns already
-                       foreach (DataRelation rel in this) {
-                               // compare child columns
-                               bool differs = false;
-                               foreach (DataColumn current in relation.ChildColumns) {
-                                       bool exists = false;
-                                       foreach (DataColumn col in rel.ChildColumns) {
-                                               if (col == current) {
-                                                       exists = true;
-                                                       break;
-                                               }
-                                       }
-                                       if (!exists) {
-                                               differs = true;
-                                               break;
-                                       }
-                               }
-
-                               if (! differs) {
-                                       // compare parent columns
-                                       differs = false;
-                                       foreach (DataColumn current in relation.ParentColumns) {
-                                               bool exists = false;
-                                               foreach (DataColumn col in rel.ParentColumns) {
-                                                       if (col == current) {
-                                                               exists = true;
-                                                               break;
-                                                       }
-                                               }
-                                               if (!exists) {
-                                                       differs = true;
-                                                       break;
-                                               }
-                                       }
-
-                                       if (! differs)
-                                               throw new ArgumentException ("A relation already exists for these child columns");
-                               }
-                       }
-
-                       // Add to collection
-                       List.Add (relation);
-               }
-
-               /// <summary>
-               /// Copies the elements of the specified DataRelation array to the end of the collection.
-               /// </summary>
-               /// <param name="relations">The array of DataRelation objects to add to the collection.</param>
-               public virtual void AddRange (DataRelation[] relations)
-               {
-                       if (relations == null)
-                               return;
-
-                       foreach (DataRelation relation in relations)
-                               Add (relation);
-               }
-
-               internal virtual void PostAddRange ()
-               {
-               }
-
-               public virtual bool CanRemove (DataRelation relation)
-               {
-                       if (relation == null || !GetDataSet ().Equals (relation.DataSet))
-                               return false;
-
-                       // check if the relation doesnot belong to this collection
-                       int tmp = IndexOf (relation.RelationName);
-                       return tmp != -1 && relation.RelationName == this [tmp].RelationName;
-               }
-
-               public virtual void Clear ()
-               {
-                       for (int i = 0; i < Count; i++)
-                               Remove (this [i]);
-
-                       List.Clear ();
-               }
-
-               public virtual bool Contains (string name)
-               {
-                       DataSet tmpDataSet = GetDataSet ();
-                       if (tmpDataSet != null) {
-                               DataRelation tmpRelation = tmpDataSet.Relations [name];
-                               if (tmpRelation != null)
-                                       return true;
-                       }
-                       return (-1 != IndexOf (name, false));
-               }
-
-               private CollectionChangeEventArgs CreateCollectionChangeEvent (CollectionChangeAction action)
-               {
-                       return new CollectionChangeEventArgs (action, this);
-               }
-
-               protected abstract DataSet GetDataSet ();
-
-               public virtual int IndexOf (DataRelation relation)
-               {
-                       return List.IndexOf (relation);
-               }
-
-               public virtual int IndexOf (string relationName)
-               {
-                       return IndexOf (relationName, false);
-               }
-
-               private int IndexOf (string name, bool error)
-               {
-                       int count = 0, match = -1;
-                       for (int i = 0; i < List.Count; i++) {
-                               String name2 = ((DataRelation) List[i]).RelationName;
-                               if (String.Compare (name, name2, true) == 0) {
-                                       if (String.Compare (name, name2, false) == 0)
-                                               return i;
-                                       match = i;
-                                       count++;
-                               }
-                       }
-                       if (count == 1)
-                               return match;
-                       if (count > 1 && error)
-                               throw new ArgumentException ("There is no match for the name in the same case and there are multiple matches in different case.");
-                       return -1;
-               }
-
-               protected virtual void OnCollectionChanged (CollectionChangeEventArgs ccevent)
-               {
-                       if (CollectionChanged != null)
-                               CollectionChanged (this, ccevent);
-               }
-
-               protected virtual void OnCollectionChanging (CollectionChangeEventArgs ccevent)
-               {
-                       // LAME Spec: No associated events and it doesn't update CollectionChanged
-                       // event too as specified in MSDN
-                       // throw new NotImplementedException ();
-               }
-
-               public void Remove (DataRelation relation)
-               {
-                       // To prevent endless recursion
-                       if (inTransition == relation)
-                               return;
-
-                       inTransition = relation;
-
-                       if (relation == null)
-                               return;
-
-                       try {
-                               // check if the list doesnot contains this relation.
-                               if (!(List.Contains (relation)))
-                                       throw new ArgumentException ("Relation doesnot belong to this Collection.");
-
-                               CollectionChangeEventArgs e = new CollectionChangeEventArgs (CollectionChangeAction.Remove, relation);
-                               OnCollectionChanging (e);
-
-                               RemoveCore (relation);
-                               string name = "Relation" + index;
-                               if (relation.RelationName == name)
-                                       index--;
-
-                               e = new CollectionChangeEventArgs (CollectionChangeAction.Remove, relation);
-                               OnCollectionChanged (e);
-                       } finally {
-                               inTransition = null;
-                       }
-               }
-
-               public void Remove (string name)
-               {
-                       DataRelation relation = this [name];
-                       if (relation == null)
-                               throw new ArgumentException ("Relation doesnot belong to this Collection.");
-                       Remove (relation);
-               }
-
-               public void RemoveAt (int index)
-               {
-                       DataRelation relation = this [index];
-                       if (relation == null)
-                               throw new IndexOutOfRangeException (String.Format ("Cannot find relation {0}", index));
-                       Remove (relation);
-               }
-
-               protected virtual void RemoveCore (DataRelation relation)
-               {
-                       // Remove from collection
-                       List.Remove (relation);
-               }
-
-               #region Events
-
-               [ResDescriptionAttribute ("Occurs whenever this collection's membership changes.")]
-               public event CollectionChangeEventHandler CollectionChanged;
-
-               #endregion
-       }
-
-       partial class DataRelationCollection {
-               public void CopyTo (DataRelation [] array, int index)
-               {
-                       CopyTo ((Array) array, index);
-               }
-
-               internal void BinarySerialize (SerializationInfo si)
-               {
-                       ArrayList l = new ArrayList ();
-                       for (int j = 0; j < Count; j++) {
-                               DataRelation dr = (DataRelation) List [j];
-                               ArrayList tmp = new ArrayList ();
-                               tmp.Add (dr.RelationName);
-
-                               // FIXME: Handle multi-column relations
-                               int [] rep = new int [2];
-                               DataTable dt = dr.ParentTable;
-                               rep [0] = dt.DataSet.Tables.IndexOf (dt);
-                               rep [1] = dt.Columns.IndexOf (dr.ParentColumns [0]);
-                               tmp.Add (rep);
-                               rep = new int [2];
-                               dt = dr.ChildTable;
-                               rep [0] = dt.DataSet.Tables.IndexOf (dt);
-                               rep [1] = dt.Columns.IndexOf (dr.ChildColumns [0]);
-                               tmp.Add (rep);
-                               tmp.Add (false); // FIXME
-                               tmp.Add (null); // FIXME
-                               l.Add (tmp);
-                       }
-                       si.AddValue ("DataSet.Relations", l, typeof (ArrayList));
-               }
-       }
-}
diff --git a/mcs/class/System.Data/System.Data/DataRelationPropertyDescriptor.cs b/mcs/class/System.Data/System.Data/DataRelationPropertyDescriptor.cs
deleted file mode 100644 (file)
index 0daa973..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-using System;\r
-using System.ComponentModel;\r
-\r
-namespace System.Data\r
-{\r
-       internal class DataRelationPropertyDescriptor : PropertyDescriptor\r
-       {\r
-               #region Fields\r
-\r
-               DataRelation _relation;\r
-\r
-               #endregion // Fields\r
-\r
-               #region Constructors\r
-\r
-               internal DataRelationPropertyDescriptor(DataRelation relation) : base(relation.RelationName,null)\r
-               {\r
-                       _relation = relation;\r
-               }\r
-\r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               public override Type ComponentType \r
-               { \r
-                       get {\r
-                               return typeof(DataRowView);\r
-                       }\r
-               }\r
-\r
-               public override bool IsReadOnly \r
-               { \r
-                       get {\r
-                               return false;\r
-                       }\r
-               }\r
-\r
-               public override Type PropertyType \r
-               { \r
-                       get {\r
-                               return typeof(IBindingList);\r
-                       }\r
-               }\r
-\r
-               public DataRelation Relation \r
-               { \r
-                       get {\r
-                               return _relation;\r
-                       }\r
-               }\r
-\r
-               #endregion // Properties\r
-\r
-               #region Methods\r
-\r
-               public override bool CanResetValue(object obj)\r
-               {\r
-                       return false;\r
-               }\r
-\r
-               public override bool Equals(object obj)\r
-               {\r
-                       DataRelationPropertyDescriptor descriptor = obj as DataRelationPropertyDescriptor;\r
-\r
-                       if (descriptor == null) {\r
-                               return false;\r
-                       }\r
-\r
-                       return (Relation == descriptor.Relation);\r
-               }\r
-\r
-               public override int GetHashCode()\r
-               {\r
-                       return _relation.GetHashCode();\r
-               }\r
-\r
-        public override object GetValue(object obj)\r
-               {\r
-                       DataRowView dr = (DataRowView)obj;\r
-                       return dr.CreateChildView(Relation);\r
-               }\r
-\r
-               public override void ResetValue(object obj)\r
-               {\r
-               }\r
-\r
-               public override void SetValue(object obj, object val)\r
-               {\r
-               }\r
-\r
-               public override bool ShouldSerializeValue(object obj)\r
-               {\r
-                       return false;\r
-               }\r
-\r
-               #endregion // Methods\r
-       }\r
-}\r
diff --git a/mcs/class/System.Data/System.Data/DataRow.cs b/mcs/class/System.Data/System.Data/DataRow.cs
deleted file mode 100644 (file)
index 70aeaf1..0000000
+++ /dev/null
@@ -1,1687 +0,0 @@
-//
-// System.Data.DataRow.cs
-//
-// Author:
-//   Rodrigo Moya <rodrigo@ximian.com>
-//   Daniel Morgan <danmorg@sc.rr.com>
-//   Tim Coleman <tim@timcoleman.com>
-//   Ville Palo <vi64pa@koti.soon.fi>
-//   Alan Tam Siu Lung <Tam@SiuLung.com>
-//   Sureshkumar T <tsureshkumar@novell.com>
-//   Veerapuram Varadhan <vvaradhan@novell.com>
-//
-// (C) Ximian, Inc 2002
-// (C) Daniel Morgan 2002, 2003
-// Copyright (C) 2002 Tim Coleman
-//
-
-//
-// Copyright (C) 2004-2009 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Data.Common;
-using System.Collections;
-using System.Globalization;
-using System.Xml;
-using System.ComponentModel;
-
-namespace System.Data {
-       /// <summary>
-       /// Represents a row of data in a DataTable.
-       /// </summary>
-       public class DataRow {
-               #region Fields
-
-               private DataTable _table;
-
-               internal int _original = -1;
-               internal int _current = -1;
-               internal int _proposed = -1;
-
-               private ArrayList _columnErrors;
-               private string rowError;
-               internal int xmlRowID = 0;
-               internal bool _nullConstraintViolation;
-               private string _nullConstraintMessage;
-               private bool _inChangingEvent;
-               private int _rowId;
-               internal bool _rowChanged = false;
-
-               private XmlDataDocument.XmlDataElement mappedElement;
-               internal bool _inExpressionEvaluation = false;
-
-               #endregion // Fields
-
-               #region Constructors
-
-               /// <summary>
-               /// This member supports the .NET Framework infrastructure and is not intended to be
-               /// used directly from your code.
-               /// </summary>
-               protected internal DataRow (DataRowBuilder builder)
-               {
-                       _table = builder.Table;
-                       // Get the row id from the builder.
-                       _rowId = builder._rowId;
-
-                       rowError = String.Empty;
-               }
-
-               internal DataRow (DataTable table, int rowId)
-               {
-                       _table = table;
-                       _rowId = rowId;
-                       rowError = String.Empty;
-               }
-
-               #endregion // Constructors
-
-               #region Properties
-
-               private ArrayList ColumnErrors {
-                       get {
-                               if (_columnErrors == null)
-                                       _columnErrors = new ArrayList ();
-                               return _columnErrors;
-                       }
-
-                       set { _columnErrors = value; }
-               }
-
-               /// <summary>
-               /// Gets a value indicating whether there are errors in a row.
-               /// </summary>
-               public bool HasErrors {
-                       get {
-                               if (!string.IsNullOrEmpty (RowError))
-                                       return true;
-
-                               foreach (String columnError in ColumnErrors) {
-                                       if (!string.IsNullOrEmpty (columnError))
-                                               return true;
-                               }
-                               return false;
-                       }
-               }
-
-               /// <summary>
-               /// Gets or sets the data stored in the column specified by name.
-               /// </summary>
-               public object this [string columnName] {
-                       get { return this [columnName, DataRowVersion.Default]; }
-                       set {
-                               DataColumn column = GetColumn (columnName);
-                               this [column.Ordinal] = value;
-                       }
-               }
-
-               /// <summary>
-               /// Gets or sets the data stored in specified DataColumn
-               /// </summary>
-               public object this [DataColumn column] {
-                       get { return this [column, DataRowVersion.Default]; }
-                       set {
-                               if (column == null)
-                                       throw new ArgumentNullException ("column");
-                               int columnIndex = _table.Columns.IndexOf (column);
-                               if (columnIndex == -1)
-                                       throw new ArgumentException (string.Format (CultureInfo.InvariantCulture,
-                                               "The column '{0}' does not belong to the table : {1}.",
-                                               column.ColumnName, _table.TableName));
-                               this [columnIndex] = value;
-                       }
-               }
-
-               /// <summary>
-               /// Gets or sets the data stored in column specified by index.
-               /// </summary>
-               public object this [int columnIndex] {
-                       get { return this [columnIndex, DataRowVersion.Default]; }
-                       set {
-                               if (columnIndex < 0 || columnIndex > _table.Columns.Count)
-                                       throw new IndexOutOfRangeException ();
-                               if (RowState == DataRowState.Deleted)
-                                       throw new DeletedRowInaccessibleException ();
-
-                               DataColumn column = _table.Columns [columnIndex];
-                               _table.ChangingDataColumn (this, column, value);
-
-                               if (value == null && column.DataType.IsValueType)
-                                       throw new ArgumentException ("Canot set column '"
-                                               + column.ColumnName + "' to be null."
-                                               + " Please use DBNull instead.");
-
-                               _rowChanged = true;
-
-                               CheckValue (value, column);
-                               bool already_editing = Proposed >= 0;
-                               if (!already_editing)
-                                       BeginEdit ();
-
-                               column [Proposed] = value;
-                               _table.ChangedDataColumn (this, column, value);
-
-                               if (!already_editing)
-                                       EndEdit ();
-                       }
-               }
-
-               /// <summary>
-               /// Gets the specified version of data stored in the named column.
-               /// </summary>
-               public object this [string columnName, DataRowVersion version] {
-                       get {
-                               DataColumn column = GetColumn (columnName);
-                               return this [column.Ordinal, version];
-                       }
-               }
-
-               /// <summary>
-               /// Gets the specified version of data stored in the specified DataColumn.
-               /// </summary>
-               public object this [DataColumn column, DataRowVersion version] {
-                       get {
-                               if (column == null)
-                                       throw new ArgumentNullException ("column");
-                               if (column.Table != Table)
-                                       throw new ArgumentException (string.Format (CultureInfo.InvariantCulture,
-                                               "The column '{0}' does not belong to the table : {1}.",
-                                               column.ColumnName, _table.TableName));
-                               return this [column.Ordinal, version];
-                       }
-               }
-
-               /// <summary>
-               /// Set a value for the column into the offset specified by the version.<br>
-               /// If the value is auto increment or null, necessary auto increment value
-               /// or the default value will be used.
-               /// </summary>
-               internal void SetValue (int column, object value, int version)
-               {
-                       DataColumn dc = Table.Columns [column];
-
-                       if (value == null && !dc.AutoIncrement) // set default value / auto increment
-                               value = dc.DefaultValue;
-
-                       Table.ChangingDataColumn (this, dc, value);
-                       CheckValue (value, dc);
-                       if (!dc.AutoIncrement)
-                               dc [version] = value;
-                       else if (_proposed >= 0 && _proposed != version) // proposed holds the AI
-                               dc [version] = dc [_proposed];
-               }
-
-               /// <summary>
-               /// Gets the data stored in the column, specified by index and version of the data to
-               /// retrieve.
-               /// </summary>
-               public object this [int columnIndex, DataRowVersion version] {
-                       get {
-                               if (columnIndex < 0 || columnIndex > _table.Columns.Count)
-                                       throw new IndexOutOfRangeException ();
-
-                               DataColumn column = _table.Columns [columnIndex];
-                               int recordIndex = IndexFromVersion (version);
-
-                               if (column.Expression != String.Empty && _table.Rows.IndexOf (this) != -1) {
-                                       // FIXME: how does this handle 'version'?
-                                       // TODO: Can we avoid the Eval each time by using the cached value?
-                                       object o = column.CompiledExpression.Eval (this);
-                                       if (o != null && o != DBNull.Value)
-                                               o = Convert.ChangeType (o, column.DataType);
-                                       column [recordIndex] = o;
-                                       return column [recordIndex];
-                               }
-
-                               return column [recordIndex];
-                       }
-               }
-
-               /// <summary>
-               /// Gets or sets all of the values for this row through an array.
-               /// </summary>
-               public object [] ItemArray {
-                       get {
-                               // Accessing deleted rows
-                               if (RowState == DataRowState.Deleted)
-                                       throw new DeletedRowInaccessibleException ("Deleted row information cannot be accessed through the row.");
-
-                               int index = Current;
-                               if (RowState == DataRowState.Detached) {
-                                       // Check if datarow is removed from the table.
-                                       if (Proposed < 0)
-                                               throw new RowNotInTableException (
-                                                       "This row has been removed from a table and does not have any data."
-                                                       + "  BeginEdit() will allow creation of new data in this row.");
-                                       index = Proposed;
-                               }
-
-                               object[] items = new object [_table.Columns.Count];
-
-                               foreach(DataColumn column in _table.Columns)
-                                       items [column.Ordinal] = column [index];
-                               return items;
-                       }
-                       set {
-                               if (value.Length > _table.Columns.Count)
-                                       throw new ArgumentException ();
-
-                               if (RowState == DataRowState.Deleted)
-                                       throw new DeletedRowInaccessibleException ();
-
-                               BeginEdit ();
-
-                               DataColumnChangeEventArgs e = new DataColumnChangeEventArgs ();
-                               foreach (DataColumn column in _table.Columns) {
-                                       int i = column.Ordinal;
-                                       object newVal = i < value.Length ? value [i] : null;
-
-                                       if (newVal == null)
-                                               continue;
-
-                                       e.Initialize (this, column, newVal);
-                                       CheckValue (e.ProposedValue, column);
-                                       _table.RaiseOnColumnChanging (e);
-                                       column [Proposed] = e.ProposedValue;
-                                       _table.RaiseOnColumnChanged (e);
-                               }
-
-                               EndEdit ();
-                       }
-               }
-
-               /// <summary>
-               /// Gets the current state of the row in regards to its relationship to the
-               /// DataRowCollection.
-               /// </summary>
-               public DataRowState RowState {
-                       get {
-                               //return rowState;
-                               if (Original == -1 && Current == -1)
-                                       return DataRowState.Detached;
-                               if (Original == Current)
-                                       return DataRowState.Unchanged;
-                               if (Original == -1)
-                                       return DataRowState.Added;
-                               if (Current == -1)
-                                       return DataRowState.Deleted;
-                               return DataRowState.Modified;
-                       }
-                       internal set {
-                               if (DataRowState.Detached == value) {
-                                       Original = -1;
-                                       Current = -1;
-                               }
-                               if (DataRowState.Unchanged == value)
-                                       Original = Current;
-                               if (DataRowState.Added == value)
-                                       Original = -1;
-                               if (DataRowState.Deleted == value)
-                                       Current = -1;
-                       }
-               }
-
-               public void SetAdded ()
-               {
-                       if (RowState != DataRowState.Unchanged)
-                               throw new InvalidOperationException ("SetAdded and SetModified can only be called on DataRows with Unchanged DataRowState.");
-                       Original = -1;
-               }
-
-               public void SetModified ()
-               {
-                       if (RowState != DataRowState.Unchanged)
-                               throw new InvalidOperationException ("SetAdded and SetModified can only be called on DataRows with Unchanged DataRowState.");
-                       Current = _table.RecordCache.NewRecord ();
-                       _table.RecordCache.CopyRecord (_table, Original, Current);
-               }
-
-               /// <summary>
-               /// Gets the DataTable for which this row has a schema.
-               /// </summary>
-               public DataTable Table {
-                       get { return _table; }
-                       internal set { _table = value; }
-               }
-
-               /// <summary>
-               /// Gets and sets index of row. This is used from
-               /// XmlDataDocument.
-               // </summary>
-               internal int XmlRowID {
-                       get { return xmlRowID; }
-                       set { xmlRowID = value; }
-               }
-
-               /// <summary>
-               /// Gets and sets index of row.
-               // </summary>
-               internal int RowID {
-                       get { return _rowId; }
-                       set { _rowId = value; }
-               }
-
-               internal int Original {
-                       get { return _original; }
-                       set {
-                               if (Table != null) {
-                                       //Table.RecordCache[_original] = null;
-                                       Table.RecordCache [value] = this;
-                               }
-                               _original = value;
-                       }
-               }
-
-               internal int Current {
-                       get { return _current; }
-                       set {
-                               if (Table != null) {
-                                       //Table.RecordCache[_current] = null;
-                                       Table.RecordCache [value] = this;
-                               }
-                               _current = value;
-                       }
-               }
-
-               internal int Proposed {
-                       get { return _proposed; }
-                       set {
-                               if (Table != null) {
-                                       //Table.RecordCache[_proposed] = null;
-                                       Table.RecordCache [value] = this;
-                               }
-                               _proposed = value;
-                       }
-               }
-
-               #endregion
-
-               #region Methods
-               // Called by DataRowCollection.Add/InsertAt
-               internal void AttachAt (int row_id, DataRowAction action)
-               {
-                       _rowId = row_id;
-                       if (Proposed != -1) {
-                               if (Current >= 0)
-                                       Table.RecordCache.DisposeRecord (Current);
-                               Current = Proposed;
-                               Proposed = -1;
-                       }
-                       if ((action & (DataRowAction.ChangeCurrentAndOriginal | DataRowAction.ChangeOriginal)) != 0)
-                               Original = Current;
-               }
-
-               void Detach ()
-               {
-                       Table.DeleteRowFromIndexes (this);
-                       _table.Rows.RemoveInternal (this);
-
-                       if (Proposed >= 0 && Proposed != Current && Proposed != Original)
-                               _table.RecordCache.DisposeRecord (Proposed);
-                       Proposed = -1;
-
-                       if (Current >= 0 && Current != Original)
-                               _table.RecordCache.DisposeRecord (Current);
-                       Current = -1;
-
-                       if (Original >= 0)
-                               _table.RecordCache.DisposeRecord (Original);
-                       Original = -1;
-
-                       _rowId = -1;
-               }
-
-               internal void ImportRecord (int record)
-               {
-                       if (HasVersion (DataRowVersion.Proposed))
-                               Table.RecordCache.DisposeRecord (Proposed);
-
-                       Proposed = record;
-
-                       foreach (DataColumn column in Table.Columns.AutoIncrmentColumns)
-                               column.UpdateAutoIncrementValue (column.DataContainer.GetInt64 (Proposed));
-
-                       foreach (DataColumn col in Table.Columns)
-                               CheckValue (this [col], col, false);
-               }
-
-               private void CheckValue (object v, DataColumn col)
-               {
-                       CheckValue (v, col, true);
-               }
-
-               private void CheckValue (object v, DataColumn col, bool doROCheck)
-               {
-                       if (doROCheck && _rowId != -1 && col.ReadOnly)
-                               throw new ReadOnlyException ();
-
-                       if (v == null || v == DBNull.Value) {
-                               if (col.AllowDBNull || col.AutoIncrement || col.DefaultValue != DBNull.Value)
-                                       return;
-
-                               //Constraint violations during data load is raise in DataTable EndLoad
-                               this._nullConstraintViolation = true;
-                               if (this.Table._duringDataLoad || (Table.DataSet != null && !Table.DataSet.EnforceConstraints))
-                                       this.Table._nullConstraintViolationDuringDataLoad = true;
-                               _nullConstraintMessage = "Column '" + col.ColumnName + "' does not allow nulls.";
-                       }
-               }
-
-               /// <summary>
-               /// Gets or sets the custom error description for a row.
-               /// </summary>
-               public string RowError {
-                       get { return rowError; }
-                       set { rowError = value ?? string.Empty; }
-               }
-
-               internal int IndexFromVersion (DataRowVersion version)
-               {
-                       switch (version) {
-                       case DataRowVersion.Default:
-                               if (Proposed >= 0)
-                                       return Proposed;
-
-                               if (Current >= 0)
-                                       return Current;
-
-                               if (Original < 0)
-                                       throw new RowNotInTableException ("This row has been removed from a table and does not have any data.  BeginEdit() will allow creation of new data in this row.");
-
-                               throw new DeletedRowInaccessibleException ("Deleted row information cannot be accessed through the row.");
-
-                       case DataRowVersion.Proposed:
-                               return AssertValidVersionIndex (version, Proposed);
-                       case DataRowVersion.Current:
-                               return AssertValidVersionIndex (version, Current);
-                       case DataRowVersion.Original:
-                               return AssertValidVersionIndex (version, Original);
-                       default:
-                               throw new DataException ("Version must be Original, Current, or Proposed.");
-                       }
-               }
-
-               private int AssertValidVersionIndex (DataRowVersion version, int index)
-               {
-                       if (index >= 0)
-                               return index;
-
-                       throw new VersionNotFoundException (String.Format ("There is no {0} data to access.", version));
-               }
-
-               internal DataRowVersion VersionFromIndex (int index)
-               {
-                       if (index < 0)
-                               throw new ArgumentException ("Index must not be negative.");
-
-                       // the order of ifs matters
-                       if (index == Current)
-                               return DataRowVersion.Current;
-                       if (index == Original)
-                               return DataRowVersion.Original;
-                       if (index == Proposed)
-                               return DataRowVersion.Proposed;
-
-                       throw new ArgumentException (String.Format ("The index {0} does not belong to this row.", index));
-               }
-
-               internal XmlDataDocument.XmlDataElement DataElement {
-                       get {
-                               if (mappedElement != null || _table.DataSet == null || _table.DataSet._xmlDataDocument == null)
-                                       return mappedElement;
-
-                               // create mapped XmlDataElement
-                               mappedElement = new XmlDataDocument.XmlDataElement (
-                                       this, _table.Prefix, XmlHelper.Encode (_table.TableName),
-                                       _table.Namespace, _table.DataSet._xmlDataDocument);
-                               return mappedElement;
-                       }
-                       set { mappedElement = value; }
-               }
-
-               internal void SetOriginalValue (string columnName, object val)
-               {
-                       DataColumn column = _table.Columns [columnName];
-                       _table.ChangingDataColumn (this, column, val);
-
-                       if (Original < 0 || Original == Current) {
-                               Original = Table.RecordCache.NewRecord ();
-                               
-                               foreach (DataColumn col in _table.Columns)
-                                       col.DataContainer.CopyValue (Table.DefaultValuesRowIndex, Original);
-                       }
-
-                       CheckValue (val, column);
-                       column [Original] = val;
-               }
-
-               /// <summary>
-               /// Commits all the changes made to this row since the last time AcceptChanges was
-               /// called.
-               /// </summary>
-               public void AcceptChanges ()
-               {
-                       EndEdit (); // in case it hasn't been called
-
-                       _table.ChangingDataRow (this, DataRowAction.Commit);
-                       CheckChildRows (DataRowAction.Commit);
-                       switch (RowState) {
-                       case DataRowState.Added:
-                       case DataRowState.Modified:
-                               if (Original >= 0)
-                                       Table.RecordCache.DisposeRecord (Original);
-                               Original = Current;
-                               break;
-                       case DataRowState.Deleted:
-                               Detach ();
-                               break;
-                       case DataRowState.Detached:
-                               throw new RowNotInTableException("Cannot perform this operation on a row not in the table.");
-                       }
-
-                       _table.ChangedDataRow (this, DataRowAction.Commit);
-               }
-
-               /// <summary>
-               /// Begins an edit operation on a DataRow object.
-               /// </summary>
-               [EditorBrowsable (EditorBrowsableState.Advanced)]
-               public void BeginEdit ()
-               {
-                       if (_inChangingEvent)
-                               throw new InRowChangingEventException ("Cannot call BeginEdit inside an OnRowChanging event.");
-                       if (RowState == DataRowState.Deleted)
-                               throw new DeletedRowInaccessibleException ();
-
-                       if (!HasVersion (DataRowVersion.Proposed)) {
-                               Proposed = Table.RecordCache.NewRecord ();
-                               int from = HasVersion (DataRowVersion.Current) ? Current : Table.DefaultValuesRowIndex;
-                               for (int i = 0; i < Table.Columns.Count; i++){
-                                       DataColumn column = Table.Columns [i];
-                                       column.DataContainer.CopyValue (from, Proposed);
-                               }
-                       }
-               }
-
-               /// <summary>
-               /// Cancels the current edit on the row.
-               /// </summary>
-               [EditorBrowsable (EditorBrowsableState.Advanced)]
-               public void CancelEdit ()
-               {
-                        if (_inChangingEvent)
-                               throw new InRowChangingEventException ("Cannot call CancelEdit inside an OnRowChanging event.");
-
-                       if (HasVersion (DataRowVersion.Proposed)) {
-                               int oldRecord = Proposed;
-                               DataRowState oldState = RowState;
-                               Table.RecordCache.DisposeRecord(Proposed);
-                               Proposed = -1;
-
-                               foreach (Index index in Table.Indexes)
-                                       index.Update (this, oldRecord, DataRowVersion.Proposed, oldState);
-                       }
-               }
-
-               /// <summary>
-               /// Clears the errors for the row, including the RowError and errors set with
-               /// SetColumnError.
-               /// </summary>
-               public void ClearErrors ()
-               {
-                       rowError = String.Empty;
-                       ColumnErrors.Clear();
-               }
-
-               /// <summary>
-               /// Deletes the DataRow.
-               /// </summary>
-               public void Delete ()
-               {
-                       _table.DeletingDataRow (this, DataRowAction.Delete);
-                       switch (RowState) {
-                       case DataRowState.Added:
-                               CheckChildRows (DataRowAction.Delete);
-                               Detach ();
-                               break;
-                       case DataRowState.Deleted:
-                       case DataRowState.Detached:
-                               break;
-                       default:
-                               // check what to do with child rows
-                               CheckChildRows (DataRowAction.Delete);
-                               break;
-                       }
-                       if (Current >= 0) {
-                               int current = Current;
-                               DataRowState oldState = RowState;
-                               if (Current != Original)
-                                       _table.RecordCache.DisposeRecord (Current);
-                               Current = -1;
-                               foreach (Index index in Table.Indexes)
-                                       index.Update (this, current, DataRowVersion.Current, oldState);
-                       }
-                       _table.DeletedDataRow (this, DataRowAction.Delete);
-               }
-
-               // check the child rows of this row before deleting the row.
-               private void CheckChildRows (DataRowAction action)
-               {
-                       DataSet ds = _table.DataSet;
-
-                       if (ds == null || !ds.EnforceConstraints)
-                               return;
-
-                       // if the table we're attached-to doesn't have an constraints, no foreign keys are pointing to us ...
-                       if (_table.Constraints.Count == 0)
-                               return;
-
-                       foreach (DataTable table in ds.Tables) {
-                               // loop on all ForeignKeyConstrain of the table.
-                               foreach (Constraint constraint in table.Constraints) {
-                                       ForeignKeyConstraint fk = constraint as ForeignKeyConstraint;
-                                       if (fk == null || fk.RelatedTable != _table)
-                                               continue;
-
-                                       switch (action) {
-                                       case DataRowAction.Delete:
-                                               CheckChildRows (fk, action, fk.DeleteRule);
-                                               break;
-                                       case DataRowAction.Commit:
-                                       case DataRowAction.Rollback:
-                                               if (fk.AcceptRejectRule != AcceptRejectRule.None)
-                                                       CheckChildRows (fk, action, Rule.Cascade);
-                                               break;
-                                       default:
-                                               CheckChildRows (fk, action, fk.UpdateRule);
-                                               break;
-                                       }
-                               }
-                       }
-               }
-
-               private void CheckChildRows (ForeignKeyConstraint fkc, DataRowAction action, Rule rule)
-               {
-                       DataRow [] childRows = GetChildRows (fkc, DataRowVersion.Current);
-                       if (childRows == null)
-                               return;
-
-                       switch (rule) {
-                       case Rule.Cascade:  // delete or change all relted rows.
-                               switch (action) {
-                               case DataRowAction.Delete:
-                                       for (int j = 0; j < childRows.Length; j++) {
-                                               if (childRows [j].RowState != DataRowState.Deleted)
-                                                       childRows [j].Delete ();
-                                       }
-                                       break;
-                               case DataRowAction.Change:
-                                       for (int j = 0; j < childRows.Length; j++) {
-                                               // if action is change we change the values in the child row
-                                               // change only the values in the key columns
-                                               // set the childcolumn value to the new parent row value
-                                               for (int k = 0; k < fkc.Columns.Length; k++)
-                                                       if (!fkc.RelatedColumns [k].DataContainer [Current].Equals (fkc.RelatedColumns [k].DataContainer [Proposed]))
-                                                               childRows [j][fkc.Columns [k]] = this [fkc.RelatedColumns [k], DataRowVersion.Proposed];
-                                       }
-                                       break;
-                               case DataRowAction.Rollback:
-                                       for (int j = 0; j < childRows.Length; j++) {
-                                               if (childRows [j].RowState != DataRowState.Unchanged)
-                                                       childRows [j].RejectChanges ();
-                                       }
-                                       break;
-                               }
-                               break;
-                       case Rule.None: // throw an exception if there are any child rows.
-                               for (int j = 0; j < childRows.Length; j++) {
-                                       if (childRows[j].RowState != DataRowState.Deleted) {
-                                               string changeStr = "Cannot change this row because constraints are enforced on relation " + fkc.ConstraintName +", and changing this row will strand child rows.";
-                                               string delStr = "Cannot delete this row because constraints are enforced on relation " + fkc.ConstraintName +", and deleting this row will strand child rows.";
-                                               string message = action == DataRowAction.Delete ? delStr : changeStr;
-                                               throw new InvalidConstraintException (message);
-                                       }
-                               }
-                               break;
-                       case Rule.SetDefault: // set the values in the child rows to the default value of the columns.
-                               if (childRows.Length > 0) {
-                                       int defaultValuesRowIndex = childRows [0].Table.DefaultValuesRowIndex;
-                                       foreach (DataRow childRow in childRows) {
-                                               if (childRow.RowState != DataRowState.Deleted) {
-                                                       int defaultIdx = childRow.IndexFromVersion (DataRowVersion.Default);
-                                                       foreach (DataColumn column in fkc.Columns)
-                                                               column.DataContainer.CopyValue (defaultValuesRowIndex, defaultIdx);
-                                               }
-                                       }
-                               }
-                               break;
-                       case Rule.SetNull: // set the values in the child row to null.
-                               for (int j = 0; j < childRows.Length; j++) {
-                                       DataRow child = childRows [j];
-                                       if (childRows[j].RowState != DataRowState.Deleted) {
-                                               // set only the key columns to DBNull
-                                               for (int k = 0; k < fkc.Columns.Length; k++)
-                                                       child.SetNull (fkc.Columns[k]);
-                                       }
-                               }
-                               break;
-                       }
-               }
-
-               /// <summary>
-               /// Ends the edit occurring on the row.
-               /// </summary>
-               [EditorBrowsable (EditorBrowsableState.Advanced)]
-               public void EndEdit ()
-               {
-                       if (_inChangingEvent)
-                               throw new InRowChangingEventException ("Cannot call EndEdit inside an OnRowChanging event.");
-
-                       if (RowState == DataRowState.Detached || !HasVersion (DataRowVersion.Proposed))
-                               return;
-
-                       CheckReadOnlyStatus ();
-
-                       _inChangingEvent = true;
-                       try {
-                               _table.ChangingDataRow (this, DataRowAction.Change);
-                       } finally {
-                               _inChangingEvent = false;
-                       }
-
-                       DataRowState oldState = RowState;
-
-                       int oldRecord = Current;
-                       Current = Proposed;
-                       Proposed = -1;
-
-
-                       //FIXME : ideally  indexes shouldnt be maintained during dataload.But this needs to
-                       //be implemented at multiple places.For now, just maintain the index.
-                       //if (!Table._duringDataLoad) {
-                       foreach (Index index in Table.Indexes)
-                               index.Update (this, oldRecord, DataRowVersion.Current, oldState);
-                       //}
-
-                       try {
-                               AssertConstraints ();
-                               
-                               // restore previous state to let the cascade update to find the rows 
-                               Proposed = Current;
-                               Current = oldRecord; 
-                               
-                               CheckChildRows (DataRowAction.Change);
-                               
-                               // apply new state
-                               Current = Proposed;
-                               Proposed = -1;
-                       } catch {
-                               int proposed = Proposed >= 0 ? Proposed : Current;
-                               Current = oldRecord;
-                               //if (!Table._duringDataLoad) {
-                               foreach (Index index in Table.Indexes)
-                                       index.Update (this, proposed, DataRowVersion.Current, RowState);
-                               //}
-                               throw;
-                       }
-
-                       if (Original != oldRecord)
-                               Table.RecordCache.DisposeRecord (oldRecord);
-
-                       // Note : row state must not be changed before all the job on indexes finished,
-                       // since the indexes works with recods rather than with rows and the decision
-                       // which of row records to choose depends on row state.
-                       if (_rowChanged == true) {
-                               _table.ChangedDataRow (this, DataRowAction.Change);
-                               _rowChanged = false;
-                       }
-               }
-
-               /// <summary>
-               /// Gets the child rows of this DataRow using the specified DataRelation.
-               /// </summary>
-               public DataRow [] GetChildRows (DataRelation relation)
-               {
-                       return GetChildRows (relation, DataRowVersion.Default);
-               }
-
-               /// <summary>
-               /// Gets the child rows of a DataRow using the specified RelationName of a
-               /// DataRelation.
-               /// </summary>
-               public DataRow [] GetChildRows (string relationName)
-               {
-                       return GetChildRows (Table.DataSet.Relations [relationName]);
-               }
-
-               /// <summary>
-               /// Gets the child rows of a DataRow using the specified DataRelation, and
-               /// DataRowVersion.
-               /// </summary>
-               public DataRow[] GetChildRows (DataRelation relation, DataRowVersion version)
-               {
-                       if (relation == null)
-                               return Table.NewRowArray (0);
-
-                       if (this.Table == null)
-                               throw new RowNotInTableException ("This row has been removed from a table and does not have any data.  BeginEdit() will allow creation of new data in this row.");
-
-                       if (relation.DataSet != this.Table.DataSet)
-                               throw new ArgumentException ();
-
-                       if (_table != relation.ParentTable)
-                               throw new InvalidConstraintException ("GetChildRow requires a row whose Table is " + relation.ParentTable + ", but the specified row's table is " + _table);
-
-                       if (relation.ChildKeyConstraint != null)
-                               return GetChildRows (relation.ChildKeyConstraint, version);
-
-                       ArrayList rows = new ArrayList ();
-                       DataColumn[] parentColumns = relation.ParentColumns;
-                       DataColumn[] childColumns = relation.ChildColumns;
-                       int numColumn = parentColumns.Length;
-                       DataRow[] result = null;
-
-                       int versionIndex = IndexFromVersion (version);
-                       int tmpRecord = relation.ChildTable.RecordCache.NewRecord ();
-
-                       try {
-                               for (int i = 0; i < numColumn; i++)
-                                       // according to MSDN: the DataType value for both columns must be identical.
-                                       childColumns [i].DataContainer.CopyValue (parentColumns [i].DataContainer, versionIndex, tmpRecord);
-
-                               Index index = relation.ChildTable.FindIndex (childColumns);
-
-                               if (index != null) {
-                                       int [] records = index.FindAll (tmpRecord);
-                                       result = relation.ChildTable.NewRowArray (records.Length);
-                                       for(int i = 0; i < records.Length; i++)
-                                               result [i] = relation.ChildTable.RecordCache [records [i]];
-                               } else {
-                                       foreach (DataRow row in relation.ChildTable.Rows) {
-                                               bool allColumnsMatch = false;
-                                               if (row.HasVersion (DataRowVersion.Default)) {
-                                                       allColumnsMatch = true;
-                                                       int childIndex = row.IndexFromVersion (DataRowVersion.Default);
-                                                       for (int columnCnt = 0; columnCnt < numColumn; ++columnCnt) {
-                                                               if (childColumns[columnCnt].DataContainer.CompareValues (childIndex, tmpRecord) != 0) {
-                                                                       allColumnsMatch = false;
-                                                                       break;
-                                                               }
-                                                       }
-                                               }
-                                               if (allColumnsMatch)
-                                                       rows.Add (row);
-                                       }
-                                       result = relation.ChildTable.NewRowArray (rows.Count);
-                                       rows.CopyTo (result, 0);
-                               }
-                       }
-                       finally {
-                               relation.ChildTable.RecordCache.DisposeRecord (tmpRecord);
-                       }
-
-                       return result;
-               }
-
-               /// <summary>
-               /// Gets the child rows of a DataRow using the specified RelationName of a
-               /// DataRelation, and DataRowVersion.
-               /// </summary>
-               public DataRow [] GetChildRows (string relationName, DataRowVersion version)
-               {
-                       return GetChildRows (Table.DataSet.Relations [relationName], version);
-               }
-
-               private DataRow [] GetChildRows (ForeignKeyConstraint fkc, DataRowVersion version)
-               {
-                       ArrayList rows = new ArrayList ();
-                       DataColumn [] parentColumns = fkc.RelatedColumns;
-                       DataColumn [] childColumns = fkc.Columns;
-                       int numColumn = parentColumns.Length;
-
-                       Index index = fkc.Index;
-
-                       int curIndex = IndexFromVersion (version);
-                       int tmpRecord = fkc.Table.RecordCache.NewRecord ();
-                       for (int i = 0; i < numColumn; i++)
-                               // according to MSDN: the DataType value for both columns must be identical.
-                               childColumns [i].DataContainer.CopyValue (parentColumns [i].DataContainer, curIndex, tmpRecord);
-
-                       try {
-                               if (index != null) {
-                                       // get the child rows from the index
-                                       int[] childRecords = index.FindAll (tmpRecord);
-                                       for (int i = 0; i < childRecords.Length; i++)
-                                               rows.Add (childColumns [i].Table.RecordCache [childRecords [i]]);
-                               } else { // if there is no index we search manualy.
-                                       foreach (DataRow row in fkc.Table.Rows) {
-                                               bool allColumnsMatch = false;
-                                               if (row.HasVersion (DataRowVersion.Default)) {
-                                                       allColumnsMatch = true;
-                                                       int childIndex = row.IndexFromVersion (DataRowVersion.Default);
-                                                       for (int columnCnt = 0; columnCnt < numColumn; ++columnCnt) {
-                                                               if (childColumns [columnCnt].DataContainer.CompareValues (childIndex, tmpRecord) != 0) {
-                                                                       allColumnsMatch = false;
-                                                                       break;
-                                                               }
-                                                       }
-                                               }
-                                               if (allColumnsMatch)
-                                                       rows.Add (row);
-                                       }
-                               }
-                       } finally {
-                               fkc.Table.RecordCache.DisposeRecord(tmpRecord);
-                       }
-
-                       DataRow[] result = fkc.Table.NewRowArray (rows.Count);
-                       rows.CopyTo (result, 0);
-                       return result;
-               }
-
-               /// <summary>
-               /// Gets the error description of the specified DataColumn.
-               /// </summary>
-               public string GetColumnError (DataColumn column)
-               {
-                       if (column == null)
-                               throw new ArgumentNullException ("column");
-
-                       int index = _table.Columns.IndexOf (column);
-                       if (index < 0)
-                               throw new ArgumentException (String.Format ("Column '{0}' does not belong to table {1}.", column.ColumnName, Table.TableName));
-
-                       return GetColumnError (index);
-               }
-
-               /// <summary>
-               /// Gets the error description for the column specified by index.
-               /// </summary>
-               public string GetColumnError (int columnIndex)
-               {
-                       if (columnIndex < 0 || columnIndex >= Table.Columns.Count)
-                               throw new IndexOutOfRangeException ();
-
-                       string retVal = null;
-                       if (columnIndex < ColumnErrors.Count)
-                               retVal = (String) ColumnErrors [columnIndex];
-                       return (retVal != null) ? retVal : String.Empty;
-               }
-
-               /// <summary>
-               /// Gets the error description for the column, specified by name.
-               /// </summary>
-               public string GetColumnError (string columnName)
-               {
-                       return GetColumnError (_table.Columns.IndexOf (columnName));
-               }
-
-               /// <summary>
-               /// Gets an array of columns that have errors.
-               /// </summary>
-               public DataColumn [] GetColumnsInError ()
-               {
-                       ArrayList dataColumns = new ArrayList ();
-
-                       int columnOrdinal = 0;
-                       foreach (String columnError in ColumnErrors) {
-                               if (columnError != null && columnError != String.Empty)
-                                       dataColumns.Add (_table.Columns [columnOrdinal]);
-                               columnOrdinal++;
-                       }
-
-                       return (DataColumn [])(dataColumns.ToArray (typeof (DataColumn)));
-               }
-
-               /// <summary>
-               /// Gets the parent row of a DataRow using the specified DataRelation.
-               /// </summary>
-               public DataRow GetParentRow (DataRelation relation)
-               {
-                       return GetParentRow (relation, DataRowVersion.Default);
-               }
-
-               /// <summary>
-               /// Gets the parent row of a DataRow using the specified RelationName of a
-               /// DataRelation.
-               /// </summary>
-               public DataRow GetParentRow (string relationName)
-               {
-                       return GetParentRow (relationName, DataRowVersion.Default);
-               }
-
-               /// <summary>
-               /// Gets the parent row of a DataRow using the specified DataRelation, and
-               /// DataRowVersion.
-               /// </summary>
-               public DataRow GetParentRow (DataRelation relation, DataRowVersion version)
-               {
-                       DataRow[] rows = GetParentRows (relation, version);
-                       if (rows.Length == 0)
-                               return null;
-                       return rows [0];
-               }
-
-               /// <summary>
-               /// Gets the parent row of a DataRow using the specified RelationName of a
-               /// DataRelation, and DataRowVersion.
-               /// </summary>
-               public DataRow GetParentRow (string relationName, DataRowVersion version)
-               {
-                       return GetParentRow (Table.DataSet.Relations [relationName], version);
-               }
-
-               /// <summary>
-               /// Gets the parent rows of a DataRow using the specified DataRelation.
-               /// </summary>
-               public DataRow [] GetParentRows (DataRelation relation)
-               {
-                       return GetParentRows (relation, DataRowVersion.Default);
-               }
-
-               /// <summary>
-               /// Gets the parent rows of a DataRow using the specified RelationName of a
-               /// DataRelation.
-               /// </summary>
-               public DataRow [] GetParentRows (string relationName)
-               {
-                       return GetParentRows (relationName, DataRowVersion.Default);
-               }
-
-               /// <summary>
-               /// Gets the parent rows of a DataRow using the specified DataRelation, and
-               /// DataRowVersion.
-               /// </summary>
-               public DataRow [] GetParentRows (DataRelation relation, DataRowVersion version)
-               {
-                       // TODO: Caching for better preformance
-                       if (relation == null)
-                               return Table.NewRowArray (0);
-
-                       if (this.Table == null)
-                               throw new RowNotInTableException ("This row has been removed from a table and does not have any data.  BeginEdit() will allow creation of new data in this row.");
-
-                       if (relation.DataSet != this.Table.DataSet)
-                               throw new ArgumentException ();
-
-                       if (_table != relation.ChildTable)
-                               throw new InvalidConstraintException ("GetParentRows requires a row whose Table is " + relation.ChildTable + ", but the specified row's table is " + _table);
-
-                       ArrayList rows = new ArrayList ();
-                       DataColumn[] parentColumns = relation.ParentColumns;
-                       DataColumn[] childColumns = relation.ChildColumns;
-                       int numColumn = parentColumns.Length;
-
-                       int curIndex = IndexFromVersion (version);
-                       int tmpRecord = relation.ParentTable.RecordCache.NewRecord ();
-                       for (int i = 0; i < numColumn; i++)
-                               // according to MSDN: the DataType value for both columns must be identical.
-                               parentColumns [i].DataContainer.CopyValue(childColumns [i].DataContainer, curIndex, tmpRecord);
-
-                       try {
-                               Index index = relation.ParentTable.FindIndex(parentColumns);
-                               if (index != null) { // get the parent rows from the index
-                                       int [] parentRecords = index.FindAll (tmpRecord);
-                                       for (int i = 0; i < parentRecords.Length; i++)
-                                               rows.Add (parentColumns [i].Table.RecordCache [parentRecords [i]]);
-                               } else { // no index so we have to search manualy.
-                                       foreach (DataRow row in relation.ParentTable.Rows) {
-                                               bool allColumnsMatch = false;
-                                               if (row.HasVersion (DataRowVersion.Default)) {
-                                                       allColumnsMatch = true;
-                                                       int parentIndex = row.IndexFromVersion (DataRowVersion.Default);
-                                                       for (int columnCnt = 0; columnCnt < numColumn; columnCnt++) {
-                                                               if (parentColumns [columnCnt].DataContainer.CompareValues (parentIndex, tmpRecord) != 0) {
-                                                                       allColumnsMatch = false;
-                                                                       break;
-                                                               }
-                                                       }
-                                               }
-                                               if (allColumnsMatch)
-                                                       rows.Add(row);
-                                       }
-                               }
-                       } finally {
-                               relation.ParentTable.RecordCache.DisposeRecord (tmpRecord);
-                       }
-
-                       DataRow [] result = relation.ParentTable.NewRowArray (rows.Count);
-                       rows.CopyTo (result, 0);
-                       return result;
-               }
-
-               /// <summary>
-               /// Gets the parent rows of a DataRow using the specified RelationName of a
-               /// DataRelation, and DataRowVersion.
-               /// </summary>
-               public DataRow [] GetParentRows (string relationName, DataRowVersion version)
-               {
-                       return GetParentRows (Table.DataSet.Relations [relationName], version);
-               }
-
-               /// <summary>
-               /// Gets a value indicating whether a specified version exists.
-               /// </summary>
-               public bool HasVersion (DataRowVersion version)
-               {
-                       switch (version) {
-                       case DataRowVersion.Default:
-                               return (Proposed >= 0 || Current >= 0);
-                       case DataRowVersion.Proposed:
-                               return Proposed >= 0;
-                       case DataRowVersion.Current:
-                               return Current >= 0;
-                       case DataRowVersion.Original:
-                               return Original >= 0;
-                       default:
-                               return IndexFromVersion (version) >= 0;
-                       }
-               }
-
-               /// <summary>
-               /// Gets a value indicating whether the specified DataColumn contains a null value.
-               /// </summary>
-               public bool IsNull (DataColumn column)
-               {
-                       return IsNull (column, DataRowVersion.Default);
-               }
-
-               /// <summary>
-               /// Gets a value indicating whether the column at the specified index contains a null
-               /// value.
-               /// </summary>
-               public bool IsNull (int columnIndex)
-               {
-                       return IsNull (Table.Columns [columnIndex]);
-               }
-
-               /// <summary>
-               /// Gets a value indicating whether the named column contains a null value.
-               /// </summary>
-               public bool IsNull (string columnName)
-               {
-                       return IsNull (GetColumn (columnName));
-               }
-
-               /// <summary>
-               /// Gets a value indicating whether the specified DataColumn and DataRowVersion
-               /// contains a null value.
-               /// </summary>
-               public bool IsNull (DataColumn column, DataRowVersion version)
-               {
-                       if (column == null)
-                               throw new ArgumentNullException ("column");
-
-                       // use the expresion if there is one
-                       if (column.Expression != String.Empty) {
-                               // FIXME: how does this handle 'version'?
-                               // TODO: Can we avoid the Eval each time by using the cached value?
-                               object o = column.CompiledExpression.Eval (this);
-                               return o == null && o == DBNull.Value;
-                       }
-
-                       return column.DataContainer.IsNull (IndexFromVersion (version));
-               }
-
-               /// <summary>
-               /// Returns a value indicating whether all of the row columns specified contain a null value.
-               /// </summary>
-               internal bool IsNullColumns (DataColumn [] columns)
-               {
-                       int i;
-                       for (i = 0; i < columns.Length; i++) {
-                               if (!IsNull (columns [i]))
-                                       break;
-                       }
-                       return i == columns.Length;
-               }
-
-               /// <summary>
-               /// Rejects all changes made to the row since AcceptChanges was last called.
-               /// </summary>
-               public void RejectChanges ()
-               {
-                       if (RowState == DataRowState.Detached)
-                               throw new RowNotInTableException ("This row has been removed from a table and does not have any data.  BeginEdit() will allow creation of new data in this row.");
-                       // If original is null, then nothing has happened since AcceptChanges
-                       // was last called.  We have no "original" to go back to.
-
-                       // Varadhan: Following if may be un-necessary
-                       /*if (_inChangingEvent) {
-                               _table.ChangedDataRow (this, DataRowAction.Rollback);
-                               CancelEdit ();
-                       }*/
-
-                       Table.ChangingDataRow (this, DataRowAction.Rollback);
-                       //TODO : Need to Verify the constraints..
-                       switch (RowState) {
-                       case DataRowState.Added:
-                               Detach ();
-                               break;
-                       case DataRowState.Modified:
-                               int current = Current;
-                               Table.RecordCache.DisposeRecord (Current);
-                               CheckChildRows (DataRowAction.Rollback);
-                               Current = Original;
-                               foreach (Index index in Table.Indexes)
-                                       index.Update (this, current, DataRowVersion.Current, DataRowState.Modified);
-                               break;
-                       case DataRowState.Deleted:
-                               CheckChildRows (DataRowAction.Rollback);
-                               Current = Original;
-                               // Add row to index and validate if the constraints are satisfied
-                               this.Validate ();
-                               break;
-                       }
-                       Table.ChangedDataRow (this, DataRowAction.Rollback);
-               }
-
-               /// <summary>
-               /// Sets the error description for a column specified as a DataColumn.
-               /// </summary>
-               public void SetColumnError (DataColumn column, string error)
-               {
-                       SetColumnError (_table.Columns.IndexOf (column), error);
-               }
-
-               /// <summary>
-               /// Sets the error description for a column specified by index.
-               /// </summary>
-               public void SetColumnError (int columnIndex, string error)
-               {
-                       if (columnIndex < 0 || columnIndex >= Table.Columns.Count)
-                               throw new IndexOutOfRangeException ();
-
-                       while (columnIndex >= ColumnErrors.Count)
-                               ColumnErrors.Add (null);
-
-                       ColumnErrors [columnIndex] = error;
-               }
-
-               /// <summary>
-               /// Sets the error description for a column specified by name.
-               /// </summary>
-               public void SetColumnError (string columnName, string error)
-               {
-                       SetColumnError (_table.Columns.IndexOf (columnName), error);
-               }
-
-               /// <summary>
-               /// Sets the value of the specified DataColumn to a null value.
-               /// </summary>
-               protected void SetNull (DataColumn column)
-               {
-                       this [column] = DBNull.Value;
-               }
-
-               /// <summary>
-               /// Sets the parent row of a DataRow with specified new parent DataRow.
-               /// </summary>
-               public void SetParentRow (DataRow parentRow)
-               {
-                       SetParentRow (parentRow, null);
-               }
-
-               /// <summary>
-               /// Sets the parent row of a DataRow with specified new parent DataRow and
-               /// DataRelation.
-               /// </summary>
-               public void SetParentRow (DataRow parentRow, DataRelation relation)
-               {
-                       if (_table == null || (parentRow != null && parentRow.Table == null))
-                               throw new RowNotInTableException ("This row has been removed from a table and does not have any data.  BeginEdit() will allow creation of new data in this row.");
-
-                       if (parentRow != null && _table.DataSet != parentRow.Table.DataSet)
-                               throw new ArgumentException ();
-
-                       if (RowState == DataRowState.Detached && !HasVersion (DataRowVersion.Default))
-                               // the row should have default data to access, i.e. we can do this for the newly created row, but not for the row once deleted from the table
-                               throw new RowNotInTableException ("This row has been removed from a table and does not have any data.  BeginEdit() will allow creation of new data in this row.");
-
-                       BeginEdit();
-
-                       IEnumerable relations;
-                       if (relation != null) {
-                               if (parentRow != null && relation.ParentColumns [0].Table != parentRow.Table)
-                                       throw new InvalidConstraintException (string.Format ("Parent belongs to table {0} but relation is for table {1}", parentRow.Table, relation.ParentColumns [0].Table));
-                               relations = new DataRelation [] { relation };
-                       } else {
-                               relations = _table.ParentRelations;
-                       }
-
-                       foreach (DataRelation rel in relations) {
-                               DataColumn [] childCols = rel.ChildColumns;
-                               DataColumn [] parentCols = rel.ParentColumns;
-
-                               for (int i = 0; i < parentCols.Length; i++) {
-                                       if (parentRow == null) {
-                                               childCols [i].DataContainer [Proposed] = DBNull.Value;
-                                       } else if (parentCols [i].Table == parentRow.Table) {
-                                               int defaultIdx = parentRow.IndexFromVersion (DataRowVersion.Default);
-                                               childCols [i].DataContainer.CopyValue(parentCols [i].DataContainer, defaultIdx, Proposed);
-                                       }
-                               }
-                       }
-
-                       EndEdit();
-               }
-
-               //Copy all values of this DataRow to the row parameter.
-               internal void CopyValuesToRow (DataRow row)
-               {
-                       CopyValuesToRow(row, true);
-               }
-               
-               internal void CopyValuesToRow (DataRow row, bool doROCheck)
-               {
-                       if (row == null)
-                               throw new ArgumentNullException("row");
-                       if (row == this)
-                               throw new ArgumentException("'row' is the same as this object");
-
-                       // create target records if missing.
-                       if (HasVersion (DataRowVersion.Original)) {
-                               if (row.Original < 0)
-                                       row.Original = row.Table.RecordCache.NewRecord ();
-                               else if (row.Original == row.Current) {
-                                       row.Original = row.Table.RecordCache.NewRecord ();
-                                       row.Table.RecordCache.CopyRecord (row.Table, row.Current, row.Original);
-                               }
-                       } else {
-                               if (row.Original > 0) {
-                                       if (row.Original != row.Current)
-                                               row.Table.RecordCache.DisposeRecord (row.Original);
-                                       row.Original = -1;
-                               }
-                       }
-
-                       if (HasVersion (DataRowVersion.Current)) {
-                               if (Current == Original) {
-                                       if (row.Current >= 0)
-                                               row.Table.RecordCache.DisposeRecord (row.Current);
-                                       row.Current = row.Original;
-                               } else {
-                                       if (row.Current < 0)
-                                               row.Current = row.Table.RecordCache.NewRecord ();
-                               }
-                       } else {
-                               if (row.Current > 0) {
-                                       row.Table.RecordCache.DisposeRecord (row.Current);
-                                       row.Current = -1;
-                               }
-                       }
-
-                       if (HasVersion (DataRowVersion.Proposed)) {
-                               if (row.Proposed < 0)
-                                       row.Proposed = row.Table.RecordCache.NewRecord ();
-                       } else {
-                               if (row.Proposed > 0) {
-                                       row.Table.RecordCache.DisposeRecord (row.Proposed);
-                                       row.Proposed = -1;
-                               }
-                       }
-
-                       // copy source record values to target records
-                       foreach (DataColumn column in Table.Columns) {
-                               DataColumn targetColumn = row.Table.Columns [column.ColumnName];
-                               //if a column with the same name exists in both rows copy the values
-                               if (targetColumn != null) {
-                                       if (HasVersion (DataRowVersion.Original)) {
-                                               object val = column[Original];
-                                               row.CheckValue (val, targetColumn, doROCheck);
-                                               targetColumn [row.Original] = val;
-                                       }
-
-                                       if (HasVersion (DataRowVersion.Current) && Current != Original) {
-                                               object val = column[Current];
-                                               row.CheckValue (val, targetColumn, doROCheck);
-                                               targetColumn [row.Current] = val;
-                                       }
-
-                                       if (HasVersion (DataRowVersion.Proposed)) {
-                                               object val = column[row.Proposed];
-                                               row.CheckValue (val, targetColumn, doROCheck);
-                                               targetColumn [row.Proposed] = val;
-                                       }
-                               }
-                       }
-                       if (HasErrors)
-                               CopyErrors (row);
-               }
-
-               //Merge all values of this DataRow to the row parameter according to merge rules.
-               internal void MergeValuesToRow (DataRow row, bool preserveChanges)
-               {
-                       if (row == null)
-                               throw new ArgumentNullException ("row");
-                       if (row == this)
-                               throw new ArgumentException ("'row' is the same as this object");
-
-                       // Original values are anyway copied
-                       if (HasVersion (DataRowVersion.Original)) {
-                               if (row.Original < 0)
-                                       row.Original = row.Table.RecordCache.NewRecord ();
-                               else if (row.Original == row.Current && !(Original == Current && !preserveChanges)) {
-                                       row.Original = row.Table.RecordCache.NewRecord ();
-                                       row.Table.RecordCache.CopyRecord (row.Table, row.Current, row.Original);
-                               }
-                       } else {
-                               if (row.Original == row.Current) { // if target has same current, better create new original
-                                       row.Original = row.Table.RecordCache.NewRecord ();
-                                       row.Table.RecordCache.CopyRecord (row.Table, row.Current, row.Original);
-                               }
-                       }
-
-                       // if i have current, push all
-                       if (HasVersion (DataRowVersion.Current)) {
-                               if (! preserveChanges && row.Current < 0)
-                                       row.Current = row.Table.RecordCache.NewRecord ();
-                       } else {
-                               if (row.Current > 0 && ! preserveChanges) {
-                                       row.Table.RecordCache.DisposeRecord (row.Current);
-                                       row.Current = -1;
-                               }
-                       }
-
-                       // copy source record values to target records
-                       foreach (DataColumn column in Table.Columns) {
-                               DataColumn targetColumn = row.Table.Columns[column.ColumnName];
-                               //if a column with the same name exists in both rows copy the values
-                               if (targetColumn != null) {
-                                       if (HasVersion (DataRowVersion.Original)) {
-                                               object val = column [Original];
-                                               row.CheckValue (val, targetColumn);
-                                               targetColumn [row.Original] = val;
-                                       }
-
-                                       if (HasVersion (DataRowVersion.Current) && !preserveChanges) {
-                                               object val = column [Current];
-                                               row.CheckValue (val, targetColumn);
-                                               targetColumn [row.Current] = val;
-                                       }
-                               }
-                       }
-
-                       if (HasErrors)
-                               CopyErrors(row);
-               }
-
-               internal void CopyErrors (DataRow row)
-               {
-                       row.RowError = RowError;
-                       DataColumn[] errorColumns = GetColumnsInError();
-                       foreach (DataColumn col in errorColumns) {
-                               DataColumn targetColumn = row.Table.Columns [col.ColumnName];
-                               row.SetColumnError (targetColumn, GetColumnError (col));
-                       }
-               }
-
-               internal bool IsRowChanged (DataRowState rowState)
-               {
-                       if((RowState & rowState) != 0)
-                               return true;
-
-                       //we need to find if child rows of this row changed.
-                       //if yes - we should return true
-
-                       // if the rowState is deleted we should get the original version of the row
-                       // else - we should get the current version of the row.
-                       DataRowVersion version = (rowState == DataRowState.Deleted) ? DataRowVersion.Original : DataRowVersion.Current;
-                       int count = Table.ChildRelations.Count;
-                       for (int i = 0; i < count; i++){
-                               DataRelation rel = Table.ChildRelations [i];
-                               DataRow [] childRows = GetChildRows (rel, version);
-                               for (int j = 0; j < childRows.Length; j++){
-                                       if (childRows [j].IsRowChanged (rowState))
-                                               return true;
-                               }
-                       }
-
-                       return false;
-               }
-
-               internal void Validate ()
-               {
-                       Table.AddRowToIndexes (this);
-                       AssertConstraints ();
-               }
-
-               void AssertConstraints ()
-               {
-                       if (Table == null || Table._duringDataLoad)
-                               return;
-
-                       if (Table.DataSet != null && !Table.DataSet.EnforceConstraints)
-                               return;
-                       for (int i = 0; i < Table.Columns.Count; ++i) {
-                               DataColumn column = Table.Columns [i];
-                               if (!column.AllowDBNull && IsNull (column))
-                                       throw new NoNullAllowedException (_nullConstraintMessage);
-                       }
-
-                       foreach (Constraint constraint in Table.Constraints) {
-                               try {
-                                       constraint.AssertConstraint (this);
-                               } catch (Exception e) {
-                                       Table.DeleteRowFromIndexes (this);
-                                       throw e;
-                               }
-                       }
-               }
-
-               internal void CheckNullConstraints ()
-               {
-                       if (_nullConstraintViolation) {
-                               if (HasVersion (DataRowVersion.Proposed)) {
-                                       foreach (DataColumn column in Table.Columns) {
-                                               if (IsNull (column) && !column.AllowDBNull)
-                                                       throw new NoNullAllowedException (_nullConstraintMessage);
-                                       }
-                               }
-                               _nullConstraintViolation = false;
-                       }
-               }
-
-               internal void CheckReadOnlyStatus()
-               {
-                       int defaultIdx = IndexFromVersion (DataRowVersion.Default);
-                       foreach(DataColumn column in Table.Columns) {
-                               if ((column.DataContainer.CompareValues (defaultIdx,Proposed) != 0) && column.ReadOnly)
-                                       throw new ReadOnlyException ();
-                       }
-               }
-
-               #endregion // Methods
-
-               /// <summary>
-               ///    This method loads a given value into the existing row affecting versions,
-               ///    state based on the LoadOption.  The matrix of changes for this method are as
-               ///    mentioned in the DataTable.Load (IDataReader, LoadOption) method.
-               /// </summary>
-               internal void Load (object [] values, LoadOption loadOption)
-               {
-                       int temp = -1;
-
-                       if (loadOption == LoadOption.OverwriteChanges ||
-                           (loadOption == LoadOption.PreserveChanges && RowState == DataRowState.Unchanged)) {
-                               Table.ChangingDataRow (this, DataRowAction.ChangeCurrentAndOriginal);
-                               temp = Table.CreateRecord (values);
-                               Table.DeleteRowFromIndexes(this);
-                               if (HasVersion (DataRowVersion.Original) && Current != Original)
-                                       Table.RecordCache.DisposeRecord (Original);
-                               Original = temp;
-
-                               if (HasVersion (DataRowVersion.Current))
-                                       Table.RecordCache.DisposeRecord (Current);
-                               Current = temp;
-                               Table.AddRowToIndexes(this);
-                               Table.ChangedDataRow (this, DataRowAction.ChangeCurrentAndOriginal);
-                               return;
-                       }
-
-                       if (loadOption == LoadOption.PreserveChanges) {
-                               Table.ChangingDataRow (this, DataRowAction.ChangeOriginal);
-                               temp = Table.CreateRecord (values);
-                               if (HasVersion (DataRowVersion.Original) && Current != Original)
-                                       Table.RecordCache.DisposeRecord (Original);
-                               Original = temp;
-                               Table.ChangedDataRow (this, DataRowAction.ChangeOriginal);
-                               return;
-                       }
-
-                       // Upsert
-                       if (RowState != DataRowState.Deleted) {
-                               int rindex = HasVersion (DataRowVersion.Proposed) ? Proposed : Current;
-                               temp = Table.CreateRecord (values);
-                               if (RowState == DataRowState.Added || Table.CompareRecords (rindex, temp) != 0) {
-                                       Table.ChangingDataRow (this, DataRowAction.Change);
-                                       Table.DeleteRowFromIndexes(this);
-                                       if (HasVersion (DataRowVersion.Proposed)) {
-                                               Table.RecordCache.DisposeRecord (Proposed);
-                                               Proposed = -1;
-                                       }
-
-                                       if (Original != Current)
-                                               Table.RecordCache.DisposeRecord (Current);
-                                       Current = temp;
-                                       Table.AddRowToIndexes(this);
-                                       Table.ChangedDataRow (this, DataRowAction.Change);
-                               } else {
-                                       Table.ChangingDataRow (this, DataRowAction.Nothing);
-                                       Table.RecordCache.DisposeRecord (temp);
-                                       Table.ChangedDataRow (this, DataRowAction.Nothing);
-                               }
-                       }
-               }
-
-               DataColumn GetColumn (string columnName)
-               {
-                       DataColumn column = _table.Columns [columnName];
-
-                       if (column == null)
-                               throw new ArgumentException ("The column '" + columnName + "' does not belong to the table " + _table.TableName);
-
-                       return column;
-               }
-       }
-}
diff --git a/mcs/class/System.Data/System.Data/DataRowAction.cs b/mcs/class/System.Data/System.Data/DataRowAction.cs
deleted file mode 100644 (file)
index 76c06cf..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-//
-// System.Data.DataRowAction.cs
-//
-// Author:
-//   Christopher Podurgiel (cpodurgiel@msn.com)
-//   Sureshkumar T <tsureshkumar@novell.com>
-//
-// (C) Chris Podurgiel
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System.Data
-{
-       /// <summary>
-       /// Describes the action taken on a DataRow.
-       /// This enumeration has a FlagsAttribute that allows a bitwise combination of its member values.
-       /// </summary>
-       [Flags]
-       public enum DataRowAction
-       {
-                Add                             = 16,
-                Change                          = 2,
-                ChangeCurrentAndOriginal        = 64,
-                ChangeOriginal                  = 32,
-                Commit                          = 8,
-                Delete                          = 1,
-                Nothing                         = 0,
-                Rollback                        = 4
-       }
-}
diff --git a/mcs/class/System.Data/System.Data/DataRowBuilder.cs b/mcs/class/System.Data/System.Data/DataRowBuilder.cs
deleted file mode 100644 (file)
index 30bd047..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-//
-// System.Data.DataRowBuilder
-//
-// Author:
-//   Tim Coleman <tim@timcoleman.com>
-//
-// Copyright (C) 2002 Tim Coleman
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace System.Data
-{
-       /// <summary>
-       /// A supporting class that exists solely to support
-       /// DataRow and DataTable
-       /// Implementation of something meaningful will follow.
-       /// Presumably, what that is will become apparent when
-       /// constructing DataTable and DataRow.
-       /// </summary>
-
-       public
-       sealed
-       class DataRowBuilder 
-       {
-               #region Fields
-               
-               private DataTable table;
-               internal int _rowId;
-
-               #endregion
-
-               #region Constructors
-
-               // DataRowBuilder on .NET takes 3 arguments, a
-               // DataTable and two Int32.  For consistency, this
-               // class will also take those arguments.
-
-               internal DataRowBuilder (DataTable table, Int32 rowID, Int32 y)
-               {
-                       this.table = table;
-                       this._rowId = rowID;
-               }
-
-               #endregion
-
-               #region Properties
-
-               internal DataTable Table {
-                       get { return table; }
-               }
-
-               #endregion
-
-       }
-}
diff --git a/mcs/class/System.Data/System.Data/DataRowChangeEventArgs.cs b/mcs/class/System.Data/System.Data/DataRowChangeEventArgs.cs
deleted file mode 100644 (file)
index a1e4345..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-//
-// System.Data.DataRowChangeEventArgs.cs
-//
-// Author:
-//   Daniel Morgan <danmorg@sc.rr.com>
-//   Ville Palo <vi64pa@koti.soon.fi>
-//
-// (C) Ximian, Inc 2002
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System.Data
-{
-       /// <summary>
-       /// argument data for events RowChanged, RowChanging, 
-       /// OnRowDeleting, and OnRowDeleted
-       /// </summary>
-       public class DataRowChangeEventArgs : EventArgs {
-
-               private DataRow row;
-               private DataRowAction action; 
-       
-               public DataRowChangeEventArgs(DataRow row,
-                       DataRowAction action) {
-                       
-                       this.row = row;
-                       this.action = action;
-               }
-
-               public DataRowAction Action {
-                       get {
-                               return action;
-                       }
-               }
-
-               public DataRow Row {
-                       get {
-                               return row;
-                       }
-               }
-       }
-}
diff --git a/mcs/class/System.Data/System.Data/DataRowChangeEventHandler.cs b/mcs/class/System.Data/System.Data/DataRowChangeEventHandler.cs
deleted file mode 100644 (file)
index 0ae010c..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-//
-// System.Data.DataRowChangeEventHandler.cs
-//
-// Author:
-//   Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System.Data
-{
-       /// <summary>
-       /// Represents the method that will handle the RowChanging, RowChanged, RowDeleting, and RowDeleted events of a DataTable.
-       /// </summary>
-       public delegate void DataRowChangeEventHandler(object sender, DataRowChangeEventArgs e);
-
-}
\ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/DataRowCollection.cs b/mcs/class/System.Data/System.Data/DataRowCollection.cs
deleted file mode 100644 (file)
index 2d80ce5..0000000
+++ /dev/null
@@ -1,347 +0,0 @@
-//
-// System.Data.DataRowCollection.cs
-//
-// Author:
-//   Daniel Morgan <danmorg@sc.rr.com>
-//   Tim Coleman <tim@timcoleman.com>
-//
-// (C) Ximian, Inc 2002
-// (C) Copyright 2002 Tim Coleman
-// (C) Copyright 2002 Daniel Morgan
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections;
-using System.ComponentModel;
-using System.Data.Common;
-
-namespace System.Data
-{
-       /// <summary>
-       /// Collection of DataRows in a DataTable
-       /// </summary>
-       public partial class DataRowCollection : InternalDataCollectionBase {
-               private DataTable table;
-
-               internal event ListChangedEventHandler ListChanged;
-
-               /// <summary>
-               /// Internal constructor used to build a DataRowCollection.
-               /// </summary>
-               internal DataRowCollection (DataTable table)
-               {
-                       this.table = table;
-               }
-
-               /// <summary>
-               /// Gets the row at the specified index.
-               /// </summary>
-               public DataRow this [int index] {
-                       get {
-                               if (index < 0 || index >= Count)
-                                       throw new IndexOutOfRangeException ("There is no row at position " + index + ".");
-
-                               return (DataRow) List [index];
-                       }
-               }
-
-               /// <summary>
-               /// Adds the specified DataRow to the DataRowCollection object.
-               /// </summary>
-               public void Add (DataRow row)
-               {
-                       //TODO: validation
-                       if (row == null)
-                               throw new ArgumentNullException ("row", "'row' argument cannot be null.");
-
-                       if (row.Table != this.table)
-                               throw new ArgumentException ("This row already belongs to another table.");
-
-                       // If row id is not -1, we know that it is in the collection.
-                       if (row.RowID != -1)
-                               throw new ArgumentException ("This row already belongs to this table.");
-
-                       row.BeginEdit ();
-
-                       row.Validate ();
-
-                       AddInternal (row);
-               }
-
-               public
-               int IndexOf (DataRow row)
-               {
-                       if (row == null || row.Table != table)
-                               return -1;
-
-                       int id = row.RowID;
-                       return (id >= 0 && id < List.Count && row == List [id]) ? id : -1;
-               }
-
-               internal void AddInternal (DataRow row)
-               {
-                       AddInternal (row, DataRowAction.Add);
-               }
-
-               internal void AddInternal (DataRow row, DataRowAction action)
-               {
-                       row.Table.ChangingDataRow (row, action);
-                       List.Add (row);
-                       row.AttachAt (List.Count - 1, action);
-                       row.Table.ChangedDataRow (row, action);
-                       if (row._rowChanged)
-                               row._rowChanged = false;
-               }
-
-               /// <summary>
-               /// Creates a row using specified values and adds it to the DataRowCollection.
-               /// </summary>
-               public DataRow Add (params object[] values)
-               {
-                       if (values == null)
-                               throw new NullReferenceException ();
-                       DataRow row = table.NewNotInitializedRow ();
-                       int newRecord = table.CreateRecord (values);
-                       row.ImportRecord (newRecord);
-
-                       row.Validate ();
-                       AddInternal (row);
-                       return row;
-               }
-
-               /// <summary>
-               /// Clears the collection of all rows.
-               /// </summary>
-               public void Clear ()
-               {
-                       if (this.table.DataSet != null && this.table.DataSet.EnforceConstraints) {
-                               foreach (Constraint c in table.Constraints) {
-                                       UniqueConstraint uc = c as UniqueConstraint;
-                                       if (uc == null)
-                                               continue;
-                                       if (uc.ChildConstraint == null || uc.ChildConstraint.Table.Rows.Count == 0)
-                                               continue;
-
-                                       string err = String.Format ("Cannot clear table Parent because " +
-                                                               "ForeignKeyConstraint {0} enforces Child.", uc.ConstraintName);
-                                       throw new InvalidConstraintException (err);
-                               }
-                       }
-
-                       table.DataTableClearing ();
-                       List.Clear ();
-
-                       // Remove from indexes
-                       table.ResetIndexes ();
-                       table.DataTableCleared ();
-                       OnListChanged (this, new ListChangedEventArgs (ListChangedType.Reset, -1, -1));
-               }
-
-               /// <summary>
-               /// Gets a value indicating whether the primary key of any row in the collection contains
-               /// the specified value.
-               /// </summary>
-               public bool Contains (object key)
-               {
-                       return Find (key) != null;
-               }
-
-               /// <summary>
-               /// Gets a value indicating whether the primary key column(s) of any row in the
-               /// collection contains the values specified in the object array.
-               /// </summary>
-               public bool Contains (object [] keys)
-               {
-                       return Find (keys) != null;
-               }
-
-               /// <summary>
-               /// Gets the row specified by the primary key value.
-               /// </summary>
-               public DataRow Find (object key)
-               {
-                       return Find (new object []{key}, DataViewRowState.CurrentRows);
-               }
-
-               /// <summary>
-               /// Gets the row containing the specified primary key values.
-               /// </summary>
-               public DataRow Find (object[] keys)
-               {
-                       return Find (keys, DataViewRowState.CurrentRows);
-               }
-
-               /// <summary>
-               /// Gets the row containing the specified primary key values by searching the rows
-               /// filtered by the state.
-               /// </summary>
-               internal DataRow Find (object [] keys, DataViewRowState rowStateFilter)
-               {
-                       if (table.PrimaryKey.Length == 0)
-                               throw new MissingPrimaryKeyException ("Table doesn't have a primary key.");
-
-                       if (keys == null)
-                               throw new ArgumentException ("Expecting " + table.PrimaryKey.Length +" value(s) for the key being indexed, but received 0 value(s).");
-
-                       Index index = table.GetIndex (table.PrimaryKey, null, rowStateFilter, null, false);
-                       int record = index.Find (keys);
-
-                       if (record != -1 || !table._duringDataLoad)
-                               return (record != -1 ? table.RecordCache [record] : null);
-
-                       // If the key is not found using Index *and* if DataTable is under BeginLoadData
-                       // then, check all the DataRows for the key
-                       record = table.RecordCache.NewRecord ();
-                       try {
-                               for (int i=0; i < table.PrimaryKey.Length; ++i)
-                                       table.PrimaryKey [i].DataContainer [record] = keys [i];
-
-                               bool found;
-                               foreach (DataRow row in this) {
-                                       int rowIndex = Key.GetRecord (row, rowStateFilter);
-                                       if (rowIndex == -1)
-                                               continue;
-
-                                       found = true;
-                                       for (int columnCnt = 0; columnCnt < table.PrimaryKey.Length; ++columnCnt) {
-                                               if (table.PrimaryKey [columnCnt].CompareValues (rowIndex, record) == 0)
-                                                       continue;
-                                               found = false;
-                                               break;
-                                       }
-                                       if (found)
-                                               return row;
-                               }
-                               return null;
-                       } finally {
-                               table.RecordCache.DisposeRecord (record);
-                       }
-               }
-
-               /// <summary>
-               /// Inserts a new row into the collection at the specified location.
-               /// </summary>
-               public void InsertAt (DataRow row, int pos)
-               {
-                       if (pos < 0)
-                               throw new IndexOutOfRangeException ("The row insert position " + pos + " is invalid.");
-
-                       if (row == null)
-                               throw new ArgumentNullException ("row", "'row' argument cannot be null.");
-
-                       if (row.Table != this.table)
-                               throw new ArgumentException ("This row already belongs to another table.");
-
-                       // If row id is not -1, we know that it is in the collection.
-                       if (row.RowID != -1)
-                               throw new ArgumentException ("This row already belongs to this table.");
-
-                       row.Validate ();
-
-                       row.Table.ChangingDataRow (row, DataRowAction.Add);
-
-                       if (pos >= List.Count) {
-                               pos = List.Count;
-                               List.Add (row);
-                       } else {
-                               List.Insert (pos, row);
-                               for (int i = pos+1; i < List.Count; i++)
-                                       ((DataRow) List [i]).RowID = i;
-                       }
-
-                       row.AttachAt (pos, DataRowAction.Add);
-                       row.Table.ChangedDataRow (row, DataRowAction.Add);
-               }
-
-               /// <summary>
-               /// Removes the specified DataRow from the internal list. Used by DataRow to commit the removing.
-               /// </summary>
-               internal void RemoveInternal (DataRow row)
-               {
-                       if (row == null)
-                               throw new IndexOutOfRangeException ("The given datarow is not in the current DataRowCollection.");
-                       int index = this.IndexOf (row);
-                       if (index < 0)
-                               throw new IndexOutOfRangeException ("The given datarow is not in the current DataRowCollection.");
-                       List.RemoveAt (index);
-                       for (; index < List.Count; ++index)
-                               ((DataRow) List [index]).RowID = index;
-               }
-
-               /// <summary>
-               /// Removes the specified DataRow from the collection.
-               /// </summary>
-               public void Remove (DataRow row)
-               {
-                       if (IndexOf (row) < 0)
-                               throw new IndexOutOfRangeException ("The given datarow is not in the current DataRowCollection.");
-
-                       DataRowState state = row.RowState;
-                       if (state != DataRowState.Deleted && state != DataRowState.Detached) {
-                               row.Delete ();
-                               // if the row was in added state it will be in Detached state after the
-                               // delete operation, so we have to check it.
-                               if (row.RowState != DataRowState.Detached)
-                                       row.AcceptChanges ();
-                       }
-               }
-
-               /// <summary>
-               /// Removes the row at the specified index from the collection.
-               /// </summary>
-               public void RemoveAt (int index)
-               {
-                       Remove (this [index]);
-               }
-
-               internal void OnListChanged (object sender, ListChangedEventArgs args)
-               {
-                       if (ListChanged != null)
-                               ListChanged (sender, args);
-               }
-       }
-
-       sealed partial class DataRowCollection {
-               public override int Count {
-                       get { return List.Count; }
-               }
-
-               public void CopyTo (DataRow [] array, int index)
-               {
-                       CopyTo ((Array) array, index);
-               }
-
-               public override void CopyTo (Array ar, int index)
-               {
-                       base.CopyTo (ar, index);
-               }
-
-               public override IEnumerator GetEnumerator ()
-               {
-                       return base.GetEnumerator ();
-               }
-       }
-}
diff --git a/mcs/class/System.Data/System.Data/DataRowState.cs b/mcs/class/System.Data/System.Data/DataRowState.cs
deleted file mode 100644 (file)
index 5990783..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-//
-// System.Data.DataRowState.cs
-//
-// Author:
-//   Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System.Data
-{
-       /// <summary>
-       /// Gets the state of a DataRow object.
-       /// </summary>
-       [Flags]
-       public enum DataRowState
-       {
-               Detached = 1,
-               Unchanged = 2,
-               Added = 4,
-               Deleted = 8,
-               Modified = 16
-       }
-
-}
diff --git a/mcs/class/System.Data/System.Data/DataRowVersion.cs b/mcs/class/System.Data/System.Data/DataRowVersion.cs
deleted file mode 100644 (file)
index a34d82a..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-//
-// System.Data.DataRowVersion.cs
-//
-// Author:
-//   Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System.Data
-{
-       /// <summary>
-       /// Describes the version of a DataRow.
-       /// </summary>
-       public enum DataRowVersion
-       {
-               Original = 256,
-               Current = 512,
-               Proposed = 1024,
-               Default = 1536
-       }
-}
\ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/DataRowView.cs b/mcs/class/System.Data/System.Data/DataRowView.cs
deleted file mode 100644 (file)
index bb865b9..0000000
+++ /dev/null
@@ -1,314 +0,0 @@
-//\r
-// System.Data.DataRowView.cs\r
-//\r
-// Author:\r
-//    Rodrigo Moya <rodrigo@ximian.com>\r
-//    Miguel de Icaza <miguel@ximian.com>\r
-//    Daniel Morgan <danmorg@sc.rr.com>\r
-//\r
-// (C) Ximian, Inc 2002\r
-// (C) Daniel Morgan 2002\r
-//\r
-\r
-//\r
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)\r
-//\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-//\r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-//\r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
-//\r
-\r
-using System;\r
-using System.Collections;\r
-using System.ComponentModel;\r
-using System.Reflection;\r
-\r
-namespace System.Data\r
-{\r
-       /// <summary>\r
-       /// Represents a customized view of a DataRow exposed as a fully featured Windows Forms control.\r
-       /// </summary>\r
-       // FIXME: correct exceptions in this[] methods\r
-       public partial class DataRowView : IEditableObject {\r
-               DataView _dataView;\r
-               DataRow _dataRow;\r
-               int _index = -1;\r
-\r
-               internal DataRowView (DataView dataView, DataRow row, int index)\r
-               {\r
-                       _dataView = dataView;\r
-                       _dataRow = row;\r
-                       _index = index;\r
-               }\r
-\r
-               public override bool Equals (object other)\r
-               {\r
-                       return other != null &&\r
-                               other is DataRowView &&\r
-                               ((DataRowView) other)._dataRow != null &&\r
-                               ((DataRowView) other)._dataRow.Equals (_dataRow);\r
-               }\r
-\r
-               public void BeginEdit ()\r
-               {\r
-                       _dataRow.BeginEdit ();\r
-               }\r
-\r
-               public void CancelEdit ()\r
-               {\r
-                       // FIXME:\r
-                       if (this.Row == DataView._lastAdded)\r
-                               DataView.CompleteLastAdded (false);\r
-                       else\r
-                               _dataRow.CancelEdit();\r
-               }\r
-\r
-               public DataView CreateChildView (DataRelation relation)\r
-               {\r
-                       return DataView.CreateChildView (relation, _index);\r
-               }\r
-\r
-               public DataView CreateChildView (string relationName)\r
-               {\r
-                       return CreateChildView (Row.Table.ChildRelations [relationName]);\r
-               }\r
-\r
-               public void Delete ()\r
-               {\r
-                       DataView.Delete (_index);\r
-               }\r
-\r
-               public void EndEdit ()\r
-               {\r
-                       // FIXME:\r
-                       if (this.Row == DataView._lastAdded)\r
-                               DataView.CompleteLastAdded(true);\r
-                       else\r
-                               _dataRow.EndEdit();\r
-               }\r
-\r
-               private void CheckAllowEdit ()\r
-               {\r
-                       if (!DataView.AllowEdit && (Row != DataView._lastAdded))\r
-                               throw new DataException ("Cannot edit on a DataSource where AllowEdit is false.");\r
-               }\r
-\r
-               public DataView DataView {\r
-                       get { return _dataView; }\r
-               }\r
-\r
-               public bool IsEdit {\r
-                       get { return _dataRow.HasVersion (DataRowVersion.Proposed); }\r
-               }\r
-\r
-               // It becomes true when this instance is created by\r
-               // DataView.AddNew(). If it is true, then the DataRow is\r
-               // "Detached", and when this.EndEdit() is invoked, the row\r
-               // will be added to the table.\r
-               public bool IsNew {\r
-                       get { return Row == DataView._lastAdded; }\r
-               }\r
-\r
-               public object this [string property] {\r
-                       get {\r
-                               DataColumn dc = _dataView.Table.Columns [property];\r
-                               if (dc == null)\r
-                                       throw new ArgumentException (\r
-                                               property + " is neither a DataColumn nor a DataRelation for table " + _dataView.Table.TableName);\r
-                               return _dataRow [dc, GetActualRowVersion ()];\r
-                       }\r
-                       set {\r
-                               CheckAllowEdit ();\r
-                               DataColumn dc = _dataView.Table.Columns [property];\r
-                               if (dc == null)\r
-                                       throw new ArgumentException (\r
-                                               property + " is neither a DataColumn nor a DataRelation for table " + _dataView.Table.TableName);\r
-                               _dataRow [dc] = value;\r
-                       }\r
-               }\r
-\r
-               public object this [int ndx] {\r
-                       get {\r
-                               DataColumn dc = _dataView.Table.Columns [ndx];\r
-                               if (dc == null)\r
-                                       throw new ArgumentException (\r
-                                               ndx + " is neither a DataColumn nor a DataRelation for table " + _dataView.Table.TableName);\r
-                               return _dataRow [dc, GetActualRowVersion ()];\r
-                       }\r
-                       set {\r
-                               CheckAllowEdit ();\r
-                               DataColumn dc = _dataView.Table.Columns [ndx];\r
-                               if (dc == null)\r
-                                       throw new ArgumentException (\r
-                                               ndx + " is neither a DataColumn nor a DataRelation for table " + _dataView.Table.TableName);\r
-                               _dataRow [dc] = value;\r
-                       }\r
-               }\r
-\r
-               private DataRowVersion GetActualRowVersion ()\r
-               {\r
-                       switch (_dataView.RowStateFilter) {\r
-                       case DataViewRowState.Added:\r
-                               if (IsNew) //"last added" was not completed on this row\r
-                                       return DataRowVersion.Proposed;\r
-                               else\r
-                                       return DataRowVersion.Current;\r
-                               \r
-                       case DataViewRowState.ModifiedOriginal:\r
-                       case DataViewRowState.Deleted:\r
-                       case DataViewRowState.Unchanged:\r
-                       case DataViewRowState.OriginalRows:\r
-                               return DataRowVersion.Original;\r
-                       case DataViewRowState.ModifiedCurrent:\r
-                               return DataRowVersion.Current;\r
-                       }\r
-                       return DataRowVersion.Default;\r
-               }\r
-\r
-               public DataRow Row {\r
-                       get { return _dataRow; }\r
-               }\r
-\r
-               public DataRowVersion RowVersion {\r
-                       get {\r
-                               DataRowVersion version = DataView.GetRowVersion(_index);\r
-                               if (version != DataRowVersion.Original)\r
-                                       version = DataRowVersion.Current;\r
-\r
-                               return version;\r
-                       }\r
-               }\r
-\r
-               public override int GetHashCode ()\r
-               {\r
-                       return _dataRow.GetHashCode();\r
-               }\r
-\r
-               internal int Index {\r
-                       get { return _index; }\r
-               }\r
-       }\r
-\r
-       partial class DataRowView : ICustomTypeDescriptor {\r
-               AttributeCollection ICustomTypeDescriptor.GetAttributes ()\r
-               {\r
-                       System.ComponentModel.AttributeCollection attributes;\r
-                       attributes = AttributeCollection.Empty;\r
-                       return attributes;\r
-               }\r
-\r
-               [MonoTODO ("Not implemented.   Always returns String.Empty")]\r
-               string ICustomTypeDescriptor.GetClassName ()\r
-               {\r
-                       return string.Empty;\r
-               }\r
-\r
-               [MonoTODO ("Not implemented.   Always returns null")]\r
-               string ICustomTypeDescriptor.GetComponentName ()\r
-               {\r
-                       return null;\r
-               }\r
-\r
-               [MonoTODO ("Not implemented.   Always returns null")]\r
-               TypeConverter ICustomTypeDescriptor.GetConverter ()\r
-               {\r
-                       return null;\r
-               }\r
-\r
-               [MonoTODO ("Not implemented.   Always returns null")]\r
-               EventDescriptor ICustomTypeDescriptor.GetDefaultEvent ()\r
-               {\r
-                       return null;\r
-               }\r
-\r
-               [MonoTODO ("Not implemented.   Always returns null")]\r
-               PropertyDescriptor ICustomTypeDescriptor.GetDefaultProperty ()\r
-               {\r
-                       return null;\r
-               }\r
-\r
-               [MonoTODO ("Not implemented.   Always returns null")]\r
-               object ICustomTypeDescriptor.GetEditor (Type editorBaseType)\r
-               {\r
-                       return null;\r
-               }\r
-\r
-               [MonoTODO ("Not implemented.   Always returns an empty collection")]\r
-               EventDescriptorCollection ICustomTypeDescriptor.GetEvents ()\r
-               {\r
-                       return new EventDescriptorCollection (null);\r
-               }\r
-\r
-               [MonoTODO ("Not implemented.   Always returns an empty collection")]\r
-               EventDescriptorCollection ICustomTypeDescriptor.GetEvents (Attribute [] attributes)\r
-               {\r
-                       return new EventDescriptorCollection (null);\r
-               }\r
-\r
-               PropertyDescriptorCollection ICustomTypeDescriptor.GetProperties ()\r
-               {\r
-                       if (DataView == null) {\r
-                               ITypedList typedList = (ITypedList) _dataView;\r
-                               return typedList.GetItemProperties (new PropertyDescriptor [0]);\r
-                       }\r
-                       return DataView.Table.GetPropertyDescriptorCollection ();\r
-               }\r
-\r
-               [MonoTODO ("It currently reports more descriptors than necessary")]\r
-               PropertyDescriptorCollection ICustomTypeDescriptor.GetProperties (Attribute [] attributes)\r
-               {\r
-                       PropertyDescriptorCollection descriptors;\r
-                       descriptors = ((ICustomTypeDescriptor) this).GetProperties ();\r
-                       // TODO: filter out descriptors which do not contain\r
-                       //       any of those attributes\r
-                       //       except, those descriptors\r
-                       //       that contain DefaultMemeberAttribute\r
-                       return descriptors;\r
-               }\r
-\r
-               [MonoTODO]\r
-               object ICustomTypeDescriptor.GetPropertyOwner (PropertyDescriptor pd)\r
-               {\r
-                       return this;\r
-               }\r
-       }\r
-\r
-       partial class DataRowView : IDataErrorInfo {\r
-               string IDataErrorInfo.Error {\r
-                       [MonoTODO ("Not implemented, always returns String.Empty")]\r
-                       get { return string.Empty; }\r
-               }\r
-\r
-               string IDataErrorInfo.this [string colName] {\r
-                       [MonoTODO ("Not implemented, always returns String.Empty")]\r
-                       get { return string.Empty; }\r
-               }\r
-       }\r
-\r
-       partial class DataRowView : INotifyPropertyChanged {\r
-               public event PropertyChangedEventHandler PropertyChanged;\r
-\r
-               void OnPropertyChanged (string propertyName)\r
-               {\r
-                       if (PropertyChanged != null) {\r
-                               PropertyChangedEventArgs args = new PropertyChangedEventArgs (propertyName);\r
-                               PropertyChanged (this, args);\r
-                       }\r
-               }\r
-       }\r
-}\r
diff --git a/mcs/class/System.Data/System.Data/DataSet.cs b/mcs/class/System.Data/System.Data/DataSet.cs
deleted file mode 100644 (file)
index 5e98f20..0000000
+++ /dev/null
@@ -1,1744 +0,0 @@
-//\r
-// System.Data/DataSet.cs\r
-//\r
-// Author:\r
-//   Christopher Podurgiel <cpodurgiel@msn.com>\r
-//   Daniel Morgan <danmorg@sc.rr.com>\r
-//   Rodrigo Moya <rodrigo@ximian.com>\r
-//   Stuart Caborn <stuart.caborn@virgin.net>\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//   Ville Palo <vi64pa@koti.soon.fi>\r
-//   Atsushi Enomoto <atsushi@ximian.com>\r
-//   Konstantin Triger <kostat@mainsoft.com>\r
-//\r
-// (C) Ximian, Inc. 2002\r
-// Copyright (C) Tim Coleman, 2002, 2003\r
-//\r
-\r
-//\r
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)\r
-//\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-//\r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-//\r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
-//\r
-\r
-using System;\r
-using System.Collections;\r
-using System.ComponentModel;\r
-using System.Globalization;\r
-using System.Threading;\r
-using System.IO;\r
-using System.Runtime.Serialization;\r
-using System.Runtime.Serialization.Formatters.Binary;\r
-using System.Xml;\r
-using System.Xml.Schema;\r
-using System.Xml.Serialization;\r
-using System.Data.Common;\r
-\r
-namespace System.Data\r
-{\r
-       [ToolboxItem ("Microsoft.VSDesigner.Data.VS.DataSetToolboxItem, " + Consts.AssemblyMicrosoft_VSDesigner)]\r
-       [DefaultProperty ("DataSetName")]\r
-       [DesignerAttribute ("Microsoft.VSDesigner.Data.VS.DataSetDesigner, "+ Consts.AssemblyMicrosoft_VSDesigner, "System.ComponentModel.Design.IDesigner")]\r
-       [Serializable]\r
-       public partial class DataSet : MarshalByValueComponent, IListSource, ISupportInitialize,\r
-                              ISerializable, IXmlSerializable {\r
-               private string dataSetName;\r
-               private string _namespace = string.Empty;\r
-               private string prefix;\r
-               private bool caseSensitive;\r
-               private bool enforceConstraints = true;\r
-               private DataTableCollection tableCollection;\r
-               private DataRelationCollection relationCollection;\r
-               private PropertyCollection properties;\r
-               private DataViewManager defaultView;\r
-               private CultureInfo locale;\r
-               internal XmlDataDocument _xmlDataDocument;\r
-\r
-               internal TableAdapterSchemaInfo tableAdapterSchemaInfo;\r
-               bool initInProgress;\r
-\r
-               #region Constructors\r
-\r
-               public DataSet ()\r
-                       : this ("NewDataSet")\r
-               {\r
-               }\r
-\r
-               public DataSet (string dataSetName)\r
-               {\r
-                       this.dataSetName = dataSetName;\r
-                       tableCollection = new DataTableCollection (this);\r
-                       relationCollection = new DataRelationCollection.DataSetRelationCollection (this);\r
-                       properties = new PropertyCollection ();\r
-                       prefix = String.Empty;\r
-               }\r
-\r
-               protected DataSet (SerializationInfo info, StreamingContext context)\r
-                       : this ()\r
-               {\r
-                       if (IsBinarySerialized (info, context)) {\r
-                               BinaryDeserialize (info);\r
-                               return;\r
-                       }\r
-                       string s = info.GetValue ("XmlSchema", typeof (String)) as String;\r
-                       XmlTextReader reader = new XmlTextReader (new StringReader (s));\r
-                       ReadXmlSchema (reader);\r
-                       reader.Close ();\r
-\r
-                       GetSerializationData (info, context);\r
-               }\r
-\r
-               #endregion // Constructors\r
-\r
-               #region Public Properties\r
-\r
-               [DataCategory ("Data")]\r
-               [DefaultValue (false)]\r
-               public bool CaseSensitive {\r
-                       get { return caseSensitive; }\r
-                       set {\r
-                               caseSensitive = value;\r
-                               if (!caseSensitive) {\r
-                                       foreach (DataTable table in Tables) {\r
-                                               table.ResetCaseSensitiveIndexes ();\r
-                                               foreach (Constraint c in table.Constraints)\r
-                                                       c.AssertConstraint ();\r
-                                       }\r
-                               } else {\r
-                                       foreach (DataTable table in Tables) {\r
-                                               table.ResetCaseSensitiveIndexes ();\r
-                                       }\r
-                               }\r
-                       }\r
-               }\r
-\r
-               [DataCategory ("Data")]\r
-               [DefaultValue ("")]\r
-               public string DataSetName {\r
-                       get { return dataSetName; }\r
-                       set { dataSetName = value; }\r
-               }\r
-\r
-               [Browsable (false)]\r
-               public DataViewManager DefaultViewManager {\r
-                       get {\r
-                               if (defaultView == null)\r
-                                       defaultView = new DataViewManager (this);\r
-                               return defaultView;\r
-                       }\r
-               }\r
-\r
-               [DefaultValue (true)]\r
-               public bool EnforceConstraints {\r
-                       get { return enforceConstraints; }\r
-                       set { InternalEnforceConstraints (value, true); }\r
-               }\r
-\r
-               [Browsable (false)]\r
-               [DataCategory ("Data")]\r
-               public PropertyCollection ExtendedProperties {\r
-                       get { return properties; }\r
-               }\r
-\r
-               [Browsable (false)]\r
-               public bool HasErrors {\r
-                       get {\r
-                               for (int i = 0; i < Tables.Count; i++) {\r
-                                       if (Tables[i].HasErrors)\r
-                                               return true;\r
-                               }\r
-                               return false;\r
-                       }\r
-               }\r
-\r
-               [DataCategory ("Data")]\r
-               public CultureInfo Locale {\r
-                       get { return locale != null ? locale : Thread.CurrentThread.CurrentCulture; }\r
-                       set {\r
-                               if (locale == null || !locale.Equals (value)) {\r
-                                       // TODO: check if the new locale is valid\r
-                                       // TODO: update locale of all tables\r
-                                       locale = value;\r
-                               }\r
-                       }\r
-               }\r
-\r
-               internal bool LocaleSpecified {\r
-                       get { return locale != null; }\r
-               }\r
-\r
-               \r
-               internal TableAdapterSchemaInfo TableAdapterSchemaData {\r
-                       get { return tableAdapterSchemaInfo; }\r
-               }\r
-               \r
-               internal void InternalEnforceConstraints (bool value,bool resetIndexes)\r
-               {\r
-                       if (value == enforceConstraints)\r
-                               return;\r
-\r
-                       if (value) {\r
-                               if (resetIndexes) {\r
-                                       // FIXME : is that correct?\r
-                                       // By design the indexes should be updated at this point.\r
-                                       // In Fill from BeginLoadData till EndLoadData indexes are not updated (reset in EndLoadData)\r
-                                       // In DataRow.EndEdit indexes are always updated.\r
-                                       foreach (DataTable table in Tables)\r
-                                               table.ResetIndexes ();\r
-                               }\r
-\r
-                               // TODO : Need to take care of Error handling and settting of RowErrors\r
-                               bool constraintViolated = false;\r
-                               foreach (DataTable table in Tables) {\r
-                                       foreach (Constraint constraint in table.Constraints)\r
-                                               constraint.AssertConstraint();\r
-                                       table.AssertNotNullConstraints ();\r
-                                       if (!constraintViolated && table.HasErrors)\r
-                                               constraintViolated = true;\r
-                               }\r
-\r
-                               if (constraintViolated)\r
-                                       Constraint.ThrowConstraintException ();\r
-                       }\r
-                       enforceConstraints = value;\r
-               }\r
-\r
-               public void Merge (DataRow[] rows)\r
-               {\r
-                       Merge (rows, false, MissingSchemaAction.Add);\r
-               }\r
-\r
-               public void Merge (DataSet dataSet)\r
-               {\r
-                       Merge (dataSet, false, MissingSchemaAction.Add);\r
-               }\r
-\r
-               public void Merge (DataTable table)\r
-               {\r
-                       Merge (table, false, MissingSchemaAction.Add);\r
-               }\r
-\r
-               public void Merge (DataSet dataSet, bool preserveChanges)\r
-               {\r
-                       Merge (dataSet, preserveChanges, MissingSchemaAction.Add);\r
-               }\r
-\r
-               public void Merge (DataRow[] rows, bool preserveChanges, MissingSchemaAction missingSchemaAction)\r
-               {\r
-                       if (rows == null)\r
-                               throw new ArgumentNullException ("rows");\r
-                       if (!IsLegalSchemaAction (missingSchemaAction))\r
-                               throw new ArgumentOutOfRangeException ("missingSchemaAction");\r
-\r
-                       MergeManager.Merge (this, rows, preserveChanges, missingSchemaAction);\r
-               }\r
-\r
-               public void Merge (DataSet dataSet, bool preserveChanges, MissingSchemaAction missingSchemaAction)\r
-               {\r
-                       if (dataSet == null)\r
-                               throw new ArgumentNullException ("dataSet");\r
-                       if (!IsLegalSchemaAction (missingSchemaAction))\r
-                               throw new ArgumentOutOfRangeException ("missingSchemaAction");\r
-\r
-                       MergeManager.Merge (this, dataSet, preserveChanges, missingSchemaAction);\r
-               }\r
-\r
-               public void Merge (DataTable table, bool preserveChanges, MissingSchemaAction missingSchemaAction)\r
-               {\r
-                       if (table == null)\r
-                               throw new ArgumentNullException ("table");\r
-                       if (!IsLegalSchemaAction (missingSchemaAction))\r
-                               throw new ArgumentOutOfRangeException ("missingSchemaAction");\r
-\r
-                       MergeManager.Merge (this, table, preserveChanges, missingSchemaAction);\r
-               }\r
-\r
-               private static bool IsLegalSchemaAction (MissingSchemaAction missingSchemaAction)\r
-               {\r
-                       if (missingSchemaAction == MissingSchemaAction.Add || missingSchemaAction == MissingSchemaAction.AddWithKey\r
-                               || missingSchemaAction == MissingSchemaAction.Error || missingSchemaAction == MissingSchemaAction.Ignore)\r
-                               return true;\r
-                       return false;\r
-               }\r
-\r
-               [DataCategory ("Data")]\r
-               [DefaultValue ("")]\r
-               public string Namespace {\r
-                       get { return _namespace; }\r
-                       set {\r
-                               //TODO - trigger an event if this happens?\r
-                               if (value == null)\r
-                                       value = String.Empty;\r
-                                if (value != this._namespace)\r
-                                       RaisePropertyChanging ("Namespace");\r
-                               _namespace = value;\r
-                       }\r
-               }\r
-\r
-               [DataCategory ("Data")]\r
-               [DefaultValue ("")]\r
-               public string Prefix {\r
-                       get { return prefix; }\r
-                       set {\r
-                               if (value == null)\r
-                                       value = String.Empty;\r
-                               // Prefix cannot contain any special characters other than '_' and ':'\r
-                               for (int i = 0; i < value.Length; i++) {\r
-                                       if (!(Char.IsLetterOrDigit (value [i])) && (value [i] != '_') && (value [i] != ':'))\r
-                                               throw new DataException ("Prefix '" + value + "' is not valid, because it contains special characters.");\r
-                               }\r
-\r
-                               if (value != this.prefix)\r
-                                       RaisePropertyChanging ("Prefix");\r
-                               prefix = value;\r
-                       }\r
-               }\r
-\r
-               [DataCategory ("Data")]\r
-               [DesignerSerializationVisibility (DesignerSerializationVisibility.Content)]\r
-               public DataRelationCollection Relations {\r
-                       get { return relationCollection; }\r
-               }\r
-\r
-               [Browsable (false)]\r
-               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]\r
-               public override ISite Site {\r
-                       get { return base.Site; }\r
-                       set { base.Site = value; }\r
-               }\r
-\r
-               [DataCategory ("Data")]\r
-               [DesignerSerializationVisibility (DesignerSerializationVisibility.Content)]\r
-               public DataTableCollection Tables {\r
-                       get { return tableCollection; }\r
-               }\r
-\r
-               #endregion // Public Properties\r
-\r
-               #region Public Methods\r
-\r
-               public void AcceptChanges ()\r
-               {\r
-                       foreach (DataTable tempTable in tableCollection)\r
-                               tempTable.AcceptChanges ();\r
-               }\r
-\r
-               /// <summary>\r
-               /// Clears all the tables\r
-               /// </summary>\r
-               public void Clear ()\r
-               {\r
-                       if (_xmlDataDocument != null)\r
-                               throw new NotSupportedException ("Clear function on dataset and datatable is not supported when XmlDataDocument is bound to the DataSet.");\r
-                       bool enforceConstraints = this.EnforceConstraints;\r
-                       this.EnforceConstraints = false;\r
-                       for (int t = 0; t < tableCollection.Count; t++)\r
-                               tableCollection[t].Clear ();\r
-                       this.EnforceConstraints = enforceConstraints;\r
-               }\r
-\r
-               public virtual DataSet Clone ()\r
-               {\r
-                       // need to return the same type as this...\r
-                       DataSet Copy = (DataSet) Activator.CreateInstance (GetType (), true);\r
-\r
-                       CopyProperties (Copy);\r
-\r
-                       foreach (DataTable Table in Tables) {\r
-                               // tables are often added in no-args constructor, don't add them\r
-                               // twice.\r
-                               if (!Copy.Tables.Contains (Table.TableName))\r
-                                       Copy.Tables.Add (Table.Clone ());\r
-                       }\r
-\r
-                       //Copy Relationships between tables after existance of tables\r
-                       //and setting properties correctly\r
-                       CopyRelations (Copy);\r
-\r
-                       return Copy;\r
-               }\r
-\r
-               // Copies both the structure and data for this DataSet.\r
-               public DataSet Copy ()\r
-               {\r
-                       // need to return the same type as this...\r
-                       DataSet Copy = (DataSet) Activator.CreateInstance (GetType (), true);\r
-\r
-                       CopyProperties (Copy);\r
-\r
-                       // Copy DatSet's tables\r
-                       foreach (DataTable Table in Tables) {\r
-                               if (! Copy.Tables.Contains (Table.TableName)) {\r
-                                       Copy.Tables.Add (Table.Copy ());\r
-                                       continue;\r
-                               }\r
-                               foreach (DataRow row in Table.Rows)\r
-                                       Copy.Tables [Table.TableName].ImportRow (row);\r
-                       }\r
-\r
-                       //Copy Relationships between tables after existance of tables\r
-                       //and setting properties correctly\r
-                       CopyRelations (Copy);\r
-\r
-                       return Copy;\r
-               }\r
-\r
-               private void CopyProperties (DataSet Copy)\r
-               {\r
-                       Copy.CaseSensitive = CaseSensitive;\r
-                       //Copy.Container = Container\r
-                       Copy.DataSetName = DataSetName;\r
-                       //Copy.DefaultViewManager\r
-                       //Copy.DesignMode\r
-                       Copy.EnforceConstraints = EnforceConstraints;\r
-                       if(ExtendedProperties.Count > 0) {\r
-                               // Cannot copy extended properties directly as the property does not have a set accessor\r
-                               Array tgtArray = Array.CreateInstance( typeof (object), ExtendedProperties.Count);\r
-                               ExtendedProperties.Keys.CopyTo (tgtArray, 0);\r
-                               for (int i = 0; i < ExtendedProperties.Count; i++)\r
-                                       Copy.ExtendedProperties.Add (tgtArray.GetValue (i), ExtendedProperties[tgtArray.GetValue (i)]);\r
-                       }\r
-                       Copy.locale = locale;\r
-                       Copy.Namespace = Namespace;\r
-                       Copy.Prefix = Prefix;\r
-                       //Copy.Site = Site; // FIXME : Not sure of this.\r
-               }\r
-\r
-\r
-               private void CopyRelations (DataSet Copy)\r
-               {\r
-\r
-                       //Creation of the relation contains some of the properties, and the constructor\r
-                       //demands these values. instead changing the DataRelation constructor and behaviour the\r
-                       //parameters are pre-configured and sent to the most general constructor\r
-\r
-                       foreach (DataRelation MyRelation in this.Relations) {\r
-\r
-                               // typed datasets create relations through ctor.\r
-                               if (Copy.Relations.Contains (MyRelation.RelationName))\r
-                                       continue;\r
-\r
-                               string pTable = MyRelation.ParentTable.TableName;\r
-                               string cTable = MyRelation.ChildTable.TableName;\r
-                               DataColumn[] P_DC = new DataColumn[MyRelation.ParentColumns.Length];\r
-                               DataColumn[] C_DC = new DataColumn[MyRelation.ChildColumns.Length];\r
-                               int i = 0;\r
-\r
-                               foreach (DataColumn DC in MyRelation.ParentColumns) {\r
-                                       P_DC[i]=Copy.Tables[pTable].Columns[DC.ColumnName];\r
-                                       i++;\r
-                               }\r
-\r
-                               i = 0;\r
-\r
-                               foreach (DataColumn DC in MyRelation.ChildColumns) {\r
-                                       C_DC[i]=Copy.Tables[cTable].Columns[DC.ColumnName];\r
-                                       i++;\r
-                               }\r
-\r
-                               DataRelation cRel = new DataRelation (MyRelation.RelationName, P_DC, C_DC, false);\r
-                               Copy.Relations.Add (cRel);\r
-                       }\r
-\r
-                       // Foreign Key constraints are not cloned in DataTable.Clone\r
-                       // so, these constraints should be cloned when copying the relations.\r
-                       foreach (DataTable table in this.Tables) {\r
-                               foreach (Constraint c in table.Constraints) {\r
-                                       if (!(c is ForeignKeyConstraint)\r
-                                               || Copy.Tables[table.TableName].Constraints.Contains (c.ConstraintName))\r
-                                               continue;\r
-                                       ForeignKeyConstraint fc = (ForeignKeyConstraint)c;\r
-                                       DataTable parentTable = Copy.Tables [fc.RelatedTable.TableName];\r
-                                       DataTable currTable = Copy.Tables [table.TableName];\r
-                                       DataColumn[] parentCols = new DataColumn [fc.RelatedColumns.Length];\r
-                                       DataColumn[] childCols = new DataColumn [fc.Columns.Length];\r
-                                       for (int j=0; j < parentCols.Length; ++j)\r
-                                               parentCols [j] = parentTable.Columns[fc.RelatedColumns[j].ColumnName];\r
-                                       for (int j=0; j < childCols.Length; ++j)\r
-                                               childCols [j] = currTable.Columns[fc.Columns[j].ColumnName];\r
-                                       currTable.Constraints.Add (fc.ConstraintName, parentCols, childCols);\r
-                               }\r
-                       }\r
-               }\r
-\r
-               public DataSet GetChanges ()\r
-               {\r
-                       return GetChanges (DataRowState.Added | DataRowState.Deleted | DataRowState.Modified);\r
-               }\r
-\r
-\r
-               public DataSet GetChanges (DataRowState rowStates)\r
-               {\r
-                       if (!HasChanges (rowStates))\r
-                               return null;\r
-\r
-                       DataSet copySet = Clone ();\r
-                       bool prev = copySet.EnforceConstraints;\r
-                       copySet.EnforceConstraints = false;\r
-\r
-                       Hashtable addedRows = new Hashtable ();\r
-\r
-                       for (int i = 0; i < Tables.Count; i++) {\r
-                               DataTable origTable = Tables [i];\r
-                               DataTable copyTable = copySet.Tables[origTable.TableName];\r
-                               for (int j = 0; j < origTable.Rows.Count; j++) {\r
-                                       DataRow row = origTable.Rows [j];\r
-                                       if (!row.IsRowChanged (rowStates) || addedRows.Contains (row))\r
-                                               continue;\r
-                                       AddChangedRow (addedRows, copyTable, row);\r
-                               }\r
-                       }\r
-                       copySet.EnforceConstraints = prev;\r
-                       return copySet;\r
-               }\r
-\r
-               private void AddChangedRow (Hashtable addedRows, DataTable copyTable, DataRow row)\r
-               {\r
-                       if (addedRows.ContainsKey (row))\r
-                               return;\r
-\r
-                       foreach (DataRelation relation in row.Table.ParentRelations) {\r
-                               DataRow parent = ( row.RowState != DataRowState.Deleted ?\r
-                                                  row.GetParentRow (relation) :\r
-                                                  row.GetParentRow (relation, DataRowVersion.Original)\r
-                                                  );\r
-                               if (parent == null)\r
-                                       continue;\r
-                               // add the parent row\r
-                               DataTable parentCopyTable = copyTable.DataSet.Tables [parent.Table.TableName];\r
-                               AddChangedRow (addedRows, parentCopyTable, parent);\r
-                       }\r
-\r
-                       // add the current row\r
-                       DataRow newRow = copyTable.NewNotInitializedRow ();\r
-                       copyTable.Rows.AddInternal (newRow);\r
-                       // Don't check for ReadOnly, when cloning data to new uninitialized row.\r
-                       row.CopyValuesToRow (newRow, false);\r
-                       newRow.XmlRowID = row.XmlRowID;\r
-                       addedRows.Add (row, row);\r
-               }\r
-\r
-               public string GetXml ()\r
-               {\r
-                       StringWriter Writer = new StringWriter ();\r
-                       WriteXml (Writer, XmlWriteMode.IgnoreSchema);\r
-                       return Writer.ToString ();\r
-               }\r
-\r
-               public string GetXmlSchema ()\r
-               {\r
-                       StringWriter Writer = new StringWriter ();\r
-                       WriteXmlSchema (Writer);\r
-                       return Writer.ToString ();\r
-               }\r
-\r
-               public bool HasChanges ()\r
-               {\r
-                       return HasChanges (DataRowState.Added | DataRowState.Deleted | DataRowState.Modified);\r
-               }\r
-\r
-               public bool HasChanges (DataRowState rowStates)\r
-               {\r
-                       if (((int) rowStates & 0xffffffe0) != 0)\r
-                               throw new ArgumentOutOfRangeException ("rowStates");\r
-\r
-                       DataTableCollection tableCollection = Tables;\r
-                       DataTable table;\r
-                       DataRowCollection rowCollection;\r
-                       DataRow row;\r
-\r
-                       for (int i = 0; i < tableCollection.Count; i++) {\r
-                               table = tableCollection [i];\r
-                               rowCollection = table.Rows;\r
-                               for (int j = 0; j < rowCollection.Count; j++) {\r
-                                       row = rowCollection [j];\r
-                                       if ((row.RowState & rowStates) != 0)\r
-                                               return true;\r
-                               }\r
-                       }\r
-\r
-                       return false;\r
-               }\r
-\r
-               public void InferXmlSchema (XmlReader reader, string[] nsArray)\r
-               {\r
-                       if (reader == null)\r
-                               return;\r
-                       XmlDocument doc = new XmlDocument ();\r
-                       doc.Load (reader);\r
-                       InferXmlSchema (doc, nsArray);\r
-               }\r
-\r
-               private void InferXmlSchema (XmlDocument doc, string [] nsArray)\r
-               {\r
-                       XmlDataInferenceLoader.Infer (this, doc, XmlReadMode.InferSchema, nsArray);\r
-               }\r
-\r
-               public void InferXmlSchema (Stream stream, string[] nsArray)\r
-               {\r
-                       InferXmlSchema (new XmlTextReader (stream), nsArray);\r
-               }\r
-\r
-               public void InferXmlSchema (TextReader reader, string[] nsArray)\r
-               {\r
-                       InferXmlSchema (new XmlTextReader (reader), nsArray);\r
-               }\r
-\r
-               public void InferXmlSchema (string fileName, string[] nsArray)\r
-               {\r
-                       XmlTextReader reader = new XmlTextReader (fileName);\r
-                       try {\r
-                               InferXmlSchema (reader, nsArray);\r
-                       } finally {\r
-                               reader.Close ();\r
-                       }\r
-               }\r
-\r
-               public virtual void RejectChanges ()\r
-               {\r
-                       int i;\r
-                       bool oldEnforceConstraints = this.EnforceConstraints;\r
-                       this.EnforceConstraints = false;\r
-\r
-                       for (i = 0; i < this.Tables.Count;i++)\r
-                               this.Tables[i].RejectChanges ();\r
-\r
-                       this.EnforceConstraints = oldEnforceConstraints;\r
-               }\r
-\r
-               public virtual void Reset ()\r
-               {\r
-                       // first we remove all ForeignKeyConstraints (if we will not do that\r
-                       // we will get an exception when clearing the tables).\r
-                       for (int i = 0; i < Tables.Count; i++) {\r
-                               ConstraintCollection cc = Tables[i].Constraints;\r
-                               for (int j = 0; j < cc.Count; j++) {\r
-                                       if (cc[j] is ForeignKeyConstraint)\r
-                                               cc.Remove (cc[j]);\r
-                               }\r
-                       }\r
-\r
-                       Clear ();\r
-                       Relations.Clear ();\r
-                       Tables.Clear ();\r
-               }\r
-\r
-               public void WriteXml (Stream stream)\r
-               {\r
-                       XmlTextWriter writer = new XmlTextWriter (stream, null);\r
-                       writer.Formatting = Formatting.Indented;\r
-                       WriteXml (writer);\r
-               }\r
-\r
-               ///<summary>\r
-               /// Writes the current data for the DataSet to the specified file.\r
-               /// </summary>\r
-               /// <param name="filename">Fully qualified filename to write to</param>\r
-               public void WriteXml (string fileName)\r
-               {\r
-                       XmlTextWriter writer = new XmlTextWriter (fileName, null);\r
-                       writer.Formatting = Formatting.Indented;\r
-                       writer.WriteStartDocument (true);\r
-                       try {\r
-                               WriteXml (writer);\r
-                       } finally {\r
-                               writer.WriteEndDocument ();\r
-                               writer.Close ();\r
-                       }\r
-               }\r
-\r
-               public void WriteXml (TextWriter writer)\r
-               {\r
-                       XmlTextWriter xwriter = new XmlTextWriter (writer);\r
-                       xwriter.Formatting = Formatting.Indented;\r
-                       WriteXml (xwriter);\r
-               }\r
-\r
-               public void WriteXml (XmlWriter writer)\r
-               {\r
-                       WriteXml (writer, XmlWriteMode.IgnoreSchema);\r
-               }\r
-\r
-               public void WriteXml (string fileName, XmlWriteMode mode)\r
-               {\r
-                       XmlTextWriter writer = new XmlTextWriter (fileName, null);\r
-                       writer.Formatting = Formatting.Indented;\r
-                       writer.WriteStartDocument (true);\r
-\r
-                       try {\r
-                               WriteXml (writer, mode);\r
-                       } finally {\r
-                               writer.WriteEndDocument ();\r
-                               writer.Close ();\r
-                       }\r
-               }\r
-\r
-               public void WriteXml (Stream stream, XmlWriteMode mode)\r
-               {\r
-                       XmlTextWriter writer = new XmlTextWriter (stream, null);\r
-                       writer.Formatting = Formatting.Indented;\r
-                       WriteXml (writer, mode);\r
-               }\r
-\r
-               public void WriteXml (TextWriter writer, XmlWriteMode mode)\r
-               {\r
-                       XmlTextWriter xwriter = new XmlTextWriter (writer);\r
-                       xwriter.Formatting = Formatting.Indented;\r
-                       WriteXml (xwriter, mode);\r
-               }\r
-\r
-               public void WriteXml (XmlWriter writer, XmlWriteMode mode)\r
-               {\r
-                       if (mode == XmlWriteMode.DiffGram) {\r
-                               SetRowsID();\r
-                               WriteDiffGramElement(writer);\r
-                       }\r
-\r
-                       // It should not write when there is no content to be written\r
-                       bool shouldOutputContent = (mode != XmlWriteMode.DiffGram);\r
-                       for (int n = 0; n < tableCollection.Count && !shouldOutputContent; n++)\r
-                               shouldOutputContent = tableCollection [n].Rows.Count > 0;\r
-\r
-                       if (shouldOutputContent) {\r
-                               WriteStartElement (writer, mode, Namespace, Prefix, XmlHelper.Encode (DataSetName));\r
-\r
-                               if (mode == XmlWriteMode.WriteSchema)\r
-                                       DoWriteXmlSchema (writer);\r
-\r
-                               WriteTables (writer, mode, Tables, DataRowVersion.Default);\r
-                               writer.WriteEndElement ();\r
-                       }\r
-\r
-                       if (mode == XmlWriteMode.DiffGram) {\r
-                               if (HasChanges(DataRowState.Modified | DataRowState.Deleted)) {\r
-                                       DataSet beforeDS = GetChanges (DataRowState.Modified | DataRowState.Deleted);\r
-                                       WriteStartElement (writer, XmlWriteMode.DiffGram, XmlConstants.DiffgrNamespace, XmlConstants.DiffgrPrefix, "before");\r
-                                       WriteTables (writer, mode, beforeDS.Tables, DataRowVersion.Original);\r
-                                       writer.WriteEndElement ();\r
-                               }\r
-                       }\r
-\r
-                       if (mode == XmlWriteMode.DiffGram)\r
-                               writer.WriteEndElement (); // diffgr:diffgram\r
-\r
-                       writer.Flush ();\r
-               }\r
-\r
-               public void WriteXmlSchema (Stream stream)\r
-               {\r
-                       XmlTextWriter writer = new XmlTextWriter (stream, null );\r
-                       writer.Formatting = Formatting.Indented;\r
-                       WriteXmlSchema (writer);\r
-               }\r
-\r
-               public void WriteXmlSchema (string fileName)\r
-               {\r
-                       XmlTextWriter writer = new XmlTextWriter (fileName, null);\r
-                       try {\r
-                               writer.Formatting = Formatting.Indented;\r
-                               writer.WriteStartDocument (true);\r
-                               WriteXmlSchema (writer);\r
-                       } finally {\r
-                               writer.WriteEndDocument ();\r
-                               writer.Close ();\r
-                       }\r
-               }\r
-\r
-               public void WriteXmlSchema (TextWriter writer)\r
-               {\r
-                       XmlTextWriter xwriter = new XmlTextWriter (writer);\r
-                       try {\r
-                               xwriter.Formatting = Formatting.Indented;\r
-                               WriteXmlSchema (xwriter);\r
-                       } finally {\r
-                               xwriter.Close ();\r
-                       }\r
-               }\r
-\r
-               public void WriteXmlSchema (XmlWriter writer)\r
-               {\r
-                       //Create a skeleton doc and then write the schema\r
-                       //proper which is common to the WriteXml method in schema mode\r
-                       DoWriteXmlSchema (writer);\r
-               }\r
-\r
-               public void ReadXmlSchema (Stream stream)\r
-               {\r
-                       XmlReader reader = new XmlTextReader (stream, new NameTable ());\r
-                       ReadXmlSchema (reader);\r
-               }\r
-\r
-               public void ReadXmlSchema (string fileName)\r
-               {\r
-                       XmlReader reader = new XmlTextReader (fileName);\r
-                       try {\r
-                               ReadXmlSchema (reader);\r
-                       } finally {\r
-                               reader.Close ();\r
-                       }\r
-               }\r
-\r
-               public void ReadXmlSchema (TextReader reader)\r
-               {\r
-                       XmlReader xr = new XmlTextReader (reader);\r
-                       ReadXmlSchema (xr);\r
-               }\r
-\r
-               public void ReadXmlSchema (XmlReader reader)\r
-               {\r
-#if true\r
-                       XmlSchemaDataImporter xsdImporter = new XmlSchemaDataImporter (this, reader, true);\r
-                       xsdImporter.Process ();\r
-                       tableAdapterSchemaInfo = xsdImporter.CurrentAdapter;\r
-#else\r
-                       XmlSchemaMapper SchemaMapper = new XmlSchemaMapper (this);\r
-                       SchemaMapper.Read (reader);\r
-#endif\r
-               }\r
-\r
-               public XmlReadMode ReadXml (Stream stream)\r
-               {\r
-                       return ReadXml (new XmlTextReader (stream));\r
-               }\r
-\r
-               public XmlReadMode ReadXml (string fileName)\r
-               {\r
-                       XmlTextReader reader = new XmlTextReader (fileName);\r
-                       try {\r
-                               return ReadXml (reader);\r
-                       } finally {\r
-                               reader.Close ();\r
-                       }\r
-               }\r
-\r
-               public XmlReadMode ReadXml (TextReader reader)\r
-               {\r
-                       return ReadXml (new XmlTextReader (reader));\r
-               }\r
-\r
-               public XmlReadMode ReadXml (XmlReader reader)\r
-               {\r
-                       return ReadXml (reader, XmlReadMode.Auto);\r
-               }\r
-\r
-               public XmlReadMode ReadXml (Stream stream, XmlReadMode mode)\r
-               {\r
-                       return ReadXml (new XmlTextReader (stream), mode);\r
-               }\r
-\r
-               public XmlReadMode ReadXml (string fileName, XmlReadMode mode)\r
-               {\r
-                       XmlTextReader reader = new XmlTextReader (fileName);\r
-                       try {\r
-                               return ReadXml (reader, mode);\r
-                       } finally {\r
-                               reader.Close ();\r
-                       }\r
-               }\r
-\r
-               public XmlReadMode ReadXml (TextReader reader, XmlReadMode mode)\r
-               {\r
-                       return ReadXml (new XmlTextReader (reader), mode);\r
-               }\r
-\r
-               // LAMESPEC: XmlReadMode.Fragment is far from presisely\r
-               // documented. MS.NET infers schema against this mode.\r
-               public XmlReadMode ReadXml (XmlReader reader, XmlReadMode mode)\r
-               {\r
-                       if (reader == null)\r
-                               return mode;\r
-\r
-                       switch (reader.ReadState) {\r
-                       case ReadState.EndOfFile:\r
-                       case ReadState.Error:\r
-                       case ReadState.Closed:\r
-                               return mode;\r
-                       }\r
-                       // Skip XML declaration and prolog\r
-                       reader.MoveToContent ();\r
-                       if (reader.EOF)\r
-                               return mode;\r
-\r
-                       if (reader is XmlTextReader) {\r
-                               // we dont need whitespace\r
-                               ((XmlTextReader) reader).WhitespaceHandling = WhitespaceHandling.None;\r
-                       }\r
-\r
-                       XmlDiffLoader DiffLoader = null;\r
-\r
-                       // If diffgram, then read the first element as diffgram\r
-                       if (reader.LocalName == "diffgram" && reader.NamespaceURI == XmlConstants.DiffgrNamespace) {\r
-                               switch (mode) {\r
-                                       case XmlReadMode.Auto:\r
-                                       case XmlReadMode.DiffGram:\r
-                                               if (DiffLoader == null)\r
-                                                       DiffLoader = new XmlDiffLoader (this);\r
-                                               DiffLoader.Load (reader);\r
-                                               // (and leave rest of the reader as is)\r
-                                               return XmlReadMode.DiffGram;\r
-                                       case XmlReadMode.Fragment:\r
-                                               reader.Skip ();\r
-                                               // (and continue to read)\r
-                                               break;\r
-                                       default:\r
-                                               reader.Skip ();\r
-                                               // (and leave rest of the reader as is)\r
-                                               return mode;\r
-                               }\r
-                       }\r
-\r
-                       // If schema, then read the first element as schema\r
-                       if (reader.LocalName == "schema" && reader.NamespaceURI == XmlSchema.Namespace) {\r
-                               switch (mode) {\r
-                                       case XmlReadMode.IgnoreSchema:\r
-                                       case XmlReadMode.InferSchema:\r
-                                               reader.Skip ();\r
-                                               // (and break up read)\r
-                                               return mode;\r
-                                       case XmlReadMode.Fragment:\r
-                                               ReadXmlSchema (reader);\r
-                                               // (and continue to read)\r
-                                               break;\r
-                                       case XmlReadMode.Auto:\r
-                                               if (Tables.Count == 0) {\r
-                                                       ReadXmlSchema (reader);\r
-                                                       return XmlReadMode.ReadSchema;\r
-                                               } else {\r
-                                                       // otherwise just ignore and return IgnoreSchema\r
-                                                       reader.Skip ();\r
-                                                       return XmlReadMode.IgnoreSchema;\r
-                                               }\r
-                                       default:\r
-                                               ReadXmlSchema (reader);\r
-                                               // (and leave rest of the reader as is)\r
-                                               return mode; // When DiffGram, return DiffGram\r
-                               }\r
-                       }\r
-\r
-                       if (reader.EOF)\r
-                               return mode;\r
-\r
-                       int depth = (reader.NodeType == XmlNodeType.Element) ? reader.Depth : -1;\r
-\r
-                       XmlDocument doc = new XmlDocument ();\r
-                       XmlElement root = doc.CreateElement(reader.Prefix, reader.LocalName, reader.NamespaceURI);\r
-                       if (reader.HasAttributes) {\r
-                               for (int i = 0; i < reader.AttributeCount; i++) {\r
-                                       reader.MoveToAttribute(i);\r
-                                       if (reader.NamespaceURI == XmlConstants.XmlnsNS)\r
-                                               root.SetAttribute(reader.Name, reader.GetAttribute(i));\r
-                                       else {\r
-                                               XmlAttribute attr = root.SetAttributeNode(reader.LocalName, reader.NamespaceURI);\r
-                                               attr.Prefix = reader.Prefix;\r
-                                               attr.Value = reader.GetAttribute(i);\r
-                                       }\r
-                               }\r
-                       }\r
-\r
-                       reader.Read();\r
-                       XmlReadMode retMode = mode;\r
-                       bool schemaLoaded = false;\r
-\r
-                       for (;;) {\r
-                               if( reader.Depth == depth ||\r
-                                       reader.NodeType == XmlNodeType.EndElement)\r
-                                       break;\r
-\r
-                               if (reader.NodeType != XmlNodeType.Element) {\r
-                                       if (!reader.Read())\r
-                                               break;\r
-                                       continue;\r
-                               }\r
-\r
-                               if (reader.LocalName == "schema" && reader.NamespaceURI == XmlSchema.Namespace) {\r
-                                       switch (mode) {\r
-                                               case XmlReadMode.IgnoreSchema:\r
-                                               case XmlReadMode.InferSchema:\r
-                                                       reader.Skip ();\r
-                                                       break;\r
-\r
-                                               default:\r
-                                                       ReadXmlSchema (reader);\r
-                                                       retMode = XmlReadMode.ReadSchema;\r
-                                                       schemaLoaded = true;\r
-                                                       // (and leave rest of the reader as is)\r
-                                                       break;\r
-                                       }\r
-\r
-                                       continue;\r
-                               }\r
-\r
-                               if ((reader.LocalName == "diffgram") && (reader.NamespaceURI == XmlConstants.DiffgrNamespace)) {\r
-                                       if ((mode == XmlReadMode.DiffGram) || (mode == XmlReadMode.IgnoreSchema)\r
-                                               || mode == XmlReadMode.Auto) {\r
-                                               if (DiffLoader == null)\r
-                                                       DiffLoader = new XmlDiffLoader (this);\r
-                                               DiffLoader.Load (reader);\r
-                                               // (and leave rest of the reader as is)\r
-                                               retMode = XmlReadMode.DiffGram;\r
-                                       }\r
-                                       else\r
-                                               reader.Skip();\r
-\r
-                                       continue;\r
-                               }\r
-\r
-                               //collect data\r
-                               XmlNode n = doc.ReadNode(reader);\r
-                               root.AppendChild(n);\r
-                       }\r
-\r
-                       if (reader.NodeType == XmlNodeType.EndElement)\r
-                               reader.Read ();\r
-                       reader.MoveToContent();\r
-\r
-                       if (mode == XmlReadMode.DiffGram) {\r
-                               return retMode;\r
-                       }\r
-\r
-                       doc.AppendChild(root);\r
-\r
-                       if (!schemaLoaded &&\r
-                               retMode != XmlReadMode.ReadSchema &&\r
-                               mode != XmlReadMode.IgnoreSchema &&\r
-                               mode != XmlReadMode.Fragment &&\r
-                               (Tables.Count == 0 || mode == XmlReadMode.InferSchema)) {\r
-                               InferXmlSchema(doc, null);\r
-                               if (mode == XmlReadMode.Auto)\r
-                                       retMode = XmlReadMode.InferSchema;\r
-                       }\r
-\r
-                       reader = new XmlNodeReader (doc);\r
-                       XmlDataReader.ReadXml (this, reader, mode);\r
-\r
-                       return retMode == XmlReadMode.Auto ?\r
-                               XmlReadMode.IgnoreSchema : retMode;\r
-               }\r
-               #endregion // Public Methods\r
-\r
-               #region Public Events\r
-\r
-               [DataCategory ("Action")]\r
-               public event MergeFailedEventHandler MergeFailed;\r
-\r
-               #endregion // Public Events\r
-\r
-               #region IListSource methods\r
-               IList IListSource.GetList ()\r
-               {\r
-                       return DefaultViewManager;\r
-               }\r
-\r
-               bool IListSource.ContainsListCollection {\r
-                       get {\r
-                               return true;\r
-                       }\r
-               }\r
-               #endregion IListSource methods\r
-\r
-               #region ISupportInitialize methods\r
-\r
-               internal bool InitInProgress {\r
-                       get { return initInProgress; }\r
-                       set { initInProgress = value; }\r
-               }\r
-\r
-               public void BeginInit ()\r
-               {\r
-                       InitInProgress = true;\r
-                       dataSetInitialized = false;\r
-               }\r
-\r
-               public void EndInit ()\r
-               {\r
-                       // Finsh the init'ing the tables only after adding all the\r
-                       // tables to the collection.\r
-                       Tables.PostAddRange ();\r
-                       for (int i=0; i < Tables.Count; ++i) {\r
-                               if (!Tables [i].InitInProgress)\r
-                                       continue;\r
-                               Tables [i].FinishInit ();\r
-                       }\r
-\r
-                       Relations.PostAddRange ();\r
-                       InitInProgress = false;\r
-                       dataSetInitialized = true;\r
-                       DataSetInitialized ();\r
-               }\r
-               #endregion\r
-\r
-               #region ISerializable\r
-               public virtual\r
-               void\r
-               GetObjectData (SerializationInfo info, StreamingContext context)\r
-               {\r
-                       if (RemotingFormat == SerializationFormat.Xml) {\r
-                               info.AddValue ("SchemaSerializationMode.DataSet", this.SchemaSerializationMode);\r
-                               StringWriter sw = new StringWriter ();\r
-                               XmlTextWriter writer = new XmlTextWriter (sw);\r
-                               DoWriteXmlSchema (writer);\r
-                               writer.Flush ();\r
-                               info.AddValue ("XmlSchema", sw.ToString ());\r
-\r
-                               sw = new StringWriter ();\r
-                               writer = new XmlTextWriter (sw);\r
-                               WriteXml (writer, XmlWriteMode.DiffGram);\r
-                               writer.Flush ();\r
-                               info.AddValue ("XmlDiffGram", sw.ToString ());\r
-                       } else /*if (DataSet.RemotingFormat == SerializationFormat.Binary)*/ {\r
-                               BinarySerialize (info);\r
-                       }\r
-               }\r
-               #endregion\r
-\r
-               #region Protected Methods\r
-               protected void GetSerializationData (SerializationInfo info, StreamingContext context)\r
-               {\r
-                       string s = info.GetValue ("XmlDiffGram", typeof (String)) as String;\r
-                       XmlTextReader reader = new XmlTextReader (new StringReader (s));\r
-                       ReadXml (reader, XmlReadMode.DiffGram);\r
-                       reader.Close ();\r
-               }\r
-\r
-\r
-               protected virtual System.Xml.Schema.XmlSchema GetSchemaSerializable ()\r
-               {\r
-                       return null;\r
-               }\r
-\r
-               protected virtual void ReadXmlSerializable (XmlReader reader)\r
-               {\r
-                       ReadXml (reader, XmlReadMode.DiffGram);\r
-               }\r
-\r
-               void IXmlSerializable.ReadXml (XmlReader reader)\r
-               {\r
-                       ReadXmlSerializable(reader);\r
-               }\r
-\r
-               void IXmlSerializable.WriteXml (XmlWriter writer)\r
-               {\r
-                       DoWriteXmlSchema (writer);\r
-                       WriteXml (writer, XmlWriteMode.DiffGram);\r
-               }\r
-\r
-               XmlSchema IXmlSerializable.GetSchema ()\r
-               {\r
-                       if (GetType() == typeof(DataSet))\r
-                               return null;\r
-                       MemoryStream stream = new MemoryStream();\r
-                       XmlTextWriter writer = new XmlTextWriter(stream, null);\r
-                       WriteXmlSchema(writer);\r
-                       stream.Position = 0;\r
-                       return XmlSchema.Read(new XmlTextReader(stream), (ValidationEventHandler)null);\r
-               }\r
-\r
-               protected virtual bool ShouldSerializeRelations ()\r
-               {\r
-                       return true;\r
-               }\r
-\r
-               protected virtual bool ShouldSerializeTables ()\r
-               {\r
-                       return true;\r
-               }\r
-\r
-               [MonoTODO]\r
-               protected internal virtual void OnPropertyChanging (PropertyChangedEventArgs pcevent)\r
-               {\r
-                       throw new NotImplementedException ();\r
-               }\r
-\r
-               [MonoTODO]\r
-               protected virtual void OnRemoveRelation (DataRelation relation)\r
-               {\r
-                       throw new NotImplementedException ();\r
-               }\r
-\r
-               [MonoTODO]\r
-               protected virtual void OnRemoveTable (DataTable table)\r
-               {\r
-                       throw new NotImplementedException ();\r
-               }\r
-\r
-               internal virtual void OnMergeFailed (MergeFailedEventArgs e)\r
-               {\r
-                       if (MergeFailed != null)\r
-                               MergeFailed (this, e);\r
-                       else\r
-                               throw new DataException (e.Conflict);\r
-               }\r
-\r
-               [MonoTODO]\r
-               protected internal void RaisePropertyChanging (string name)\r
-               {\r
-               }\r
-\r
-               #endregion\r
-\r
-               #region Private Methods\r
-\r
-               internal static string WriteObjectXml (object o)\r
-               {\r
-                       switch (Type.GetTypeCode (o.GetType ())) {\r
-                               case TypeCode.Boolean:\r
-                                       return XmlConvert.ToString ((Boolean) o);\r
-                               case TypeCode.Byte:\r
-                                       return XmlConvert.ToString ((Byte) o);\r
-                               case TypeCode.Char:\r
-                                       return XmlConvert.ToString ((Char) o);\r
-                               case TypeCode.DateTime:\r
-                                       return XmlConvert.ToString ((DateTime) o, XmlDateTimeSerializationMode.Unspecified);\r
-                               case TypeCode.Decimal:\r
-                                       return XmlConvert.ToString ((Decimal) o);\r
-                               case TypeCode.Double:\r
-                                       return XmlConvert.ToString ((Double) o);\r
-                               case TypeCode.Int16:\r
-                                       return XmlConvert.ToString ((Int16) o);\r
-                               case TypeCode.Int32:\r
-                                       return XmlConvert.ToString ((Int32) o);\r
-                               case TypeCode.Int64:\r
-                                       return XmlConvert.ToString ((Int64) o);\r
-                               case TypeCode.SByte:\r
-                                       return XmlConvert.ToString ((SByte) o);\r
-                               case TypeCode.Single:\r
-                                       return XmlConvert.ToString ((Single) o);\r
-                               case TypeCode.UInt16:\r
-                                       return XmlConvert.ToString ((UInt16) o);\r
-                               case TypeCode.UInt32:\r
-                                       return XmlConvert.ToString ((UInt32) o);\r
-                               case TypeCode.UInt64:\r
-                                       return XmlConvert.ToString ((UInt64) o);\r
-                       }\r
-                       if (o is TimeSpan) return XmlConvert.ToString ((TimeSpan) o);\r
-                       if (o is Guid) return XmlConvert.ToString ((Guid) o);\r
-                       if (o is byte[]) return Convert.ToBase64String ((byte[])o);\r
-\r
-                       return o.ToString ();\r
-               }\r
-\r
-               private void WriteTables (XmlWriter writer, XmlWriteMode mode, DataTableCollection tableCollection, DataRowVersion version)\r
-               {\r
-                       //WriteTable takes care of skipping a table if it has a\r
-                       //Nested Parent Relationship\r
-                       foreach (DataTable table in tableCollection)\r
-                               WriteTable ( writer, table, mode, version);\r
-               }\r
-\r
-               internal static void WriteTable (XmlWriter writer, DataTable table, XmlWriteMode mode, DataRowVersion version)\r
-               {\r
-                       DataRow[] rows = table.NewRowArray(table.Rows.Count);\r
-                       table.Rows.CopyTo (rows, 0);\r
-                       WriteTable (writer, rows, mode, version, true);\r
-               }\r
-\r
-               internal static void WriteTable (XmlWriter writer,\r
-                       DataRow [] rows,\r
-                       XmlWriteMode mode,\r
-                       DataRowVersion version, bool skipIfNested)\r
-               {\r
-                       if (rows.Length == 0) return;\r
-                       DataTable table = rows[0].Table;\r
-\r
-                       if (table.TableName == null || table.TableName == "")\r
-                               throw new InvalidOperationException("Cannot serialize the DataTable. DataTable name is not set.");\r
-\r
-                       //The columns can be attributes, hidden, elements, or simple content\r
-                       //There can be 0-1 simple content cols or 0-* elements\r
-                       System.Collections.ArrayList atts;\r
-                       System.Collections.ArrayList elements;\r
-                       DataColumn simple = null;\r
-\r
-                       SplitColumns (table, out atts, out elements, out simple);\r
-                       //sort out the namespacing\r
-\r
-                       foreach (DataRow row in rows) {\r
-                               if (skipIfNested) {\r
-                                       // Skip rows that is a child of any tables.\r
-                                       bool skip = false;\r
-                                       for (int i = 0; i < table.ParentRelations.Count; i++) {\r
-                                               DataRelation prel = table.ParentRelations [i];\r
-                                               if (!prel.Nested)\r
-                                                       continue;\r
-                                               if (row.GetParentRow (prel) != null) {\r
-                                                       skip = true;\r
-                                                       continue;\r
-                                               }\r
-                                       }\r
-                                       if (skip)\r
-                                               continue;\r
-                               }\r
-\r
-                               if (!row.HasVersion(version) ||\r
-                                  (mode == XmlWriteMode.DiffGram && row.RowState == DataRowState.Unchanged\r
-                                     && version == DataRowVersion.Original))\r
-                                       continue;\r
-\r
-                               // First check are all the rows null. If they are we just write empty element\r
-                               bool AllNulls = true;\r
-                               foreach (DataColumn dc in table.Columns) {\r
-                                       if (row [dc.ColumnName, version] != DBNull.Value) {\r
-                                               AllNulls = false;\r
-                                               break;\r
-                                       }\r
-                               }\r
-\r
-                               // If all of the columns were null, we have to write empty element\r
-                               if (AllNulls) {\r
-                                       writer.WriteElementString (XmlHelper.Encode (table.TableName), "");\r
-                                       continue;\r
-                               }\r
-\r
-                               WriteTableElement (writer, mode, table, row, version);\r
-\r
-                               foreach (DataColumn col in atts)\r
-                                       WriteColumnAsAttribute (writer, mode, col, row, version);\r
-\r
-                               if (simple != null) {\r
-                                       writer.WriteString (WriteObjectXml (row[simple, version]));\r
-                               } else {\r
-                                       foreach (DataColumn col in elements)\r
-                                               WriteColumnAsElement (writer, mode, col, row, version);\r
-                               }\r
-\r
-                               foreach (DataRelation relation in table.ChildRelations) {\r
-                                       if (relation.Nested)\r
-                                               WriteTable (writer, row.GetChildRows (relation), mode, version, false);\r
-                               }\r
-\r
-                               writer.WriteEndElement ();\r
-                       }\r
-\r
-               }\r
-\r
-               internal static void WriteColumnAsElement (XmlWriter writer, XmlWriteMode mode, DataColumn col, DataRow row, DataRowVersion version)\r
-               {\r
-                       string colnspc = null;\r
-                       object rowObject = row [col, version];\r
-\r
-                       if (rowObject == null || rowObject == DBNull.Value)\r
-                               return;\r
-\r
-                       if (col.Namespace != String.Empty)\r
-                               colnspc = col.Namespace;\r
-\r
-                       //TODO check if I can get away with write element string\r
-                       WriteStartElement (writer, mode, colnspc, col.Prefix, XmlHelper.Encode (col.ColumnName));       \r
-                       if (typeof (IXmlSerializable).IsAssignableFrom (col.DataType) \r
-                           || col.DataType == typeof (object)) {\r
-                               IXmlSerializable serializableObj = rowObject as IXmlSerializable;\r
-                               if (serializableObj == null)\r
-                                       throw new InvalidOperationException ();\r
-                               ((IXmlSerializable)rowObject).WriteXml (writer);                                \r
-                       } else {\r
-                               writer.WriteString (WriteObjectXml (rowObject));\r
-                       }\r
-\r
-                       writer.WriteEndElement ();\r
-               }\r
-\r
-               internal static void WriteColumnAsAttribute (XmlWriter writer, XmlWriteMode mode, DataColumn col, DataRow row, DataRowVersion version)\r
-               {\r
-                       if (!row.IsNull (col))\r
-                               WriteAttributeString (writer, mode, col.Namespace, col.Prefix, XmlHelper.Encode (col.ColumnName), WriteObjectXml (row[col, version]));\r
-               }\r
-\r
-               internal static void WriteTableElement (XmlWriter writer, XmlWriteMode mode, DataTable table, DataRow row, DataRowVersion version)\r
-               {\r
-                       //sort out the namespacing\r
-                       string nspc = (table.Namespace.Length > 0 || table.DataSet == null) ? table.Namespace : table.DataSet.Namespace;\r
-\r
-                       WriteStartElement (writer, mode, nspc, table.Prefix, XmlHelper.Encode (table.TableName));\r
-\r
-                       if (mode == XmlWriteMode.DiffGram) {\r
-                               WriteAttributeString (writer, mode, XmlConstants.DiffgrNamespace, XmlConstants.DiffgrPrefix, "id", table.TableName + (row.XmlRowID + 1));\r
-                               WriteAttributeString (writer, mode, XmlConstants.MsdataNamespace, XmlConstants.MsdataPrefix, "rowOrder", XmlConvert.ToString (row.XmlRowID));\r
-                               string modeName = null;\r
-                               if (row.RowState == DataRowState.Modified)\r
-                                       modeName = "modified";\r
-                               else if (row.RowState == DataRowState.Added)\r
-                                       modeName = "inserted";\r
-\r
-                               if (version != DataRowVersion.Original && modeName != null)\r
-                                       WriteAttributeString (writer, mode, XmlConstants.DiffgrNamespace, XmlConstants.DiffgrPrefix, "hasChanges", modeName);\r
-                       }\r
-               }\r
-\r
-               internal static void WriteStartElement (XmlWriter writer, XmlWriteMode mode, string nspc, string prefix, string name)\r
-               {\r
-                       writer.WriteStartElement (prefix, name, nspc);\r
-               }\r
-\r
-               internal static void WriteAttributeString (XmlWriter writer, XmlWriteMode mode, string nspc, string prefix, string name, string stringValue)\r
-               {\r
-                       switch ( mode) {\r
-                       //      case XmlWriteMode.WriteSchema:\r
-                       //              writer.WriteAttributeString (prefix, name, nspc);\r
-                       //              break;\r
-                               case XmlWriteMode.DiffGram:\r
-                                       writer.WriteAttributeString (prefix, name, nspc,stringValue);\r
-                                       break;\r
-                               default:\r
-                                       writer.WriteAttributeString (name, stringValue);\r
-                                       break;\r
-                       };\r
-               }\r
-\r
-               internal void WriteIndividualTableContent (XmlWriter writer, DataTable table, XmlWriteMode mode)\r
-               {\r
-                       if (mode == XmlWriteMode.DiffGram) {\r
-                               table.SetRowsID ();\r
-                               WriteDiffGramElement (writer);\r
-                       }\r
-\r
-                       WriteStartElement (writer, mode, Namespace, Prefix, XmlHelper.Encode (DataSetName));\r
-\r
-                       WriteTable (writer, table, mode, DataRowVersion.Default);\r
-\r
-                       if (mode == XmlWriteMode.DiffGram) {\r
-                               writer.WriteEndElement (); //DataSet name\r
-                               if (HasChanges (DataRowState.Modified | DataRowState.Deleted)) {\r
-\r
-                                       DataSet beforeDS = GetChanges (DataRowState.Modified | DataRowState.Deleted);\r
-                                       WriteStartElement (writer, XmlWriteMode.DiffGram, XmlConstants.DiffgrNamespace, XmlConstants.DiffgrPrefix, "before");\r
-                                       WriteTable (writer, beforeDS.Tables [table.TableName], mode, DataRowVersion.Original);\r
-                                       writer.WriteEndElement ();\r
-                               }\r
-                       }\r
-                       writer.WriteEndElement (); // DataSet name or diffgr:diffgram\r
-               }\r
-\r
-               private void DoWriteXmlSchema (XmlWriter writer)\r
-               {\r
-                       if (writer.WriteState == WriteState.Start)\r
-                               writer.WriteStartDocument ();\r
-                       XmlSchemaWriter.WriteXmlSchema (this, writer);\r
-               }\r
-\r
-               ///<summary>\r
-               /// Helper function to split columns into attributes elements and simple\r
-               /// content\r
-               /// </summary>\r
-               internal static void SplitColumns (DataTable table,\r
-                       out ArrayList atts,\r
-                       out ArrayList elements,\r
-                       out DataColumn simple)\r
-               {\r
-                       //The columns can be attributes, hidden, elements, or simple content\r
-                       //There can be 0-1 simple content cols or 0-* elements\r
-                       atts = new System.Collections.ArrayList ();\r
-                       elements = new System.Collections.ArrayList ();\r
-                       simple = null;\r
-\r
-                       //Sort out the columns\r
-                       foreach (DataColumn col in table.Columns) {\r
-                               switch (col.ColumnMapping) {\r
-                                       case MappingType.Attribute:\r
-                                               atts.Add (col);\r
-                                               break;\r
-                                       case MappingType.Element:\r
-                                               elements.Add (col);\r
-                                               break;\r
-                                       case MappingType.SimpleContent:\r
-                                               if (simple != null) {\r
-                                                       throw new System.InvalidOperationException ("There may only be one simple content element");\r
-                                               }\r
-                                               simple = col;\r
-                                               break;\r
-                                       default:\r
-                                               //ignore Hidden elements\r
-                                               break;\r
-                               }\r
-                       }\r
-               }\r
-\r
-               internal static void WriteDiffGramElement (XmlWriter writer)\r
-               {\r
-                       WriteStartElement (writer, XmlWriteMode.DiffGram, XmlConstants.DiffgrNamespace, XmlConstants.DiffgrPrefix, "diffgram");\r
-                       WriteAttributeString (writer, XmlWriteMode.DiffGram, null, "xmlns", XmlConstants.MsdataPrefix, XmlConstants.MsdataNamespace);\r
-               }\r
-\r
-               private void SetRowsID ()\r
-               {\r
-                       foreach (DataTable table in Tables)\r
-                               table.SetRowsID ();\r
-               }\r
-\r
-               #endregion //Private Xml Serialisation\r
-       }\r
-\r
-       [XmlSchemaProvider ("GetDataSetSchema")]\r
-       [XmlRoot ("DataSet")]\r
-       partial class DataSet : ISupportInitializeNotification {\r
-               private bool dataSetInitialized = true;\r
-               public event EventHandler Initialized;\r
-\r
-               protected DataSet (SerializationInfo info, StreamingContext context, bool ConstructSchema)\r
-                       : this ()\r
-               {\r
-                       if (DetermineSchemaSerializationMode (info, context) == SchemaSerializationMode.ExcludeSchema) {\r
-                               InitializeDerivedDataSet ();\r
-                       }\r
-                       \r
-                       if (IsBinarySerialized (info, context)) {\r
-                               BinaryDeserialize (info);\r
-                               return;\r
-                       }\r
-                       \r
-                       if (ConstructSchema) {\r
-                               string s = info.GetValue ("XmlSchema", typeof (String)) as String;\r
-                               XmlTextReader reader = new XmlTextReader (new StringReader (s));\r
-                               ReadXmlSchema (reader);\r
-                               reader.Close ();\r
-                               \r
-                               GetSerializationData (info, context);\r
-                       }\r
-               }\r
-\r
-               SerializationFormat remotingFormat = SerializationFormat.Xml;\r
-               [DefaultValue (SerializationFormat.Xml)]\r
-               public SerializationFormat RemotingFormat {\r
-                       get { return remotingFormat; }\r
-                       set { remotingFormat = value; }\r
-               }\r
-\r
-               [Browsable (false)]\r
-               public bool IsInitialized {\r
-                       get { return dataSetInitialized; }\r
-               }\r
-\r
-               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]\r
-               [Browsable (false)]\r
-               public virtual SchemaSerializationMode SchemaSerializationMode {\r
-                       get { return SchemaSerializationMode.IncludeSchema; }\r
-                       set {\r
-                               if (value != SchemaSerializationMode.IncludeSchema)\r
-                                       throw new InvalidOperationException (\r
-                                                       "Only IncludeSchema Mode can be set for Untyped DataSet");\r
-                       }\r
-               }\r
-\r
-               public DataTableReader CreateDataReader (params DataTable[] dataTables)\r
-               {\r
-                       return new DataTableReader (dataTables);\r
-               }\r
-\r
-               public DataTableReader CreateDataReader ()\r
-               {\r
-                       return new DataTableReader ((DataTable[])Tables.ToArray (typeof (DataTable)));\r
-               }\r
-\r
-               public static XmlSchemaComplexType GetDataSetSchema (XmlSchemaSet schemaSet)\r
-               {\r
-                       return new XmlSchemaComplexType ();\r
-               }\r
-\r
-               public void Load (IDataReader reader, LoadOption loadOption, params DataTable[] tables)\r
-               {\r
-                       if (reader == null)\r
-                               throw new ArgumentNullException ("Value cannot be null. Parameter name: reader");\r
-\r
-                       foreach (DataTable dt in tables) {\r
-                               if (dt.DataSet == null || dt.DataSet != this)\r
-                                       throw new ArgumentException ("Table " + dt.TableName + " does not belong to this DataSet.");\r
-                               dt.Load (reader, loadOption);\r
-                               reader.NextResult ();\r
-                       }\r
-               }\r
-\r
-               public void Load (IDataReader reader, LoadOption loadOption, params string[] tables)\r
-               {\r
-                       if (reader == null)\r
-                               throw new ArgumentNullException ("Value cannot be null. Parameter name: reader");\r
-\r
-                       foreach (string tableName in tables) {\r
-                               DataTable dt = Tables [tableName];\r
-\r
-                               if (dt == null) {\r
-                                       dt = new DataTable (tableName);\r
-                                       Tables.Add (dt);\r
-                               }\r
-                               dt.Load (reader, loadOption);\r
-                               reader.NextResult ();\r
-                       }\r
-               }\r
-\r
-               public virtual void Load (IDataReader reader, LoadOption loadOption,\r
-                                         FillErrorEventHandler errorHandler, params DataTable[] tables)\r
-               {\r
-                       if (reader == null)\r
-                               throw new ArgumentNullException ("Value cannot be null. Parameter name: reader");\r
-\r
-                       foreach (DataTable dt in tables) {\r
-                               if (dt.DataSet == null || dt.DataSet != this)\r
-                                       throw new ArgumentException ("Table " + dt.TableName + " does not belong to this DataSet.");\r
-                               dt.Load (reader, loadOption, errorHandler);\r
-                               reader.NextResult ();\r
-                       }\r
-               }\r
-\r
-               void BinarySerialize (SerializationInfo si)\r
-               {\r
-                       Version vr = new Version(2, 0);\r
-                       si.AddValue ("DataSet.RemotingVersion", vr, typeof (Version));\r
-                       si.AddValue ("DataSet.RemotingFormat", RemotingFormat, typeof (SerializationFormat));\r
-                       si.AddValue ("DataSet.DataSetName", DataSetName);\r
-                       si.AddValue ("DataSet.Namespace", Namespace);\r
-                       si.AddValue ("DataSet.Prefix", Prefix);\r
-                       si.AddValue ("DataSet.CaseSensitive", CaseSensitive);\r
-                       si.AddValue ("DataSet.LocaleLCID", Locale.LCID);\r
-                       si.AddValue ("DataSet.EnforceConstraints", EnforceConstraints);\r
-                       si.AddValue ("DataSet.ExtendedProperties", properties, typeof (PropertyCollection));\r
-\r
-                       Tables.BinarySerialize_Schema (si);\r
-                       Tables.BinarySerialize_Data (si);\r
-\r
-                       Relations.BinarySerialize (si);\r
-               }\r
-\r
-               void BinaryDeserialize (SerializationInfo info)\r
-               {\r
-                       ArrayList arrayList = null;\r
-\r
-                       DataSetName = info.GetString ("DataSet.DataSetName");\r
-                       Namespace = info.GetString ("DataSet.Namespace");\r
-                       CaseSensitive = info.GetBoolean ("DataSet.CaseSensitive");\r
-                       Locale = new CultureInfo (info.GetInt32 ("DataSet.LocaleLCID"));\r
-                       EnforceConstraints = info.GetBoolean ("DataSet.EnforceConstraints");\r
-                       Prefix = info.GetString ("DataSet.Prefix");\r
-                       /*\r
-                         FIXME: Private variable available in SerializationInfo\r
-                         this.RemotingVersion = (System.Version) info.GetValue("DataSet.RemotingVersion",\r
-                         typeof(System.Version));\r
-                       */\r
-                       properties = (PropertyCollection) info.GetValue ("DataSet.ExtendedProperties",\r
-                                                                        typeof (PropertyCollection));\r
-                       int tableCount = info.GetInt32 ("DataSet.Tables.Count");\r
-\r
-                       Byte [] bytes;\r
-                       DataTable dt = null;\r
-                       for (int i = 0; i < tableCount; i++) {\r
-                               bytes = (Byte []) info.GetValue ("DataSet.Tables_" + i,\r
-                                                                typeof (Byte[]));\r
-                               MemoryStream ms = new MemoryStream (bytes);\r
-                               BinaryFormatter bf = new BinaryFormatter ();\r
-                               dt = (DataTable) bf.Deserialize (ms);\r
-                               ms.Close ();\r
-                               for (int j = 0; j < dt.Columns.Count; j++) {\r
-                                       dt.Columns[j].Expression = info.GetString ("DataTable_" + i +\r
-                                                                                  ".DataColumn_" + j +\r
-                                                                                  ".Expression");\r
-                               }\r
-                               /*\r
-                                 Not using\r
-                                 int rowsCount = info.GetInt32 ("DataTable_" + i + ".Rows.Count");\r
-                                 int recordsCount = info.GetInt32 ("DataTable_" + i + ".Records.Count");\r
-                               */\r
-                               ArrayList nullBits = (ArrayList) info.GetValue ("DataTable_" + i + ".NullBits",\r
-                                                                               typeof (ArrayList));\r
-                               arrayList = (ArrayList) info.GetValue ("DataTable_" + i + ".Records",\r
-                                                                      typeof (ArrayList));\r
-                               BitArray rowStateBitArray = (BitArray) info.GetValue ("DataTable_" + i + ".RowStates",\r
-                                                                                     typeof (BitArray));\r
-                               dt.DeserializeRecords (arrayList, nullBits, rowStateBitArray);\r
-                               Tables.Add (dt);\r
-                       }\r
-                       for (int i = 0; i < tableCount; i++) {\r
-                               dt = Tables [i];\r
-                               dt.dataSet = this;\r
-                               arrayList = (ArrayList) info.GetValue ("DataTable_" + i + ".Constraints",\r
-                                                                      typeof (ArrayList));\r
-                               if (dt.Constraints == null)\r
-                                       dt.Constraints = new ConstraintCollection (dt);\r
-                               dt.DeserializeConstraints (arrayList);\r
-                       }\r
-                       arrayList = (ArrayList) info.GetValue ("DataSet.Relations",\r
-                                                              typeof (ArrayList));\r
-                       bool bParentColumn = true;\r
-                       for (int l = 0; l < arrayList.Count; l++) {\r
-                               ArrayList tmpArrayList = (ArrayList) arrayList[l];\r
-                               ArrayList childColumns = new ArrayList ();\r
-                               ArrayList parentColumns = new ArrayList ();\r
-                               for (int k = 0; k < tmpArrayList.Count; k++) {\r
-                                       if (tmpArrayList[k] != null && typeof (int) == tmpArrayList[k].GetType().GetElementType()) {\r
-                                               Array dataColumnArray = (Array)tmpArrayList[k];\r
-                                               if (bParentColumn) {\r
-                                                       parentColumns.Add (Tables [(int) dataColumnArray.GetValue (0)].\r
-                                                                          Columns [(int) dataColumnArray.GetValue (1)]);\r
-                                                       bParentColumn = false;\r
-                                               }\r
-                                               else {\r
-                                                       childColumns.Add (Tables [(int) dataColumnArray.GetValue (0)].\r
-                                                                         Columns [(int) dataColumnArray.GetValue (1)]);\r
-                                                       bParentColumn = true;\r
-                                               }\r
-                                       }\r
-                               }\r
-                               Relations.Add ((string) tmpArrayList [0],\r
-                                              (DataColumn []) parentColumns.ToArray (typeof (DataColumn)),\r
-                                              (DataColumn []) childColumns.ToArray (typeof (DataColumn)),\r
-                                              false);\r
-                       }\r
-               }\r
-\r
-               private void OnDataSetInitialized (EventArgs e)\r
-               {\r
-                       if (null != Initialized)\r
-                               Initialized (this, e);\r
-               }\r
-\r
-               private void DataSetInitialized ()\r
-               {\r
-                       EventArgs e = new EventArgs ();\r
-                       OnDataSetInitialized (e);\r
-               }\r
-\r
-               protected virtual void InitializeDerivedDataSet ()\r
-               {\r
-               }\r
-\r
-               protected SchemaSerializationMode DetermineSchemaSerializationMode (XmlReader reader)\r
-               {\r
-                       return SchemaSerializationMode.IncludeSchema;\r
-               }\r
-\r
-               protected SchemaSerializationMode DetermineSchemaSerializationMode (SerializationInfo info, StreamingContext context)\r
-               {\r
-                       SerializationInfoEnumerator e = info.GetEnumerator ();\r
-                       while (e.MoveNext ()) {\r
-                               if (e.Name == "SchemaSerializationMode.DataSet") {\r
-                                       return (SchemaSerializationMode) e.Value;\r
-                               }\r
-                       }\r
-                       \r
-                       return SchemaSerializationMode.IncludeSchema;\r
-               }\r
-\r
-               protected bool IsBinarySerialized (SerializationInfo info, StreamingContext context)\r
-               {\r
-                       SerializationInfoEnumerator e = info.GetEnumerator ();\r
-                       while (e.MoveNext ()) {\r
-                               if (e.ObjectType == typeof (System.Data.SerializationFormat))\r
-                                       return true;\r
-                       }\r
-                       return false;\r
-               }\r
-       }\r
-}\r
diff --git a/mcs/class/System.Data/System.Data/DataSetDateTime.cs b/mcs/class/System.Data/System.Data/DataSetDateTime.cs
deleted file mode 100644 (file)
index 7e33554..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-// System.Data.DataColumnChangeEventHandler.cs
-//
-// Author:
-//   Senganal T <tsenganal@novell.com>
-//
-//
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-// Copyright (C) Authors.
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace System.Data
-{
-       public enum DataSetDateTime 
-       {
-               Local = 1,
-               Unspecified = 2,
-               UnspecifiedLocal = 3,
-               Utc = 4
-       }
-}
diff --git a/mcs/class/System.Data/System.Data/DataSysDescriptionAttribute.cs b/mcs/class/System.Data/System.Data/DataSysDescriptionAttribute.cs
deleted file mode 100644 (file)
index f3a3c15..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-// 
-// System.Data/DataSysDescriptionAttribute.cs
-//
-// Author:
-//   Tim Coleman (tim@timcoleman.com)
-//
-// Copyright (C) Tim Coleman, 2002
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.ComponentModel;
-
-namespace System.Data {
-       [Obsolete ("DataSysDescriptionAttribute has been deprecated")]
-       [AttributeUsage (AttributeTargets.All)]
-       public class DataSysDescriptionAttribute : DescriptionAttribute
-       {
-               #region Fields
-
-               string description;
-
-               #endregion // Fields
-
-               #region Constructors
-
-               [Obsolete ("DataSysDescriptionAttribute has been deprecated")]
-               public DataSysDescriptionAttribute (string description)
-                       : base (description)
-               {
-                       this.description = description; 
-               }
-
-               #endregion // Constructors
-
-               #region Properties
-
-               public override string Description {
-                       get { return description; }
-               }
-
-               #endregion // Properties
-       }
-}
diff --git a/mcs/class/System.Data/System.Data/DataTable.cs b/mcs/class/System.Data/System.Data/DataTable.cs
deleted file mode 100644 (file)
index ca2d999..0000000
+++ /dev/null
@@ -1,2942 +0,0 @@
-//\r
-// System.Data.DataTable.cs\r
-//\r
-// Author:\r
-//   Franklin Wise <gracenote@earthlink.net>\r
-//   Christopher Podurgiel (cpodurgiel@msn.com)\r
-//   Daniel Morgan <danmorg@sc.rr.com>\r
-//   Rodrigo Moya <rodrigo@ximian.com>\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//   Ville Palo <vi64pa@koti.soon.fi>\r
-//   Sureshkumar T <tsureshkumar@novell.com>\r
-//   Konstantin Triger <kostat@mainsoft.com>\r
-//\r
-// (C) Chris Podurgiel\r
-// (C) Ximian, Inc 2002\r
-// Copyright (C) Tim Coleman, 2002-2003\r
-// Copyright (C) Daniel Morgan, 2002-2003\r
-//\r
-\r
-//\r
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)\r
-//\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-//\r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-//\r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
-//\r
-\r
-using System;\r
-using System.Data.Common;\r
-using System.Collections;\r
-using System.Collections.Generic;\r
-using System.ComponentModel;\r
-using System.Globalization;\r
-using System.IO;\r
-using System.Runtime.Serialization;\r
-using System.Xml;\r
-using System.Xml.Schema;\r
-using System.Xml.Serialization;\r
-using System.Text.RegularExpressions;\r
-using Mono.Data.SqlExpressions;\r
-\r
-namespace System.Data {\r
-       //[Designer]\r
-       [ToolboxItem (false)]\r
-       [DefaultEvent ("RowChanging")]\r
-       [DefaultProperty ("TableName")]\r
-       [DesignTimeVisible (false)]\r
-       [EditorAttribute ("Microsoft.VSDesigner.Data.Design.DataTableEditor, "+ Consts.AssemblyMicrosoft_VSDesigner, "System.Drawing.Design.UITypeEditor, "+ Consts.AssemblySystem_Drawing )]\r
-       [Serializable]\r
-       public partial class DataTable : MarshalByValueComponent, IListSource, ISupportInitialize, ISerializable {\r
-               #region Fields\r
-\r
-               internal DataSet dataSet;\r
-\r
-               private bool _caseSensitive;\r
-               private DataColumnCollection _columnCollection;\r
-               private ConstraintCollection _constraintCollection;\r
-               // never access it. Use DefaultView.\r
-               private DataView _defaultView = null;\r
-\r
-               private string _displayExpression;\r
-               private PropertyCollection _extendedProperties;\r
-               private CultureInfo _locale;\r
-               private int _minimumCapacity;\r
-               private string _nameSpace;\r
-               private DataRelationCollection _childRelations;\r
-               private DataRelationCollection _parentRelations;\r
-               private string _prefix;\r
-               private UniqueConstraint _primaryKeyConstraint;\r
-               private DataRowCollection _rows;\r
-               private ISite _site;\r
-               private string _tableName;\r
-               internal bool _duringDataLoad;\r
-               internal bool _nullConstraintViolationDuringDataLoad;\r
-               private bool dataSetPrevEnforceConstraints;\r
-               private bool enforceConstraints = true;\r
-               private DataRowBuilder _rowBuilder;\r
-               private ArrayList _indexes;\r
-               private RecordCache _recordCache;\r
-               private int _defaultValuesRowIndex = -1;\r
-               protected internal bool fInitInProgress;\r
-\r
-               // If CaseSensitive property is changed once it does not anymore follow owner DataSet's\r
-               // CaseSensitive property. So when you lost you virginity it's gone for ever\r
-               private bool _virginCaseSensitive = true;\r
-\r
-               private PropertyDescriptorCollection _propertyDescriptorsCache;\r
-               static DataColumn[] _emptyColumnArray = new DataColumn[0];\r
-\r
-               // Regex to parse the Sort string.\r
-               static Regex SortRegex = new Regex ( @"^((\[(?<ColName>.+)\])|(?<ColName>\S+))([ ]+(?<Order>ASC|DESC))?$",\r
-                                                       RegexOptions.IgnoreCase|RegexOptions.ExplicitCapture);\r
-\r
-\r
-               DataColumn [] _latestPrimaryKeyCols;\r
-               #endregion //Fields\r
-\r
-               /// <summary>\r
-               /// Initializes a new instance of the DataTable class with no arguments.\r
-               /// </summary>\r
-               public DataTable ()\r
-               {\r
-                       dataSet = null;\r
-                       _columnCollection = new DataColumnCollection(this);\r
-                       _constraintCollection = new ConstraintCollection(this);\r
-                       _extendedProperties = new PropertyCollection();\r
-                       _tableName = "";\r
-                       _nameSpace = null;\r
-                       _caseSensitive = false;         //default value\r
-                       _displayExpression = null;\r
-                       _primaryKeyConstraint = null;\r
-                       _site = null;\r
-                       _rows = new DataRowCollection (this);\r
-                       _indexes = new ArrayList();\r
-                       _recordCache = new RecordCache(this);\r
-\r
-                       //LAMESPEC: spec says 25 impl does 50\r
-                       _minimumCapacity = 50;\r
-\r
-                       _childRelations = new DataRelationCollection.DataTableRelationCollection (this);\r
-                       _parentRelations = new DataRelationCollection.DataTableRelationCollection (this);\r
-               }\r
-\r
-               /// <summary>\r
-               /// Intitalizes a new instance of the DataTable class with the specified table name.\r
-               /// </summary>\r
-               public DataTable (string tableName)\r
-                       : this ()\r
-               {\r
-                       _tableName = tableName;\r
-               }\r
-\r
-               /// <summary>\r
-               /// Initializes a new instance of the DataTable class with the SerializationInfo and the StreamingContext.\r
-               /// </summary>\r
-               protected DataTable (SerializationInfo info, StreamingContext context)\r
-                       : this ()\r
-               {\r
-                       SerializationInfoEnumerator e = info.GetEnumerator ();\r
-                       SerializationFormat serializationFormat = SerializationFormat.Xml;\r
-\r
-                       while (e.MoveNext()) {\r
-                               if (e.ObjectType == typeof(System.Data.SerializationFormat)) {\r
-                                       serializationFormat = (SerializationFormat) e.Value;\r
-                                       break;\r
-                               }\r
-                       }\r
-                       if (serializationFormat == SerializationFormat.Xml) {\r
-                               string schema = info.GetString ("XmlSchema");\r
-                               string data = info.GetString ("XmlDiffGram");\r
-\r
-                               DataSet ds = new DataSet ();\r
-                               ds.ReadXmlSchema (new StringReader (schema));\r
-                               ds.Tables [0].CopyProperties (this);\r
-                               ds = new DataSet ();\r
-                               ds.Tables.Add (this);\r
-                               ds.ReadXml (new StringReader (data), XmlReadMode.DiffGram);\r
-                               ds.Tables.Remove (this);\r
-                               /* keeping for a while. With the change above, we shouldn't have to consider\r
-                                * DataTable mode in schema inference/read.\r
-                                XmlSchemaMapper mapper = new XmlSchemaMapper (this);\r
-                                XmlTextReader xtr = new XmlTextReader(new StringReader (schema));\r
-                                mapper.Read (xtr);\r
-\r
-                                XmlDiffLoader loader = new XmlDiffLoader (this);\r
-                                xtr = new XmlTextReader(new StringReader (data));\r
-                                loader.Load (xtr);\r
-                               */\r
-                       } else /*if (Tables.RemotingFormat == SerializationFormat.Binary)*/ {\r
-                               BinaryDeserializeTable (info);\r
-                       }\r
-               }\r
-\r
-               /// <summary>\r
-               /// Indicates whether string comparisons within the table are case-sensitive.\r
-               /// </summary>\r
-               public bool CaseSensitive {\r
-                       get {\r
-                               if (_virginCaseSensitive && dataSet != null)\r
-                                       return dataSet.CaseSensitive;\r
-                               else\r
-                                       return _caseSensitive;\r
-                               }\r
-                       set {\r
-                               if (_childRelations.Count > 0 || _parentRelations.Count > 0) {\r
-                                       throw new ArgumentException ("Cannot change CaseSensitive or Locale property. This change would lead to at least one DataRelation or Constraint to have different Locale or CaseSensitive settings between its related tables.");\r
-                               }\r
-                               _virginCaseSensitive = false;\r
-                               _caseSensitive = value;\r
-                               ResetCaseSensitiveIndexes();\r
-                       }\r
-               }\r
-\r
-               internal ArrayList Indexes {\r
-                       get { return _indexes; }\r
-               }\r
-\r
-               internal void ChangedDataColumn (DataRow dr, DataColumn dc, object pv)\r
-               {\r
-                       DataColumnChangeEventArgs e = new DataColumnChangeEventArgs (dr, dc, pv);\r
-                       OnColumnChanged (e);\r
-               }\r
-\r
-               internal void ChangingDataColumn (DataRow dr, DataColumn dc, object pv)\r
-               {\r
-                       DataColumnChangeEventArgs e = new DataColumnChangeEventArgs (dr, dc, pv);\r
-                       OnColumnChanging (e);\r
-               }\r
-\r
-               internal void DeletedDataRow (DataRow dr, DataRowAction action)\r
-               {\r
-                       DataRowChangeEventArgs e = new DataRowChangeEventArgs (dr, action);\r
-                       OnRowDeleted (e);\r
-               }\r
-\r
-               internal void DeletingDataRow (DataRow dr, DataRowAction action)\r
-               {\r
-                       DataRowChangeEventArgs e = new DataRowChangeEventArgs (dr, action);\r
-                       OnRowDeleting (e);\r
-               }\r
-\r
-               internal void ChangedDataRow (DataRow dr, DataRowAction action)\r
-               {\r
-                       DataRowChangeEventArgs e = new DataRowChangeEventArgs (dr, action);\r
-                       OnRowChanged (e);\r
-               }\r
-\r
-               internal void ChangingDataRow (DataRow dr, DataRowAction action)\r
-               {\r
-                       DataRowChangeEventArgs e = new DataRowChangeEventArgs (dr, action);\r
-                       OnRowChanging (e);\r
-               }\r
-               \r
-               /// <summary>\r
-               /// Gets the collection of child relations for this DataTable.\r
-               /// </summary>\r
-               [Browsable (false)]\r
-               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]\r
-               public DataRelationCollection ChildRelations {\r
-                       get { return _childRelations; }\r
-               }\r
-\r
-               /// <summary>\r
-               /// Gets the collection of columns that belong to this table.\r
-               /// </summary>\r
-               [DataCategory ("Data")]\r
-               [DesignerSerializationVisibility (DesignerSerializationVisibility.Content)]\r
-               public DataColumnCollection Columns {\r
-                       get { return _columnCollection; }\r
-               }\r
-\r
-               /// <summary>\r
-               /// Gets the collection of constraints maintained by this table.\r
-               /// </summary>\r
-               [DataCategory ("Data")]\r
-               [DesignerSerializationVisibility (DesignerSerializationVisibility.Content)]\r
-               public ConstraintCollection Constraints {\r
-                       get { return _constraintCollection; }\r
-                       internal set { _constraintCollection = value; }\r
-               }\r
-\r
-               /// <summary>\r
-               /// Gets the DataSet that this table belongs to.\r
-               /// </summary>\r
-               [Browsable (false)]\r
-               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]\r
-               public DataSet DataSet {\r
-                       get { return dataSet; }\r
-               }\r
-\r
-               /// <summary>\r
-               /// Gets a customized view of the table which may\r
-               /// include a filtered view, or a cursor position.\r
-               /// </summary>\r
-               [Browsable (false)]\r
-               public DataView DefaultView {\r
-                       get {\r
-                               if (_defaultView == null) {\r
-                                       lock(this){\r
-                                               if (_defaultView == null){\r
-                                                       if (dataSet != null)\r
-                                                               _defaultView = dataSet.DefaultViewManager.CreateDataView(this);\r
-                                                       else\r
-                                                               _defaultView = new DataView(this);\r
-                                               }\r
-                                       }\r
-                               }\r
-                               return _defaultView;\r
-                       }\r
-               }\r
-\r
-\r
-               /// <summary>\r
-               /// Gets or sets the expression that will return\r
-               /// a value used to represent this table in the user interface.\r
-               /// </summary>\r
-               [DataCategory ("Data")]\r
-               [DefaultValue ("")]\r
-               public string DisplayExpression {\r
-                       get { return _displayExpression == null ? "" : _displayExpression; }\r
-                       set { _displayExpression = value; }\r
-               }\r
-\r
-               /// <summary>\r
-               /// Gets the collection of customized user information.\r
-               /// </summary>\r
-               [Browsable (false)]\r
-               [DataCategory ("Data")]\r
-               public PropertyCollection ExtendedProperties {\r
-                       get { return _extendedProperties; }\r
-               }\r
-\r
-               /// <summary>\r
-               /// Gets a value indicating whether there are errors in\r
-               /// any of the_rows in any of the tables of the DataSet to\r
-               /// which the table belongs.\r
-               /// </summary>\r
-               [Browsable (false)]\r
-               public bool HasErrors {\r
-                       get {\r
-                               // we can not use the _hasError flag because we do not know when to turn it off!\r
-                               for (int i = 0; i < _rows.Count; i++) {\r
-                                       if (_rows[i].HasErrors)\r
-                                               return true;\r
-                               }\r
-                               return false;\r
-                       }\r
-               }\r
-\r
-               /// <summary>\r
-               /// Gets or sets the locale information used to\r
-               /// compare strings within the table.\r
-               /// </summary>\r
-               public CultureInfo Locale {\r
-                       get {\r
-                               // if the locale is null, we check for the DataSet locale\r
-                               // and if the DataSet is null we return the current culture.\r
-                               // this way if DataSet locale is changed, only if there is no locale for\r
-                               // the DataTable it influece the Locale get;\r
-                               if (_locale != null)\r
-                                       return _locale;\r
-                               if (DataSet != null)\r
-                                       return DataSet.Locale;\r
-                               return CultureInfo.CurrentCulture;\r
-                       }\r
-                       set {\r
-                               if (_childRelations.Count > 0 || _parentRelations.Count > 0) {\r
-                                       throw new ArgumentException ("Cannot change CaseSensitive or Locale property. This change would lead to at least one DataRelation or Constraint to have different Locale or CaseSensitive settings between its related tables.");\r
-                               }\r
-                               if (_locale == null || !_locale.Equals(value))\r
-                                       _locale = value;\r
-                       }\r
-               }\r
-\r
-               internal bool LocaleSpecified {\r
-                       get { return _locale != null; }\r
-               }\r
-\r
-               /// <summary>\r
-               /// Gets or sets the initial starting size for this table.\r
-               /// </summary>\r
-               [DataCategory ("Data")]\r
-               [DefaultValue (50)]\r
-               public int MinimumCapacity {\r
-                       get { return _minimumCapacity; }\r
-                       set { _minimumCapacity = value; }\r
-               }\r
-\r
-               /// <summary>\r
-               /// Gets or sets the namespace for the XML represenation\r
-               /// of the data stored in the DataTable.\r
-               /// </summary>\r
-               [DataCategory ("Data")]\r
-               public string Namespace {\r
-                       get {\r
-                               if (_nameSpace != null)\r
-                                       return _nameSpace;\r
-                               if (DataSet != null)\r
-                                       return DataSet.Namespace;\r
-                               return String.Empty;\r
-                       }\r
-                       set { _nameSpace = value; }\r
-               }\r
-\r
-               /// <summary>\r
-               /// Gets the collection of parent relations for\r
-               /// this DataTable.\r
-               /// </summary>\r
-               [Browsable (false)]\r
-               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]\r
-               public DataRelationCollection ParentRelations {\r
-                       get { return _parentRelations; }\r
-               }\r
-\r
-               /// <summary>\r
-               /// Gets or sets the namespace for the XML represenation\r
-               ///  of the data stored in the DataTable.\r
-               /// </summary>\r
-               [DataCategory ("Data")]\r
-               [DefaultValue ("")]\r
-               public string Prefix {\r
-                       get { return _prefix == null ? "" : _prefix; }\r
-                       set {\r
-                               // Prefix cannot contain any special characters other than '_' and ':'\r
-                               for (int i = 0; i < value.Length; i++) {\r
-                                       if (!(Char.IsLetterOrDigit (value [i])) && (value [i] != '_') && (value [i] != ':'))\r
-                                               throw new DataException ("Prefix '" + value + "' is not valid, because it contains special characters.");\r
-                               }\r
-                               _prefix = value;\r
-                       }\r
-               }\r
-\r
-               /// <summary>\r
-               /// Gets or sets an array of columns that function as\r
-               /// primary keys for the data table.\r
-               /// </summary>\r
-               [DataCategory ("Data")]\r
-               [EditorAttribute ("Microsoft.VSDesigner.Data.Design.PrimaryKeyEditor, "+ Consts.AssemblyMicrosoft_VSDesigner, "System.Drawing.Design.UITypeEditor, "+ Consts.AssemblySystem_Drawing )]\r
-               [TypeConverterAttribute ("System.Data.PrimaryKeyTypeConverter, " + Consts.AssemblySystem_Data)]\r
-               public DataColumn[] PrimaryKey {\r
-                       get {\r
-                               if (_primaryKeyConstraint == null)\r
-                                       return new DataColumn[] {};\r
-                               return _primaryKeyConstraint.Columns;\r
-                       }\r
-                       set {\r
-                               if (value == null || value.Length == 0) {\r
-                                       if (_primaryKeyConstraint != null) {\r
-                                               _primaryKeyConstraint.SetIsPrimaryKey (false);\r
-                                               Constraints.Remove(_primaryKeyConstraint);\r
-                                               _primaryKeyConstraint = null;\r
-                                       }\r
-                                       return;\r
-                               }\r
-\r
-                               if (InitInProgress) {\r
-                                       _latestPrimaryKeyCols = value;\r
-                                       return;\r
-                               }\r
-\r
-                               // first check if value is the same as current PK.\r
-                               if (_primaryKeyConstraint != null &&\r
-                                   DataColumn.AreColumnSetsTheSame (value, _primaryKeyConstraint.Columns))\r
-                                       return;\r
-\r
-                               //Does constraint exist for these columns\r
-                               UniqueConstraint uc = UniqueConstraint.GetUniqueConstraintForColumnSet (this.Constraints, (DataColumn[]) value);\r
-\r
-                               //if constraint doesn't exist for columns\r
-                               //create new unique primary key constraint\r
-                               if (null == uc) {\r
-                                       foreach (DataColumn Col in (DataColumn []) value) {\r
-                                               if (Col.Table == null)\r
-                                                       break;\r
-\r
-                                               if (Columns.IndexOf (Col) < 0)\r
-                                                       throw new ArgumentException ("PrimaryKey columns do not belong to this table.");\r
-                                       }\r
-                                       // create constraint with primary key indication set to false\r
-                                       // to avoid recursion\r
-                                       uc = new UniqueConstraint ((DataColumn []) value, false);\r
-                                       Constraints.Add (uc);\r
-                               }\r
-\r
-                               //Remove the existing primary key\r
-                               if (_primaryKeyConstraint != null) {\r
-                                       _primaryKeyConstraint.SetIsPrimaryKey (false);\r
-                                       Constraints.Remove (_primaryKeyConstraint);\r
-                                       _primaryKeyConstraint = null;\r
-                               }\r
-\r
-                               //set the constraint as the new primary key\r
-                               UniqueConstraint.SetAsPrimaryKey (Constraints, uc);\r
-                               _primaryKeyConstraint = uc;\r
-\r
-                               for (int j = 0; j < uc.Columns.Length; ++j)\r
-                                       uc.Columns [j].AllowDBNull = false;\r
-                       }\r
-               }\r
-\r
-               internal UniqueConstraint PrimaryKeyConstraint {\r
-                       get { return _primaryKeyConstraint; }\r
-               }\r
-\r
-               /// <summary>\r
-               /// Gets the collection of_rows that belong to this table.\r
-               /// </summary>\r
-               [Browsable (false)]\r
-               public DataRowCollection Rows {\r
-                       get { return _rows; }\r
-               }\r
-\r
-               /// <summary>\r
-               /// Gets or sets an System.ComponentModel.ISite\r
-               /// for the DataTable.\r
-               /// </summary>\r
-               [Browsable (false)]\r
-               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]\r
-               public override ISite Site {\r
-                       get { return _site; }\r
-                       set { _site = value; }\r
-               }\r
-\r
-               /// <summary>\r
-               /// Gets or sets the name of the the DataTable.\r
-               /// </summary>\r
-               [DataCategory ("Data")]\r
-               [DefaultValue ("")]\r
-               [RefreshProperties (RefreshProperties.All)]\r
-               public string TableName {\r
-                       get { return _tableName == null ? "" : _tableName; }\r
-                       set { _tableName = value; }\r
-               }\r
-\r
-               bool IListSource.ContainsListCollection {\r
-                       // the collection is a DataView\r
-                       get { return false; }\r
-               }\r
-\r
-               internal RecordCache RecordCache {\r
-                       get { return _recordCache; }\r
-               }\r
-\r
-               private DataRowBuilder RowBuilder {\r
-                       get {\r
-                               // initiate only one row builder.\r
-                               if (_rowBuilder == null)\r
-                                       _rowBuilder = new DataRowBuilder (this, -1, 0);\r
-                               else\r
-                                       // new row get id -1.\r
-                                       _rowBuilder._rowId = -1;\r
-\r
-                               return _rowBuilder;\r
-                       }\r
-               }\r
-\r
-               internal bool EnforceConstraints {\r
-                       get { return enforceConstraints; }\r
-                       set {\r
-                               if (value == enforceConstraints)\r
-                                       return;\r
-\r
-                               if (value) {\r
-                                       // reset indexes since they may be outdated\r
-                                       ResetIndexes();\r
-\r
-                                       // assert all constraints\r
-                                       foreach (Constraint constraint in Constraints)\r
-                                               constraint.AssertConstraint ();\r
-\r
-                                       AssertNotNullConstraints ();\r
-\r
-                                       if (HasErrors)\r
-                                               Constraint.ThrowConstraintException ();\r
-                               }\r
-                               enforceConstraints = value;\r
-                       }\r
-               }\r
-\r
-               internal void AssertNotNullConstraints ()\r
-               {\r
-                       if (_duringDataLoad && !_nullConstraintViolationDuringDataLoad)\r
-                               return;\r
-\r
-                       bool seen = false;\r
-                       for (int i = 0; i < Columns.Count; i++) {\r
-                               DataColumn column = Columns [i];\r
-                               if (column.AllowDBNull)\r
-                                       continue;\r
-                               for (int j = 0; j < Rows.Count; j++) {\r
-                                       if (Rows [j].HasVersion (DataRowVersion.Default) && Rows[j].IsNull (column)) {\r
-                                               seen = true;\r
-                                               string errMsg = String.Format ("Column '{0}' does not allow DBNull.Value.",\r
-                                                                              column.ColumnName);\r
-                                               Rows [j].SetColumnError (i, errMsg);\r
-                                               Rows [j].RowError = errMsg;\r
-                                       }\r
-                               }\r
-                       }\r
-                       _nullConstraintViolationDuringDataLoad = seen;\r
-               }\r
-\r
-               internal bool RowsExist (DataColumn [] columns, DataColumn [] relatedColumns, DataRow row)\r
-               {\r
-                       int curIndex = row.IndexFromVersion (DataRowVersion.Default);\r
-                       int tmpRecord = RecordCache.NewRecord ();\r
-\r
-                       try {\r
-                               for (int i = 0; i < relatedColumns.Length; i++)\r
-                                       // according to MSDN: the DataType value for both columns must be identical.\r
-                                       columns [i].DataContainer.CopyValue (relatedColumns [i].DataContainer, curIndex, tmpRecord);\r
-                               return RowsExist (columns, tmpRecord);\r
-                       } finally {\r
-                               RecordCache.DisposeRecord (tmpRecord);\r
-                       }\r
-               }\r
-\r
-               bool RowsExist (DataColumn [] columns, int index)\r
-               {\r
-                       Index indx = this.FindIndex (columns);\r
-\r
-                       if (indx != null)\r
-                               return indx.Find (index) != -1;\r
-\r
-                       // we have to perform full-table scan\r
-                       // check that there is a parent for this row.\r
-                       foreach (DataRow thisRow in this.Rows) {\r
-                               if (thisRow.RowState == DataRowState.Deleted)\r
-                                       continue;\r
-                               // check if the values in the columns are equal\r
-                               int thisIndex = thisRow.IndexFromVersion (\r
-                                       thisRow.RowState == DataRowState.Modified ? DataRowVersion.Original : DataRowVersion.Current);\r
-                               bool match = true;\r
-                               foreach (DataColumn column in columns) {\r
-                                       if (column.DataContainer.CompareValues (thisIndex, index) != 0) {\r
-                                               match = false;\r
-                                               break;\r
-                                       }\r
-                               }\r
-                               if (match)\r
-                                       return true;\r
-                       }\r
-                       return false;\r
-               }\r
-\r
-               /// <summary>\r
-               /// Commits all the changes made to this table since the\r
-               /// last time AcceptChanges was called.\r
-               /// </summary>\r
-               public void AcceptChanges ()\r
-               {\r
-                       //FIXME: Do we need to validate anything here or\r
-                       //try to catch any errors to deal with them?\r
-\r
-                       // we do not use foreach because if one of the rows is in Delete state\r
-                       // it will be romeved from Rows and we get an exception.\r
-                       DataRow myRow;\r
-                       for (int i = 0; i < Rows.Count; ) {\r
-                               myRow = Rows [i];\r
-                               myRow.AcceptChanges ();\r
-\r
-                               // if the row state is Detached it meens that it was removed from row list (Rows)\r
-                               // so we should not increase 'i'.\r
-                               if (myRow.RowState != DataRowState.Detached)\r
-                                       i++;\r
-                       }\r
-                       _rows.OnListChanged (this, new ListChangedEventArgs (ListChangedType.Reset, -1, -1));\r
-               }\r
-\r
-               /// <summary>\r
-               /// Begins the initialization of a DataTable that is used\r
-               /// on a form or used by another component. The initialization\r
-               /// occurs at runtime.\r
-               /// </summary>\r
-               public\r
-               virtual\r
-               void BeginInit ()\r
-               {\r
-                       InitInProgress = true;\r
-                       tableInitialized = false;\r
-               }\r
-\r
-               /// <summary>\r
-               /// Turns off notifications, index maintenance, and\r
-               /// constraints while loading data.\r
-               /// </summary>\r
-               public void BeginLoadData ()\r
-               {\r
-                       if (this._duringDataLoad)\r
-                               return;\r
-\r
-                       //duringDataLoad is important to EndLoadData and\r
-                       //for not throwing unexpected exceptions.\r
-                       this._duringDataLoad = true;\r
-                       this._nullConstraintViolationDuringDataLoad = false;\r
-\r
-                       if (this.dataSet != null) {\r
-                               //Saving old Enforce constraints state for later\r
-                               //use in the EndLoadData.\r
-                               this.dataSetPrevEnforceConstraints = this.dataSet.EnforceConstraints;\r
-                               this.dataSet.EnforceConstraints = false;\r
-                       } else {\r
-                               //if table does not belong to any data set use EnforceConstraints of the table\r
-                               this.EnforceConstraints = false;\r
-                       }\r
-                       return;\r
-               }\r
-\r
-               /// <summary>\r
-               /// Clears the DataTable of all data.\r
-               /// </summary>\r
-               public void Clear ()\r
-               {\r
-                       // Foriegn key constraints are checked in _rows.Clear method\r
-                       _rows.Clear ();\r
-               }\r
-\r
-               /// <summary>\r
-               /// Clones the structure of the DataTable, including\r
-               ///  all DataTable schemas and constraints.\r
-               /// </summary>\r
-               public virtual DataTable Clone ()\r
-               {\r
-                        // Use Activator so we can use non-public constructors.\r
-                       DataTable Copy = (DataTable) Activator.CreateInstance (GetType (), true);\r
-                       CopyProperties (Copy);\r
-                       return Copy;\r
-               }\r
-\r
-               /// <summary>\r
-               /// Computes the given expression on the current_rows that\r
-               /// pass the filter criteria.\r
-               /// </summary>\r
-               public object Compute (string expression, string filter)\r
-               {\r
-                       // expression is an aggregate function\r
-                       // filter is an expression used to limit rows\r
-\r
-                       DataRow [] rows = Select (filter);\r
-\r
-                       if (rows == null || rows.Length == 0)\r
-                               return DBNull.Value;\r
-\r
-                       Parser parser = new Parser (rows);\r
-                       IExpression expr = parser.Compile (expression);\r
-                       object obj = expr.Eval (rows [0]);\r
-\r
-                       return obj;\r
-               }\r
-\r
-               /// <summary>\r
-               /// Copies both the structure and data for this DataTable.\r
-               /// </summary>\r
-               public DataTable Copy ()\r
-               {\r
-                       DataTable copy = Clone ();\r
-\r
-                       copy._duringDataLoad = true;\r
-                       foreach (DataRow row in Rows) {\r
-                               DataRow newRow = copy.NewNotInitializedRow ();\r
-                               copy.Rows.AddInternal (newRow);\r
-                               CopyRow (row, newRow);\r
-                       }\r
-                       copy._duringDataLoad = false;\r
-\r
-                       // rebuild copy indexes after loading all rows\r
-                       copy.ResetIndexes ();\r
-                       return copy;\r
-               }\r
-\r
-               internal void CopyRow (DataRow fromRow, DataRow toRow)\r
-               {\r
-                       if (fromRow.HasErrors)\r
-                               fromRow.CopyErrors (toRow);\r
-\r
-                       if (fromRow.HasVersion (DataRowVersion.Original))\r
-                               toRow.Original = toRow.Table.RecordCache.CopyRecord (this, fromRow.Original, -1);\r
-\r
-                       if (fromRow.HasVersion (DataRowVersion.Current)) {\r
-                               if (fromRow.Original != fromRow.Current)\r
-                                       toRow.Current = toRow.Table.RecordCache.CopyRecord (this, fromRow.Current, -1);\r
-                               else\r
-                                       toRow.Current = toRow.Original;\r
-                       }\r
-               }\r
-\r
-               private void CopyProperties (DataTable Copy)\r
-               {\r
-                       Copy.CaseSensitive = CaseSensitive;\r
-                       Copy._virginCaseSensitive = _virginCaseSensitive;\r
-\r
-                       // Copy.ChildRelations\r
-                       // Copy.Constraints\r
-                       // Copy.Container\r
-                       // Copy.DefaultView\r
-                       // Copy.DesignMode\r
-                       Copy.DisplayExpression = DisplayExpression;\r
-                       if (ExtendedProperties.Count > 0) {\r
-                               //  Cannot copy extended properties directly as the property does not have a set accessor\r
-                               Array tgtArray = Array.CreateInstance (typeof (object), ExtendedProperties.Count);\r
-                               ExtendedProperties.Keys.CopyTo (tgtArray, 0);\r
-                               for (int i=0; i < ExtendedProperties.Count; i++)\r
-                                       Copy.ExtendedProperties.Add (tgtArray.GetValue (i), ExtendedProperties[tgtArray.GetValue (i)]);\r
-                       }\r
-                       Copy._locale = _locale;\r
-                       Copy.MinimumCapacity = MinimumCapacity;\r
-                       Copy.Namespace = Namespace;\r
-                       // Copy.ParentRelations\r
-                       Copy.Prefix = Prefix;\r
-                       Copy.Site = Site;\r
-                       Copy.TableName = TableName;\r
-\r
-                       bool isEmpty = Copy.Columns.Count == 0;\r
-\r
-                       // Copy columns\r
-                       foreach (DataColumn column in Columns) {\r
-                               // When cloning a table, the columns may be added in the default constructor.\r
-                               if (isEmpty || !Copy.Columns.Contains (column.ColumnName))\r
-                                       Copy.Columns.Add (column.Clone ());\r
-                       }\r
-                       foreach (DataColumn column in Copy.Columns)\r
-                               column.CompileExpression ();\r
-\r
-                       CopyConstraints (Copy);\r
-                       // add primary key to the copy\r
-                       if (PrimaryKey.Length > 0) {\r
-                               DataColumn[] pColumns = new DataColumn[PrimaryKey.Length];\r
-                               for (int i = 0; i < pColumns.Length; i++)\r
-                                       pColumns[i] = Copy.Columns[PrimaryKey[i].ColumnName];\r
-\r
-                               Copy.PrimaryKey = pColumns;\r
-                       }\r
-               }\r
-\r
-               private void CopyConstraints (DataTable copy)\r
-               {\r
-                       UniqueConstraint origUc;\r
-                       UniqueConstraint copyUc;\r
-                       for (int i = 0; i < this.Constraints.Count; i++) {\r
-                               if (this.Constraints[i] is UniqueConstraint) {\r
-                                       // typed ds can already contain the constraints\r
-                                       if (copy.Constraints.Contains (this.Constraints [i].ConstraintName))\r
-                                               continue;\r
-\r
-                                       origUc = (UniqueConstraint) this.Constraints [i];\r
-                                       DataColumn [] columns = new DataColumn [origUc.Columns.Length];\r
-                                       for (int j = 0; j < columns.Length; j++)\r
-                                               columns[j] = copy.Columns [origUc.Columns [j].ColumnName];\r
-\r
-                                       copyUc = new UniqueConstraint (origUc.ConstraintName, columns, origUc.IsPrimaryKey);\r
-                                       copy.Constraints.Add (copyUc);\r
-                               }\r
-                       }\r
-               }\r
-               /// <summary>\r
-               /// Ends the initialization of a DataTable that is used\r
-               /// on a form or used by another component. The\r
-               /// initialization occurs at runtime.\r
-               /// </summary>\r
-               public\r
-               virtual\r
-               void EndInit ()\r
-               {\r
-                       InitInProgress = false;\r
-                       DataTableInitialized ();\r
-                       FinishInit ();\r
-               }\r
-\r
-               // defined in NET_2_0 profile\r
-               partial void DataTableInitialized ();\r
-\r
-               internal bool InitInProgress {\r
-                       get { return fInitInProgress; }\r
-                       set { fInitInProgress = value; }\r
-               }\r
-\r
-               internal void FinishInit ()\r
-               {\r
-                       UniqueConstraint oldPK = _primaryKeyConstraint;\r
-\r
-                       // Columns shud be added 'before' the constraints\r
-                       Columns.PostAddRange ();\r
-\r
-                       // Add the constraints\r
-                       _constraintCollection.PostAddRange ();\r
-\r
-                       // ms.net behavior : If a PrimaryKey (UniqueConstraint) is added thru AddRange,\r
-                       // then it takes precedence over an direct assignment of PrimaryKey\r
-                       if (_primaryKeyConstraint == oldPK)\r
-                               PrimaryKey = _latestPrimaryKeyCols;\r
-               }\r
-\r
-               /// <summary>\r
-               /// Turns on notifications, index maintenance, and\r
-               /// constraints after loading data.\r
-               /// </summary>\r
-               public void EndLoadData ()\r
-               {\r
-                       if (this._duringDataLoad) {\r
-                               //Getting back to previous EnforceConstraint state\r
-                               if (this.dataSet != null)\r
-                                       this.dataSet.InternalEnforceConstraints (this.dataSetPrevEnforceConstraints, true);\r
-                               else\r
-                                       this.EnforceConstraints = true;\r
-\r
-                               this._duringDataLoad = false;\r
-                       }\r
-               }\r
-\r
-               /// <summary>\r
-               /// Gets a copy of the DataTable that contains all\r
-               ///  changes made to it since it was loaded or\r
-               ///  AcceptChanges was last called.\r
-               /// </summary>\r
-               public DataTable GetChanges ()\r
-               {\r
-                       return GetChanges (DataRowState.Added | DataRowState.Deleted | DataRowState.Modified);\r
-               }\r
-\r
-               /// <summary>\r
-               /// Gets a copy of the DataTable containing all\r
-               /// changes made to it since it was last loaded, or\r
-               /// since AcceptChanges was called, filtered by DataRowState.\r
-               /// </summary>\r
-               public DataTable GetChanges (DataRowState rowStates)\r
-               {\r
-                       DataTable copyTable = null;\r
-\r
-                       foreach (DataRow row in Rows) {\r
-                               // The spec says relationship constraints may cause Unchanged parent rows to be included but\r
-                               // MS .NET 1.1 does not include Unchanged rows even if their child rows are changed.\r
-                               if (!row.IsRowChanged (rowStates))\r
-                                       continue;\r
-                               if (copyTable == null)\r
-                                       copyTable = Clone ();\r
-                               DataRow newRow = copyTable.NewNotInitializedRow ();\r
-                               // Don't check for ReadOnly, when cloning data to new uninitialized row.\r
-                               row.CopyValuesToRow (newRow, false);\r
-                               newRow.XmlRowID = row.XmlRowID;\r
-                               copyTable.Rows.AddInternal (newRow);\r
-                       }\r
-\r
-                       return copyTable;\r
-               }\r
-\r
-               /// <summary>\r
-               /// Gets an array of DataRow objects that contain errors.\r
-               /// </summary>\r
-               public DataRow [] GetErrors ()\r
-               {\r
-                       ArrayList errors = new ArrayList();\r
-                       for (int i = 0; i < _rows.Count; i++) {\r
-                               if (_rows[i].HasErrors)\r
-                                       errors.Add (_rows[i]);\r
-                       }\r
-\r
-                       DataRow[] ret = NewRowArray (errors.Count);\r
-                       errors.CopyTo (ret, 0);\r
-                       return ret;\r
-               }\r
-\r
-               /// <summary>\r
-               /// This member is only meant to support Mono's infrastructure\r
-               /// </summary>\r
-               protected virtual DataTable CreateInstance ()\r
-               {\r
-                       return Activator.CreateInstance (this.GetType (), true) as DataTable;\r
-               }\r
-\r
-               /// <summary>\r
-               /// This member is only meant to support Mono's infrastructure\r
-               /// </summary>\r
-               protected virtual Type GetRowType ()\r
-               {\r
-                       return typeof (DataRow);\r
-               }\r
-\r
-               /// <summary>\r
-               /// This member is only meant to support Mono's infrastructure\r
-               ///\r
-               /// Used for Data Binding between System.Web.UI. controls\r
-               /// like a DataGrid\r
-               /// or\r
-               /// System.Windows.Forms controls like a DataGrid\r
-               /// </summary>\r
-               IList IListSource.GetList ()\r
-               {\r
-                       IList list = (IList) DefaultView;\r
-                       return list;\r
-               }\r
-\r
-               /// <summary>\r
-               /// Copies a DataRow into a DataTable, preserving any\r
-               /// property settings, as well as original and current values.\r
-               /// </summary>\r
-               public void ImportRow (DataRow row)\r
-               {\r
-                       if (row.RowState == DataRowState.Detached)\r
-                               return;\r
-\r
-                       DataRow newRow = NewNotInitializedRow ();\r
-\r
-                       int original = -1;\r
-                       if (row.HasVersion (DataRowVersion.Original)) {\r
-                               original = row.IndexFromVersion (DataRowVersion.Original);\r
-                               newRow.Original = RecordCache.NewRecord ();\r
-                               RecordCache.CopyRecord (row.Table, original, newRow.Original);\r
-                       }\r
-\r
-                       if (row.HasVersion (DataRowVersion.Current)) {\r
-                               int current = row.IndexFromVersion (DataRowVersion.Current);\r
-                               if (current == original) {\r
-                                       newRow.Current = newRow.Original;\r
-                               } else {\r
-                                       newRow.Current = RecordCache.NewRecord ();\r
-                                       RecordCache.CopyRecord (row.Table, current, newRow.Current);\r
-                               }\r
-                       }\r
-\r
-                       //Import the row only if RowState is not detached\r
-                       //Validation for Deleted Rows happens during Accept/RejectChanges\r
-                       if (row.RowState != DataRowState.Deleted)\r
-                               newRow.Validate ();\r
-                       else\r
-                               AddRowToIndexes (newRow);\r
-                       Rows.AddInternal(newRow);\r
-\r
-                       if (row.HasErrors)\r
-                               row.CopyErrors (newRow);\r
-               }\r
-\r
-               internal int DefaultValuesRowIndex {\r
-                       get { return _defaultValuesRowIndex; }\r
-               }\r
-\r
-               /// <summary>\r
-               /// This member is only meant to support Mono's infrastructure\r
-               /// </summary>\r
-               public virtual\r
-               void\r
-               GetObjectData (SerializationInfo info, StreamingContext context)\r
-               {\r
-                       if (RemotingFormat == SerializationFormat.Xml) {\r
-                               DataSet dset;\r
-                               if (dataSet != null)\r
-                                       dset = dataSet;\r
-                               else {\r
-                                       dset = new DataSet ("tmpDataSet");\r
-                                       dset.Tables.Add (this);\r
-                               }\r
-\r
-                               StringWriter sw = new StringWriter ();\r
-                               XmlTextWriter tw = new XmlTextWriter (sw);\r
-                               tw.Formatting = Formatting.Indented;\r
-                               dset.WriteIndividualTableContent (tw, this, XmlWriteMode.DiffGram);\r
-                               tw.Close ();\r
-\r
-                               StringWriter sw2 = new StringWriter ();\r
-                               DataTableCollection tables = new DataTableCollection (dset);\r
-                               tables.Add (this);\r
-                               XmlSchemaWriter.WriteXmlSchema (dset, new XmlTextWriter (sw2), tables, null);\r
-                               sw2.Close ();\r
-\r
-                               info.AddValue ("XmlSchema", sw2.ToString(), typeof(string));\r
-                               info.AddValue ("XmlDiffGram", sw.ToString(), typeof(string));\r
-                       } else /*if (RemotingFormat == SerializationFormat.Binary)*/ {\r
-                               BinarySerializeProperty (info);\r
-                               if (dataSet == null) {\r
-                                       for (int i = 0; i < Columns.Count; i++) {\r
-                                               info.AddValue ("DataTable.DataColumn_" + i + ".Expression",\r
-                                                              Columns[i].Expression);\r
-                                       }\r
-                                       BinarySerialize (info, "DataTable_0.");\r
-                               }\r
-                       }\r
-               }\r
-\r
-               /// <summary>\r
-               /// Finds and updates a specific row. If no matching row\r
-               ///  is found, a new row is created using the given values.\r
-               /// </summary>\r
-               public DataRow LoadDataRow (object [] values, bool fAcceptChanges)\r
-               {\r
-                       DataRow row = null;\r
-                       if (PrimaryKey.Length == 0) {\r
-                               row = Rows.Add (values);\r
-                       } else {\r
-                               EnsureDefaultValueRowIndex ();\r
-                               int newRecord = CreateRecord (values);\r
-                               int existingRecord = _primaryKeyConstraint.Index.Find (newRecord);\r
-\r
-                               if (existingRecord < 0) {\r
-                                       row = NewRowFromBuilder (RowBuilder);\r
-                                       row.Proposed = newRecord;\r
-                                       Rows.AddInternal(row);\r
-                                       if (!_duringDataLoad)\r
-                                               AddRowToIndexes (row);\r
-                               } else {\r
-                                       row = RecordCache [existingRecord];\r
-                                       row.BeginEdit ();\r
-                                       row.ImportRecord (newRecord);\r
-                                       row.EndEdit ();\r
-                               }\r
-                       }\r
-\r
-                       if (fAcceptChanges)\r
-                               row.AcceptChanges ();\r
-\r
-                       return row;\r
-               }\r
-\r
-               internal DataRow LoadDataRow (IDataRecord record, int[] mapping, int length, bool fAcceptChanges)\r
-               {\r
-                       DataRow row = null;\r
-                       int tmpRecord = this.RecordCache.NewRecord ();\r
-                       try {\r
-                               RecordCache.ReadIDataRecord (tmpRecord,record,mapping,length);\r
-                               if (PrimaryKey.Length != 0) {\r
-                                       bool hasPrimaryValues = true;\r
-                                       foreach(DataColumn col in PrimaryKey) {\r
-                                               if(!(col.Ordinal < mapping.Length)) {\r
-                                                       hasPrimaryValues = false;\r
-                                                       break;\r
-                                               }\r
-                                       }\r
-\r
-                                       if (hasPrimaryValues) {\r
-                                               int existingRecord = _primaryKeyConstraint.Index.Find (tmpRecord);\r
-                                               if (existingRecord != -1)\r
-                                                       row  = RecordCache [existingRecord];\r
-                                       }\r
-                               }\r
-\r
-                               if (row == null) {\r
-                                       row = NewNotInitializedRow ();\r
-                                       row.Proposed = tmpRecord;\r
-                                       Rows.AddInternal (row);\r
-                               } else {\r
-                                       row.BeginEdit ();\r
-                                       row.ImportRecord (tmpRecord);\r
-                                       row.EndEdit ();\r
-                               }\r
-\r
-                               if (fAcceptChanges)\r
-                                       row.AcceptChanges ();\r
-\r
-                       } catch {\r
-                               this.RecordCache.DisposeRecord (tmpRecord);\r
-                               throw;\r
-                       }\r
-                       return row;\r
-               }\r
-\r
-               /// <summary>\r
-               /// Creates a new DataRow with the same schema as the table.\r
-               /// </summary>\r
-               public DataRow NewRow ()\r
-               {\r
-                       EnsureDefaultValueRowIndex();\r
-\r
-                       DataRow newRow = NewRowFromBuilder (RowBuilder);\r
-                       newRow.Proposed = CreateRecord (null);\r
-                       NewRowAdded (newRow);\r
-                       return newRow;\r
-               }\r
-\r
-               // defined in the NET_2_0 profile\r
-               partial void NewRowAdded (DataRow dr);\r
-\r
-               internal int CreateRecord (object [] values)\r
-               {\r
-                       int valCount = values != null ? values.Length : 0;\r
-                       if (valCount > Columns.Count)\r
-                               throw new ArgumentException ("Input array is longer than the number of columns in this table.");\r
-\r
-                       int index = RecordCache.NewRecord ();\r
-\r
-                       try {\r
-                               for (int i = 0; i < valCount; i++) {\r
-                                       object value = values[i];\r
-                                       if (value == null)\r
-                                               Columns [i].SetDefaultValue (index);\r
-                                       else\r
-                                               Columns [i][index] = values [i];\r
-                               }\r
-\r
-                               for(int i = valCount; i < Columns.Count; i++)\r
-                                       Columns [i].SetDefaultValue (index);\r
-\r
-                               return index;\r
-                       } catch {\r
-                               RecordCache.DisposeRecord (index);\r
-                               throw;\r
-                       }\r
-               }\r
-\r
-               private void EnsureDefaultValueRowIndex ()\r
-               {\r
-                       // initialize default values row for the first time\r
-                       if (_defaultValuesRowIndex == -1) {\r
-                               _defaultValuesRowIndex = RecordCache.NewRecord();\r
-                               for (int i = 0; i < Columns.Count; ++i) {\r
-                                       DataColumn column = Columns [i];\r
-                                       column.DataContainer [_defaultValuesRowIndex] = column.DefaultValue;\r
-                               }\r
-                       }\r
-               }\r
-\r
-               /// <summary>\r
-               /// This member supports the .NET Framework infrastructure\r
-               ///  and is not intended to be used directly from your code.\r
-               /// </summary>\r
-               DataRow [] empty_rows;\r
-               protected internal DataRow [] NewRowArray (int size)\r
-               {\r
-                       if (size == 0 && empty_rows != null)\r
-                               return empty_rows;\r
-                       Type t = GetRowType ();\r
-                       /* Avoid reflection if possible */\r
-                       DataRow [] rows = t == typeof (DataRow) ? new DataRow [size] : (DataRow []) Array.CreateInstance (t, size);\r
-                       if (size == 0)\r
-                               empty_rows = rows;\r
-                       return rows;\r
-               }\r
-\r
-               /// <summary>\r
-               /// Creates a new row from an existing row.\r
-               /// </summary>\r
-               protected virtual DataRow NewRowFromBuilder (DataRowBuilder builder)\r
-               {\r
-                       return new DataRow (builder);\r
-               }\r
-\r
-               internal DataRow NewNotInitializedRow ()\r
-               {\r
-                       EnsureDefaultValueRowIndex ();\r
-\r
-                       return NewRowFromBuilder (RowBuilder);\r
-               }\r
-\r
-               /// <summary>\r
-               /// Rolls back all changes that have been made to the\r
-               /// table since it was loaded, or the last time AcceptChanges\r
-               ///  was called.\r
-               /// </summary>\r
-               public void RejectChanges ()\r
-               {\r
-                       for (int i = _rows.Count - 1; i >= 0; i--) {\r
-                               DataRow row = _rows [i];\r
-                               if (row.RowState != DataRowState.Unchanged)\r
-                                       _rows [i].RejectChanges ();\r
-                       }\r
-               }\r
-\r
-               /// <summary>\r
-               /// Resets the DataTable to its original state.\r
-               /// </summary>\r
-               public virtual void Reset ()\r
-               {\r
-                       Clear ();\r
-                       while (ParentRelations.Count > 0) {\r
-                               if (dataSet.Relations.Contains (ParentRelations [ParentRelations.Count - 1].RelationName))\r
-                                       dataSet.Relations.Remove (ParentRelations [ParentRelations.Count - 1]);\r
-                       }\r
-\r
-                       while (ChildRelations.Count > 0) {\r
-                               if (dataSet.Relations.Contains (ChildRelations [ChildRelations.Count - 1].RelationName))\r
-                                       dataSet.Relations.Remove (ChildRelations [ChildRelations.Count - 1]);\r
-                       }\r
-                       Constraints.Clear ();\r
-                       Columns.Clear ();\r
-               }\r
-\r
-               /// <summary>\r
-               /// Gets an array of all DataRow objects.\r
-               /// </summary>\r
-               public DataRow[] Select ()\r
-               {\r
-                       return Select (String.Empty, String.Empty, DataViewRowState.CurrentRows);\r
-               }\r
-\r
-               /// <summary>\r
-               /// Gets an array of all DataRow objects that match\r
-               /// the filter criteria in order of primary key (or\r
-               /// lacking one, order of addition.)\r
-               /// </summary>\r
-               public DataRow[] Select (string filterExpression)\r
-               {\r
-                       return Select (filterExpression, String.Empty, DataViewRowState.CurrentRows);\r
-               }\r
-\r
-               /// <summary>\r
-               /// Gets an array of all DataRow objects that\r
-               /// match the filter criteria, in the the\r
-               /// specified sort order.\r
-               /// </summary>\r
-               public DataRow[] Select (string filterExpression, string sort)\r
-               {\r
-                       return Select (filterExpression, sort, DataViewRowState.CurrentRows);\r
-               }\r
-\r
-               /// <summary>\r
-               /// Gets an array of all DataRow objects that match\r
-               /// the filter in the order of the sort, that match\r
-               /// the specified state.\r
-               /// </summary>\r
-               public DataRow [] Select (string filterExpression, string sort, DataViewRowState recordStates)\r
-               {\r
-                       if (filterExpression == null)\r
-                               filterExpression = String.Empty;\r
-\r
-                       IExpression filter = null;\r
-                       if (filterExpression != String.Empty) {\r
-                               Parser parser = new Parser ();\r
-                               filter = parser.Compile (filterExpression);\r
-                       }\r
-\r
-                       DataColumn [] columns = _emptyColumnArray;\r
-                       ListSortDirection [] sorts = null;\r
-\r
-                       if (sort != null && !sort.Equals(String.Empty))\r
-                               columns = ParseSortString (this, sort, out sorts, false);\r
-\r
-                       if (Rows.Count == 0)\r
-                               return NewRowArray (0);\r
-\r
-                       //if sort order is not given, sort it in Ascending order of the\r
-                       //columns involved in the filter\r
-                       if (columns.Length == 0 && filter != null) {\r
-                               ArrayList list = new ArrayList ();\r
-                               for (int i = 0; i < Columns.Count; ++i) {\r
-                                       if (!filter.DependsOn (Columns [i]))\r
-                                               continue;\r
-                                       list.Add (Columns [i]);\r
-                               }\r
-                               columns = (DataColumn []) list.ToArray (typeof (DataColumn));\r
-                       }\r
-\r
-                       bool addIndex = true;\r
-                       if (filterExpression != String.Empty)\r
-                               addIndex = false;\r
-                       Index index = GetIndex (columns, sorts, recordStates, filter, false, addIndex);\r
-\r
-                       int [] records = index.GetAll ();\r
-                       DataRow [] dataRows = NewRowArray (index.Size);\r
-                       for (int i = 0; i < dataRows.Length; i++)\r
-                               dataRows [i] = RecordCache [records [i]];\r
-\r
-                       return dataRows;\r
-               }\r
-\r
-               private void AddIndex (Index index)\r
-               {\r
-                       if (_indexes == null)\r
-                               _indexes = new ArrayList();\r
-                       _indexes.Add (index);\r
-               }\r
-\r
-               /// <summary>\r
-               /// Returns index corresponding to columns,sort,row state filter and unique values given.\r
-               /// If such an index not exists, creates a new one.\r
-               /// </summary>\r
-               /// <param name="columns">Columns set of the index to look for.</param>\r
-               /// <param name="sort">Columns sort order of the index to look for.</param>\r
-               /// <param name="rowState">Rpw state filter of the index to look for.</param>\r
-               /// <param name="unique">Uniqueness of the index to look for.</param>\r
-               /// <param name="strict">Indicates whenever the index found should correspond in its uniquness to the value of unique parameter specified.</param>\r
-               /// <param name="reset">Indicates whenever the already existing index should be forced to reset.</param>\r
-               /// <returns></returns>\r
-               internal Index GetIndex (DataColumn[] columns, ListSortDirection[] sort, DataViewRowState rowState, IExpression filter, bool reset)\r
-               {\r
-                       return GetIndex (columns, sort, rowState, filter, reset, true);\r
-               }\r
-\r
-               internal Index GetIndex (DataColumn[] columns, ListSortDirection[] sort,\r
-                                        DataViewRowState rowState, IExpression filter,\r
-                                        bool reset, bool addIndex)\r
-               {\r
-                       Index index = FindIndex(columns, sort, rowState, filter);\r
-                       if (index == null) {\r
-                               index = new Index(new Key (this, columns, sort, rowState, filter));\r
-\r
-                               if (addIndex)\r
-                                       AddIndex (index);\r
-                       } else if (reset) {\r
-                               // reset existing index only if asked for this\r
-                               index.Reset ();\r
-                       }\r
-                       return index;\r
-               }\r
-\r
-               internal Index FindIndex (DataColumn[] columns)\r
-               {\r
-                       return FindIndex (columns, null, DataViewRowState.None, null);\r
-               }\r
-\r
-               internal Index FindIndex (DataColumn[] columns, ListSortDirection[] sort, DataViewRowState rowState, IExpression filter)\r
-               {\r
-                       if (Indexes != null) {\r
-                               foreach (Index index in Indexes) {\r
-                                       if (index.Key.Equals (columns,sort,rowState, filter))\r
-                                               return index;\r
-                               }\r
-                       }\r
-                       return null;\r
-               }\r
-\r
-               internal void ResetIndexes ()\r
-               {\r
-                       foreach(Index index in Indexes)\r
-                               index.Reset ();\r
-               }\r
-\r
-               internal void ResetCaseSensitiveIndexes ()\r
-               {\r
-                       foreach (Index index in Indexes) {\r
-                               bool containsStringcolumns = false;\r
-                               foreach(DataColumn column in index.Key.Columns) {\r
-                                       if (column.DataType == typeof(string)) {\r
-                                               containsStringcolumns = true;\r
-                                               break;\r
-                                       }\r
-                               }\r
-\r
-                               if (!containsStringcolumns && index.Key.HasFilter) {\r
-                                       foreach (DataColumn column in Columns) {\r
-                                               if ((column.DataType == DbTypes.TypeOfString) && (index.Key.DependsOn (column))) {\r
-                                                       containsStringcolumns = true;\r
-                                                       break;\r
-                                               }\r
-                                       }\r
-                               }\r
-\r
-                               if (containsStringcolumns)\r
-                                       index.Reset ();\r
-                       }\r
-               }\r
-\r
-               internal void DropIndex (Index index)\r
-               {\r
-                       if (index != null && index.RefCount == 0) {\r
-                               _indexes.Remove (index);\r
-                       }\r
-               }\r
-\r
-               internal void DropReferencedIndexes (DataColumn column)\r
-               {\r
-                       if (_indexes != null)\r
-                               for (int i = _indexes.Count - 1; i >= 0; i--) {\r
-                                       Index indx = (Index)_indexes [i];\r
-                                       if (indx.Key.DependsOn (column))\r
-                                               _indexes.Remove (indx);\r
-                               }\r
-               }\r
-\r
-               internal void AddRowToIndexes (DataRow row)\r
-               {\r
-                       if (_indexes != null) {\r
-                               for (int i = 0; i < _indexes.Count; ++i)\r
-                                       ((Index)_indexes [i]).Add (row);\r
-                       }\r
-               }\r
-\r
-               internal void DeleteRowFromIndexes (DataRow row)\r
-               {\r
-                       if (_indexes != null) {\r
-                               foreach (Index indx in _indexes)\r
-                                       indx.Delete (row);\r
-                       }\r
-               }\r
-\r
-               /// <summary>\r
-               /// Gets the TableName and DisplayExpression, if\r
-               /// there is one as a concatenated string.\r
-               /// </summary>\r
-               public override string ToString ()\r
-               {\r
-                       //LAMESPEC: spec says concat the two. impl puts a\r
-                       //plus sign infront of DisplayExpression\r
-                       string retVal = TableName;\r
-                       if(DisplayExpression != null && DisplayExpression != "")\r
-                               retVal += " + " + DisplayExpression;\r
-                       return retVal;\r
-               }\r
-\r
-               #region Events\r
-\r
-               /// <summary>\r
-               /// Raises the ColumnChanged event.\r
-               /// </summary>\r
-               protected virtual void OnColumnChanged (DataColumnChangeEventArgs e)\r
-               {\r
-                       if (null != ColumnChanged)\r
-                               ColumnChanged (this, e);\r
-               }\r
-\r
-               internal void RaiseOnColumnChanged (DataColumnChangeEventArgs e)\r
-               {\r
-                       OnColumnChanged (e);\r
-               }\r
-\r
-               /// <summary>\r
-               /// Raises the ColumnChanging event.\r
-               /// </summary>\r
-               protected virtual void OnColumnChanging (DataColumnChangeEventArgs e)\r
-               {\r
-                       if (null != ColumnChanging)\r
-                               ColumnChanging (this, e);\r
-               }\r
-\r
-               internal void RaiseOnColumnChanging (DataColumnChangeEventArgs e)\r
-               {\r
-                       OnColumnChanging(e);\r
-               }\r
-\r
-               /// <summary>\r
-               /// Raises the PropertyChanging event.\r
-               /// </summary>\r
-               [MonoTODO]\r
-               protected internal virtual void OnPropertyChanging (PropertyChangedEventArgs pcevent)\r
-               {\r
-                       //if (null != PropertyChanging)\r
-                       //{\r
-                       //      PropertyChanging (this, pcevent);\r
-                       //}\r
-                       throw new NotImplementedException ();\r
-               }\r
-\r
-               /// <summary>\r
-               /// Notifies the DataTable that a DataColumn is being removed.\r
-               /// </summary>\r
-               protected internal virtual void OnRemoveColumn (DataColumn column)\r
-               {\r
-                       DropReferencedIndexes (column);\r
-               }\r
-\r
-               /// <summary>\r
-               /// Raises the RowChanged event.\r
-               /// </summary>\r
-               protected virtual void OnRowChanged (DataRowChangeEventArgs e)\r
-               {\r
-                       if (null != RowChanged)\r
-                               RowChanged (this, e);\r
-               }\r
-\r
-\r
-               /// <summary>\r
-               /// Raises the RowChanging event.\r
-               /// </summary>\r
-               protected virtual void OnRowChanging (DataRowChangeEventArgs e)\r
-               {\r
-                       if (null != RowChanging)\r
-                               RowChanging (this, e);\r
-               }\r
-\r
-               /// <summary>\r
-               /// Raises the RowDeleted event.\r
-               /// </summary>\r
-               protected virtual void OnRowDeleted (DataRowChangeEventArgs e)\r
-               {\r
-                       if (null != RowDeleted)\r
-                               RowDeleted (this, e);\r
-               }\r
-\r
-               /// <summary>\r
-               /// Raises the RowDeleting event.\r
-               /// </summary>\r
-               protected virtual void OnRowDeleting (DataRowChangeEventArgs e)\r
-               {\r
-                       if (null != RowDeleting)\r
-                               RowDeleting (this, e);\r
-               }\r
-\r
-               /// <summary>\r
-               /// Occurs when after a value has been changed for\r
-               /// the specified DataColumn in a DataRow.\r
-               /// </summary>\r
-               [DataCategory ("Data")]\r
-               public event DataColumnChangeEventHandler ColumnChanged;\r
-\r
-               /// <summary>\r
-               /// Occurs when a value is being changed for the specified\r
-               /// DataColumn in a DataRow.\r
-               /// </summary>\r
-               [DataCategory ("Data")]\r
-               public event DataColumnChangeEventHandler ColumnChanging;\r
-\r
-               /// <summary>\r
-               /// Occurs after a DataRow has been changed successfully.\r
-               /// </summary>\r
-               [DataCategory ("Data")]\r
-               public event DataRowChangeEventHandler RowChanged;\r
-\r
-               /// <summary>\r
-               /// Occurs when a DataRow is changing.\r
-               /// </summary>\r
-               [DataCategory ("Data")]\r
-               public event DataRowChangeEventHandler RowChanging;\r
-\r
-               /// <summary>\r
-               /// Occurs after a row in the table has been deleted.\r
-               /// </summary>\r
-               [DataCategory ("Data")]\r
-               public event DataRowChangeEventHandler RowDeleted;\r
-\r
-               /// <summary>\r
-               /// Occurs before a row in the table is about to be deleted.\r
-               /// </summary>\r
-               [DataCategory ("Data")]\r
-               public event DataRowChangeEventHandler RowDeleting;\r
-\r
-               #endregion // Events\r
-\r
-               internal static DataColumn[] ParseSortString (DataTable table, string sort, out ListSortDirection[] sortDirections, bool rejectNoResult)\r
-               {\r
-                       DataColumn[] sortColumns = _emptyColumnArray;\r
-                       sortDirections = null;\r
-\r
-                       ArrayList columns = null;\r
-                       ArrayList sorts = null;\r
-\r
-                       if (sort != null && !sort.Equals ("")) {\r
-                               columns = new ArrayList ();\r
-                               sorts = new ArrayList();\r
-                               string[] columnExpression = sort.Trim ().Split (new char[1] {','});\r
-\r
-                               for (int c = 0; c < columnExpression.Length; c++) {\r
-                                       string rawColumnName = columnExpression[c].Trim ();\r
-\r
-                                       Match match = SortRegex.Match (rawColumnName);\r
-                                       Group g = match.Groups["ColName"] ;\r
-                                       if (!g.Success)\r
-                                               throw new IndexOutOfRangeException ("Could not find column: " + rawColumnName);\r
-\r
-                                       string columnName = g.Value;\r
-                                       DataColumn dc = table.Columns[columnName];\r
-                                       if (dc == null){\r
-                                               try {\r
-                                                       dc = table.Columns[Int32.Parse (columnName)];\r
-                                               } catch (FormatException) {\r
-                                                       throw new IndexOutOfRangeException("Cannot find column " + columnName);\r
-                                               }\r
-                                       }\r
-                                       columns.Add (dc);\r
-\r
-                                       g = match.Groups["Order"];\r
-                                       if (!g.Success || String.Compare (g.Value, "ASC", true, CultureInfo.InvariantCulture) == 0)\r
-                                               sorts.Add(ListSortDirection.Ascending);\r
-                                       else\r
-                                               sorts.Add (ListSortDirection.Descending);\r
-                               }\r
-\r
-                               sortColumns = (DataColumn[]) columns.ToArray (typeof (DataColumn));\r
-                               sortDirections = new ListSortDirection[sorts.Count];\r
-                               for (int i = 0; i < sortDirections.Length; i++)\r
-                                       sortDirections[i] = (ListSortDirection)sorts[i];\r
-                       }\r
-\r
-                       if (rejectNoResult) {\r
-                               if (sortColumns == null)\r
-                                       throw new SystemException ("sort expression result is null");\r
-                               if (sortColumns.Length == 0)\r
-                                       throw new SystemException("sort expression result is 0");\r
-                       }\r
-\r
-                       return sortColumns;\r
-               }\r
-\r
-               private void UpdatePropertyDescriptorsCache ()\r
-               {\r
-                       PropertyDescriptor[] descriptors = new PropertyDescriptor[Columns.Count + ChildRelations.Count];\r
-                       int index = 0;\r
-                       foreach (DataColumn col in Columns)\r
-                               descriptors [index++] = new DataColumnPropertyDescriptor (col);\r
-\r
-                       foreach (DataRelation rel in ChildRelations)\r
-                               descriptors [index++] = new DataRelationPropertyDescriptor (rel);\r
-\r
-                       _propertyDescriptorsCache = new PropertyDescriptorCollection (descriptors);\r
-               }\r
-\r
-               internal PropertyDescriptorCollection GetPropertyDescriptorCollection()\r
-               {\r
-                       if (_propertyDescriptorsCache == null)\r
-                               UpdatePropertyDescriptorsCache ();\r
-                       return _propertyDescriptorsCache;\r
-               }\r
-\r
-               internal void ResetPropertyDescriptorsCache ()\r
-               {\r
-                       _propertyDescriptorsCache = null;\r
-               }\r
-\r
-               internal void SetRowsID()\r
-               {\r
-                       int dataRowID = 0;\r
-                       foreach (DataRow row in Rows) {\r
-                               row.XmlRowID = dataRowID;\r
-                               dataRowID++;\r
-                       }\r
-               }\r
-       }\r
-\r
-       [XmlSchemaProvider ("GetDataTableSchema")]\r
-       partial class DataTable : IXmlSerializable {\r
-               [MonoNotSupported ("")]\r
-               XmlSchema IXmlSerializable.GetSchema ()\r
-               {\r
-                       return GetSchema ();\r
-               }\r
-\r
-               void IXmlSerializable.ReadXml (XmlReader reader)\r
-               {\r
-                       ReadXml_internal (reader, true);\r
-               }\r
-\r
-               void IXmlSerializable.WriteXml (XmlWriter writer)\r
-               {\r
-                       DataSet dset = dataSet;\r
-                       bool isPartOfDataSet = true;\r
-\r
-                       if (dataSet == null) {\r
-                               dset = new DataSet ();\r
-                               dset.Tables.Add (this);\r
-                               isPartOfDataSet = false;\r
-                       }\r
-\r
-                       XmlSchemaWriter.WriteXmlSchema (writer, new DataTable [] { this },\r
-                                                                                       null, TableName, dset.DataSetName, LocaleSpecified ? Locale : dset.LocaleSpecified ? dset.Locale : null);\r
-                       dset.WriteIndividualTableContent (writer, this, XmlWriteMode.DiffGram);\r
-                       writer.Flush ();\r
-\r
-                       if (!isPartOfDataSet)\r
-                               dataSet.Tables.Remove(this);\r
-               }\r
-\r
-               [MonoTODO]\r
-               protected virtual XmlSchema GetSchema ()\r
-               {\r
-                       throw new NotImplementedException ();\r
-               }\r
-\r
-               public static XmlSchemaComplexType GetDataTableSchema (XmlSchemaSet schemaSet)\r
-               {\r
-                       return new XmlSchemaComplexType ();\r
-               }\r
-\r
-               public XmlReadMode ReadXml (Stream stream)\r
-               {\r
-                       return ReadXml (new XmlTextReader(stream, new NameTable ()));\r
-               }\r
-\r
-               public XmlReadMode ReadXml (string fileName)\r
-               {\r
-                       XmlReader reader = new XmlTextReader (fileName);\r
-                       try {\r
-                               return ReadXml (reader);\r
-                       } finally {\r
-                               reader.Close();\r
-                       }\r
-               }\r
-\r
-               public XmlReadMode ReadXml (TextReader reader)\r
-               {\r
-                       return ReadXml (new XmlTextReader (reader));\r
-               }\r
-\r
-               public XmlReadMode ReadXml (XmlReader reader)\r
-               {\r
-                       return ReadXml_internal (reader, false);\r
-               }\r
-\r
-               public XmlReadMode ReadXml_internal (XmlReader reader, bool serializable)\r
-               {\r
-                       // The documentation from MS for this method is rather\r
-                       // poor.  The following cases have been observed\r
-                       // during testing:\r
-                       //\r
-                       //     Reading a table from XML may create a DataSet to\r
-                       //     store child tables.\r
-                       //\r
-                       //     If the table has at least one column present,\r
-                       //     we do not require the schema to be present in\r
-                       //     the xml.  If the table has no columns, neither\r
-                       //     regular data nor diffgrams will be read, but\r
-                       //     will throw an error indicating that schema\r
-                       //     will not be inferred.\r
-                       //\r
-                       //     We will likely need to take advantage of the\r
-                       //     msdata:MainDataTable attribute added to the\r
-                       //     schema info to load into the appropriate\r
-                       //     locations.\r
-                       bool isPartOfDataSet = true;\r
-                       bool isTableNameBlank = false;\r
-                       XmlReadMode mode = XmlReadMode.ReadSchema;\r
-                       DataSet dataSet = null;\r
-                       DataSet ds = new DataSet ();\r
-\r
-                       reader.MoveToContent ();\r
-                       if (Columns.Count > 0 && reader.LocalName != "diffgram" || serializable)\r
-                               mode = ds.ReadXml (reader);\r
-                       else if (Columns.Count > 0 && reader.LocalName == "diffgram") {\r
-                                 try {\r
-                                       if (TableName == String.Empty)\r
-                                               isTableNameBlank = true;\r
-                                       if (DataSet == null) {\r
-                                               isPartOfDataSet = false;\r
-                                               ds.Tables.Add (this);\r
-                                               mode = ds.ReadXml (reader);\r
-                                       } else\r
-                                               mode = DataSet.ReadXml (reader);\r
-                                 } catch (DataException) {\r
-                                       mode = XmlReadMode.DiffGram;\r
-                                       if (isTableNameBlank)\r
-                                               TableName = String.Empty;\r
-                                 } finally {\r
-                                       if (!isPartOfDataSet)\r
-                                               ds.Tables.Remove (this);\r
-                                 }\r
-                                 return mode;\r
-                       } else {\r
-                               mode = ds.ReadXml (reader, XmlReadMode.ReadSchema);\r
-                       }\r
-                       if (mode == XmlReadMode.InferSchema)\r
-                               mode = XmlReadMode.IgnoreSchema;\r
-                       if (DataSet == null) {\r
-                                 isPartOfDataSet = false;\r
-                                 dataSet = new DataSet ();\r
-                                 if (TableName == String.Empty)\r
-                                       isTableNameBlank = true;\r
-                                 dataSet.Tables.Add (this);\r
-                       }\r
-\r
-                       DenyXmlResolving (this, ds, mode, isTableNameBlank, isPartOfDataSet);\r
-                       if (Columns.Count > 0 && TableName != ds.Tables [0].TableName) {\r
-                               if (isPartOfDataSet == false)\r
-                                       dataSet.Tables.Remove (this);\r
-\r
-                               if (isTableNameBlank && isPartOfDataSet == false)\r
-                                       TableName = String.Empty;\r
-                               return mode;\r
-                       }\r
-                       else {\r
-                               TableName = ds.Tables [0].TableName;\r
-                       }\r
-\r
-                       if (!isPartOfDataSet) {\r
-                               if (Columns.Count > 0) {\r
-                                       dataSet.Merge (ds, true, MissingSchemaAction.Ignore);\r
-                               } else {\r
-                                       dataSet.Merge (ds, true, MissingSchemaAction.AddWithKey);\r
-                               }\r
-                               if (ChildRelations.Count == 0) {\r
-                                       dataSet.Tables.Remove (this);\r
-                               } else {\r
-                                       dataSet.DataSetName = ds.DataSetName;\r
-                               }\r
-                       } else {\r
-                               if (Columns.Count > 0) {\r
-                                       DataSet.Merge (ds, true, MissingSchemaAction.Ignore);\r
-                               } else {\r
-                                       DataSet.Merge (ds, true, MissingSchemaAction.AddWithKey);\r
-                               }\r
-                       }\r
-                       return mode;\r
-               }\r
-\r
-               private void DenyXmlResolving (DataTable table, DataSet ds, XmlReadMode mode, bool isTableNameBlank, bool isPartOfDataSet)\r
-               {\r
-                       if (ds.Tables.Count == 0 && table.Columns.Count == 0)\r
-                               throw new InvalidOperationException ("DataTable does not support schema inference from XML");\r
-\r
-                       if (table.Columns.Count == 0 && ds.Tables [0].TableName != table.TableName && isTableNameBlank == false)\r
-                               throw new ArgumentException (String.Format ("DataTable '{0}' does not match to any DataTable in source",\r
-                                                                           table.TableName));\r
-\r
-                       if (table.Columns.Count > 0 && ds.Tables [0].TableName != table.TableName &&\r
-                           isTableNameBlank == false && mode == XmlReadMode.ReadSchema &&\r
-                           isPartOfDataSet == false)\r
-                               throw new ArgumentException (String.Format ("DataTable '{0}' does not match to any DataTable in source",\r
-                                                                           table.TableName));\r
-\r
-                       if (isPartOfDataSet == true && table.Columns.Count > 0 &&\r
-                           mode == XmlReadMode.ReadSchema && table.TableName != ds.Tables [0].TableName)\r
-                               throw new ArgumentException (String.Format ("DataTable '{0}' does not match to any DataTable in source",\r
-                                                                           table.TableName));\r
-               }\r
-\r
-               public void ReadXmlSchema (Stream stream)\r
-               {\r
-                       ReadXmlSchema (new XmlTextReader (stream));\r
-               }\r
-\r
-               public void ReadXmlSchema (TextReader reader)\r
-               {\r
-                       ReadXmlSchema (new XmlTextReader (reader));\r
-               }\r
-\r
-               public void ReadXmlSchema (string fileName)\r
-               {\r
-                       XmlTextReader reader = null;\r
-                       try {\r
-                               reader = new XmlTextReader (fileName);\r
-                               ReadXmlSchema (reader);\r
-                       } finally {\r
-                               if (reader != null)\r
-                                       reader.Close ();\r
-                       }\r
-               }\r
-\r
-               private bool ReadSchemaElement (XmlReader reader)\r
-               {\r
-                       var insideElement = false;\r
-                       reader.MoveToElement ();\r
-                       while (reader.Read ())\r
-                       {\r
-                               if (reader.NodeType == XmlNodeType.Element || reader.NodeType == XmlNodeType.EndElement)\r
-                               {\r
-                                       if (reader.NamespaceURI != XmlSchema.Namespace)\r
-                                       {\r
-                                               if (reader.LocalName == "schema" || insideElement)\r
-                                                       throw new ArgumentException ("The schema namespace is invalid. Please use this one instead: " + XmlSchema.Namespace);\r
-\r
-                                               insideElement = true;\r
-                                               reader.MoveToElement ();\r
-                                       }\r
-                                       else\r
-                                       {\r
-                                               return true;\r
-                                       }\r
-                               }\r
-                       }\r
-                       return false;\r
-               }\r
-\r
-               public void ReadXmlSchema (XmlReader reader)\r
-               {\r
-                       if (this.Columns.Count > 0)\r
-                               return;\r
-\r
-                       DataSet ds = new DataSet ();\r
-\r
-                       if (reader.ReadState == ReadState.Initial && !ReadSchemaElement (reader))\r
-                               return;\r
-\r
-                       new XmlSchemaDataImporter (ds, reader, false).Process ();\r
-                       DataTable target = null;\r
-                       if (TableName == String.Empty) {\r
-                               if (ds.Tables.Count > 0)\r
-                                       target = ds.Tables [0];\r
-                       }\r
-                       else {\r
-                               target = ds.Tables [TableName];\r
-                               if (target == null)\r
-                                       throw new ArgumentException (String.Format ("DataTable '{0}' does not match to any DataTable in source.", TableName));\r
-                       }\r
-                       if (target != null)\r
-                               target.CopyProperties (this);\r
-               }\r
-\r
-               [MonoNotSupported ("")]\r
-               protected virtual void ReadXmlSerializable (XmlReader reader)\r
-               {\r
-                       throw new NotImplementedException ();\r
-               }\r
-\r
-               private XmlWriterSettings GetWriterSettings ()\r
-               {\r
-                       XmlWriterSettings s = new XmlWriterSettings ();\r
-                       s.Indent = true;\r
-                       s.OmitXmlDeclaration = true;\r
-                       return s;\r
-               }\r
-\r
-               public void WriteXml (Stream stream)\r
-               {\r
-                       WriteXml (stream, XmlWriteMode.IgnoreSchema, false);\r
-               }\r
-\r
-               public void WriteXml (TextWriter writer)\r
-               {\r
-                       WriteXml (writer, XmlWriteMode.IgnoreSchema, false);\r
-               }\r
-\r
-               public void WriteXml (XmlWriter writer)\r
-               {\r
-                       WriteXml (writer, XmlWriteMode.IgnoreSchema, false);\r
-               }\r
-\r
-               public void WriteXml (string fileName)\r
-               {\r
-                       WriteXml (fileName, XmlWriteMode.IgnoreSchema, false);\r
-               }\r
-\r
-               public void WriteXml (Stream stream, XmlWriteMode mode)\r
-               {\r
-                       WriteXml (stream, mode, false);\r
-               }\r
-\r
-               public void WriteXml (TextWriter writer, XmlWriteMode mode)\r
-               {\r
-                       WriteXml (writer, mode, false);\r
-               }\r
-\r
-               public void WriteXml (XmlWriter writer, XmlWriteMode mode)\r
-               {\r
-                       WriteXml (writer, mode, false);\r
-               }\r
-\r
-               public void WriteXml (string fileName, XmlWriteMode mode)\r
-               {\r
-                       WriteXml (fileName, mode, false);\r
-               }\r
-\r
-               public void WriteXml (Stream stream, bool writeHierarchy)\r
-               {\r
-                       WriteXml (stream, XmlWriteMode.IgnoreSchema, writeHierarchy);\r
-               }\r
-\r
-               public void WriteXml (string fileName, bool writeHierarchy)\r
-               {\r
-                       WriteXml (fileName, XmlWriteMode.IgnoreSchema, writeHierarchy);\r
-               }\r
-\r
-               public void WriteXml (TextWriter writer, bool writeHierarchy)\r
-               {\r
-                       WriteXml (writer, XmlWriteMode.IgnoreSchema, writeHierarchy);\r
-               }\r
-\r
-               public void WriteXml (XmlWriter writer, bool writeHierarchy)\r
-               {\r
-                       WriteXml (writer, XmlWriteMode.IgnoreSchema, writeHierarchy);\r
-               }\r
-\r
-               public void WriteXml (Stream stream, XmlWriteMode mode, bool writeHierarchy)\r
-               {\r
-                       WriteXml (XmlWriter.Create (stream, GetWriterSettings ()), mode, writeHierarchy);\r
-               }\r
-\r
-               public void WriteXml (string fileName, XmlWriteMode mode, bool writeHierarchy)\r
-               {\r
-                       XmlWriter xw = null;\r
-                       try {\r
-                               xw = XmlWriter.Create (fileName, GetWriterSettings ());\r
-                               WriteXml (xw, mode, writeHierarchy);\r
-                       } finally {\r
-                               if (xw != null)\r
-                                       xw.Close ();\r
-                       }\r
-               }\r
-\r
-               public void WriteXml (TextWriter writer, XmlWriteMode mode, bool writeHierarchy)\r
-               {\r
-                       WriteXml (XmlWriter.Create (writer, GetWriterSettings ()), mode, writeHierarchy);\r
-               }\r
-\r
-               public void WriteXml (XmlWriter writer, XmlWriteMode mode, bool writeHierarchy)\r
-               {\r
-                       // If we're in mode XmlWriteMode.WriteSchema, we need to output an extra\r
-                       // msdata:MainDataTable attribute that wouldn't normally be part of the\r
-                       // DataSet WriteXml output.\r
-                       //\r
-                       // For the writeHierarchy == true case, we write what would be output by\r
-                       // a DataSet write, but we limit ourselves to our table and its descendants.\r
-                       //\r
-                       // For the writeHierarchy == false case, we write what would be output by\r
-                       // a DataSet write, but we limit ourselves to this table.\r
-                       //\r
-                       // If the table is not in a DataSet, we follow the following behaviour:\r
-                       //   For WriteSchema cases, we do a write as if there is a wrapper\r
-                       //   dataset called NewDataSet.\r
-                       //   For IgnoreSchema or DiffGram cases, we do a write as if there\r
-                       //   is a wrapper dataset called DocumentElement.\r
-\r
-                       // Generate a list of tables to write.\r
-                       List <DataTable> tables = new List <DataTable> ();\r
-                       if (writeHierarchy == false)\r
-                               tables.Add (this);\r
-                       else\r
-                               FindAllChildren (tables, this);\r
-\r
-                       // If we're in a DataSet, generate a list of relations to write.\r
-                       List <DataRelation> relations = new List <DataRelation> ();\r
-                       if (DataSet != null) {\r
-                               foreach (DataRelation relation in DataSet.Relations) {\r
-                                       if (tables.Contains (relation.ParentTable) &&\r
-                                          tables.Contains (relation.ChildTable))\r
-                                               relations.Add (relation);\r
-                               }\r
-                       }\r
-\r
-                       // Add the msdata:MainDataTable info if we're writing schema data.\r
-                       string mainDataTable = null;\r
-                       if (mode == XmlWriteMode.WriteSchema)\r
-                               mainDataTable = this.TableName;\r
-\r
-                       // Figure out the DataSet name.\r
-                       string dataSetName = null;\r
-                       if (DataSet != null)\r
-                               dataSetName = DataSet.DataSetName;\r
-                       else if (DataSet == null && mode == XmlWriteMode.WriteSchema)\r
-                               dataSetName = "NewDataSet";\r
-                       else\r
-                               dataSetName = "DocumentElement";\r
-\r
-                       XmlTableWriter.WriteTables(writer, mode, tables, relations, mainDataTable, dataSetName);\r
-               }\r
-\r
-               private void FindAllChildren(List<DataTable> list, DataTable root)\r
-               {\r
-                       if (!list.Contains(root))\r
-                       {\r
-                               list.Add(root);\r
-                               foreach (DataRelation relation in root.ChildRelations)\r
-                               {\r
-                                       FindAllChildren(list, relation.ChildTable);\r
-                               }\r
-                       }\r
-               }\r
-\r
-               public void WriteXmlSchema (Stream stream)\r
-               {\r
-                       if (TableName == "") {\r
-                               throw new InvalidOperationException ("Cannot serialize the DataTable. DataTable name is not set.");\r
-                       }\r
-                       XmlWriterSettings s = GetWriterSettings ();\r
-                       s.OmitXmlDeclaration = false;\r
-                       WriteXmlSchema (XmlWriter.Create (stream, s));\r
-               }\r
-\r
-               public void WriteXmlSchema (TextWriter writer)\r
-               {\r
-                       if (TableName == "") {\r
-                               throw new InvalidOperationException ("Cannot serialize the DataTable. DataTable name is not set.");\r
-                       }\r
-                       XmlWriterSettings s = GetWriterSettings ();\r
-                       s.OmitXmlDeclaration = false;\r
-                       WriteXmlSchema (XmlWriter.Create (writer, s));\r
-               }\r
-\r
-               public void WriteXmlSchema (XmlWriter writer)\r
-               {\r
-                       WriteXmlSchema (writer, false);\r
-/*\r
-                       if (TableName == "") {\r
-                               throw new InvalidOperationException ("Cannot serialize the DataTable. DataTable name is not set.");\r
-                       }\r
-                       DataSet ds = DataSet;\r
-                       DataSet tmp = null;\r
-                       try {\r
-                               if (ds == null) {\r
-                                       tmp = ds = new DataSet ();\r
-                                       ds.Tables.Add (this);\r
-                               }\r
-                               writer.WriteStartDocument ();\r
-                               DataTableCollection col = new DataTableCollection (ds);\r
-                               col.Add (this);\r
-                               DataTable [] tables = new DataTable [col.Count];\r
-                               for (int i = 0; i < col.Count; i++) tables[i] = col[i];\r
-                               string tableName;\r
-                               if (ds.Namespace == "")\r
-                                       tableName = TableName;\r
-                               else\r
-                                       tableName = ds.Namespace + "_x003A_" + TableName;\r
-                               XmlSchemaWriter.WriteXmlSchema (writer, tables, null, tableName, ds.DataSetName);\r
-                       } finally {\r
-                               if (tmp != null)\r
-                                       ds.Tables.Remove (this);\r
-                       }\r
-*/\r
-               }\r
-\r
-               public void WriteXmlSchema (string fileName)\r
-               {\r
-                       if (fileName == "") {\r
-                               throw new ArgumentException ("Empty path name is not legal.");\r
-                       }\r
-                       if (TableName == "") {\r
-                               throw new InvalidOperationException ("Cannot serialize the DataTable. DataTable name is not set.");\r
-                       }\r
-                       XmlTextWriter writer = null;\r
-                       try {\r
-                               XmlWriterSettings s = GetWriterSettings ();\r
-                               s.OmitXmlDeclaration = false;\r
-                               writer = new XmlTextWriter (fileName, null);\r
-                               WriteXmlSchema (writer);\r
-                       } finally {\r
-                               if (writer != null) {\r
-                                       writer.Close ();\r
-                               }\r
-                       }\r
-               }\r
-\r
-               public void WriteXmlSchema (Stream stream, bool writeHierarchy)\r
-               {\r
-                       if (TableName == "") {\r
-                               throw new InvalidOperationException ("Cannot serialize the DataTable. DataTable name is not set.");\r
-                       }\r
-                       XmlWriterSettings s = GetWriterSettings ();\r
-                       s.OmitXmlDeclaration = false;\r
-                       WriteXmlSchema (XmlWriter.Create (stream, s), writeHierarchy);\r
-               }\r
-\r
-               public void WriteXmlSchema (TextWriter writer, bool writeHierarchy)\r
-               {\r
-                       if (TableName == "") {\r
-                               throw new InvalidOperationException ("Cannot serialize the DataTable. DataTable name is not set.");\r
-                       }\r
-                       XmlWriterSettings s = GetWriterSettings ();\r
-                       s.OmitXmlDeclaration = false;\r
-                       WriteXmlSchema (XmlWriter.Create (writer, s), writeHierarchy);\r
-               }\r
-\r
-               public void WriteXmlSchema (XmlWriter writer, bool writeHierarchy)\r
-               {\r
-                       if (TableName == "") {\r
-                               throw new InvalidOperationException ("Cannot serialize the DataTable. DataTable name is not set.");\r
-                       }\r
-//                     if (writeHierarchy == false) {\r
-//                             WriteXmlSchema (writer);\r
-//                     }\r
-//                     else {\r
-                               DataSet ds = DataSet;\r
-                               DataSet tmp = null;\r
-                               try {\r
-                                       if (ds == null) {\r
-                                               tmp = ds = new DataSet ();\r
-                                               ds.Tables.Add (this);\r
-                                       }\r
-                                       writer.WriteStartDocument ();\r
-                                       //XmlSchemaWriter.WriteXmlSchema (ds, writer);\r
-                                       //DataTable [] tables = new DataTable [ds.Tables.Count];\r
-                                       DataTable [] tables = null;\r
-                                       //DataRelation [] relations =  new DataRelation [ds.Relations.Count];\r
-                                       //for (int i = 0; i < ds.Relations.Count; i++) {\r
-                                       //      relations[i] = ds.Relations[i];\r
-                                       //}\r
-                                       DataRelation [] relations = null;\r
-                                       if (writeHierarchy && ChildRelations.Count > 0) {\r
-                                               relations = new DataRelation [ChildRelations.Count];\r
-                                               for (int i = 0; i < ChildRelations.Count; i++) {\r
-                                                       relations [i] = ChildRelations [i];\r
-                                               }\r
-                                               tables = new DataTable [ds.Tables.Count];\r
-                                               for (int i = 0; i < ds.Tables.Count; i++) tables [i] = ds.Tables [i];\r
-                                       } else {\r
-                                               tables = new DataTable [1];\r
-                                               tables [0] = this;\r
-                                       }\r
-\r
-                                       string tableName;\r
-                                       if (ds.Namespace == "")\r
-                                               tableName = TableName;\r
-                                       else\r
-                                               tableName = ds.Namespace + "_x003A_" + TableName;\r
-                                       XmlSchemaWriter.WriteXmlSchema (writer, tables, relations, tableName, ds.DataSetName, LocaleSpecified ? Locale : ds.LocaleSpecified ? ds.Locale : null);\r
-                               } finally {\r
-                                       if (tmp != null)\r
-                                               ds.Tables.Remove (this);\r
-                               }\r
-//                     }\r
-               }\r
-\r
-               public void WriteXmlSchema (string fileName, bool writeHierarchy)\r
-               {\r
-                       if (fileName == "") {\r
-                               throw new ArgumentException ("Empty path name is not legal.");\r
-                       }\r
-                       if (TableName == "") {\r
-                               throw new InvalidOperationException ("Cannot serialize the DataTable. DataTable name is not set.");\r
-                       }\r
-                       XmlTextWriter writer = null;\r
-                       try {\r
-                               XmlWriterSettings s = GetWriterSettings ();\r
-                               s.OmitXmlDeclaration = false;\r
-                               writer = new XmlTextWriter (fileName, null);\r
-                               WriteXmlSchema (writer, writeHierarchy);\r
-                       } finally {\r
-                               if (writer != null) {\r
-                                       writer.Close ();\r
-                               }\r
-                       }\r
-               }\r
-       }\r
-\r
-       partial class DataTable : ISupportInitializeNotification {\r
-               private bool tableInitialized = true;\r
-\r
-               [Browsable (false)]\r
-               public bool IsInitialized {\r
-                       get { return tableInitialized; }\r
-               }\r
-\r
-               public event EventHandler Initialized;\r
-\r
-               private void OnTableInitialized (EventArgs e)\r
-               {\r
-                       if (null != Initialized)\r
-                               Initialized (this, e);\r
-               }\r
-\r
-               partial void DataTableInitialized ()\r
-               {\r
-                       tableInitialized = true;\r
-                       OnTableInitialized (new EventArgs ());\r
-               }\r
-       }\r
-\r
-       partial class DataTable {\r
-               public DataTable (string tableName, string tableNamespace)\r
-                       : this (tableName)\r
-               {\r
-                       _nameSpace = tableNamespace;\r
-               }\r
-\r
-               SerializationFormat remotingFormat = SerializationFormat.Xml;\r
-               [DefaultValue (SerializationFormat.Xml)]\r
-               public SerializationFormat RemotingFormat {\r
-                       get {\r
-                               if (dataSet != null)\r
-                                       remotingFormat = dataSet.RemotingFormat;\r
-                               return remotingFormat;\r
-                       }\r
-                       set {\r
-                               if (dataSet != null)\r
-                                       throw new ArgumentException ("Cannot have different remoting format property value for DataSet and DataTable");\r
-                               remotingFormat = value;\r
-                       }\r
-               }\r
-\r
-               internal void DeserializeConstraints (ArrayList arrayList)\r
-               {\r
-                       bool fKeyNavigate = false;\r
-                       for (int i = 0; i < arrayList.Count; i++) {\r
-                               ArrayList tmpArrayList = arrayList [i] as ArrayList;\r
-                               if (tmpArrayList == null)\r
-                                       continue;\r
-                               if ((string) tmpArrayList [0] == "F") {\r
-                                       int [] constraintsArray = tmpArrayList [2] as int [];\r
-\r
-                                       if (constraintsArray == null)\r
-                                               continue;\r
-                                       ArrayList parentColumns = new ArrayList ();\r
-                                       DataTable dt = dataSet.Tables [constraintsArray [0]];\r
-                                       for (int j = 0; j < constraintsArray.Length - 1; j++) {\r
-                                               parentColumns.Add (dt.Columns [constraintsArray [j + 1]]);\r
-                                       }\r
-\r
-                                       constraintsArray = tmpArrayList [3] as int [];\r
-\r
-                                       if (constraintsArray == null)\r
-                                               continue;\r
-                                       ArrayList childColumns  = new ArrayList ();\r
-                                       dt = dataSet.Tables [constraintsArray [0]];\r
-                                       for (int j = 0; j < constraintsArray.Length - 1; j++) {\r
-                                               childColumns.Add (dt.Columns [constraintsArray [j + 1]]);\r
-                                       }\r
-\r
-                                       ForeignKeyConstraint fKeyConstraint = new\r
-                                         ForeignKeyConstraint ((string) tmpArrayList [1],\r
-                                                               (DataColumn []) parentColumns.ToArray (typeof (DataColumn)),\r
-                                                               (DataColumn []) childColumns.ToArray (typeof (DataColumn)));\r
-                                       Array ruleArray = (Array) tmpArrayList [4];\r
-                                       fKeyConstraint.AcceptRejectRule = (AcceptRejectRule) ruleArray.GetValue (0);\r
-                                       fKeyConstraint.UpdateRule = (Rule) ruleArray.GetValue (1);\r
-                                       fKeyConstraint.DeleteRule = (Rule) ruleArray.GetValue (2);\r
-                                       // FIXME: refactor this deserialization code out to ForeighKeyConstraint\r
-                                       fKeyConstraint.SetExtendedProperties ((PropertyCollection) tmpArrayList [5]);\r
-                                       Constraints.Add (fKeyConstraint);\r
-                                       fKeyNavigate = true;\r
-                               } else if (fKeyNavigate == false &&\r
-                                          (string) tmpArrayList [0] == "U") {\r
-                                       UniqueConstraint unique = null;\r
-                                       ArrayList uniqueDataColumns = new ArrayList ();\r
-                                       int [] constraintsArray = tmpArrayList [2] as int [];\r
-\r
-                                       if (constraintsArray == null)\r
-                                               continue;\r
-\r
-                                       for (int j = 0; j < constraintsArray.Length; j++) {\r
-                                               uniqueDataColumns.Add (Columns [constraintsArray [j]]);\r
-                                       }\r
-                                       unique = new UniqueConstraint ((string) tmpArrayList[1],\r
-                                                                      (DataColumn[]) uniqueDataColumns.\r
-                                                                      ToArray (typeof (DataColumn)),\r
-                                                                      (bool) tmpArrayList [3]);\r
-                                       /*\r
-                                         If UniqueConstraint already exist, don't add them\r
-                                       */\r
-                                       if (Constraints.IndexOf (unique) != -1 ||\r
-                                           Constraints.IndexOf ((string) tmpArrayList[1]) != -1) {\r
-                                               continue;\r
-                                       }\r
-                                       // FIXME: refactor this deserialization code out to UniqueConstraint\r
-                                       unique.SetExtendedProperties ((PropertyCollection) tmpArrayList [4]);\r
-                                       Constraints.Add (unique);\r
-                               } else {\r
-                                       fKeyNavigate = false;\r
-                               }\r
-                       }\r
-               }\r
-\r
-               DataRowState GetCurrentRowState (BitArray rowStateBitArray, int i)\r
-               {\r
-                       DataRowState currentRowState;\r
-                       if (rowStateBitArray[i] == false &&\r
-                           rowStateBitArray[i+1] == false &&\r
-                           rowStateBitArray[i+2] == true)\r
-                               currentRowState = DataRowState.Detached;\r
-                       else if (rowStateBitArray[i] == false &&\r
-                                rowStateBitArray[i+1] == false &&\r
-                                rowStateBitArray[i+2] == false)\r
-                               currentRowState = DataRowState.Unchanged;\r
-                       else if (rowStateBitArray[i] == false &&\r
-                                rowStateBitArray[i+1] == true &&\r
-                                rowStateBitArray[i+2] == false)\r
-                               currentRowState = DataRowState.Added;\r
-                       else if (rowStateBitArray[i] == true &&\r
-                                rowStateBitArray[i+1] == true &&\r
-                                rowStateBitArray[i+2] == false)\r
-                               currentRowState = DataRowState.Deleted;\r
-                       else\r
-                               currentRowState = DataRowState.Modified;\r
-                       return currentRowState;\r
-               }\r
-\r
-               internal void DeserializeRecords (ArrayList arrayList, ArrayList nullBits, BitArray rowStateBitArray)\r
-               {\r
-                       BitArray  nullBit = null;\r
-                       if (arrayList == null || arrayList.Count < 1)\r
-                               return;\r
-                       int len = ((Array) arrayList [0]).Length;\r
-                       object [] tmpArray = new object [arrayList.Count];\r
-                       int k = 0;\r
-                       DataRowState currentRowState;\r
-                       for (int l = 0; l < len; l++) { // Columns\r
-                               currentRowState = GetCurrentRowState (rowStateBitArray, k *3);\r
-                               for (int j = 0; j < arrayList.Count; j++) { // Rows\r
-                                       Array array = (Array) arrayList [j];\r
-                                       nullBit = (BitArray) nullBits [j];\r
-                                       if (nullBit [l] == false) {\r
-                                               tmpArray [j] = array.GetValue (l);\r
-                                       } else {\r
-                                               tmpArray [j] = null;\r
-                                       }\r
-                               }\r
-                               LoadDataRow (tmpArray, false);\r
-                               if (currentRowState == DataRowState.Modified) {\r
-                                       Rows[k].AcceptChanges ();\r
-                                       l++;\r
-                                       for (int j = 0; j < arrayList.Count; j++) {\r
-                                               Array array = (Array) arrayList [j];\r
-                                               nullBit = (BitArray) nullBits[j];\r
-                                               if (nullBit [l] == false) {\r
-                                                       Rows [k][j] = array.GetValue (l);\r
-                                               } else {\r
-                                                       Rows [k][j] = null;\r
-                                               }\r
-                                       }\r
-                               } else if (currentRowState == DataRowState.Unchanged) {\r
-                                       Rows[k].AcceptChanges ();\r
-                               } else if (currentRowState == DataRowState.Deleted) {\r
-                                       Rows[k].AcceptChanges ();\r
-                                       Rows[k].Delete ();\r
-                               }\r
-                               k++;\r
-                       }\r
-               }\r
-\r
-               void BinaryDeserializeTable (SerializationInfo info)\r
-               {\r
-                       ArrayList arrayList = null;\r
-\r
-                       TableName = info.GetString ("DataTable.TableName");\r
-                       Namespace = info.GetString ("DataTable.Namespace");\r
-                       Prefix = info.GetString ("DataTable.Prefix");\r
-                       CaseSensitive = info.GetBoolean ("DataTable.CaseSensitive");\r
-                       /*\r
-                         FIXME: Private variable available in SerializationInfo\r
-                         this.caseSensitiveAmbientCaseSensitive = info.GetBoolean("DataTable.caseSensitiveAmbientCaseSensitive");\r
-                         this.NestedInDataSet = info.GetBoolean("DataTable.NestedInDataSet");\r
-                         this.RepeatableElement = info.GetBoolean("DataTable.RepeatableElement");\r
-                         this.RemotingVersion = (System.Version) info.GetValue("DataTable.RemotingVersion",\r
-                         typeof(System.Version));\r
-                       */\r
-                       Locale = new CultureInfo (info.GetInt32 ("DataTable.LocaleLCID"));\r
-                       _extendedProperties = (PropertyCollection) info.GetValue ("DataTable.ExtendedProperties",\r
-                                                                                typeof (PropertyCollection));\r
-                       MinimumCapacity = info.GetInt32 ("DataTable.MinimumCapacity");\r
-                       int columnsCount = info.GetInt32 ("DataTable.Columns.Count");\r
-\r
-                       for (int i = 0; i < columnsCount; i++) {\r
-                               Columns.Add ();\r
-                               string prefix = "DataTable.DataColumn_" + i + ".";\r
-                               Columns[i].ColumnName = info.GetString (prefix + "ColumnName");\r
-                               Columns[i].Namespace = info.GetString (prefix + "Namespace");\r
-                               Columns[i].Caption = info.GetString (prefix + "Caption");\r
-                               Columns[i].Prefix = info.GetString (prefix + "Prefix");\r
-                               Columns[i].DataType = (Type) info.GetValue (prefix + "DataType",\r
-                                                                           typeof (Type));\r
-                               Columns[i].DefaultValue = info.GetValue (prefix + "DefaultValue",\r
-                                                                                 typeof (Object));\r
-                               Columns[i].AllowDBNull = info.GetBoolean (prefix + "AllowDBNull");\r
-                               Columns[i].AutoIncrement = info.GetBoolean (prefix + "AutoIncrement");\r
-                               Columns[i].AutoIncrementStep = info.GetInt64 (prefix + "AutoIncrementStep");\r
-                               Columns[i].AutoIncrementSeed = info.GetInt64(prefix + "AutoIncrementSeed");\r
-                               Columns[i].ReadOnly = info.GetBoolean (prefix + "ReadOnly");\r
-                               Columns[i].MaxLength = info.GetInt32 (prefix + "MaxLength");\r
-                               /*\r
-                                 FIXME: Private variable available in SerializationInfo\r
-                                 this.Columns[i].SimpleType = info.GetString("DataTable.DataColumn_" +\r
-                                 i + ".SimpleType");\r
-                                 this.Columns[i].AutoIncrementCurrent = info.GetInt64("DataTable.DataColumn_" +\r
-                                 i + ".AutoIncrementCurrent");\r
-                                 this.Columns[i].XmlDataType = info.GetString("DataTable.DataColumn_" +\r
-                                 i + ".XmlDataType");\r
-                               */\r
-                               Columns[i].ExtendedProperties = (PropertyCollection) info.GetValue (prefix + "ExtendedProperties",\r
-                                                                                                   typeof (PropertyCollection));\r
-                               if (Columns[i].DataType == typeof (DataSetDateTime)) {\r
-                                       Columns[i].DateTimeMode = (DataSetDateTime) info.GetValue (prefix + "DateTimeMode",\r
-                                                                                                  typeof (DataSetDateTime));\r
-                               }\r
-                               Columns[i].ColumnMapping = (MappingType) info.GetValue (prefix + "ColumnMapping",\r
-                                                                                       typeof (MappingType));\r
-                               try {\r
-                                       Columns[i].Expression = info.GetString (prefix + "Expression");\r
-\r
-                                       prefix = "DataTable_0.";\r
-\r
-                                       arrayList = (ArrayList) info.GetValue (prefix + "Constraints",\r
-                                                                              typeof (ArrayList));\r
-                                       if (Constraints == null)\r
-                                               Constraints = new ConstraintCollection (this);\r
-                                       DeserializeConstraints (arrayList);\r
-                               } catch (SerializationException) {\r
-                               }\r
-                       }\r
-                       try {\r
-                               String prefix = "DataTable_0.";\r
-                               ArrayList nullBits = (ArrayList) info.GetValue (prefix + "NullBits",\r
-                                                                               typeof (ArrayList));\r
-                               arrayList = (ArrayList) info.GetValue (prefix + "Records",\r
-                                                                      typeof (ArrayList));\r
-                               BitArray rowStateBitArray = (BitArray) info.GetValue (prefix + "RowStates",\r
-                                                                                     typeof (BitArray));\r
-                               Hashtable htRowErrors = (Hashtable) info.GetValue (prefix + "RowErrors",\r
-                                                                                 typeof (Hashtable));\r
-                               DeserializeRecords (arrayList, nullBits, rowStateBitArray);\r
-                       } catch (SerializationException) {\r
-                       }\r
-               }\r
-\r
-               internal void BinarySerializeProperty (SerializationInfo info)\r
-               {\r
-                       Version vr = new Version (2, 0);\r
-                       info.AddValue ("DataTable.RemotingVersion", vr);\r
-                       info.AddValue ("DataTable.RemotingFormat", RemotingFormat);\r
-                       info.AddValue ("DataTable.TableName", TableName);\r
-                       info.AddValue ("DataTable.Namespace", Namespace);\r
-                       info.AddValue ("DataTable.Prefix", Prefix);\r
-                       info.AddValue ("DataTable.CaseSensitive", CaseSensitive);\r
-                       /*\r
-                         FIXME: Required by MS.NET\r
-                         caseSensitiveAmbient, NestedInDataSet, RepeatableElement\r
-                       */\r
-                       info.AddValue ("DataTable.caseSensitiveAmbient", true);\r
-                       info.AddValue ("DataTable.NestedInDataSet", true);\r
-                       info.AddValue ("DataTable.RepeatableElement", false);\r
-                       info.AddValue ("DataTable.LocaleLCID", Locale.LCID);\r
-                       info.AddValue ("DataTable.MinimumCapacity", MinimumCapacity);\r
-                       info.AddValue ("DataTable.Columns.Count", Columns.Count);\r
-                       info.AddValue ("DataTable.ExtendedProperties", _extendedProperties);\r
-                       for (int i = 0; i < Columns.Count; i++) {\r
-                               info.AddValue ("DataTable.DataColumn_" + i + ".ColumnName",\r
-                                              Columns[i].ColumnName);\r
-                               info.AddValue ("DataTable.DataColumn_" + i + ".Namespace",\r
-                                              Columns[i].Namespace);\r
-                               info.AddValue ("DataTable.DataColumn_" + i + ".Caption",\r
-                                              Columns[i].Caption);\r
-                               info.AddValue ("DataTable.DataColumn_" + i + ".Prefix",\r
-                                              Columns[i].Prefix);\r
-                               info.AddValue ("DataTable.DataColumn_" + i + ".DataType",\r
-                                              Columns[i].DataType, typeof (Type));\r
-                               info.AddValue ("DataTable.DataColumn_" + i + ".DefaultValue",\r
-                                              Columns[i].DefaultValue);\r
-                               info.AddValue ("DataTable.DataColumn_" + i + ".AllowDBNull",\r
-                                              Columns[i].AllowDBNull);\r
-                               info.AddValue ("DataTable.DataColumn_" + i + ".AutoIncrement",\r
-                                              Columns[i].AutoIncrement);\r
-                               info.AddValue ("DataTable.DataColumn_" + i + ".AutoIncrementStep",\r
-                                              Columns[i].AutoIncrementStep);\r
-                               info.AddValue ("DataTable.DataColumn_" + i + ".AutoIncrementSeed",\r
-                                              Columns[i].AutoIncrementSeed);\r
-                               info.AddValue ("DataTable.DataColumn_" + i + ".ReadOnly",\r
-                                              Columns[i].ReadOnly);\r
-                               info.AddValue ("DataTable.DataColumn_" + i + ".MaxLength",\r
-                                              Columns[i].MaxLength);\r
-                               info.AddValue ("DataTable.DataColumn_" + i + ".ExtendedProperties",\r
-                                              Columns[i].ExtendedProperties);\r
-                               info.AddValue ("DataTable.DataColumn_" + i + ".DateTimeMode",\r
-                                              Columns[i].DateTimeMode);\r
-                               info.AddValue ("DataTable.DataColumn_" + i + ".ColumnMapping",\r
-                                              Columns[i].ColumnMapping, typeof (MappingType));\r
-                               /*\r
-                                 FIXME: Required by MS.NET\r
-                                 SimpleType, AutoIncrementCurrent, XmlDataType\r
-                               */\r
-                               info.AddValue ("DataTable.DataColumn_" + i + ".SimpleType",\r
-                                              null, typeof (string));\r
-                               info.AddValue ("DataTable.DataColumn_" + i + ".AutoIncrementCurrent",\r
-                                              Columns[i].AutoIncrementValue());\r
-                               info.AddValue ("DataTable.DataColumn_" + i + ".XmlDataType",\r
-                                              null, typeof (string));\r
-                       }\r
-                       /*\r
-                         FIXME: Required by MS.NET\r
-                         TypeName\r
-                       */\r
-                       info.AddValue ("DataTable.TypeName", null, typeof (string));\r
-               }\r
-\r
-               internal void SerializeConstraints (SerializationInfo info, string prefix)\r
-               {\r
-                       ArrayList constraintArrayList = new ArrayList ();\r
-                       for (int j = 0; j < Constraints.Count; j++) {\r
-                               ArrayList constraintList = new ArrayList ();\r
-                               if (Constraints[j] is UniqueConstraint) {\r
-                                       constraintList.Add ("U");\r
-                                       UniqueConstraint unique = (UniqueConstraint) Constraints [j];\r
-                                       constraintList.Add (unique.ConstraintName);\r
-                                       DataColumn [] columns = unique.Columns;\r
-                                       int [] tmpArray = new int [columns.Length];\r
-                                       for (int k = 0; k < columns.Length; k++)\r
-                                               tmpArray [k] = unique.Table.Columns.IndexOf (unique.Columns [k]);\r
-                                       constraintList.Add (tmpArray);\r
-                                       constraintList.Add (unique.IsPrimaryKey);\r
-                                       constraintList.Add (unique.ExtendedProperties);\r
-                               } else if (Constraints[j] is ForeignKeyConstraint) {\r
-                                       constraintList.Add ("F");\r
-                                       ForeignKeyConstraint fKey = (ForeignKeyConstraint) Constraints [j];\r
-                                       constraintList.Add (fKey.ConstraintName);\r
-\r
-                                       int [] tmpArray = new int [fKey.RelatedColumns.Length + 1];\r
-                                       tmpArray [0] = DataSet.Tables.IndexOf (fKey.RelatedTable);\r
-                                       for (int i = 0; i < fKey.Columns.Length; i++) {\r
-                                               tmpArray [i + 1] = fKey.RelatedColumns [i].Ordinal;\r
-                                       }\r
-                                       constraintList.Add (tmpArray);\r
-\r
-                                       tmpArray = new int [fKey.Columns.Length + 1];\r
-                                       tmpArray [0] = DataSet.Tables.IndexOf (fKey.Table);\r
-                                       for (int i = 0; i < fKey.Columns.Length; i++) {\r
-                                               tmpArray [i + 1] = fKey.Columns [i].Ordinal;\r
-                                       }\r
-                                       constraintList.Add (tmpArray);\r
-\r
-                                       tmpArray = new int [3];\r
-                                       tmpArray [0] = (int) fKey.AcceptRejectRule;\r
-                                       tmpArray [1] = (int) fKey.UpdateRule;\r
-                                       tmpArray [2] = (int) fKey.DeleteRule;\r
-                                       constraintList.Add (tmpArray);\r
-\r
-                                       constraintList.Add (fKey.ExtendedProperties);\r
-                               }\r
-                               else\r
-                                       continue;\r
-                               constraintArrayList.Add (constraintList);\r
-                       }\r
-                       info.AddValue (prefix, constraintArrayList, typeof (ArrayList));\r
-               }\r
-\r
-               internal void BinarySerialize (SerializationInfo info, string prefix)\r
-               {\r
-                       int columnsCount = Columns.Count;\r
-                       int rowsCount = Rows.Count;\r
-                       int recordsCount = Rows.Count;\r
-                       ArrayList recordList = new ArrayList ();\r
-                       ArrayList bitArrayList = new ArrayList ();\r
-                       BitArray rowStateBitArray = new BitArray (rowsCount * 3);\r
-                       for (int k = 0; k < Rows.Count; k++) {\r
-                               if (Rows[k].RowState == DataRowState.Modified)\r
-                                       recordsCount++;\r
-                       }\r
-                       SerializeConstraints (info, prefix + "Constraints");\r
-                       for (int j = 0; j < columnsCount; j++) {\r
-                               if (rowsCount == 0)\r
-                                       continue;\r
-                               BitArray nullBits = new BitArray (rowsCount);\r
-                               DataColumn column = Columns [j];\r
-                               Array recordArray = Array.CreateInstance (column.DataType, recordsCount);\r
-                               for (int k = 0, l = 0; k < Rows.Count; k++, l++) {\r
-                                       DataRowVersion version;\r
-                                       DataRow dr = Rows[k];\r
-                                       if (dr.RowState == DataRowState.Modified) {\r
-                                               version = DataRowVersion.Default;\r
-                                               nullBits.Length = nullBits.Length + 1;\r
-                                               if (dr.IsNull (column, version) == false) {\r
-                                                       nullBits [l] = false;\r
-                                                       recordArray.SetValue (dr [j, version], l);\r
-                                               } else {\r
-                                                       nullBits [l] = true;\r
-                                               }\r
-                                               l++;\r
-                                               version = DataRowVersion.Current;\r
-                                       } else if (dr.RowState == DataRowState.Deleted) {\r
-                                               version = DataRowVersion.Original;\r
-                                       } else {\r
-                                               version = DataRowVersion.Default;\r
-                                       }\r
-                                       if (dr.IsNull (column, version) == false) {\r
-                                               nullBits [l] = false;\r
-                                               recordArray.SetValue (dr [j, version], l);\r
-                                       } else {\r
-                                               nullBits [l] = true;\r
-                                       }\r
-                               }\r
-                               recordList.Add (recordArray);\r
-                               bitArrayList.Add (nullBits);\r
-                       }\r
-                       for (int j = 0; j < Rows.Count; j++) {\r
-                               int l = j * 3;\r
-                               DataRowState rowState = Rows [j].RowState;\r
-                               if (rowState == DataRowState.Detached) {\r
-                                       rowStateBitArray [l] = false;\r
-                                       rowStateBitArray [l + 1] = false;\r
-                                       rowStateBitArray [l + 2] = true;\r
-                               } else if (rowState == DataRowState.Unchanged) {\r
-                                       rowStateBitArray [l] = false;\r
-                                       rowStateBitArray [l + 1] = false;\r
-                                       rowStateBitArray [l + 2] = false;\r
-                               } else if (rowState == DataRowState.Added) {\r
-                                       rowStateBitArray [l] = false;\r
-                                       rowStateBitArray [l + 1] = true;\r
-                                       rowStateBitArray [l + 2] = false;\r
-                               } else if (rowState == DataRowState.Deleted) {\r
-                                       rowStateBitArray [l] = true;\r
-                                       rowStateBitArray [l + 1] = true;\r
-                                       rowStateBitArray [l + 2] = false;\r
-                               } else {\r
-                                       rowStateBitArray [l] = true;\r
-                                       rowStateBitArray [l + 1] = false;\r
-                                       rowStateBitArray [l + 2] = false;\r
-                               }\r
-                       }\r
-                       info.AddValue (prefix + "Rows.Count", Rows.Count);\r
-                       info.AddValue (prefix + "Records.Count", recordsCount);\r
-                       info.AddValue (prefix + "Records", recordList, typeof (ArrayList));\r
-                       info.AddValue (prefix + "NullBits", bitArrayList, typeof (ArrayList));\r
-                       info.AddValue (prefix + "RowStates",\r
-                                      rowStateBitArray, typeof (BitArray));\r
-                       // FIXME: To get row errors\r
-                       Hashtable htRowErrors = new Hashtable ();\r
-                       info.AddValue (prefix + "RowErrors",\r
-                                      htRowErrors, typeof (Hashtable));\r
-                       // FIXME: To get column errors\r
-                       Hashtable htColumnErrors = new Hashtable ();\r
-                       info.AddValue (prefix + "ColumnErrors",\r
-                                      htColumnErrors, typeof (Hashtable));\r
-               }\r
-\r
-               public DataTableReader CreateDataReader ()\r
-               {\r
-                       return new DataTableReader (this);\r
-               }\r
-\r
-               /// <summary>\r
-               ///     Loads the table with the values from the reader\r
-               /// </summary>\r
-               public void Load (IDataReader reader)\r
-               {\r
-                       if (reader == null)\r
-                               throw new ArgumentNullException ("Value cannot be null. Parameter name: reader");\r
-                       Load (reader, LoadOption.PreserveChanges);\r
-               }\r
-\r
-               /// <summary>\r
-               ///     Loads the table with the values from the reader and the pattern\r
-               ///     of the changes to the existing rows or the new rows are based on\r
-               ///     the LoadOption passed.\r
-               /// </summary>\r
-               public void Load (IDataReader reader, LoadOption loadOption)\r
-               {\r
-                       if (reader == null)\r
-                               throw new ArgumentNullException ("Value cannot be null. Parameter name: reader");\r
-                       bool prevEnforceConstr = this.EnforceConstraints;\r
-                       try {\r
-                               this.EnforceConstraints = false;\r
-                               int [] mapping = DbDataAdapter.BuildSchema (reader, this, SchemaType.Mapped,\r
-                                                                           MissingSchemaAction.AddWithKey,\r
-                                                                           MissingMappingAction.Passthrough,\r
-                                                                           new DataTableMappingCollection ());\r
-                               DbDataAdapter.FillFromReader (this,\r
-                                                             reader,\r
-                                                             0, // start from\r
-                                                             0, // all records\r
-                                                             mapping,\r
-                                                             loadOption);\r
-                       } finally {\r
-                               this.EnforceConstraints = prevEnforceConstr;\r
-                       }\r
-               }\r
-\r
-               public virtual void Load (IDataReader reader, LoadOption loadOption, FillErrorEventHandler errorHandler)\r
-               {\r
-                       if (reader == null)\r
-                               throw new ArgumentNullException ("Value cannot be null. Parameter name: reader");\r
-\r
-                       bool prevEnforceConstr = this.EnforceConstraints;\r
-                       try {\r
-                               this.EnforceConstraints = false;\r
-\r
-                               int [] mapping = DbDataAdapter.BuildSchema (reader, this, SchemaType.Mapped,\r
-                                                                           MissingSchemaAction.AddWithKey,\r
-                                                                           MissingMappingAction.Passthrough,\r
-                                                                           new DataTableMappingCollection ());\r
-                               DbDataAdapter.FillFromReader (this,\r
-                                                             reader,\r
-                                                             0, // start from\r
-                                                             0, // all records\r
-                                                             mapping,\r
-                                                             loadOption,\r
-                                                             errorHandler);\r
-                       } finally {\r
-                               this.EnforceConstraints = prevEnforceConstr;\r
-                       }\r
-               }\r
-\r
-               /// <summary>\r
-               ///     Loads the given values into an existing row if matches or creates\r
-               ///     the new row popluated with the values.\r
-               /// </summary>\r
-               /// <remarks>\r
-               ///     This method searches for the values using primary keys and it first\r
-               ///     searches using the original values of the rows and if not found, it\r
-               ///     searches using the current version of the row.\r
-               /// </remarks>\r
-               public DataRow LoadDataRow (object [] values, LoadOption loadOption)\r
-               {\r
-                       DataRow row = null;\r
-\r
-                       // Find Data DataRow\r
-                       if (this.PrimaryKey.Length > 0) {\r
-                               object [] keys = new object [PrimaryKey.Length];\r
-                               for (int i = 0; i < PrimaryKey.Length; i++)\r
-                                       keys [i] = values [PrimaryKey [i].Ordinal];\r
-\r
-                               row = Rows.Find (keys, DataViewRowState.OriginalRows);\r
-                               if (row == null)\r
-                                       row = Rows.Find (keys);\r
-                       }\r
-\r
-                       // If not found, add new row\r
-                       if (row == null ||\r
-                           (row.RowState == DataRowState.Deleted && loadOption == LoadOption.Upsert)) {\r
-                               row = NewNotInitializedRow ();\r
-                               row.ImportRecord (CreateRecord (values));\r
-\r
-                               row.Validate (); // this adds to index ;-)\r
-\r
-                               if (loadOption == LoadOption.OverwriteChanges ||\r
-                                   loadOption == LoadOption.PreserveChanges)\r
-                                       Rows.AddInternal (row, DataRowAction.ChangeCurrentAndOriginal);\r
-                               else\r
-                                       Rows.AddInternal(row);\r
-                               return row;\r
-                       }\r
-\r
-                       row.Load (values, loadOption);\r
-\r
-                       return row;\r
-               }\r
-\r
-               public void Merge (DataTable table)\r
-               {\r
-                       Merge (table, false, MissingSchemaAction.Add);\r
-               }\r
-\r
-               public void Merge (DataTable table, bool preserveChanges)\r
-               {\r
-                       Merge (table, preserveChanges, MissingSchemaAction.Add);\r
-               }\r
-\r
-               public void Merge (DataTable table, bool preserveChanges, MissingSchemaAction missingSchemaAction)\r
-               {\r
-                       MergeManager.Merge (this, table, preserveChanges, missingSchemaAction);\r
-               }\r
-\r
-               internal int CompareRecords (int x, int y)\r
-               {\r
-                       for (int col = 0; col < Columns.Count; col++) {\r
-                               int res = Columns[col].DataContainer.CompareValues (x, y);\r
-                               if (res != 0)\r
-                                       return res;\r
-                       }\r
-\r
-                       return 0;\r
-               }\r
-\r
-               /// <summary>\r
-               /// Occurs after the Clear method is called on the datatable.\r
-               /// </summary>\r
-               [DataCategory ("Data")]\r
-               public event DataTableClearEventHandler TableCleared;\r
-\r
-               [DataCategory ("Data")]\r
-               public event DataTableClearEventHandler TableClearing;\r
-\r
-               public event DataTableNewRowEventHandler TableNewRow;\r
-\r
-               /// <summary>\r
-               /// Raises TableCleared Event and delegates to subscribers\r
-               /// </summary>\r
-               protected virtual void OnTableCleared (DataTableClearEventArgs e)\r
-               {\r
-                       if (TableCleared != null)\r
-                               TableCleared (this, e);\r
-               }\r
-\r
-               internal void DataTableCleared ()\r
-               {\r
-                       OnTableCleared (new DataTableClearEventArgs (this));\r
-               }\r
-\r
-               protected virtual void OnTableClearing (DataTableClearEventArgs e)\r
-               {\r
-                       if (TableClearing != null)\r
-                               TableClearing (this, e);\r
-               }\r
-\r
-               internal void DataTableClearing ()\r
-               {\r
-                       OnTableClearing (new DataTableClearEventArgs (this));\r
-               }\r
-\r
-               protected virtual void OnTableNewRow (DataTableNewRowEventArgs e)\r
-               {\r
-                       if (null != TableNewRow)\r
-                               TableNewRow (this, e);\r
-               }\r
-\r
-               partial void NewRowAdded (DataRow dr)\r
-               {\r
-                       OnTableNewRow (new DataTableNewRowEventArgs (dr));\r
-               }\r
-       }\r
-}\r
diff --git a/mcs/class/System.Data/System.Data/DataTableClearEventArgs.cs b/mcs/class/System.Data/System.Data/DataTableClearEventArgs.cs
deleted file mode 100644 (file)
index 30df811..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-//
-// System.Data.DataTableClearEventArgs.cs
-//
-// Author:
-//   Sureshkumar T <tsureshkumar@novell.com>
-//
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-// Copyright (C) Authors.
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System.Data 
-{
-        public sealed class DataTableClearEventArgs : EventArgs
-        {
-                #region Fields
-                private readonly DataTable _table;
-                #endregion //Fields
-
-                #region Constructors
-                public DataTableClearEventArgs(DataTable dataTable) 
-                {
-                        _table = dataTable;
-                }
-                #endregion // Constructors
-
-
-                #region Properties
-                public DataTable Table { get { return _table; } }
-                public string TableName { get { return _table.TableName ; } }
-                public string TableNamespace { get { return _table.Namespace; } }
-                #endregion // Properties
-        }
-}
diff --git a/mcs/class/System.Data/System.Data/DataTableClearEventHandler.cs b/mcs/class/System.Data/System.Data/DataTableClearEventHandler.cs
deleted file mode 100644 (file)
index d82c3ff..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-//
-// System.Data.DataColumnChangeEventHandler.cs
-//
-// Author:
-//   Sureshkumar T <tsureshkumar@novell.com>
-//
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-// Copyright (C) Authors.
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System.Data
-{
-       /// <summary>
-       /// Represents the method that will handle the the TableCleared event.
-       /// </summary>
-       public delegate void DataTableClearEventHandler(object sender, DataTableClearEventArgs e);
-
-}
diff --git a/mcs/class/System.Data/System.Data/DataTableCollection.cs b/mcs/class/System.Data/System.Data/DataTableCollection.cs
deleted file mode 100644 (file)
index 9439598..0000000
+++ /dev/null
@@ -1,452 +0,0 @@
-//
-// System.Data.DataTableCollection.cs
-//
-// Authors:
-//   Christopher Podurgiel (cpodurgiel@msn.com)
-//   Tim Coleman <tim@timcoleman.com>
-//
-// (C) Chris Podurgiel
-// (C) Copyright 2002 Tim Coleman
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections;
-using System.ComponentModel;
-using System.Globalization;
-using System.IO;
-using System.Runtime.Serialization;
-using System.Runtime.Serialization.Formatters.Binary;
-
-namespace System.Data
-{
-       /// <summary>
-       /// Represents the collection of tables for the DataSet.
-       /// </summary>
-       [Editor ("Microsoft.VSDesigner.Data.Design.TablesCollectionEditor, " + Consts.AssemblyMicrosoft_VSDesigner,
-                "System.Drawing.Design.UITypeEditor, " + Consts.AssemblySystem_Drawing)]
-       [DefaultEvent ("CollectionChanged")]
-       [ListBindable (false)]
-       public partial class DataTableCollection : InternalDataCollectionBase {
-               DataSet dataSet;
-               DataTable[] mostRecentTables;
-
-               #region Constructors
-
-               internal DataTableCollection (DataSet dataSet)
-                       : base ()
-               {
-                       this.dataSet = dataSet;
-               }
-
-               #endregion
-
-               #region Properties
-
-               public DataTable this [int index] {
-                       get {
-                               if (index < 0 || index >= List.Count)
-                                       throw new IndexOutOfRangeException (String.Format ("Cannot find table {0}", index));
-                               return (DataTable)(List [index]);
-                       }
-               }
-
-               public DataTable this [string name] {
-                       get {
-                               int index = IndexOf (name, true);
-                               return index < 0 ? null : (DataTable) List [index];
-                       }
-               }
-
-               protected override ArrayList List {
-                       get { return base.List; }
-               }
-
-               #endregion
-
-               #region Methods
-
-               public
-               DataTable Add ()
-               {
-                       DataTable Table = new DataTable ();
-                       Add (Table);
-                       return Table;
-               }
-
-               public
-               void Add (DataTable table)
-               {
-                       OnCollectionChanging (new CollectionChangeEventArgs (CollectionChangeAction.Add, table));
-                       // check if the reference is a null reference
-                       if (table == null)
-                               throw new ArgumentNullException ("table");
-
-                       // check if the list already contains this tabe.
-                       if (List.Contains (table))
-                               throw new ArgumentException ("DataTable already belongs to this DataSet.");
-
-                       // check if table is part of another DataSet
-                       if (table.DataSet != null && table.DataSet != this.dataSet)
-                               throw new ArgumentException ("DataTable already belongs to another DataSet");
-
-                       // if the table name is null or empty string.
-                       // give her a name.
-                       if (table.TableName == null || table.TableName == string.Empty)
-                               NameTable (table);
-
-                       // check if the collection has a table with the same name.
-                       int tmp = IndexOf (table.TableName, table.Namespace);
-                       // if we found a table with same name we have to check
-                       // that it is the same case.
-                       // indexof can return a table with different case letters.
-                       if (tmp != -1 &&
-                           table.TableName == this [tmp].TableName)
-                               throw new DuplicateNameException ("A DataTable named '" + table.TableName + "' already belongs to this DataSet.");
-
-                       List.Add (table);
-                       table.dataSet = dataSet;
-                       OnCollectionChanged (new CollectionChangeEventArgs (CollectionChangeAction.Add, table));
-               }
-
-               public
-               DataTable Add (string name)
-               {
-                       DataTable table = new DataTable (name);
-                       this.Add (table);
-                       return table;
-               }
-
-               public void AddRange (DataTable [] tables)
-               {
-                       if (dataSet != null && dataSet.InitInProgress) {
-                               mostRecentTables = tables;
-                               return;
-                       }
-
-                       if (tables == null)
-                               return;
-
-                       foreach (DataTable table in tables) {
-                               if (table == null)
-                                       continue;
-                               Add (table);
-                       }
-               }
-
-               internal void PostAddRange ()
-               {
-                       if (mostRecentTables == null)
-                               return;
-
-                       foreach (DataTable table in mostRecentTables){
-                               if (table == null)
-                                       continue;
-                               Add (table);
-                       }
-                       mostRecentTables = null;
-               }
-
-               public bool CanRemove (DataTable table)
-               {
-                       return CanRemove (table, false);
-               }
-
-               public void Clear ()
-               {
-                       List.Clear ();
-               }
-
-               public bool Contains (string name)
-               {
-                       return (-1 != IndexOf (name, false));
-               }
-
-               public
-               int IndexOf (DataTable table)
-               {
-                       return List.IndexOf (table);
-               }
-
-               public
-               int IndexOf (string tableName)
-               {
-                       return IndexOf (tableName, false);
-               }
-
-               public void Remove (DataTable table)
-               {
-                       OnCollectionChanging (new CollectionChangeEventArgs (CollectionChangeAction.Remove, table));
-                       if (CanRemove (table, true))
-                               table.dataSet = null;
-
-                       List.Remove (table);
-                       table.dataSet = null;
-                       OnCollectionChanged (new CollectionChangeEventArgs (CollectionChangeAction.Remove, table));
-               }
-
-               public void Remove (string name)
-               {
-                       int index = IndexOf (name, false);
-                       if (index == -1)
-                               throw new ArgumentException ("Table " + name + " does not belong to this DataSet");
-                       RemoveAt (index);
-               }
-
-               public void RemoveAt (int index)
-               {
-                       Remove (this [index]);
-               }
-
-               #endregion
-
-               #region Protected methods
-
-               internal
-               void OnCollectionChanging (CollectionChangeEventArgs ccevent)
-               {
-                       if (CollectionChanging != null)
-                               CollectionChanging (this, ccevent);
-               }
-
-               internal
-               void OnCollectionChanged (CollectionChangeEventArgs ccevent)
-               {
-                       if (CollectionChanged != null)
-                               CollectionChanged (this, ccevent);
-               }
-
-               #endregion
-
-               #region Private methods
-
-               private int IndexOf (string name, bool error, int start)
-               {
-                       int count = 0, match = -1;
-                       for (int i = start; i < List.Count; i++) {
-                               String name2 = ((DataTable) List[i]).TableName;
-                               if (String.Compare (name, name2, false, dataSet.Locale) == 0)
-                                       return i;
-                               if (String.Compare (name, name2, true, dataSet.Locale) == 0) {
-                                       match = i;
-                                       count++;
-                               }
-                       }
-                       if (count == 1)
-                               return match;
-                       if (count > 1 && error)
-                               throw new ArgumentException ("There is no match for the name in the same case and there are multiple matches in different case.");
-                       return -1;
-               }
-
-               /// <summary>
-               /// gives name to Table (Table1, Table2, Table3,...)
-               /// </summary>
-               private void NameTable (DataTable Table)
-               {
-                       string Name = "Table";
-                       int i = 1;
-                       while (Contains (Name + i))
-                               i++;
-
-                       Table.TableName = Name + i;
-               }
-
-               // check if a table can be removed from this collectiuon.
-               // if the table can not be remved act according to throwException parameter.
-               // if it is true throws an Exception, else return false.
-               private bool CanRemove (DataTable table, bool throwException)
-               {
-                       // check if table is null reference
-                       if (table == null) {
-                               if (throwException)
-                                       throw new ArgumentNullException ("table");
-                               return false;
-                       }
-
-                       // check if the table has the same DataSet as this collection.
-                       if (table.DataSet != this.dataSet) {
-                               if (!throwException)
-                                       return false;
-                               throw new ArgumentException ("Table " + table.TableName + " does not belong to this DataSet.");
-                       }
-
-                       // check the table has a relation attached to it.
-                       if (table.ParentRelations.Count > 0 || table.ChildRelations.Count > 0) {
-                               if (!throwException)
-                                       return false;
-                               throw new ArgumentException ("Cannot remove a table that has existing relations. Remove relations first.");
-                       }
-
-                       // now we check if any ForeignKeyConstraint is referncing 'table'.
-                       foreach (Constraint c in table.Constraints) {
-                               UniqueConstraint uc = c as UniqueConstraint;
-                               if (uc != null) {
-                                       if (uc.ChildConstraint == null)
-                                               continue;
-
-                                       if (!throwException)
-                                               return false;
-                                       RaiseForeignKeyReferenceException (table.TableName, uc.ChildConstraint.ConstraintName);
-                               }
-
-                               ForeignKeyConstraint fc = c as ForeignKeyConstraint;
-                               if (fc == null)
-                                       continue;
-
-                               if (!throwException)
-                                       return false;
-                               RaiseForeignKeyReferenceException (table.TableName, fc.ConstraintName);
-                       }
-
-                       return true;
-               }
-
-               private void RaiseForeignKeyReferenceException (string table, string constraint)
-               {
-                       throw new ArgumentException (String.Format ("Cannot remove table {0}, because it is referenced" +
-                                                               " in ForeignKeyConstraint {1}. Remove the constraint first.",
-                                                               table, constraint));
-               }
-
-               #endregion // Private methods
-
-               #region Events
-
-               [ResDescriptionAttribute ("Occurs whenever this collection's membership changes.")]
-               public event CollectionChangeEventHandler CollectionChanged;
-
-               public event CollectionChangeEventHandler CollectionChanging;
-
-               #endregion
-       }
-
-       sealed partial class DataTableCollection {
-               public DataTable this [string name, string tableNamespace] {
-                       get {
-                               int index = IndexOf (name, tableNamespace, true);
-                               return index < 0 ? null : (DataTable) List [index];
-                       }
-               }
-
-               public DataTable Add (string name, string tableNamespace)
-               {
-                       DataTable table = new DataTable (name, tableNamespace);
-                       this.Add (table);
-                       return table;
-               }
-
-               public bool Contains (string name, string tableNamespace)
-               {
-                       return (IndexOf (name, tableNamespace) != -1);
-               }
-
-               public int IndexOf (string tableName, string tableNamespace)
-               {
-                       if (tableNamespace == null)
-                               throw new ArgumentNullException ("'tableNamespace' argument cannot be null.",
-                                               "tableNamespace");
-                       return IndexOf (tableName, tableNamespace, false);
-               }
-
-               public void Remove (string name, string tableNamespace)
-               {
-                       int index = IndexOf (name, tableNamespace, true);
-                       if (index == -1)
-                                throw new ArgumentException ("Table " + name + " does not belong to this DataSet");
-
-                       RemoveAt (index);
-               }
-
-               private int IndexOf (string name, string ns, bool error)
-               {
-                       int index = -1, count = 0, match = -1;
-                       do {
-                               index = IndexOf (name, error, index+1);
-
-                               if (index == -1)
-                                       break;
-
-                               if (ns == null) {
-                                       if (count > 1)
-                                               break;
-                                       count++;
-                                       match = index;
-                               } else if (this [index].Namespace.Equals (ns))
-                                       return index;
-
-                       } while (index != -1 && index < Count);
-
-                       if (count == 1)
-                               return match;
-
-                       if (count == 0 || !error)
-                               return -1;
-
-                       throw new ArgumentException ("The given name '" + name + "' matches atleast two names" +
-                                       "in the collection object with different namespaces");
-               }
-
-               private int IndexOf (string name, bool error)
-               {
-                       return IndexOf (name, null, error);
-               }
-
-               public void CopyTo (DataTable [] array, int index)
-               {
-                       CopyTo ((Array) array, index);
-               }
-
-               internal void BinarySerialize_Schema (SerializationInfo si)
-               {
-                       si.AddValue ("DataSet.Tables.Count", Count);
-                       for (int i = 0; i < Count; i++) {
-                               DataTable dt = (DataTable) List [i];
-
-                               if (dt.dataSet != dataSet)
-                                       throw new SystemException ("Internal Error: inconsistent DataTable");
-
-                               MemoryStream ms = new MemoryStream ();
-                               BinaryFormatter bf = new BinaryFormatter ();
-                               bf.Serialize (ms, dt);
-                               byte [] serializedStream = ms.ToArray ();
-                               ms.Close ();
-                               si.AddValue ("DataSet.Tables_" + i, serializedStream, typeof (Byte []));
-                       }
-               }
-
-               internal void BinarySerialize_Data (SerializationInfo si)
-               {
-                       for (int i = 0; i < Count; i++) {
-                               DataTable dt = (DataTable) List [i];
-                               for (int j = 0; j < dt.Columns.Count; j++) {
-                                       si.AddValue ("DataTable_" + i + ".DataColumn_" + j + ".Expression",
-                                                    dt.Columns[j].Expression);
-                               }
-                               dt.BinarySerialize (si, "DataTable_" + i + ".");
-                       }
-               }
-       }
-}
diff --git a/mcs/class/System.Data/System.Data/DataTableNewRowEventArgs.cs b/mcs/class/System.Data/System.Data/DataTableNewRowEventArgs.cs
deleted file mode 100644 (file)
index 2a6b59d..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-//
-// System.Data.DataTableClearEventArgs.cs
-//
-// Author:
-//   Senganal T <tsenganal@novell.com>
-//
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-// Copyright (C) Authors.
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System.Data
-{
-        public sealed class DataTableNewRowEventArgs : EventArgs
-        {
-                #region Fields
-               private readonly DataRow _row;
-               #endregion //Fields
-
-                #region Constructors
-                public DataTableNewRowEventArgs(DataRow dataRow)
-                {
-                        _row = dataRow;
-               }
-               #endregion // Constructors
-
-                #region Properties
-               public DataRow Row {
-                       get { return _row; }
-               }
-                #endregion // Properties
-        }
-}
diff --git a/mcs/class/System.Data/System.Data/DataTableNewRowEventHandler.cs b/mcs/class/System.Data/System.Data/DataTableNewRowEventHandler.cs
deleted file mode 100644 (file)
index b096c85..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-// System.Data.DataColumnChangeEventHandler.cs
-//
-// Author:
-//   Senganal T <tsenganal@novell.com>
-//
-//
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-// Copyright (C) Authors.
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System.Data
-{
-       /// <summary>
-       /// Represents the method that will handle the the TableCleared event.
-       /// </summary>
-       public delegate void DataTableNewRowEventHandler(object sender, DataTableNewRowEventArgs e);
-}
diff --git a/mcs/class/System.Data/System.Data/DataTablePropertyDescriptor.cs b/mcs/class/System.Data/System.Data/DataTablePropertyDescriptor.cs
deleted file mode 100644 (file)
index 2015d26..0000000
+++ /dev/null
@@ -1,105 +0,0 @@
-//
-// System.Data.DataTablePropertyDescriptor
-//
-// Authors:
-//     Gonzalo Paniagua Javier (gonzalo@ximian.com)
-//
-// (C) 2003 Ximian, Inc (http://www.ximian.com)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.ComponentModel;
-
-namespace System.Data
-{
-       internal class DataTablePropertyDescriptor : PropertyDescriptor
-       {
-               DataTable table;
-
-               internal DataTablePropertyDescriptor (DataTable table) : base (table.TableName, null)
-               {
-                       this.table = table;
-               }
-
-               public DataTable Table {
-                       get { return table; }
-               }
-
-               public override object GetValue (object component)
-               {
-                       DataViewManagerListItemTypeDescriptor desc = component as DataViewManagerListItemTypeDescriptor;
-                       if (desc == null)
-                               return null;
-
-                       return new DataView (table, desc.DataViewManager);
-               }
-
-               public override bool CanResetValue (object component)
-               {
-                       return false;
-               }
-
-               public override bool Equals (object other)
-               {
-                       return (other is DataTablePropertyDescriptor && 
-                               ((DataTablePropertyDescriptor) other).table == table);
-               }
-
-               public override int GetHashCode ()
-               {
-                       return table.GetHashCode ();
-               }
-
-               public override bool ShouldSerializeValue (object component)
-               {
-                       return false;
-               }
-
-               public override void ResetValue (object component)
-               {
-               }
-
-               public override void SetValue (object component, object value)
-               {
-               }
-
-               public override bool IsReadOnly
-               {
-                       get { return false; }
-               }
-
-               public override Type ComponentType
-               {
-                       get { return typeof (DataRowView); }
-               }
-
-               public override Type PropertyType
-               {
-                       get { return typeof (IBindingList); }
-               }
-       }
-}
-
diff --git a/mcs/class/System.Data/System.Data/DataTableReader.cs b/mcs/class/System.Data/System.Data/DataTableReader.cs
deleted file mode 100644 (file)
index 8323b6b..0000000
+++ /dev/null
@@ -1,543 +0,0 @@
-//
-// System.Data.DataTableReader.cs
-//
-// Author:
-//   Sureshkumar T      <tsureshkumar@novell.com>
-//   Tim Coleman        (tim@timcoleman.com)
-//
-// Copyright (C) Tim Coleman, 2003
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-using System.Collections;
-using System.Data.Common;
-using System.ComponentModel;
-using System.Text.RegularExpressions;
-
-namespace System.Data {
-       public sealed class DataTableReader : DbDataReader {
-               bool            _closed;
-               DataTable []    _tables;
-               int             _current = -1;
-               int             _index;
-               DataTable       _schemaTable;
-               bool            _tableCleared = false;
-               bool            _subscribed = false;
-               DataRow         _rowRef;
-               bool            _schemaChanged = false;
-
-               #region Constructors
-
-               public DataTableReader (DataTable dataTable)
-                       : this (new DataTable[] {dataTable})
-               {
-               }
-
-               public DataTableReader (DataTable[] dataTables)
-               {
-                       if (dataTables == null || dataTables.Length <= 0)
-                               throw new ArgumentException ("Cannot Create DataTable. Argument Empty!");
-
-                       this._tables = new DataTable [dataTables.Length];
-
-                       for (int i = 0; i < dataTables.Length; i++)
-                               this._tables [i] = dataTables [i];
-
-                       _closed = false;
-                       _index = 0;
-                       _current = -1;
-                       _rowRef = null;
-                       _tableCleared = false;
-
-                       SubscribeEvents ();
-               }
-
-               #endregion // Constructors
-
-               #region Properties
-
-               public override int Depth {
-                       get { return 0; }
-               }
-
-               public override int FieldCount {
-                       get { return CurrentTable.Columns.Count; }
-               }
-
-               public override bool HasRows {
-                       get { return CurrentTable.Rows.Count > 0; }
-               }
-
-               public override bool IsClosed {
-                       get { return _closed; }
-               }
-
-               public override object this [int ordinal] {
-                       get {
-                               Validate ();
-                               if (ordinal < 0 || ordinal >= FieldCount)
-                                       throw new ArgumentOutOfRangeException ("index " + ordinal + " is not in the range");
-                               DataRow row = CurrentRow;
-                               if (row.RowState == DataRowState.Deleted)
-                                       throw new InvalidOperationException ("Deleted Row's information cannot be accessed!");
-                               return row [ordinal];
-                       }
-               }
-
-               private DataTable CurrentTable {
-                       get { return _tables [_index]; }
-               }
-
-               private DataRow CurrentRow {
-                       get { return (DataRow) CurrentTable.Rows [_current]; }
-               }
-
-
-               public override object this [string name] {
-                       get {
-                               Validate ();
-                               DataRow row = CurrentRow;
-                               if (row.RowState == DataRowState.Deleted)
-                                       throw new InvalidOperationException ("Deleted Row's information cannot be accessed!");
-                               return row [name];
-                       }
-               }
-
-               public override int RecordsAffected {
-                       get { return 0; }
-               }
-
-               #endregion // Properties
-
-               #region Methods
-
-               private void SubscribeEvents ()
-               {
-                       if (_subscribed)        // avoid subscribing multiple times
-                               return;
-                       CurrentTable.TableCleared += new DataTableClearEventHandler (OnTableCleared);
-                       CurrentTable.RowChanged += new DataRowChangeEventHandler (OnRowChanged);
-                       CurrentTable.Columns.CollectionChanged += new CollectionChangeEventHandler (OnColumnCollectionChanged);
-                       for (int i=0; i < CurrentTable.Columns.Count; ++i)
-                               CurrentTable.Columns [i].PropertyChanged += new PropertyChangedEventHandler (OnColumnChanged);
-                       _subscribed = true;
-                       _schemaChanged = false;
-               }
-
-               private void UnsubscribeEvents ()
-               {
-                       if (!_subscribed)       // avoid un-subscribing multiple times
-                               return;
-                       CurrentTable.TableCleared -= new DataTableClearEventHandler (OnTableCleared);
-                       CurrentTable.RowChanged -= new DataRowChangeEventHandler (OnRowChanged);
-                       CurrentTable.Columns.CollectionChanged -= new CollectionChangeEventHandler (OnColumnCollectionChanged);
-                       for (int i=0; i < CurrentTable.Columns.Count; ++i)
-                               CurrentTable.Columns [i].PropertyChanged -= new PropertyChangedEventHandler (OnColumnChanged);
-                       _subscribed = false;
-                       _schemaChanged = false;
-               }
-
-               public override void Close ()
-               {
-                       if (IsClosed)
-                               return;
-
-                       UnsubscribeEvents ();
-                       _closed = true;
-               }
-
-               public override bool GetBoolean (int ordinal)
-               {
-                       return (bool) GetValue (ordinal);
-               }
-
-               public override byte GetByte (int ordinal)
-               {
-                       return (byte) GetValue (ordinal);
-               }
-
-               public override long GetBytes (int ordinal, long dataIndex, byte[] buffer, int bufferIndex, int length)
-               {
-                       byte[] value = this [ordinal] as byte[];
-                       if (value == null)
-                               ThrowInvalidCastException (this [ordinal].GetType (), typeof (byte[]));
-                       if (buffer == null)
-                               return value.Length;
-                       int copylen = length > value.Length ? value.Length : length;
-                       Array.Copy (value, dataIndex, buffer, bufferIndex, copylen);
-                       return copylen;
-               }
-
-               public override char GetChar (int ordinal)
-               {
-                       return (char) GetValue (ordinal);
-               }
-
-               public override long GetChars (int ordinal, long dataIndex, char[] buffer, int bufferIndex, int length)
-               {
-                       char[] value = this [ordinal] as char[];
-                       if (value == null)
-                               ThrowInvalidCastException (this [ordinal].GetType (), typeof (char[]));
-                       if (buffer == null)
-                               return value.Length;
-                       int copylen = length > value.Length ? value.Length : length;
-                       Array.Copy (value, dataIndex, buffer, bufferIndex, copylen);
-                       return copylen;
-               }
-
-               public override string GetDataTypeName (int ordinal)
-               {
-                       return GetFieldType (ordinal).ToString ();
-               }
-
-               public override DateTime GetDateTime (int ordinal)
-               {
-                       return (DateTime) GetValue (ordinal);
-               }
-
-               public override decimal GetDecimal (int ordinal)
-               {
-                       return (decimal) GetValue (ordinal);
-               }
-
-               public override double GetDouble (int ordinal)
-               {
-                       return (double) GetValue (ordinal);
-               }
-
-               public override IEnumerator GetEnumerator ()
-               {
-                       return new DbEnumerator (this);
-               }
-
-               public override Type GetProviderSpecificFieldType (int ordinal)
-               {
-                       return GetFieldType (ordinal);
-               }
-
-               public override Type GetFieldType (int ordinal)
-               {
-                       ValidateClosed ();
-                       return CurrentTable.Columns [ordinal].DataType;
-               }
-
-               public override float GetFloat (int ordinal)
-               {
-                       return (float) GetValue (ordinal);
-               }
-
-               public override Guid GetGuid (int ordinal)
-               {
-                       return (Guid) GetValue (ordinal);
-               }
-
-               public override short GetInt16 (int ordinal)
-               {
-                       return (short) GetValue (ordinal);
-               }
-
-               public override int GetInt32 (int ordinal)
-               {
-                       return (int) GetValue (ordinal);
-               }
-
-               public override long GetInt64 (int ordinal)
-               {
-                       return (long) GetValue (ordinal);
-               }
-
-               public override string GetName (int ordinal)
-               {
-                       ValidateClosed ();
-                       return CurrentTable.Columns [ordinal].ColumnName;
-               }
-
-               public override int GetOrdinal (string name)
-               {
-                       ValidateClosed ();
-                       int index = CurrentTable.Columns.IndexOf (name);
-                       if (index == -1)
-                               throw new ArgumentException (String.Format ("Column {0} is not found in the schema", name));
-                       return index;
-               }
-
-               public override object GetProviderSpecificValue (int ordinal)
-               {
-                       return GetValue (ordinal);
-               }
-
-               public override int GetProviderSpecificValues (object[] values)
-               {
-                       return GetValues (values);
-               }
-
-               public override string GetString (int ordinal)
-               {
-                       return (string) GetValue (ordinal);
-               }
-
-               public override object GetValue (int ordinal)
-               {
-                       return this [ordinal];
-               }
-
-               public override int GetValues (object[] values)
-               {
-                       Validate ();
-                       if (CurrentRow.RowState == DataRowState.Deleted)
-                               throw new DeletedRowInaccessibleException ("");
-
-                       int count = (FieldCount < values.Length ? FieldCount : values.Length);
-                       for (int i=0; i < count; ++i)
-                               values [i] = CurrentRow [i];
-                       return count;
-               }
-
-               public override bool IsDBNull (int ordinal)
-               {
-                       return GetValue (ordinal) is DBNull;
-               }
-
-               public override DataTable GetSchemaTable ()
-               {
-                       ValidateClosed ();
-                       ValidateSchemaIntact ();
-
-                       if (_schemaTable != null)
-                               return _schemaTable;
-
-                       DataTable dt = new DataTable ();
-                       dt.Columns.Add ("ColumnName", typeof (string));
-                       dt.Columns.Add ("ColumnOrdinal", typeof (int));
-                       dt.Columns.Add ("ColumnSize", typeof (int));
-                       dt.Columns.Add ("NumericPrecision", typeof (short));
-                       dt.Columns.Add ("NumericScale", typeof (short));
-                       dt.Columns.Add ("DataType", typeof (Type));
-                       dt.Columns.Add ("ProviderType", typeof (int));
-                       dt.Columns.Add ("IsLong", typeof (bool));
-                       dt.Columns.Add ("AllowDBNull", typeof (bool));
-                       dt.Columns.Add ("IsReadOnly", typeof (bool));
-                       dt.Columns.Add ("IsRowVersion", typeof (bool));
-                       dt.Columns.Add ("IsUnique", typeof (bool));
-                       dt.Columns.Add ("IsKey", typeof (bool));
-                       dt.Columns.Add ("IsAutoIncrement", typeof (bool));
-                       dt.Columns.Add ("BaseCatalogName", typeof (string));
-                       dt.Columns.Add ("BaseSchemaName", typeof (string));
-                       dt.Columns.Add ("BaseTableName", typeof (string));
-                       dt.Columns.Add ("BaseColumnName", typeof (string));
-                       dt.Columns.Add ("AutoIncrementSeed", typeof (Int64));
-                       dt.Columns.Add ("AutoIncrementStep", typeof (Int64));
-                       dt.Columns.Add ("DefaultValue", typeof (object));
-                       dt.Columns.Add ("Expression", typeof (string));
-                       dt.Columns.Add ("ColumnMapping", typeof (MappingType));
-                       dt.Columns.Add ("BaseTableNamespace", typeof (string));
-                       dt.Columns.Add ("BaseColumnNamespace", typeof (string));
-
-                       DataRow row;
-                       DataColumn col;
-                       for (int i=0; i < CurrentTable.Columns.Count; ++i) {
-                               row = dt.NewRow ();
-                               col = CurrentTable.Columns [i];
-                               row ["ColumnName"] = col.ColumnName;
-                               row ["BaseColumnName"] = col.ColumnName;
-                               row ["ColumnOrdinal"] = col.Ordinal;
-                               row ["ColumnSize"] = col.MaxLength;
-                               // ms.net doesent set precision and scale even for Decimal values
-                               // when are these set ?
-                               row ["NumericPrecision"] = DBNull.Value;
-                               row ["NumericScale"] = DBNull.Value;
-                               row ["DataType"] = col.DataType;
-                               row ["ProviderType"] = DBNull.Value; //col.ProviderType;
-                               // ms.net doesent set this when datatype is string and maxlength = -1
-                               // when is this set ?
-                               row ["IsLong"] = false;
-                               row ["AllowDBNull"] = col.AllowDBNull;
-                               row ["IsReadOnly"] = col.ReadOnly;
-                               row ["IsRowVersion"] = false; //this is always false
-                               row ["IsUnique"] = col.Unique;
-                               row ["IsKey"] = (Array.IndexOf (CurrentTable.PrimaryKey, col) != -1) ;
-                               row ["IsAutoIncrement"]= col.AutoIncrement;
-                               row ["AutoIncrementSeed"] = col.AutoIncrementSeed;
-                               row ["AutoIncrementStep"] = col.AutoIncrementStep;
-                               row ["BaseCatalogName"] = (CurrentTable.DataSet != null ? CurrentTable.DataSet.DataSetName : null);
-                               row ["BaseSchemaName"] = DBNull.Value; // this is always null
-                               row ["BaseTableName"] = CurrentTable.TableName;
-                               row ["DefaultValue"] = col.DefaultValue;
-                               // If col expression depends on any external table , then the
-                               // Expression value is set to empty string in the schematable.
-                               if (col.Expression == "")
-                                       row ["Expression"] = col.Expression;
-                               else {
-                                       Regex reg = new Regex ("((Parent|Child)( )*[.(])", RegexOptions.IgnoreCase);
-                                       if (reg.IsMatch (col.Expression, 0))
-                                               row ["Expression"] = DBNull.Value;
-                                       else
-                                               row ["Expression"] = col.Expression;
-                               }
-
-                               row ["ColumnMapping"] = col.ColumnMapping;
-                               row ["BaseTableNamespace"] = CurrentTable.Namespace;
-                               row ["BaseColumnNamespace"] = col.Namespace;
-                               dt.Rows.Add (row);
-                       }
-
-                       return _schemaTable = dt;
-               }
-
-               private void Validate ()
-               {
-                       ValidateClosed ();
-
-                       if (_index >= _tables.Length)
-                               throw new InvalidOperationException ("Invalid attempt to read when no data is present");
-                       if (_tableCleared)
-                               throw new RowNotInTableException ("The table is cleared, no rows are accessible");
-                       if (_current == -1)
-                               throw new InvalidOperationException ("DataReader is invalid for the DataTable");
-                       ValidateSchemaIntact ();
-               }
-
-               private void ValidateClosed ()
-               {
-                       if (IsClosed)
-                               throw new InvalidOperationException ("Invalid attempt to read when the reader is closed");
-               }
-
-               private void ValidateSchemaIntact ()
-               {
-                       if (_schemaChanged)
-                               throw new InvalidOperationException ("Schema of current DataTable '" + CurrentTable.TableName +
-                                               "' in DataTableReader has changed, DataTableReader is invalid.");
-               }
-
-               void ThrowInvalidCastException (Type sourceType, Type destType)
-               {
-                       throw new InvalidCastException (
-                               String.Format ("Unable to cast object of type '{0}' to type '{1}'.", sourceType, destType));
-               }
-
-               private bool MoveNext ()
-               {
-                       if (_index >= _tables.Length || _tableCleared)
-                               return false;
-
-                       do {
-                               _current++;
-                       } while (_current < CurrentTable.Rows.Count && CurrentRow.RowState == DataRowState.Deleted);
-
-                       _rowRef = _current < CurrentTable.Rows.Count ? CurrentRow : null;
-
-                       return _current < CurrentTable.Rows.Count;
-
-               }
-
-               public override bool NextResult ()
-               {
-                       if ((_index + 1) >= _tables.Length) {
-                               UnsubscribeEvents ();
-                               _index = _tables.Length;     // to make any attempt invalid
-                               return false; // end of tables.
-                       }
-
-                       UnsubscribeEvents ();
-                       _index++;
-                       _current = -1;
-                       _rowRef = null;
-                       _schemaTable = null;            // force to create fresh
-                       _tableCleared = false;
-                       SubscribeEvents ();
-                       return true;
-               }
-
-               public override bool Read ()
-               {
-                       ValidateClosed ();
-                       return MoveNext ();
-               }
-
-               #endregion // Methods
-
-               #region // Event Handlers
-
-               private void OnColumnChanged (object sender, PropertyChangedEventArgs args)
-               {
-                       _schemaChanged = true;
-               }
-
-               private void OnColumnCollectionChanged (object sender, CollectionChangeEventArgs args)
-               {
-                       _schemaChanged = true;
-               }
-
-               private void OnRowChanged (object src, DataRowChangeEventArgs args)
-               {
-                       DataRowAction action = args.Action;
-                       DataRow row = args.Row;
-                       if (action == DataRowAction.Add) {
-                               if (_tableCleared && _current != -1)
-                                       return;
-
-                               if (_current == -1 || (_current >= 0 && row.RowID > CurrentRow.RowID)) {
-                                       _tableCleared = false;
-                                       return; // no. movement required, if row added after current.
-                               }
-
-                               _current++;
-                               _rowRef = CurrentRow;
-                       }
-
-                       if (action == DataRowAction.Commit && row.RowState == DataRowState.Detached) {
-                               // if i am the row deleted, move one down
-                               if (_rowRef == row) {
-                                       _current --;
-                                       _rowRef = _current >= 0 ? CurrentRow : null;
-                               }
-
-                               // if the row deleted is the last row, move down
-                               if (_current >= CurrentTable.Rows.Count) {
-                                       _current--;
-                                       _rowRef = _current >= 0 ? CurrentRow : null;
-                                       return;
-                               }
-
-                               // deleting a row below _current moves the row one down
-                               if (_current > 0 && _rowRef == CurrentTable.Rows [_current-1]) {
-                                       _current--;
-                                       _rowRef = CurrentRow;
-                                       return;
-                               }
-                       }
-               }
-
-               private void OnTableCleared (object src, DataTableClearEventArgs args)
-               {
-                       _tableCleared = true;
-               }
-
-               #endregion // Event Handlers
-       }
-}
-
diff --git a/mcs/class/System.Data/System.Data/DataTableTypeConverter.cs b/mcs/class/System.Data/System.Data/DataTableTypeConverter.cs
deleted file mode 100644 (file)
index 6ca71fc..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-// System.Data.DataTableTypeConverter.cs
-//
-// Author:
-//   Gert Driesen <drieseng@users.sourceforge.net>
-//
-// Copyright (C) Novell, 2004
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.ComponentModel;
-
-namespace System.Data
-{
-       internal class DataTableTypeConverter : ReferenceConverter
-       {
-               public DataTableTypeConverter () : base(typeof(DataTable))
-               {
-               }
-
-               public override bool GetPropertiesSupported (ITypeDescriptorContext context)
-               {
-                       return false;
-               }
-       }
-}
-
diff --git a/mcs/class/System.Data/System.Data/DataView.cs b/mcs/class/System.Data/System.Data/DataView.cs
deleted file mode 100644 (file)
index 6016f32..0000000
+++ /dev/null
@@ -1,1213 +0,0 @@
-//\r
-// System.Data.DataView.cs\r
-//\r
-// Author:\r
-//    Daniel Morgan <danmorg@sc.rr.com>\r
-//    Tim Coleman (tim@timcoleman.com)\r
-//    Punit Todi (punits_mailbox@yahoo.com)\r
-//    Atsushi Enomoto <atsushi@ximian.com>\r
-//    Konstantin Triger (kostat@mainsoft.com)\r
-//\r
-// Copyright (C) Daniel Morgan, 2002, 2003\r
-// (C) Ximian, Inc 2002\r
-// Copyright (C) Tim Coleman, 2002-2003\r
-\r
-using System;\r
-using System.Collections;\r
-using System.Collections.Generic;\r
-using System.ComponentModel;\r
-using System.Reflection;\r
-using System.Data.Common;\r
-using System.Globalization;\r
-using Mono.Data.SqlExpressions;\r
-using System.Text;\r
-\r
-namespace System.Data\r
-{\r
-       /// <summary>\r
-       /// A DataView is used in the binding of data between\r
-       /// a DataTable and Windows Forms or Web Forms allowing\r
-       /// a view of a DataTable for editing, filtering,\r
-       /// navigation, searching, and sorting.\r
-       /// </summary>\r
-       //[Designer]\r
-       [Editor ("Microsoft.VSDesigner.Data.Design.DataSourceEditor, " + Consts.AssemblyMicrosoft_VSDesigner,\r
-                "System.Drawing.Design.UITypeEditor, " + Consts.AssemblySystem_Drawing)]\r
-       [DefaultEvent ("PositionChanged")]\r
-       [DefaultProperty ("Table")]\r
-       [DesignerAttribute ("Microsoft.VSDesigner.Data.VS.DataViewDesigner, "+ Consts.AssemblyMicrosoft_VSDesigner, "System.ComponentModel.Design.IDesigner")]\r
-       public partial class DataView : MarshalByValueComponent, IEnumerable, ISupportInitialize {\r
-               internal DataTable dataTable;\r
-               string rowFilter = String.Empty;\r
-               IExpression rowFilterExpr;\r
-               string sort = String.Empty;\r
-               ListSortDirection [] sortOrder;\r
-               PropertyDescriptor sortProperty;\r
-               DataColumn [] sortColumns;\r
-               internal DataViewRowState rowState;\r
-               internal DataRowView[] rowCache = new DataRowView [0];\r
-\r
-               // BeginInit() support\r
-               bool isInitPhase;\r
-               bool inEndInit;\r
-               DataTable initTable;\r
-               bool initApplyDefaultSort;\r
-               string initSort;\r
-               string initRowFilter;\r
-               DataViewRowState initRowState;\r
-\r
-               // FIXME: what are the default values?\r
-               bool allowNew = true;\r
-               bool allowEdit = true;\r
-               bool allowDelete = true;\r
-               bool applyDefaultSort;\r
-               //bool isSorted = false;\r
-\r
-               bool isOpen;\r
-\r
-               bool useDefaultSort = true;\r
-\r
-               Index _index;\r
-               internal DataRow _lastAdded;\r
-\r
-               private DataViewManager dataViewManager;\r
-               internal static ListChangedEventArgs ListResetEventArgs = new ListChangedEventArgs (ListChangedType.Reset,-1,-1);\r
-\r
-               public DataView ()\r
-               {\r
-                       rowState = DataViewRowState.CurrentRows;\r
-                       Open ();\r
-               }\r
-\r
-               public DataView (DataTable table)\r
-                       : this (table, (DataViewManager) null)\r
-               {\r
-               }\r
-\r
-               internal DataView (DataTable table, DataViewManager manager)\r
-               {\r
-                       dataTable = table;\r
-                       rowState = DataViewRowState.CurrentRows;\r
-                       dataViewManager = manager;\r
-                       Open ();\r
-               }\r
-\r
-               public DataView (DataTable table, string RowFilter,\r
-                       string Sort, DataViewRowState RowState)\r
-                       : this (table, null, RowFilter, Sort, RowState)\r
-               {\r
-               }\r
-\r
-               internal DataView (DataTable table, DataViewManager manager,\r
-                       string RowFilter, string Sort, DataViewRowState RowState)\r
-               {\r
-                       dataTable = table;\r
-                       dataViewManager = manager;\r
-                       rowState = DataViewRowState.CurrentRows;\r
-                       this.RowFilter = RowFilter;\r
-                       this.Sort = Sort;\r
-                       rowState = RowState;\r
-                       Open ();\r
-               }\r
-\r
-               [DataCategory ("Data")]\r
-               [DefaultValue (true)]\r
-               public bool AllowDelete {\r
-                       get { return allowDelete; }\r
-                       set { allowDelete = value; }\r
-               }\r
-\r
-               [DataCategory ("Data")]\r
-               [DefaultValue (true)]\r
-               public bool AllowEdit {\r
-                       get { return allowEdit; }\r
-                       set { allowEdit = value; }\r
-               }\r
-\r
-               [DataCategory ("Data")]\r
-               [DefaultValue (true)]\r
-               public bool AllowNew {\r
-                       get { return allowNew; }\r
-                       set { allowNew = value; }\r
-               }\r
-\r
-               [DataCategory ("Data")]\r
-               [DefaultValue (false)]\r
-               [RefreshProperties (RefreshProperties.All)]\r
-               public bool ApplyDefaultSort {\r
-                       get { return applyDefaultSort; }\r
-                       set {\r
-                               if (isInitPhase) {\r
-                                       initApplyDefaultSort = value;\r
-                                       return;\r
-                               }\r
-                               if (applyDefaultSort == value)\r
-                                       return;\r
-\r
-                               applyDefaultSort = value;\r
-                               if (applyDefaultSort == true && (sort == null || sort == string.Empty))\r
-                                       PopulateDefaultSort ();\r
-                               if (!inEndInit) {\r
-                                       UpdateIndex (true);\r
-                                       OnListChanged (new ListChangedEventArgs (ListChangedType.Reset, -1, -1));\r
-                               }\r
-                       }\r
-               }\r
-               // get the count of rows in the DataView after RowFilter\r
-               // and RowStateFilter have been applied\r
-               [Browsable (false)]\r
-               public int Count {\r
-                       get { return rowCache.Length; }\r
-               }\r
-\r
-               [Browsable (false)]\r
-               public DataViewManager DataViewManager {\r
-                       get { return dataViewManager; }\r
-               }\r
-\r
-               // Item indexer\r
-               // the compiler creates a DefaultMemeberAttribute from\r
-               // this IndexerNameAttribute\r
-               [System.Runtime.CompilerServices.IndexerName("Item")]\r
-               public DataRowView this [int recordIndex] {\r
-                       get {\r
-                               if (recordIndex > rowCache.Length)\r
-                                       throw new IndexOutOfRangeException ("There is no row at position: " + recordIndex + ".");\r
-                               return rowCache [recordIndex];\r
-                       }\r
-               }\r
-\r
-               [DataCategory ("Data")]\r
-               [DefaultValue ("")]\r
-               public virtual string RowFilter {\r
-                       get { return rowFilter; }\r
-                       set {\r
-                               if (value == null)\r
-                                       value = String.Empty;\r
-                               if (isInitPhase) {\r
-                                       initRowFilter = value;\r
-                                       return;\r
-                               }\r
-\r
-                               CultureInfo info = (Table != null) ? Table.Locale : CultureInfo.CurrentCulture;\r
-                               if (String.Compare (rowFilter, value, false, info) == 0)\r
-                                       return;\r
-\r
-                               if (value.Length == 0) {\r
-                                       rowFilterExpr = null;\r
-                               } else {\r
-                                       Parser parser = new Parser ();\r
-                                       rowFilterExpr = parser.Compile (value);\r
-                               }\r
-                               rowFilter = value;\r
-                               if (!inEndInit) {\r
-                                       UpdateIndex (true);\r
-                                       OnListChanged (new ListChangedEventArgs (ListChangedType.Reset, -1, -1));\r
-                               }\r
-                       }\r
-               }\r
-\r
-               [DataCategory ("Data")]\r
-               [DefaultValue (DataViewRowState.CurrentRows)]\r
-               public DataViewRowState RowStateFilter {\r
-                       get { return rowState; }\r
-                       set {\r
-                               if (isInitPhase) {\r
-                                       initRowState = value;\r
-                                       return;\r
-                               }\r
-\r
-                               if (value == rowState)\r
-                                       return;\r
-\r
-                               rowState = value;\r
-                               if (!inEndInit) {\r
-                                       UpdateIndex (true);\r
-                                       OnListChanged (new ListChangedEventArgs (ListChangedType.Reset, -1, -1));\r
-                               }\r
-                       }\r
-               }\r
-\r
-               [DataCategory ("Data")]\r
-               [DefaultValue ("")]\r
-               public string Sort {\r
-                       get {\r
-                               if (useDefaultSort)\r
-                                       return String.Empty;\r
-                               else\r
-                                       return sort;\r
-                       }\r
-                       set {\r
-                               if (isInitPhase) {\r
-                                       initSort = value;\r
-                                       return;\r
-                               }\r
-                               if (value == Sort)\r
-                                       return;\r
-\r
-                               if (value == null || value.Length == 0) {\r
-                               /* if given value is null useDefaultSort */\r
-                                       useDefaultSort = true;\r
-                                       /* if ApplyDefault sort is true try appling it */\r
-                                       if (ApplyDefaultSort)\r
-                                               PopulateDefaultSort ();\r
-                               } else {\r
-                                       /* else donot useDefaultSort. set it as false */\r
-                                       /* sort is set to value specified */\r
-                                       useDefaultSort = false;\r
-                                       sort = value;\r
-                                       //sortedColumns = SortableColumn.ParseSortString (dataTable, value, true);\r
-                               }\r
-\r
-                               if (!inEndInit) {\r
-                                       UpdateIndex (true);\r
-                                       OnListChanged (new ListChangedEventArgs (ListChangedType.Reset, -1, -1));\r
-                               }\r
-                       }\r
-               }\r
-\r
-               [TypeConverter (typeof (DataTableTypeConverter))]\r
-               [DataCategory ("Data")]\r
-               [DefaultValue (null)]\r
-               [RefreshProperties (RefreshProperties.All)]\r
-               public DataTable Table {\r
-                       get { return dataTable; }\r
-                       set {\r
-                               if (value == dataTable)\r
-                                       return;\r
-\r
-                               if (isInitPhase) {\r
-                                       initTable = value;\r
-                                       return;\r
-                               }\r
-\r
-                               if (value != null && value.TableName.Equals(string.Empty)) {\r
-                                       throw new DataException("Cannot bind to DataTable with no name.");\r
-                               }\r
-\r
-                               if (dataTable != null)\r
-                                       UnregisterEventHandlers ();\r
-\r
-                               dataTable = value;\r
-\r
-                               if (dataTable != null) {\r
-                                       RegisterEventHandlers ();\r
-                                       OnListChanged (new ListChangedEventArgs (ListChangedType.PropertyDescriptorChanged, 0, 0));\r
-                                       sort = string.Empty;\r
-                                       rowFilter = string.Empty;\r
-                                       if (!inEndInit) {\r
-                                               UpdateIndex (true);\r
-                                               OnListChanged (new ListChangedEventArgs (ListChangedType.Reset, -1, -1));\r
-                                       }\r
-                               }\r
-                       }\r
-               }\r
-\r
-               public virtual DataRowView AddNew ()\r
-               {\r
-                       if (!IsOpen)\r
-                               throw new DataException ("DataView is not open.");\r
-                       if (!AllowNew)\r
-                               throw new DataException ("Cannot call AddNew on a DataView where AllowNew is false.");\r
-\r
-                       if (_lastAdded != null)\r
-                               // FIXME : finish last added\r
-                               CompleteLastAdded (true);\r
-\r
-                       _lastAdded = dataTable.NewRow ();\r
-                       UpdateIndex (true);\r
-                       OnListChanged (new ListChangedEventArgs (ListChangedType.ItemAdded, Count - 1, -1));\r
-\r
-                       return this [Count - 1];\r
-               }\r
-\r
-               internal void CompleteLastAdded (bool add)\r
-               {\r
-                       DataRow dr = _lastAdded;\r
-\r
-                       if (add) {\r
-                               try {\r
-                                       dataTable.Rows.Add (_lastAdded);\r
-                                       //OnListChanged(new ListChangedEventArgs(ListChangedType.ItemAdded, Count - 1, -1));\r
-                                       _lastAdded = null;\r
-                                       UpdateIndex ();\r
-                               } catch (Exception) {\r
-                                       _lastAdded = dr;\r
-                                       throw;\r
-                               }\r
-                       } else {\r
-                               _lastAdded.CancelEdit ();\r
-                               _lastAdded = null;\r
-                               UpdateIndex ();\r
-                               OnListChanged (new ListChangedEventArgs (ListChangedType.ItemDeleted, Count, -1));\r
-                       }\r
-               }\r
-\r
-               public void BeginInit ()\r
-               {\r
-                       initTable = Table;\r
-                       initApplyDefaultSort = ApplyDefaultSort;\r
-                       initSort = Sort;\r
-                       initRowFilter = RowFilter;\r
-                       initRowState = RowStateFilter;\r
-\r
-                       isInitPhase = true;\r
-                       DataViewInitialized (false);\r
-               }\r
-\r
-               partial void DataViewInitialized (bool value);\r
-\r
-               public void CopyTo (Array array, int index)\r
-               {\r
-                       if (index + rowCache.Length > array.Length)\r
-                               throw new IndexOutOfRangeException ();\r
-\r
-                       int row = 0;\r
-                       for (; row < rowCache.Length && row < array.Length; row++)\r
-                               array.SetValue (rowCache [row], index + row);\r
-               }\r
-\r
-               public void Delete (int index)\r
-               {\r
-                       if (!IsOpen)\r
-                               throw new DataException ("DataView is not open.");\r
-\r
-                       if (_lastAdded != null && index == Count) {\r
-                               CompleteLastAdded (false);\r
-                               return;\r
-                       }\r
-\r
-                       if (!AllowDelete)\r
-                               throw new DataException ("Cannot delete on a DataSource where AllowDelete is false.");\r
-\r
-                       if (index > rowCache.Length)\r
-                               throw new IndexOutOfRangeException ("There is no row at position: " + index + ".");\r
-                       DataRowView row = rowCache [index];\r
-                       row.Row.Delete ();\r
-               }\r
-\r
-               public void EndInit ()\r
-               {\r
-                       isInitPhase = false;\r
-\r
-                       inEndInit = true;\r
-\r
-                       Table = initTable;\r
-                       ApplyDefaultSort = initApplyDefaultSort;\r
-                       Sort = initSort;\r
-                       RowFilter = initRowFilter;\r
-                       RowStateFilter = initRowState;\r
-\r
-                       inEndInit = false;\r
-\r
-                       UpdateIndex (true);\r
-\r
-                       DataViewInitialized (true);\r
-               }\r
-\r
-               public int Find (object key)\r
-               {\r
-                       object [] keys = new object[] { key };\r
-                       return Find (keys);\r
-               }\r
-\r
-               public int Find (object [] key)\r
-               {\r
-                       if (sort == null || sort.Length == 0)\r
-                               throw new ArgumentException ("Find finds a row based on a Sort order, and no Sort order is specified");\r
-\r
-                       if (Index == null)\r
-                               UpdateIndex (true);\r
-\r
-                       int index = -1;\r
-                       try {\r
-                               index = Index.FindIndex (key);\r
-                       } catch (FormatException) {\r
-                               // suppress exception\r
-                       } catch (InvalidCastException) {\r
-                               // suppress exception\r
-                       }\r
-                       return index;\r
-               }\r
-\r
-               public DataRowView [] FindRows (object key)\r
-               {\r
-                       return FindRows (new object[] {key});\r
-               }\r
-\r
-               public DataRowView [] FindRows (object [] key)\r
-               {\r
-                       if (sort == null || sort.Length == 0)\r
-                               throw new ArgumentException ("Find finds a row based on a Sort order, and no Sort order is specified");\r
-\r
-                       if (Index == null)\r
-                               UpdateIndex (true);\r
-\r
-                       int [] indexes = Index.FindAllIndexes (key);\r
-\r
-                       DataRowView[] rowViewArr = new DataRowView [indexes.Length];\r
-                       for (int r = 0; r < indexes.Length; r++)\r
-                               rowViewArr [r] = rowCache [indexes[r]];\r
-                       return rowViewArr;\r
-               }\r
-\r
-               public IEnumerator GetEnumerator ()\r
-               {\r
-                       DataRowView[] dataRowViews = new DataRowView [Count];\r
-                       CopyTo (dataRowViews, 0);\r
-                       return dataRowViews.GetEnumerator ();\r
-               }\r
-\r
-               [DataCategory ("Data")]\r
-               public event ListChangedEventHandler ListChanged;\r
-\r
-               [Browsable (false)]\r
-               protected bool IsOpen {\r
-                       get { return isOpen; }\r
-               }\r
-\r
-               internal Index Index {\r
-                       get { return _index; }\r
-                       set {\r
-                               if (_index != null) {\r
-                                       _index.RemoveRef ();\r
-                                       Table.DropIndex (_index);\r
-                               }\r
-\r
-                               _index = value;\r
-\r
-                               if (_index != null)\r
-                                       _index.AddRef ();\r
-                       }\r
-               }\r
-\r
-               protected void Close ()\r
-               {\r
-                       if (dataTable != null)\r
-                               UnregisterEventHandlers ();\r
-                       Index = null;\r
-                       rowCache = new DataRowView [0];\r
-                       isOpen = false;\r
-               }\r
-\r
-               protected override void Dispose (bool disposing)\r
-               {\r
-                       if (disposing)\r
-                               Close ();\r
-\r
-                       base.Dispose (disposing);\r
-               }\r
-\r
-               protected virtual void IndexListChanged (object sender, ListChangedEventArgs e)\r
-               {\r
-               }\r
-\r
-               protected virtual void OnListChanged (ListChangedEventArgs e)\r
-               {\r
-                       // Yes, under MS.NET, when it is overriden, the\r
-                       // events are not fired (even if it is essential\r
-                       // to internal processing).\r
-                       try {\r
-                               if (ListChanged != null)\r
-                                       ListChanged (this, e);\r
-                       } catch {\r
-                       }\r
-               }\r
-\r
-               internal void ChangedList (ListChangedType listChangedType, int newIndex,int oldIndex)\r
-               {\r
-                       ListChangedEventArgs e = new ListChangedEventArgs (listChangedType,newIndex,oldIndex);\r
-                       OnListChanged (e);\r
-               }\r
-\r
-               protected void Open ()\r
-               {\r
-                       // I wonder if this comment is still valid, but keep\r
-                       // in the meantime.\r
-\r
-                       // FIXME: create the initial index cache to the DataTable, and\r
-                       //        only refresh the index when the DataTable\r
-                       //        has changes via column, row, or constraint\r
-                       //        changed events. the index cache is generally\r
-                       //        a DataViewRow array that points to the actual\r
-                       //        DataRows in the this DataTable's DataRowCollection;\r
-                       //        this index is really a cache that gets\r
-                       //        created during Open(), gets Updated\r
-                       //        when various properties of this view\r
-                       //        changes, gets Updated when this DataTable's\r
-                       //        row, column, or constraint collections have changed.\r
-                       //        I'm not sure what else.\r
-                       //        The data view will know one of the DataTable's\r
-                       //        collections have changed via one of\r
-                       //        its changed events.\r
-                       //        Otherwise, if getting a/the DataRowView(s),\r
-                       //        Count, or other properties, then just use the\r
-                       //        index cache.\r
-                       //              dataTable.ColumnChanged  += new DataColumnChangeEventHandler(OnColumnChanged);\r
-\r
-                       UpdateIndex (true);\r
-                       if (dataTable != null)\r
-                               RegisterEventHandlers ();\r
-                       isOpen = true;\r
-               }\r
-\r
-               private void RegisterEventHandlers ()\r
-               {\r
-                       //dataTable.ColumnChanging += new DataColumnChangeEventHandler(OnColumnChanging);\r
-                       dataTable.ColumnChanged  += new DataColumnChangeEventHandler(OnColumnChanged);\r
-                       dataTable.RowChanged     += new DataRowChangeEventHandler(OnRowChanged);\r
-                       //dataTable.RowDeleting    += new DataRowChangeEventHandler(OnRowDeleting);\r
-                       dataTable.RowDeleted     += new DataRowChangeEventHandler(OnRowDeleted);\r
-                       dataTable.Columns.CollectionChanged += new CollectionChangeEventHandler(ColumnCollectionChanged);\r
-                       dataTable.Columns.CollectionMetaDataChanged += new CollectionChangeEventHandler(ColumnCollectionChanged);\r
-                       dataTable.Constraints.CollectionChanged += new CollectionChangeEventHandler(OnConstraintCollectionChanged);\r
-                       dataTable.ChildRelations.CollectionChanged += new CollectionChangeEventHandler(OnRelationCollectionChanged);\r
-                       dataTable.ParentRelations.CollectionChanged += new CollectionChangeEventHandler(OnRelationCollectionChanged);\r
-\r
-                       dataTable.Rows.ListChanged += new ListChangedEventHandler (OnRowCollectionChanged);\r
-               }\r
-\r
-               private void OnRowCollectionChanged (object sender, ListChangedEventArgs args)\r
-               {\r
-                       if (args.ListChangedType == ListChangedType.Reset) {\r
-                               rowCache = new DataRowView [0];\r
-                               UpdateIndex (true);\r
-                               OnListChanged (new ListChangedEventArgs (ListChangedType.Reset, -1, -1 ));\r
-                       }\r
-               }\r
-\r
-               private void UnregisterEventHandlers ()\r
-               {\r
-//                     dataTable.ColumnChanging -= new DataColumnChangeEventHandler(OnColumnChanging);\r
-                       dataTable.ColumnChanged  -= new DataColumnChangeEventHandler(OnColumnChanged);\r
-                       dataTable.RowChanged     -= new DataRowChangeEventHandler(OnRowChanged);\r
-//                     dataTable.RowDeleting    -= new DataRowChangeEventHandler(OnRowDeleting);\r
-                       dataTable.RowDeleted     -= new DataRowChangeEventHandler(OnRowDeleted);\r
-                       dataTable.Columns.CollectionChanged -= new CollectionChangeEventHandler(ColumnCollectionChanged);\r
-                       dataTable.Columns.CollectionMetaDataChanged -= new CollectionChangeEventHandler(ColumnCollectionChanged);\r
-                       dataTable.Constraints.CollectionChanged -= new CollectionChangeEventHandler(OnConstraintCollectionChanged);\r
-                       dataTable.ChildRelations.CollectionChanged -= new CollectionChangeEventHandler(OnRelationCollectionChanged);\r
-                       dataTable.ParentRelations.CollectionChanged -= new CollectionChangeEventHandler(OnRelationCollectionChanged);\r
-\r
-                       dataTable.Rows.ListChanged -= new ListChangedEventHandler (OnRowCollectionChanged);\r
-               }\r
-\r
-               // These index storing and rowView preservation must be done\r
-               // before the actual row value is changed; thus we can't use\r
-               // RowChanging which accepts "already modified" DataRow.\r
-\r
-               private void OnColumnChanged (object sender, DataColumnChangeEventArgs args)\r
-               {       /* not used */\r
-                       //UpdateIndex(true);\r
-               }\r
-\r
-               private void OnRowChanged (object sender, DataRowChangeEventArgs args)\r
-               {\r
-                       int oldIndex,newIndex;\r
-                       oldIndex = newIndex = -1;\r
-                       oldIndex = IndexOf (args.Row);\r
-                       UpdateIndex (true);\r
-                       newIndex = IndexOf (args.Row);\r
-\r
-                       /* ItemAdded */\r
-                       if (args.Action == DataRowAction.Add && oldIndex != newIndex)\r
-                               OnListChanged (new ListChangedEventArgs (ListChangedType.ItemAdded, newIndex, -1));\r
-\r
-                       /* ItemChanged or ItemDeleted */\r
-                       if (args.Action == DataRowAction.Change) {\r
-                               if (oldIndex != -1 && oldIndex == newIndex)\r
-                                       OnListChanged (new ListChangedEventArgs (ListChangedType.ItemChanged, newIndex, -1));\r
-                               else if (oldIndex != newIndex) {\r
-                                       if (newIndex < 0)\r
-                                               OnListChanged (new ListChangedEventArgs (ListChangedType.ItemDeleted, newIndex, oldIndex));\r
-                                       else\r
-                                               OnListChanged (new ListChangedEventArgs (ListChangedType.ItemMoved, newIndex, oldIndex));\r
-                               }\r
-                       }\r
-                       \r
-                       /* Rollback - ItemAdded or ItemDeleted */\r
-                       if (args.Action == DataRowAction.Rollback) {\r
-                               if (oldIndex < 0 && newIndex > -1)\r
-                                       OnListChanged (new ListChangedEventArgs (ListChangedType.ItemAdded, newIndex, -1));\r
-                               else if (oldIndex > -1 && newIndex < 0)\r
-                                       OnListChanged (new ListChangedEventArgs (ListChangedType.ItemDeleted, newIndex, oldIndex));\r
-                               else if (oldIndex != -1 && oldIndex == newIndex)\r
-                                       OnListChanged (new ListChangedEventArgs (ListChangedType.ItemChanged, newIndex, -1));\r
-                       }\r
-               }\r
-\r
-               private void OnRowDeleted (object sender, DataRowChangeEventArgs args)\r
-               {\r
-                       /* ItemDeleted */\r
-                       int newIndex, oldCount;\r
-                       oldCount = Count;\r
-                       newIndex = IndexOf (args.Row);\r
-                       UpdateIndex (true);\r
-                       /* Fire ListChanged only when the RowFilter is affected */\r
-                       if (oldCount != Count)\r
-                               OnListChanged (new ListChangedEventArgs (ListChangedType.ItemDeleted, newIndex, -1));\r
-               }\r
-\r
-               protected virtual void ColumnCollectionChanged (object sender, CollectionChangeEventArgs e)\r
-               {\r
-                       // UpdateIndex() is not invoked here (even if the sort\r
-                       // column is being removed).\r
-\r
-                       // PropertyDescriptor Add\r
-                       if (e.Action == CollectionChangeAction.Add)\r
-                               OnListChanged (new ListChangedEventArgs (ListChangedType.PropertyDescriptorAdded, 0, 0));\r
-\r
-                       // PropertyDescriptor Removed\r
-                       if (e.Action == CollectionChangeAction.Remove)\r
-                               OnListChanged (new ListChangedEventArgs (ListChangedType.PropertyDescriptorDeleted, 0, 0));\r
-\r
-                       // PropertyDescriptor Changed\r
-                       if (e.Action == CollectionChangeAction.Refresh)\r
-                               OnListChanged (new ListChangedEventArgs (ListChangedType.PropertyDescriptorChanged, 0, 0));\r
-               }\r
-\r
-               private void OnConstraintCollectionChanged (object sender, CollectionChangeEventArgs args)\r
-               {\r
-                       //      The Sort variable is set to the UniqueConstraint column.\r
-                       //  if ApplyDefault Sort is true and Sort is null or is not set Explicitly\r
-\r
-                       // FIXME: The interal cache may change as result of change in Constraint collection\r
-                       // one such scenerio is taken care.\r
-                       // There may be more. I dont know what else can be done.\r
-                       /* useDefaultSort is set to false when Sort is set explicitly */\r
-                       if (args.Action == CollectionChangeAction.Add && args.Element is UniqueConstraint) {\r
-                               if (ApplyDefaultSort && useDefaultSort)\r
-                                       PopulateDefaultSort ((UniqueConstraint) args.Element);\r
-                       }\r
-                       // UpdateIndex() is not invoked here.\r
-               }\r
-\r
-               private void OnRelationCollectionChanged (object sender, CollectionChangeEventArgs args)\r
-               {\r
-                       /* PropertyDescriptor Add */\r
-                       if (args.Action == CollectionChangeAction.Add)\r
-                               OnListChanged (new ListChangedEventArgs (ListChangedType.PropertyDescriptorAdded,0,0));\r
-\r
-                       /* PropertyDescriptor Removed */\r
-                       if (args.Action == CollectionChangeAction.Remove)\r
-                               OnListChanged (new ListChangedEventArgs (ListChangedType.PropertyDescriptorDeleted,0,0));\r
-\r
-                       /* FIXME: PropertyDescriptor Changed ???*/\r
-                       if (args.Action == CollectionChangeAction.Refresh)\r
-                               OnListChanged (new ListChangedEventArgs (ListChangedType.PropertyDescriptorChanged,0,0));\r
-               }\r
-\r
-               // internal use by Mono\r
-               protected void Reset ()\r
-               {\r
-                       // TODO: what really happens?\r
-                       Close ();\r
-                       rowCache = new DataRowView [0];\r
-                       Open ();\r
-                       OnListChanged (new ListChangedEventArgs (ListChangedType.Reset, -1, -1 ));\r
-               }\r
-\r
-               protected void UpdateIndex ()\r
-               {\r
-                       UpdateIndex (false);\r
-               }\r
-\r
-               // This is method is internal to\r
-               // the Mono implementation of DataView; it\r
-               // is not to be used from your code.\r
-               //\r
-               // Update the DataRowView array which is an index cache\r
-               // into the DataTable's DataRowCollection.\r
-               //\r
-               // I assume this is what UpdateIndex is used for\r
-               protected virtual void UpdateIndex (bool force)\r
-               {\r
-                       if (Table == null)\r
-                               // FIXME\r
-                               return;\r
-\r
-                       if (Index == null || force) {\r
-                               sortColumns = DataTable.ParseSortString(Table, Sort, out sortOrder, false);\r
-                               Index = dataTable.GetIndex(sortColumns,sortOrder,RowStateFilter,FilterExpression,true);\r
-                       } else {\r
-                               Index.Key.RowStateFilter = RowStateFilter;\r
-                               Index.Reset();\r
-                       }\r
-\r
-                       int[] records = Index.GetAll ();\r
-\r
-                       if (records != null)\r
-                               InitDataRowViewArray (records,Index.Size);\r
-                       else\r
-                               rowCache = new DataRowView [0];\r
-               }\r
-\r
-               internal virtual IExpression FilterExpression {\r
-                       get { return rowFilterExpr; }\r
-               }\r
-\r
-               private void InitDataRowViewArray (int [] records, int size)\r
-               {\r
-                       if (_lastAdded != null)\r
-                               rowCache = new DataRowView [size + 1];\r
-                       else\r
-                               rowCache = new DataRowView [size];\r
-\r
-                       for (int r = 0; r < size; r++)\r
-                               rowCache [r] = new DataRowView (this, Table.RecordCache [records [r]],r);\r
-\r
-                       if (_lastAdded != null)\r
-                               rowCache [size] = new DataRowView (this, _lastAdded, size);\r
-               }\r
-\r
-               PropertyDescriptorCollection ITypedList.GetItemProperties (PropertyDescriptor [] listAccessors)\r
-               {\r
-                       if (dataTable == null)\r
-                               return new PropertyDescriptorCollection (new PropertyDescriptor [0]);\r
-\r
-                       // FIXME: use listAccessors somehow\r
-                       PropertyDescriptor [] descriptors =\r
-                               new PropertyDescriptor [dataTable.Columns.Count + dataTable.ChildRelations.Count];\r
-\r
-                       int d = 0;\r
-                       for (int col = 0; col < dataTable.Columns.Count; col ++) {\r
-                               DataColumn dataColumn = dataTable.Columns[col];\r
-                               DataColumnPropertyDescriptor descriptor;\r
-\r
-                               descriptor = new DataColumnPropertyDescriptor (dataColumn.ColumnName, col, null);\r
-                               descriptor.SetComponentType (typeof (System.Data.DataRowView));\r
-                               descriptor.SetPropertyType (dataColumn.DataType);\r
-                               descriptor.SetReadOnly (dataColumn.ReadOnly);\r
-                               descriptor.SetBrowsable (dataColumn.ColumnMapping != MappingType.Hidden);\r
-                               descriptors [d++] = descriptor;\r
-                       }\r
-                       for (int rel = 0; rel < dataTable.ChildRelations.Count; rel ++) {\r
-                               DataRelation dataRelation = dataTable.ChildRelations [rel];\r
-                               DataRelationPropertyDescriptor descriptor;\r
-\r
-                               descriptor = new DataRelationPropertyDescriptor (dataRelation);\r
-                               descriptors [d++] = descriptor;\r
-                       }\r
-\r
-                       return new PropertyDescriptorCollection (descriptors);\r
-               }\r
-\r
-\r
-               private int IndexOf (DataRow dr)\r
-               {\r
-                       for (int i=0; i < rowCache.Length; i++)\r
-                               if (dr.Equals (rowCache [i].Row))\r
-                               return i;\r
-                       return -1;\r
-               }\r
-\r
-               private void PopulateDefaultSort ()\r
-               {\r
-                       sort = string.Empty;\r
-                       foreach (Constraint c in dataTable.Constraints) {\r
-                               if (c is UniqueConstraint) {\r
-                                       PopulateDefaultSort ((UniqueConstraint) c);\r
-                                       break;\r
-                               }\r
-                       }\r
-               }\r
-\r
-               private void PopulateDefaultSort (UniqueConstraint uc)\r
-               {\r
-                       if (isInitPhase)\r
-                               return;\r
-\r
-                       DataColumn [] columns = uc.Columns;\r
-                       if (columns.Length == 0) {\r
-                               sort = String.Empty;\r
-                               return;\r
-                       }\r
-\r
-                       StringBuilder builder = new StringBuilder ();\r
-                       builder.Append (columns[0].ColumnName);\r
-                       for (int i = 1; i < columns.Length; i++) {\r
-                               builder.Append (", ");\r
-                               builder.Append (columns [i].ColumnName);\r
-                       }\r
-                       sort = builder.ToString ();\r
-               }\r
-\r
-               internal DataView CreateChildView (DataRelation relation, int index)\r
-               {\r
-                       if (relation == null || relation.ParentTable != Table)\r
-                               throw new ArgumentException("The relation is not parented to the table to which this DataView points.");\r
-\r
-                       int record = GetRecord (index);\r
-                       object[] keyValues = new object [relation.ParentColumns.Length];\r
-                       for (int i = 0; i < relation.ParentColumns.Length; i++)\r
-                               keyValues [i] = relation.ParentColumns [i] [record];\r
-\r
-                       return new RelatedDataView (relation.ChildColumns, keyValues);\r
-               }\r
-\r
-               private int GetRecord (int index)\r
-               {\r
-                       if (index < 0 || index >= Count)\r
-                               throw new IndexOutOfRangeException(String.Format("There is no row at position {0}.", index));\r
-\r
-                       return (index == Index.Size) ?\r
-                               _lastAdded.IndexFromVersion (DataRowVersion.Default) :\r
-                               Index.IndexToRecord (index);\r
-               }\r
-\r
-               internal DataRowVersion GetRowVersion (int index)\r
-               {\r
-                       int record = GetRecord (index);\r
-                       return Table.RecordCache [record].VersionFromIndex (record);\r
-               }\r
-       }\r
-\r
-       partial class DataView : ITypedList {\r
-               string ITypedList.GetListName (PropertyDescriptor [] listAccessors)\r
-               {\r
-                       if (dataTable != null)\r
-                               return dataTable.TableName;\r
-                       return string.Empty;\r
-               }\r
-       }\r
-\r
-       partial class DataView : ICollection {\r
-               bool ICollection.IsSynchronized {\r
-                       get { return false; }\r
-               }\r
-\r
-               object ICollection.SyncRoot {\r
-                       get { return this; }\r
-               }\r
-       }\r
-\r
-       partial class DataView : IList {\r
-               bool IList.IsFixedSize {\r
-                       get { return false; }\r
-               }\r
-\r
-               bool IList.IsReadOnly {\r
-                       get { return false; }\r
-               }\r
-\r
-               object IList.this [int recordIndex] {\r
-                       get { return this [recordIndex]; }\r
-                       [MonoTODO]\r
-                       set { throw new InvalidOperationException (); }\r
-               }\r
-\r
-               int IList.Add (object value)\r
-               {\r
-                       throw new ArgumentException ("Cannot add external objects to this list.");\r
-               }\r
-\r
-               void IList.Clear ()\r
-               {\r
-                       throw new ArgumentException ("Cannot clear this list.");\r
-               }\r
-\r
-               bool IList.Contains (object value)\r
-               {\r
-                       DataRowView drv = value as DataRowView;\r
-                       if (drv == null)\r
-                               return false;\r
-\r
-                       return drv.DataView == this;\r
-               }\r
-\r
-               int IList.IndexOf (object value)\r
-               {\r
-                       DataRowView drv = value as DataRowView;\r
-                       if (drv != null && drv.DataView == this)\r
-                               return drv.Index;\r
-                       return -1;\r
-               }\r
-\r
-               void IList.Insert (int index,object value)\r
-               {\r
-                       throw new ArgumentException ("Cannot insert external objects to this list.");\r
-               }\r
-\r
-               void IList.Remove (object value)\r
-               {\r
-                       DataRowView drv = value as DataRowView;\r
-                       if (drv != null && drv.DataView == this)\r
-                               ((IList) this).RemoveAt (drv.Index);\r
-\r
-                       throw new ArgumentException ("Cannot remove external objects to this list.");\r
-               }\r
-\r
-               void IList.RemoveAt (int index)\r
-               {\r
-                       Delete (index);\r
-               }\r
-       }\r
-\r
-       partial class DataView : IBindingList {\r
-               [MonoTODO]\r
-               void IBindingList.AddIndex (PropertyDescriptor property)\r
-               {\r
-                       throw new NotImplementedException ();\r
-               }\r
-\r
-               object IBindingList.AddNew ()\r
-               {\r
-                       return this.AddNew ();\r
-               }\r
-\r
-               void IBindingList.ApplySort (PropertyDescriptor property, ListSortDirection direction)\r
-               {\r
-                       if (!(property is DataColumnPropertyDescriptor))\r
-                               throw new ArgumentException ("Dataview accepts only DataColumnPropertyDescriptors", "property");\r
-                       sortProperty = property;\r
-                       string sort = String.Format ("[{0}]" , property.Name);\r
-                       if (direction == ListSortDirection.Descending)\r
-                               sort += " DESC";\r
-                       this.Sort = sort;\r
-               }\r
-\r
-               int IBindingList.Find (PropertyDescriptor property, object key)\r
-               {\r
-                       DataColumn dc = Table.Columns [property.Name];\r
-                       Index index = Table.FindIndex (new DataColumn [] {dc}, sortOrder, RowStateFilter, FilterExpression);\r
-                       if (index == null)\r
-                               index = new Index (new Key (Table, new DataColumn [] {dc}, sortOrder, RowStateFilter, FilterExpression));\r
-\r
-                       return index.FindIndex (new object [] {key});\r
-               }\r
-\r
-               [MonoTODO]\r
-               void IBindingList.RemoveIndex (PropertyDescriptor property)\r
-               {\r
-                       throw new NotImplementedException ();\r
-               }\r
-\r
-               void IBindingList.RemoveSort ()\r
-               {\r
-                       sortProperty = null;\r
-                       this.Sort = String.Empty;\r
-               }\r
-\r
-               bool IBindingList.AllowEdit {\r
-                       get { return AllowEdit; }\r
-               }\r
-\r
-               bool IBindingList.AllowNew {\r
-                       get { return AllowNew; }\r
-               }\r
-\r
-               bool IBindingList.AllowRemove {\r
-                       [MonoTODO]\r
-                       get { return AllowDelete; }\r
-               }\r
-\r
-               bool IBindingList.IsSorted {\r
-                       get { return (Sort != null && Sort.Length != 0); }\r
-               }\r
-\r
-               ListSortDirection IBindingList.SortDirection {\r
-                       get {\r
-                               if (sortOrder != null && sortOrder.Length > 0)\r
-                                       return sortOrder [0];\r
-                               return ListSortDirection.Ascending;\r
-                       }\r
-               }\r
-\r
-               PropertyDescriptor IBindingList.SortProperty {\r
-                       get {\r
-                               if (sortProperty == null && sortColumns != null && sortColumns.Length > 0) {\r
-                                       // return property from Sort String\r
-                                       PropertyDescriptorCollection properties = ((ITypedList)this).GetItemProperties (null);\r
-                                       return properties.Find (sortColumns [0].ColumnName, false);\r
-                               }\r
-                               return sortProperty;\r
-                       }\r
-               }\r
-\r
-               bool IBindingList.SupportsChangeNotification {\r
-                       get { return true; }\r
-               }\r
-\r
-               bool IBindingList.SupportsSearching {\r
-                       get { return true; }\r
-               }\r
-\r
-               bool IBindingList.SupportsSorting {\r
-                       get { return true; }\r
-               }\r
-       }\r
-\r
-       partial class DataView : IBindingListView {\r
-               string IBindingListView.Filter {\r
-                       get { return ((DataView) this).RowFilter; }\r
-                       set { ((DataView) this).RowFilter = value; }\r
-               }\r
-\r
-               ListSortDescriptionCollection IBindingListView.SortDescriptions {\r
-                       get {\r
-                               var l = new List<ListSortDescription> ();\r
-                               for (int i = 0; i < sortColumns.Length; ++i) {\r
-                                       ListSortDescription ldesc = new ListSortDescription (\r
-                                                                               new DataColumnPropertyDescriptor (sortColumns [i]),\r
-                                                                               sortOrder [i]);\r
-                                       l.Add (ldesc);\r
-                               }\r
-                               return new ListSortDescriptionCollection (l.ToArray ());\r
-                       }\r
-               }\r
-\r
-               bool IBindingListView.SupportsAdvancedSorting {\r
-                       get { return true; }\r
-               }\r
-\r
-               bool IBindingListView.SupportsFiltering {\r
-                       get { return true; }\r
-               }\r
-\r
-               [MonoTODO]\r
-               void IBindingListView.ApplySort (ListSortDescriptionCollection sorts)\r
-               {\r
-                       StringBuilder sb = new StringBuilder ();\r
-                       foreach (ListSortDescription ldesc in sorts)\r
-                               sb.AppendFormat ("[{0}]{1},", ldesc.PropertyDescriptor.Name,\r
-                                       (ldesc.SortDirection == ListSortDirection.Descending ? " DESC" : string.Empty));\r
-                       this.Sort = sb.ToString (0, sb.Length-1);\r
-               }\r
-\r
-               void IBindingListView.RemoveFilter ()\r
-               {\r
-                       ((IBindingListView) this).Filter = string.Empty;\r
-               }\r
-       }\r
-\r
-       partial class DataView : ISupportInitializeNotification {\r
-               private bool dataViewInitialized = true;\r
-\r
-               [Browsable (false)]\r
-               public bool IsInitialized {\r
-                       get { return dataViewInitialized; }\r
-               }\r
-\r
-               public event EventHandler Initialized;\r
-\r
-               partial void DataViewInitialized (bool value)\r
-               {\r
-                       dataViewInitialized = value;\r
-                       if (value)\r
-                               OnDataViewInitialized (new EventArgs ());\r
-               }\r
-\r
-               private void OnDataViewInitialized (EventArgs e)\r
-               {\r
-                       if (null != Initialized)\r
-                               Initialized (this, e);\r
-               }\r
-       }\r
-\r
-       partial class DataView {\r
-               public virtual bool Equals (DataView view)\r
-               {\r
-                       if (this == view)\r
-                               return true;\r
-                       if (!(this.Table == view.Table && this.Sort == view.Sort &&\r
-                               this.RowFilter == view.RowFilter &&\r
-                               this.RowStateFilter == view.RowStateFilter &&\r
-                               this.AllowEdit == view.AllowEdit &&\r
-                               this.AllowNew == view.AllowNew &&\r
-                               this.AllowDelete == view.AllowDelete &&\r
-                               this.Count == view.Count))\r
-                               return false;\r
-\r
-                       for (int i = 0; i < Count; ++i)\r
-                               if (!this [i].Equals (view [i]))\r
-                                       return false;\r
-                       return true;\r
-               }\r
-               public DataTable ToTable ()\r
-               {\r
-                       return this.ToTable (Table.TableName, false, new string[] {});\r
-               }\r
-\r
-               public DataTable ToTable (string tableName)\r
-               {\r
-                       return this.ToTable (tableName, false, new string[] {});\r
-               }\r
-\r
-               public DataTable ToTable (bool distinct, params string[] columnNames)\r
-               {\r
-                       return this.ToTable (Table.TableName, distinct, columnNames);\r
-               }\r
-\r
-               public DataTable ToTable (string tableName, bool distinct, params string[] columnNames)\r
-               {\r
-                       if (columnNames == null)\r
-                               throw new ArgumentNullException ("columnNames", "'columnNames' argument cannot be null.");\r
-\r
-                       DataTable newTable = new DataTable (tableName);\r
-\r
-                       DataColumn[] columns;\r
-                       ListSortDirection[] sortDirection = null;\r
-                       if (columnNames.Length > 0) {\r
-                               columns = new DataColumn [columnNames.Length];\r
-                               for (int i=0; i < columnNames.Length; ++i)\r
-                                       columns [i] = Table.Columns [columnNames [i]];\r
-\r
-                               if (sortColumns != null) {\r
-                                       sortDirection = new ListSortDirection [columnNames.Length];\r
-                                       for (int i=0; i < columnNames.Length; ++i) {\r
-                                               sortDirection [i] = ListSortDirection.Ascending;\r
-                                               for (int j = 0; j < sortColumns.Length; ++j) {\r
-                                                       if (sortColumns [j] != columns [i])\r
-                                                               continue;\r
-                                                       sortDirection [i] = sortOrder [j];\r
-                                               }\r
-                                       }\r
-                               }\r
-                       } else {\r
-                               columns = (DataColumn[]) Table.Columns.ToArray (typeof (DataColumn));\r
-                               sortDirection = sortOrder;\r
-                       }\r
-\r
-                       ArrayList expressionCols = new ArrayList ();\r
-                       for (int i = 0; i < columns.Length; ++i) {\r
-                               DataColumn col = columns [i].Clone ();\r
-                               if (col.Expression != String.Empty) {\r
-                                       col.Expression = string.Empty;\r
-                                       expressionCols.Add (col);\r
-                               }\r
-                               if (col.ReadOnly)\r
-                                       col.ReadOnly = false;\r
-                               newTable.Columns.Add (col);\r
-                       }\r
-\r
-                       DataRow [] rows;\r
-\r
-                       // Get the index from index collection of the data table.\r
-                       Index index = null;\r
-                       if (sort != string.Empty)\r
-                               index = Table.GetIndex(sortColumns,sortOrder,RowStateFilter,FilterExpression,true);\r
-                       else\r
-                               index = new Index (new Key(Table, columns, sortDirection, RowStateFilter, rowFilterExpr));\r
-                       \r
-                       if (distinct)\r
-                               rows = index.GetDistinctRows ();\r
-                       else\r
-                               rows = index.GetAllRows ();\r
-\r
-                       foreach (DataRow row in rows) {\r
-                               DataRow newRow = newTable.NewNotInitializedRow ();\r
-                               newTable.Rows.AddInternal (newRow);\r
-                               newRow.Original = -1;\r
-                               if (row.HasVersion (DataRowVersion.Current))\r
-                                       newRow.Current = newTable.RecordCache.CopyRecord (Table, row.Current, -1);\r
-                               else if (row.HasVersion (DataRowVersion.Original))\r
-                                       newRow.Current = newTable.RecordCache.CopyRecord (Table, row.Original, -1);\r
-\r
-                               foreach (DataColumn col in expressionCols)\r
-                                       newRow [col] = row [col.ColumnName];\r
-                               newRow.Original = -1;\r
-                       }\r
-                       return newTable;\r
-               }\r
-       }\r
-}\r
diff --git a/mcs/class/System.Data/System.Data/DataViewManager.cs b/mcs/class/System.Data/System.Data/DataViewManager.cs
deleted file mode 100644 (file)
index 6417e41..0000000
+++ /dev/null
@@ -1,441 +0,0 @@
-//\r
-// System.Data.DataViewManager\r
-//\r
-// Author:\r
-//   Rodrigo Moya (rodrigo@ximian.com)\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//   Atsushi Enomoto (atsushi@ximian.com)\r
-//   Ivan N. Zlatev (contact@i-nz.net)\r
-//\r
-// (C) Ximian, Inc. 2002\r
-// Copyright (C) Tim Coleman, 2002\r
-// Copyright (C) 2005 Novell Inc,\r
-//\r
-\r
-//\r
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)\r
-//\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-// \r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-// \r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
-//\r
-\r
-using System;\r
-using System.Collections;\r
-using System.ComponentModel;\r
-using System.IO;\r
-using System.Xml;\r
-\r
-namespace System.Data\r
-{\r
-       /// <summary>\r
-       /// Contains a default DataViewSettingCollection for each DataTable in a DataSet.\r
-       /// </summary>\r
-       //[Designer]\r
-       [DesignerAttribute ("Microsoft.VSDesigner.Data.VS.DataViewManagerDesigner, "+ Consts.AssemblyMicrosoft_VSDesigner, "System.ComponentModel.Design.IDesigner")]\r
-       public class DataViewManager : MarshalByValueComponent, IBindingList, ICollection, IList, ITypedList, IEnumerable\r
-       {\r
-               #region Fields\r
-\r
-               DataSet dataSet;\r
-               DataViewManagerListItemTypeDescriptor descriptor;\r
-               DataViewSettingCollection settings;\r
-               string xml;\r
-\r
-               #endregion // Fields\r
-\r
-               #region Constructors\r
-\r
-               public DataViewManager ()\r
-                       : this (null)\r
-               {\r
-               }\r
-\r
-               public DataViewManager (DataSet dataSet)\r
-               {\r
-                       // Null argument is allowed here.\r
-                       SetDataSet (dataSet);\r
-               }\r
-\r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               [DefaultValue (null)]\r
-               public DataSet DataSet {\r
-                       get { return dataSet; }\r
-                       set {\r
-                               if (value == null)\r
-                                       throw new DataException ("Cannot set null DataSet.");\r
-                               SetDataSet (value);\r
-                       }\r
-               }\r
-\r
-               public string DataViewSettingCollectionString {\r
-                       get { return xml; }\r
-                       set {\r
-                               try {\r
-                                       ParseSettingString (value);\r
-                                       xml = BuildSettingString ();\r
-                               } catch (XmlException ex) {\r
-                                       throw new DataException ("Cannot set DataViewSettingCollectionString.", ex);\r
-                               }\r
-                       }\r
-               }\r
-\r
-               [DesignerSerializationVisibility (DesignerSerializationVisibility.Content)]\r
-               public DataViewSettingCollection DataViewSettings {\r
-                       get { return settings; }\r
-               }\r
-\r
-               int ICollection.Count {\r
-                       get { return 1; }\r
-               }\r
-\r
-               bool ICollection.IsSynchronized {\r
-                       get { return false; }\r
-               }\r
-\r
-               object ICollection.SyncRoot {\r
-                       get { return this; }\r
-               }\r
-\r
-               bool IList.IsFixedSize {\r
-                       get { return true; }\r
-               }\r
-\r
-               bool IList.IsReadOnly {\r
-                       get { return true; }\r
-               }\r
-\r
-               object IList.this [int index] {\r
-                       get { \r
-                               if (descriptor == null)\r
-                                       descriptor = new DataViewManagerListItemTypeDescriptor (this);\r
-\r
-                               return descriptor;\r
-                       }\r
-\r
-                       set { throw new ArgumentException ("Not modifiable"); }\r
-               }\r
-\r
-               bool IBindingList.AllowEdit {\r
-                       get { return false; }\r
-               }\r
-\r
-               bool IBindingList.AllowNew {\r
-                       get { return false; }\r
-               }\r
-\r
-               bool IBindingList.AllowRemove {\r
-                       get { return false; }\r
-               }\r
-\r
-               bool IBindingList.IsSorted {\r
-                       get { throw new NotSupportedException (); }\r
-               }\r
-\r
-               ListSortDirection IBindingList.SortDirection {\r
-                       get { throw new NotSupportedException (); }\r
-               }\r
-\r
-               PropertyDescriptor IBindingList.SortProperty {\r
-                       get { throw new NotSupportedException (); }\r
-               }\r
-\r
-               bool IBindingList.SupportsChangeNotification {\r
-                       get { return true; }\r
-               }\r
-\r
-               bool IBindingList.SupportsSearching {\r
-                       get { return false; }\r
-               }\r
-\r
-               bool IBindingList.SupportsSorting {\r
-                       get { return false; }\r
-               }\r
-\r
-               #endregion // Properties\r
-\r
-               #region Methods\r
-\r
-               private void SetDataSet (DataSet ds)\r
-               {\r
-                       if (dataSet != null) {\r
-                               dataSet.Tables.CollectionChanged -= new CollectionChangeEventHandler (TableCollectionChanged);\r
-                               dataSet.Relations.CollectionChanged -= new CollectionChangeEventHandler (RelationCollectionChanged);\r
-                       }\r
-\r
-                       dataSet = ds;\r
-                       settings = new DataViewSettingCollection (this);\r
-                       xml = BuildSettingString ();\r
-\r
-                       if (dataSet != null) {\r
-                               dataSet.Tables.CollectionChanged += new CollectionChangeEventHandler (TableCollectionChanged);\r
-                               dataSet.Relations.CollectionChanged += new CollectionChangeEventHandler (RelationCollectionChanged);\r
-                       }\r
-               }\r
-\r
-               private void ParseSettingString (string source)\r
-               {\r
-                       XmlTextReader xtr = new XmlTextReader (source,\r
-                               XmlNodeType.Element, null);\r
-\r
-                       xtr.Read ();\r
-                       if (xtr.Name != "DataViewSettingCollectionString")\r
-                               // easy way to throw the expected exception ;-)\r
-                       xtr.ReadStartElement ("DataViewSettingCollectionString");\r
-                       if (xtr.IsEmptyElement)\r
-                               return; // MS does not change the value.\r
-\r
-                       xtr.Read ();\r
-                       do {\r
-                               xtr.MoveToContent ();\r
-                               if (xtr.NodeType == XmlNodeType.EndElement)\r
-                                       break;\r
-                               if (xtr.NodeType == XmlNodeType.Element)\r
-                                       ReadTableSetting (xtr);\r
-                               else\r
-                                       xtr.Skip ();\r
-                       } while (!xtr.EOF);\r
-                       if (xtr.NodeType == XmlNodeType.EndElement)\r
-                               xtr.ReadEndElement ();\r
-               }\r
-\r
-               private void ReadTableSetting (XmlReader reader)\r
-               {\r
-                       // Namespace is ignored BTW.\r
-                       DataTable dt = DataSet.Tables [XmlConvert.DecodeName (\r
-                               reader.LocalName)];\r
-                       // The code below might result in NullReference error.\r
-                       DataViewSetting s = settings [dt];\r
-                       string sort = reader.GetAttribute ("Sort");\r
-                       if (sort != null)\r
-                               s.Sort = sort.Trim ();\r
-                       string ads = reader.GetAttribute ("ApplyDefaultSort");\r
-                       if (ads != null && ads.Trim () == "true")\r
-                               s.ApplyDefaultSort = true;\r
-                       string rowFilter = reader.GetAttribute ("RowFilter");\r
-                       if (rowFilter != null)\r
-                               s.RowFilter = rowFilter.Trim ();\r
-                       string rsf = reader.GetAttribute ("RowStateFilter");\r
-                       if (rsf != null)\r
-                               s.RowStateFilter = (DataViewRowState)\r
-                                       Enum.Parse (typeof (DataViewRowState), \r
-                                       rsf.Trim ());\r
-                       reader.Skip ();\r
-               }\r
-\r
-               private string BuildSettingString ()\r
-               {\r
-                       if (dataSet == null)\r
-                               return String.Empty;\r
-\r
-                       StringWriter sw = new StringWriter ();\r
-                       sw.Write ('<');\r
-                       sw.Write ("DataViewSettingCollectionString>");\r
-                       foreach (DataViewSetting s in DataViewSettings) {\r
-                               sw.Write ('<');\r
-                               sw.Write (XmlConvert.EncodeName (\r
-                                               s.Table.TableName));\r
-                               sw.Write (" Sort=\"");\r
-                               sw.Write (Escape (s.Sort));\r
-                               sw.Write ('"');\r
-                               // LAMESPEC: MS.NET does not seem to handle this property as expected.\r
-                               if (s.ApplyDefaultSort)\r
-                                       sw.Write (" ApplyDefaultSort=\"true\"");\r
-                               sw.Write (" RowFilter=\"");\r
-                               sw.Write (Escape (s.RowFilter));\r
-                               sw.Write ("\" RowStateFilter=\"");\r
-                               sw.Write (s.RowStateFilter.ToString ());\r
-                               sw.Write ("\"/>");\r
-                       }\r
-                       sw.Write ("</DataViewSettingCollectionString>");\r
-                       return sw.ToString ();\r
-               }\r
-\r
-               private string Escape (string s)\r
-               {\r
-                       return s.Replace ("&", "&amp;")\r
-                               .Replace ("\"", "&quot;")\r
-                               .Replace ("\'", "&apos;")\r
-                               .Replace ("<", "&lt;")\r
-                               .Replace (">", "&gt;");\r
-               }\r
-\r
-               public DataView CreateDataView (DataTable table)\r
-               {\r
-                       if (settings [table] != null) {\r
-                               DataViewSetting s = settings [table];\r
-                               return new DataView (table, this, s.Sort, s.RowFilter, s.RowStateFilter);\r
-                       } else {\r
-                               return new DataView (table);\r
-                       }\r
-               }\r
-\r
-               void IBindingList.AddIndex (PropertyDescriptor property)\r
-               {\r
-               }\r
-       \r
-               object IBindingList.AddNew ()\r
-               {\r
-                       throw new NotSupportedException ();\r
-               }\r
-       \r
-               void IBindingList.ApplySort (PropertyDescriptor property, ListSortDirection direction)\r
-               {\r
-                       throw new NotSupportedException ();\r
-               }\r
-       \r
-               int IBindingList.Find (PropertyDescriptor property, object key)\r
-               {\r
-                       throw new NotSupportedException ();\r
-               }\r
-       \r
-               void IBindingList.RemoveIndex (PropertyDescriptor property)\r
-               {\r
-               }\r
-       \r
-               void IBindingList.RemoveSort ()\r
-               {\r
-                       throw new NotSupportedException ();\r
-               }\r
-       \r
-               void ICollection.CopyTo (Array array, int index)\r
-               {\r
-                       array.SetValue (descriptor, index);\r
-               }\r
-       \r
-               IEnumerator IEnumerable.GetEnumerator ()\r
-               {\r
-                       DataViewManagerListItemTypeDescriptor[] array = new DataViewManagerListItemTypeDescriptor[((ICollection)this).Count];\r
-                       ((ICollection)this).CopyTo (array, 0);\r
-                       return array.GetEnumerator ();\r
-               }\r
-       \r
-               int IList.Add (object value)\r
-               {\r
-                       throw new ArgumentException ("Not modifiable");\r
-               }\r
-       \r
-               void IList.Clear ()\r
-               {\r
-                       throw new ArgumentException ("Not modifiable");\r
-               }\r
-       \r
-               bool IList.Contains (object value)\r
-               {\r
-                       return value == descriptor;\r
-               }\r
-       \r
-               int IList.IndexOf (object value)\r
-               {\r
-                       if (value == descriptor)\r
-                               return 0;\r
-                       return -1;\r
-               }\r
-       \r
-               void IList.Insert (int index, object value)\r
-               {\r
-                       throw new ArgumentException ("Not modifiable");\r
-               }\r
-       \r
-               void IList.Remove (object value)\r
-               {\r
-                       throw new ArgumentException ("Not modifiable");\r
-               }\r
-       \r
-               void IList.RemoveAt (int index)\r
-               {\r
-                       throw new ArgumentException ("Not modifiable");\r
-               }\r
-       \r
-               [MonoLimitation("Supported only empty list of listAccessors")]\r
-               PropertyDescriptorCollection ITypedList.GetItemProperties (PropertyDescriptor[] listAccessors)\r
-               {\r
-                       if (dataSet == null)\r
-                               throw new DataException ("dataset is null");\r
-\r
-                       if (listAccessors == null || listAccessors.Length == 0) {\r
-                               ICustomTypeDescriptor desc = new DataViewManagerListItemTypeDescriptor (this);\r
-                               return desc.GetProperties ();\r
-                       }\r
-                               \r
-                       throw new NotImplementedException ();\r
-               }\r
-       \r
-               string ITypedList.GetListName (PropertyDescriptor[] listAccessors)\r
-               {\r
-                       if (dataSet != null) {\r
-                               if (listAccessors == null || listAccessors.Length == 0)\r
-                                       return  dataSet.DataSetName;\r
-                       }\r
-                       \r
-                       return string.Empty;\r
-               }\r
-       \r
-               protected virtual void OnListChanged (ListChangedEventArgs e)\r
-               {\r
-                       if (ListChanged != null)\r
-                               ListChanged (this, e);\r
-               }\r
-\r
-               protected virtual void RelationCollectionChanged (object sender, CollectionChangeEventArgs e)\r
-               {\r
-                       this.OnListChanged (CollectionToListChangeEventArgs (e));\r
-               }\r
-\r
-               protected virtual void TableCollectionChanged (object sender, CollectionChangeEventArgs e)\r
-               {\r
-                       this.OnListChanged (CollectionToListChangeEventArgs (e));\r
-               }\r
-\r
-               private ListChangedEventArgs CollectionToListChangeEventArgs (CollectionChangeEventArgs e)\r
-               {\r
-                       ListChangedEventArgs args;\r
-\r
-                       if (e.Action == CollectionChangeAction.Remove)\r
-                               args = null;\r
-                       else if (e.Action == CollectionChangeAction.Refresh)\r
-                               args = new ListChangedEventArgs(ListChangedType.PropertyDescriptorChanged, null);\r
-                       else { \r
-                              object obj;\r
-                              \r
-                              if (typeof (DataTable).IsAssignableFrom (e.Element.GetType()))\r
-                                      obj = new DataTablePropertyDescriptor ((DataTable) e.Element);\r
-                              else // Assume a DataRelation\r
-                                      obj = new DataRelationPropertyDescriptor((DataRelation) e.Element);\r
-                              \r
-                              if (e.Action == CollectionChangeAction.Add)\r
-                                      args = new ListChangedEventArgs(ListChangedType.PropertyDescriptorAdded, (PropertyDescriptor) obj);\r
-                              else\r
-                                      args = new ListChangedEventArgs(ListChangedType.PropertyDescriptorDeleted, (PropertyDescriptor) obj);\r
-                       }\r
-                       \r
-                       return args;\r
-               }\r
-\r
-               #endregion // Methods\r
-\r
-               #region Events\r
-\r
-               public event ListChangedEventHandler ListChanged;\r
-\r
-               #endregion // Events\r
-       }\r
-}\r
diff --git a/mcs/class/System.Data/System.Data/DataViewManagerListItemTypeDescriptor.cs b/mcs/class/System.Data/System.Data/DataViewManagerListItemTypeDescriptor.cs
deleted file mode 100644 (file)
index b82e0be..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-//
-// System.Data.DataViewManagerListItemTypeDscriptor
-//
-// Authors:
-//     Gonzalo Paniagua Javier (gonzalo@ximian.com)
-//      Jackson Harper  (jackson@ximian.com)
-//
-// (C) 2002 Ximian, Inc (http://www.ximian.com)
-// (C) 2005 Novell, Inc (http://www.novell.com)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.ComponentModel;
-
-namespace System.Data
-{
-       class DataViewManagerListItemTypeDescriptor : ICustomTypeDescriptor
-       {
-               DataViewManager dvm;
-               //PropertyDescriptorCollection propsCollection;
-
-               internal DataViewManagerListItemTypeDescriptor (DataViewManager dvm)
-               {
-                       this.dvm = dvm;
-               }
-
-               internal DataViewManager DataViewManager {
-                       get { return dvm; }
-               }
-
-               AttributeCollection ICustomTypeDescriptor.GetAttributes ()
-               {
-                       return new AttributeCollection (null);
-               }
-
-               string ICustomTypeDescriptor.GetClassName ()
-               {
-                       return null;
-               }
-
-               string ICustomTypeDescriptor.GetComponentName ()
-               {
-                       return null;
-               }
-
-               TypeConverter ICustomTypeDescriptor.GetConverter ()
-               {
-                       return null;
-               }
-
-               EventDescriptor ICustomTypeDescriptor.GetDefaultEvent ()
-               {
-                       return null;
-               }
-
-               PropertyDescriptor ICustomTypeDescriptor.GetDefaultProperty ()
-               {
-                       return null;
-               }
-
-               object ICustomTypeDescriptor.GetEditor (Type editorBaseType)
-               {
-                       return null;
-               }
-
-               EventDescriptorCollection ICustomTypeDescriptor.GetEvents ()
-               {
-                       return new EventDescriptorCollection (null);
-               }
-
-               EventDescriptorCollection ICustomTypeDescriptor.GetEvents (System.Attribute[] attributes)
-               {
-                       return new EventDescriptorCollection (null);
-               }
-
-               public PropertyDescriptorCollection GetProperties ()
-               {
-                       DataSet ds = dvm.DataSet;
-                       if (ds == null)
-                               return null;
-
-                       DataTableCollection tables = ds.Tables;
-                       int index = 0;
-                       PropertyDescriptor [] descriptors  = new PropertyDescriptor [tables.Count];
-                       foreach (DataTable table in tables)
-                               descriptors [index++] = new DataTablePropertyDescriptor (table);
-
-                       return new PropertyDescriptorCollection (descriptors);
-               }
-
-               PropertyDescriptorCollection ICustomTypeDescriptor.GetProperties (System.Attribute[] attributes)
-               {
-                       return this.GetProperties ();
-               }
-
-               object ICustomTypeDescriptor.GetPropertyOwner (PropertyDescriptor pd)
-               {
-                       return this;
-               }
-       }
-}
-
diff --git a/mcs/class/System.Data/System.Data/DataViewRowState.cs b/mcs/class/System.Data/System.Data/DataViewRowState.cs
deleted file mode 100644 (file)
index 5f24c90..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-//
-// System.Data.DataViewRowState.cs
-//
-// Author:
-//   Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.ComponentModel;
-
-namespace System.Data
-{
-       /// <summary>
-       /// Describes the version of data in a DataRow.
-       /// This enumeration has a FlagsAttribute that allows a bitwise combination of its member values.
-       /// </summary>
-       [Flags]
-       [EditorAttribute("Microsoft.VSDesigner.Data.Design.DataViewRowStateEditor, "+Consts.AssemblyMicrosoft_VSDesigner, "System.Drawing.Design.UITypeEditor, "+Consts.AssemblySystem_Drawing )]
-       public enum DataViewRowState
-       {
-               None = 0,
-               Unchanged = 2,
-               Added = 4,
-               Deleted = 8,
-               ModifiedCurrent = 16,
-               CurrentRows = Unchanged | Added | ModifiedCurrent,
-               ModifiedOriginal = 32,
-               OriginalRows = Unchanged | Deleted | ModifiedOriginal
-       }
-}
diff --git a/mcs/class/System.Data/System.Data/DataViewSetting.cs b/mcs/class/System.Data/System.Data/DataViewSetting.cs
deleted file mode 100644 (file)
index 7ebe2ed..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-//
-// System.Data.DataViewSetting
-//
-// Authors:
-//   Rodrigo Moya (rodrigo@ximian.com)
-//   Tim Coleman (tim@timcoleman.com)
-//   Atsushi Enomoto (atsushi@ximian.com)
-//
-// (C) Ximian, Inc. 2002
-// Copyright (C) Tim Coleman, 2002
-// Copyright (C) 2005 Novell Inc,
-//
-
-//
-// Copyright (C) 2004-05 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.ComponentModel;
-
-namespace System.Data
-{
-       /// <summary>
-       /// Represents the default settings for ApplyDefaultSort, DataViewManager, RowFilter, RowStateFilter, Sort, and Table for DataViews created from the DataViewManager.
-       /// </summary>
-       [TypeConverterAttribute (typeof (ExpandableObjectConverter))]
-       public class DataViewSetting
-       {
-               #region Fields
-
-               bool applyDefaultSort;
-               DataViewManager dataViewManager;
-               string rowFilter = String.Empty;
-               DataViewRowState rowStateFilter = DataViewRowState.CurrentRows;
-               string sort = String.Empty;
-               DataTable dataTable;
-
-               #endregion // Fields
-
-               #region Constructors
-
-               internal DataViewSetting (DataViewManager manager, DataTable table)
-               {
-                       dataViewManager = manager;
-                       dataTable = table;
-               }
-
-               #endregion // Constructors
-
-               #region Properties
-               
-               public bool ApplyDefaultSort {
-                       get { return applyDefaultSort; }
-                       set { applyDefaultSort = value; }
-               }
-
-               [Browsable (false)]
-               public DataViewManager DataViewManager {
-                       get { return dataViewManager; }
-               }
-
-               public string RowFilter {
-                       get { return rowFilter; }
-                       set { rowFilter = value; }
-               }
-
-               public DataViewRowState RowStateFilter {
-                       get { return rowStateFilter; }
-                       set { rowStateFilter = value; }
-               }
-
-               public string Sort {
-                       get { return sort; }
-                       set { sort = value; }
-               }
-
-               [Browsable (false)]
-               public DataTable Table {
-                       get { return dataTable; }
-               }
-
-               #endregion // Properties
-       }
-}
diff --git a/mcs/class/System.Data/System.Data/DataViewSettingCollection.cs b/mcs/class/System.Data/System.Data/DataViewSettingCollection.cs
deleted file mode 100644 (file)
index 2d771cc..0000000
+++ /dev/null
@@ -1,143 +0,0 @@
-//
-// System.Data.DataViewSettingCollection.cs
-//
-// Authors:
-//   Rodrigo Moya (rodrigo@ximian.com)
-//   Miguel de Icaza (miguel@gnome.org)
-//   Tim Coleman (tim@timcoleman.com)
-//   Atsushi Enomoto (atsushi@ximian.com)
-//
-// (C) 2002 Ximian, Inc.  http://www.ximian.com
-// Copyright (C) Tim Coleman, 2002
-// Copyright (C) 2005 Novell Inc,
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections;
-using System.ComponentModel;
-
-namespace System.Data
-{
-       /// <summary>
-       /// Contains a read-only collection of DataViewSetting objects for each DataTable in a DataSet.
-       /// </summary>
-       [Editor ("Microsoft.VSDesigner.Data.Design.DataViewSettingsCollectionEditor, " + Consts.AssemblyMicrosoft_VSDesigner,
-                "System.Drawing.Design.UITypeEditor, " + Consts.AssemblySystem_Drawing)]
-       public class DataViewSettingCollection : ICollection, IEnumerable 
-       {
-               #region Fields
-
-               readonly ArrayList settingList;
-
-               #endregion // Fields
-
-               #region Constructors
-
-               internal DataViewSettingCollection (DataViewManager manager)
-               {
-                       settingList = new ArrayList ();
-                       if (manager.DataSet != null)
-                               foreach (DataTable dt in manager.DataSet.Tables)
-                                       settingList.Add (new DataViewSetting (
-                                               manager, dt));
-               }
-
-               #endregion // Constructors
-
-               #region Properties
-       
-               [Browsable (false)]
-               public virtual int Count {
-                       get { return settingList.Count; }
-               }
-
-               [Browsable (false)]
-               public bool IsReadOnly {
-                       get { return settingList.IsReadOnly; }
-               }
-
-               [Browsable (false)]
-               public bool IsSynchronized {
-                       get { return settingList.IsSynchronized; }
-               }
-
-               public virtual DataViewSetting this [DataTable table] {
-                       get {
-                               for (int i = 0; i < settingList.Count; i++) {
-                                       DataViewSetting dvs = (DataViewSetting) settingList [i];
-                                       if (dvs.Table == table)
-                                               return dvs;
-                               }
-                               return null;
-                       }
-                       set {
-                               this [table] = value;
-                       }
-               }
-
-               public virtual DataViewSetting this [string tableName] {
-                       get {
-                               for (int i = 0; i < settingList.Count; i++) {
-                                       DataViewSetting dvs = (DataViewSetting) settingList [i];
-                                       if (dvs.Table.TableName == tableName)
-                                               return dvs;
-                               }
-                               return null;
-                       }
-               }
-
-               public virtual DataViewSetting this [int index] {
-                       get { return (DataViewSetting) settingList [index]; }
-                       set { settingList [index] = value; }
-               }
-
-               [Browsable (false)]
-               public object SyncRoot {
-                       get { return settingList.SyncRoot; }
-               }
-
-               #endregion // Properties
-
-               #region Methods
-
-               public void CopyTo (Array ar, int index)
-               {
-                       settingList.CopyTo (ar, index);
-               }
-
-               public void CopyTo (DataViewSetting [] ar, int index)
-               {
-                       settingList.CopyTo (ar, index);
-               }
-
-               public IEnumerator GetEnumerator ()
-               {
-                       return settingList.GetEnumerator ();
-               }
-
-               #endregion // Methods
-       }
-}
diff --git a/mcs/class/System.Data/System.Data/DbMetaData.cs b/mcs/class/System.Data/System.Data/DbMetaData.cs
deleted file mode 100644 (file)
index 5eae894..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-//
-// System.Data.DbMetaData.cs
-//
-// Author:
-//   Tim Coleman (tim@timcoleman.com)
-//
-// Copyright (C) Tim Coleman, 2003
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-namespace System.Data {
-       public class DbMetaData 
-       {
-               #region Fields
-
-               DbType dbType;
-               bool isNullable;
-               long maxLength;
-               string name;
-
-               #endregion // Fields
-
-               #region Constructors
-
-               [MonoTODO]
-               public DbMetaData ()
-               {
-               }
-
-               [MonoTODO]
-               public DbMetaData (DbMetaData source)
-               {
-               }
-
-               #endregion // Constructors
-
-               #region Properties
-
-               public virtual DbType DbType {
-                       get { return dbType; }
-                       set { dbType = value; }
-               }
-
-               public virtual bool IsNullable {
-                       get { return isNullable; }
-                       set { isNullable = value; }
-               }
-
-               public virtual long MaxLength {
-                       get { return maxLength; }
-                       set { maxLength = value; }
-               }
-
-               public string Name {
-                       get { return name; } 
-                       set { name = value; }
-               }
-
-               #endregion // Properties
-       }
-}
-
diff --git a/mcs/class/System.Data/System.Data/DbType.cs b/mcs/class/System.Data/System.Data/DbType.cs
deleted file mode 100644 (file)
index 71ee9e3..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-//
-// System.Data.DbType.cs
-//
-// Author:
-//   Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System.Data
-{
-       /// <summary>
-       /// Gets the data type of a field, a property, or a Parameter object of a .NET data provider.
-       /// </summary>
-       public enum DbType
-       {
-               AnsiString = 0,
-               Binary = 1,
-               Byte = 2,
-               Boolean = 3,
-               Currency = 4,
-               Date = 5,
-               DateTime = 6,
-               Decimal = 7,
-               Double = 8,
-               Guid = 9,
-               Int16 = 10,
-               Int32 = 11,
-               Int64 = 12,
-               Object = 13,
-               SByte = 14,
-               Single = 15,
-               String = 16,
-               Time = 17,
-               UInt16 = 18,
-               UInt32 = 19,
-               UInt64 = 20,
-               VarNumeric = 21,
-               AnsiStringFixedLength = 22,
-               Xml = 25,
-               DateTime2 = 26,
-               DateTimeOffset = 27,
-               StringFixedLength = 23
-       }
-}
diff --git a/mcs/class/System.Data/System.Data/DefaultValueTypeConverter.cs b/mcs/class/System.Data/System.Data/DefaultValueTypeConverter.cs
deleted file mode 100644 (file)
index 29e8a5a..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-//
-// System.Data.DefaultValueTypeConverter.cs
-//
-// Author:
-//   Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//
-// (C) 2004 Andreas Nahr
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Globalization;
-using System.ComponentModel;
-
-namespace System.Data
-{
-       internal sealed class DefaultValueTypeConverter : ExpandableObjectConverter
-       {
-               [MonoTODO]
-               public DefaultValueTypeConverter ()
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               public override object ConvertTo (ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               public override bool CanConvertTo (ITypeDescriptorContext context, Type destinationType)
-               {
-                       throw new NotImplementedException ();
-               }
-       }
-}
diff --git a/mcs/class/System.Data/System.Data/DeletedRowInaccessibleException.cs b/mcs/class/System.Data/System.Data/DeletedRowInaccessibleException.cs
deleted file mode 100644 (file)
index 661d485..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// System.Data.DeletedRowInaccessibleException.cs
-//
-// Author: Duncan Mak  (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System.Data
-{
-       [Serializable]
-       public class DeletedRowInaccessibleException : DataException
-       {
-               public DeletedRowInaccessibleException ()
-                       : base (Locale.GetText ("This DataRow has been deleted"))
-               {
-               }
-
-               public DeletedRowInaccessibleException (string s)
-                       : base (s)
-               {
-               }
-
-               public DeletedRowInaccessibleException (string message, Exception innerException)
-                       : base (message, innerException)
-               {
-               }
-
-               protected DeletedRowInaccessibleException (SerializationInfo info, StreamingContext context)
-                       : base (info, context)
-               {
-               }
-       }
-}
diff --git a/mcs/class/System.Data/System.Data/DuplicateNameException.cs b/mcs/class/System.Data/System.Data/DuplicateNameException.cs
deleted file mode 100644 (file)
index fa0eefe..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// System.Data.DuplicateNameException.cs
-//
-// Author: Duncan Mak  (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System.Data
-{
-       [Serializable]
-       public class DuplicateNameException : DataException
-       {
-               public DuplicateNameException ()
-                       : base (Locale.GetText ("There is a database object with the same name"))
-               {
-               }
-
-               public DuplicateNameException (string s)
-                       : base (s)
-               {
-               }
-
-               public DuplicateNameException (string message, Exception innerException)
-                       : base (message, innerException)
-               {
-               }
-
-               protected DuplicateNameException (SerializationInfo info, StreamingContext context)
-                       : base (info, context)
-               {
-               }
-       }
-}
diff --git a/mcs/class/System.Data/System.Data/EvaluateException.cs b/mcs/class/System.Data/System.Data/EvaluateException.cs
deleted file mode 100644 (file)
index 3b0a404..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// System.Data.EvaluateException.cs
-//
-// Author: Duncan Mak  (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System.Data
-{
-       [Serializable]
-       public class EvaluateException : InvalidExpressionException
-       {
-               public EvaluateException ()
-                       : base (Locale.GetText ("This expression cannot be evaluated"))
-               {
-               }
-
-               public EvaluateException (string s)
-                       : base (s)
-               {
-               }
-
-               public EvaluateException (string message, Exception innerException)
-                       : base (message, innerException)
-               {
-               }
-
-               protected EvaluateException (SerializationInfo info, StreamingContext context)
-                       : base (info, context)
-               {
-               }
-       }
-}
diff --git a/mcs/class/System.Data/System.Data/ExpressionElement.cs b/mcs/class/System.Data/System.Data/ExpressionElement.cs
deleted file mode 100644 (file)
index 3b79735..0000000
+++ /dev/null
@@ -1,3404 +0,0 @@
-//\r
-// System.Data.ExpressionElement \r
-//\r
-// Author:\r
-//   Ville Palo <vi64pa@kolumbus.fi>\r
-//\r
-// Copyright (C) Ville Palo, 2003\r
-//\r
-// TODO: - Some functionelements and aggregates.\r
-//       - New parsing style.\r
-//       - Exceptions\r
-//\r
-\r
-using System;\r
-using System.Data;\r
-using System.Reflection;\r
-\r
-using System.Collections;\r
-using System.Text;\r
-\r
-namespace System.Data\r
-{\r
-#if false\r
-       /// <summary>\r
-       /// The main element which includes whole expression\r
-       /// </summary>\r
-       internal class ExpressionMainElement : ExpressionElement\r
-       {\r
-               \r
-               \r
-\r
-               public ExpressionMainElement (string s)\r
-               {\r
-                       s = ExpressionElement.ValidateExpression (s);\r
-                       ParseExpression (s);\r
-               }\r
-               \r
-               public override bool Test (DataRow Row) \r
-               {\r
-\r
-                       foreach (ExpressionElement El in Elements) \r
-                       {\r
-                               if (!El.Test (Row))\r
-                                       return false;\r
-                       }\r
-                       \r
-                       return true;\r
-               }\r
-\r
-               \r
-       }\r
-\r
-       //\r
-       // O_P_E_R_A_T_O_R_S\r
-       //\r
-\r
-       /// <summary>\r
-       ///  Class for =\r
-       /// </summary>\r
-       internal class ExpressionEquals : ExpressionElement\r
-       {       \r
-\r
-               public ExpressionEquals (string exp1, string exp2) \r
-               {       \r
-                       this.exp1 = exp1;\r
-                       this.exp2 = exp2;\r
-                       ParseExpression (exp1);\r
-                       ParseExpression (exp2);\r
-               }\r
-\r
-               public override bool Test (DataRow Row) \r
-               {\r
-                       \r
-                       ExpressionElement E1 = (ExpressionElement)Elements [0];\r
-                       ExpressionElement E2 = (ExpressionElement)Elements [1];\r
-\r
-                       return ExpressionElement.Compare (E1, E2, Row) == 0;\r
-               }\r
-       }\r
-\r
-       /// <summary>\r
-       ///  Class for <\r
-       /// </summary>\r
-       internal class ExpressionLessThan : ExpressionElement\r
-       {       \r
-\r
-               public ExpressionLessThan (string exp1, string exp2) \r
-               {       \r
-                       this.exp1 = exp1;\r
-                       this.exp2 = exp2;\r
-                       ParseExpression (exp1);\r
-                       ParseExpression (exp2);\r
-               }\r
-\r
-               public override bool Test (DataRow Row) \r
-               {\r
-                                                               \r
-                       ExpressionElement E1 = (ExpressionElement)Elements [0];\r
-                       ExpressionElement E2 = (ExpressionElement)Elements [1];\r
-                                          \r
-                       return ExpressionElement.Compare (E1, E2, Row) < 0;\r
-               }\r
-       }\r
-\r
-       /// <summary>\r
-       ///  Class for <=\r
-       /// </summary>\r
-       internal class ExpressionLessThanOrEqual : ExpressionElement\r
-       {       \r
-\r
-               public ExpressionLessThanOrEqual (string exp1, string exp2) \r
-               {       \r
-                       this.exp1 = exp1;\r
-                       this.exp2 = exp2;\r
-                       ParseExpression (exp1);\r
-                       ParseExpression (exp2);\r
-               }\r
-\r
-               public override bool Test (DataRow Row) \r
-               {\r
-\r
-                       ExpressionElement E1 = (ExpressionElement)Elements [0];\r
-                       ExpressionElement E2 = (ExpressionElement)Elements [1];\r
-\r
-                       return ExpressionElement.Compare (E1, E2, Row) <= 0;\r
-               }\r
-       }\r
-\r
-       /// <summary>\r
-       ///  Class for >\r
-       /// </summary>\r
-       internal class ExpressionGreaterThan : ExpressionElement\r
-       {       \r
-\r
-               public ExpressionGreaterThan (string exp1, string exp2) \r
-               {       \r
-                       this.exp1 = exp1;\r
-                       this.exp2 = exp2;\r
-                       ParseExpression (exp1);\r
-                       ParseExpression (exp2);\r
-               }\r
-\r
-               public override bool Test (DataRow Row) \r
-               {\r
-                       \r
-                       ExpressionElement E1 = (ExpressionElement)Elements [0];\r
-                       ExpressionElement E2 = (ExpressionElement)Elements [1];\r
-\r
-                       return ExpressionElement.Compare (E1, E2, Row) > 0;\r
-               }\r
-       }\r
-\r
-       /// <summary>\r
-       ///  Class for >=\r
-       /// </summary>\r
-       internal class ExpressionGreaterThanOrEqual : ExpressionElement\r
-       {       \r
-\r
-               public ExpressionGreaterThanOrEqual (string exp1, string exp2) \r
-               {       \r
-                       this.exp1 = exp1;\r
-                       this.exp2 = exp2;\r
-                       ParseExpression (exp1);\r
-                       ParseExpression (exp2);\r
-               }\r
-\r
-               public override bool Test (DataRow Row) \r
-               {\r
-\r
-                       ExpressionElement E1 = (ExpressionElement)Elements [0];\r
-                       ExpressionElement E2 = (ExpressionElement)Elements [1];\r
-\r
-                       return ExpressionElement.Compare (E1, E2, Row) >= 0;\r
-               }\r
-       }\r
-\r
-       /// <summary>\r
-       ///  Class for <>\r
-       /// </summary>\r
-       internal class ExpressionUnequals : ExpressionElement\r
-       {       \r
-\r
-               public ExpressionUnequals (string exp1, string exp2) \r
-               {       \r
-                       this.exp1 = exp1;\r
-                       this.exp2 = exp2;\r
-                       ParseExpression (exp1);\r
-                       ParseExpression (exp2);\r
-               }\r
-\r
-               public override bool Test (DataRow Row) \r
-               {\r
-                       \r
-                       ExpressionElement E1 = (ExpressionElement)Elements [0];\r
-                       ExpressionElement E2 = (ExpressionElement)Elements [1];\r
-\r
-                       return ExpressionElement.Compare (E1, E2, Row) != 0;\r
-               }\r
-       }\r
-\r
-\r
-       /// <summary>\r
-       ///  Class for LIKE-operator\r
-       /// </summary>\r
-       internal class ExpressionLike : ExpressionElement\r
-       {       \r
-\r
-               public ExpressionLike (string exp1, string exp2) \r
-               {\r
-                       ParseExpression (exp1);\r
-                       ParseExpression (exp2);\r
-               }\r
-\r
-               public override bool Test (DataRow Row) \r
-               {\r
-\r
-                       ExpressionElement E1 = (ExpressionElement)Elements [0];\r
-                       ExpressionElement E2 = (ExpressionElement)Elements [1];\r
-                       object value1 = E1.Result (Row);\r
-                       object value2 = E2.Result (Row);\r
-                       \r
-                       if (value1.GetType () != typeof (string) || value2.GetType () != typeof (string))\r
-                               throw new Exception (); // TODO: what exception\r
-                       \r
-                       string operand1 = value1.ToString ();\r
-                       string operand2 = value2.ToString ();\r
-\r
-                       // find out is there wildcards like * or %.\r
-                       while (operand2.EndsWith ("*") || operand2.EndsWith ("%"))                             \r
-                               operand2 = operand2.Remove (operand2.Length - 1, 1);\r
-                       while (operand2.StartsWith ("*") || operand2.StartsWith ("%"))\r
-                               operand2 = operand2.Remove (0, 1);\r
-\r
-                       int oldIndex = 0;\r
-                       int indexOf = -1;\r
-\r
-                       indexOf = operand2.IndexOf ("*");\r
-                       while (indexOf != -1) \r
-                       {\r
-\r
-                               oldIndex = indexOf + 1;\r
-                               if (operand2 [indexOf + 1] != ']' || operand2 [indexOf - 1] != '[')\r
-                                       throw new EvaluateException ("Error in Like operator: ther string pattern " + operand1 + " is invalid");\r
-                               else \r
-                               {\r
-                                       operand2 = operand2.Remove (indexOf + 1, 1);\r
-                                       operand2 = operand2.Remove (indexOf -1, 1);\r
-                                       oldIndex--;\r
-                               }\r
-                                       \r
-                               indexOf = operand2.IndexOf ("*", oldIndex);\r
-                       }\r
-\r
-                       oldIndex = 0;\r
-                       indexOf = operand2.IndexOf ("%");\r
-                       while (indexOf != -1) \r
-                       {\r
-\r
-                               oldIndex = indexOf + 1;\r
-                               \r
-                               if (operand2 [indexOf + 1] != ']' || operand2 [indexOf - 1] != '[')\r
-                                       throw new EvaluateException ("Error in Like operator: ther string pattern " + operand2 + " is invalid");\r
-                               else \r
-                               {\r
-                                       operand2 = operand2.Remove (indexOf + 1, 1);\r
-                                       operand2 = operand2.Remove (indexOf -1, 1);                                     \r
-                                       oldIndex--;\r
-                               }\r
-\r
-                               indexOf = operand2.IndexOf ("%", oldIndex);\r
-                       }\r
-\r
-                       int len2 = operand2.Length;\r
-                       int startIndex = 0;\r
-                       while ((startIndex + len2) <= operand1.Length) \r
-                       {\r
-                               if (String.Compare (operand1.Substring (startIndex, len2), operand2, !Row.Table.CaseSensitive) == 0)\r
-                                       return true;\r
-                               startIndex++;\r
-                       }\r
-\r
-                       return false;\r
-               }\r
-       }\r
-\r
-\r
-       /// <summary>\r
-       ///  Class for OR\r
-       /// </summary>\r
-       internal class ExpressionOr : ExpressionElement\r
-       {                               \r
-               public ExpressionOr (string exp1, string exp2)\r
-               {\r
-                       ParseExpression (exp1);\r
-                       ParseExpression (exp2);\r
-               }\r
-\r
-               public override bool Test (DataRow Row) \r
-               {                       \r
-                       foreach (ExpressionElement El in Elements) \r
-                       {\r
-                               if (El.Test (Row))\r
-                                       return true;\r
-                       }\r
-                       \r
-                       return false;\r
-               }                               \r
-       }\r
-               \r
-       /// <summary>\r
-       ///  Class for AND\r
-       /// </summary>\r
-       internal class ExpressionAnd : ExpressionElement\r
-       {                               \r
-               public ExpressionAnd (string exp1, string exp2)\r
-               {\r
-                       ParseExpression (exp1);\r
-                       ParseExpression (exp2);\r
-               }\r
-              \r
-               public override object Result (DataRow Row) \r
-               {\r
-                       \r
-                       return Test(Row);\r
-               }\r
-\r
-               public override bool Test (DataRow Row) \r
-               {\r
-                       foreach (ExpressionElement El in Elements) \r
-                       {\r
-                               if (!El.Test (Row))\r
-                                       return false;\r
-                       }\r
-                       \r
-                       return true;\r
-               }                               \r
-       }\r
-\r
-\r
-       //\r
-       // A_R_I_T_H_M_E_T_I_C  O_P_E_R_A_T_O_R_S\r
-       //\r
-\r
-       /// <summary>\r
-       ///  Class for +\r
-       /// </summary>\r
-       internal class ExpressionAddition : ExpressionElement\r
-       {\r
-               public ExpressionAddition (string exp1, string exp2)\r
-               {                       \r
-                       this.exp1 = exp1;\r
-                       this.exp2 = exp2;\r
-                       ParseExpression (exp1);\r
-                       ParseExpression (exp2);\r
-               }\r
-               \r
-               public override Type ResultType (DataRow Row)\r
-               {\r
-                       Type ResultType = typeof (string);\r
-                       ExpressionElement exp1Temp = ((ExpressionElement)Elements [0]);\r
-                       ExpressionElement exp2Temp = ((ExpressionElement)Elements [1]);\r
-\r
-                       if (exp1Temp.ResultType (Row) == typeof (string) || exp2Temp.ResultType (Row) == typeof (string))\r
-                               ResultType = typeof (string);\r
-\r
-                       else if (exp1Temp.ResultType (Row) == typeof (long) || exp2Temp.ResultType (Row) == typeof (long))\r
-                               ResultType = typeof (long);\r
-\r
-                       else if (exp1Temp.ResultType (Row) == typeof (int) || exp2Temp.ResultType (Row) == typeof (int))\r
-                               ResultType = typeof (int);\r
-\r
-                       return ResultType;\r
-               }\r
-\r
-               public override object Result (DataRow Row) \r
-               {\r
-                       return CalculateResult (Row);\r
-               }\r
-               \r
-               protected override object Calculate (object value1, object value2, Type TempType) \r
-               {\r
-                       object Result = null;                   \r
-\r
-                       if (TempType == typeof (string))\r
-                               Result = (string)value1 + (string)value2;\r
-                       else if (TempType == typeof (long))\r
-                               Result = (long)value1 + (long)value2;\r
-                       else if (TempType == typeof (int))\r
-                               Result = (int)value1 + (int)value2;\r
-                       else if (TempType == typeof (short))\r
-                               Result = (short)value1 + (short)value2;\r
-                       else if (TempType == typeof (ulong))\r
-                               Result = (ulong)value1 + (ulong)value2;\r
-                       else if (TempType == typeof (uint))\r
-                               Result = (uint)value1 + (uint)value2;\r
-                       else if (TempType == typeof (ushort))\r
-                               Result = (ushort)value1 + (ushort)value2;\r
-                       else if (TempType == typeof (byte))\r
-                               Result = (byte)value1 + (byte)value2;\r
-                       else if (TempType == typeof (sbyte))\r
-                               Result = (sbyte)value1 + (sbyte)value2;\r
-                               // FIXME:\r
-                               //else if (TempType == typeof (bool))\r
-                               //      Result = (bool)value1 + (bool)value2;\r
-                       else if (TempType == typeof (float))\r
-                               Result = (float)value1 + (float)value2;\r
-                       else if (TempType == typeof (double))\r
-                               Result = (double)value1 + (double)value2;\r
-                       else if (TempType == typeof (decimal))\r
-                               Result = (decimal)value1 + (decimal)value2;\r
-                       // FIXME:\r
-                       //else if (TempType == typeof (DateTime))\r
-                       //      Result = (DateTime)value1 + (DateTime)value2;\r
-                       \r
-                       return Result;\r
-               }\r
-\r
-\r
-               // This method is shouldnt never invoked\r
-               public override bool Test (DataRow Row)\r
-               {\r
-                       throw new EvaluateException ();\r
-               }\r
-       }\r
-\r
-       /// <summary>\r
-       ///  Class for -\r
-       /// </summary>\r
-       internal class ExpressionSubtraction : ExpressionElement\r
-       {\r
-               public ExpressionSubtraction (string exp1, string exp2)\r
-               {                       \r
-                       this.exp1 = exp1;\r
-                       this.exp2 = exp2;\r
-                       ParseExpression (exp1);\r
-                       ParseExpression (exp2);\r
-               }\r
-               \r
-               public override object Result (DataRow Row) \r
-               {                       \r
-                       return CalculateResult (Row);\r
-               }\r
-               \r
-               // This method is shouldnt never invoked\r
-               public override bool Test (DataRow Row)\r
-               {\r
-                       throw new EvaluateException ();\r
-               }\r
-\r
-               protected override object Calculate (object value1, object value2, Type TempType) \r
-               {\r
-                       object Result = null;                   \r
-\r
-                       // FIXME:\r
-                       //if (TempType == typeof (string))\r
-                       //      Result = (string)value1 - (string)value2;\r
-                       if (TempType == typeof (long))\r
-                               Result = (long)value1 - (long)value2;\r
-                       else if (TempType == typeof (int))\r
-                               Result = (int)value1 - (int)value2;\r
-                       else if (TempType == typeof (short))\r
-                               Result = (short)value1 - (short)value2;\r
-                       else if (TempType == typeof (ulong))\r
-                               Result = (ulong)value1 + (ulong)value2;\r
-                       else if (TempType == typeof (uint))\r
-                               Result = (uint)value1 - (uint)value2;\r
-                       else if (TempType == typeof (ushort))\r
-                               Result = (ushort)value1 - (ushort)value2;\r
-                       else if (TempType == typeof (byte))\r
-                               Result = (byte)value1 - (byte)value2;\r
-                       else if (TempType == typeof (sbyte))\r
-                               Result = (sbyte)value1 - (sbyte)value2;\r
-                               // FIXME:\r
-                               //else if (TempType == typeof (bool))\r
-                               //      Result = (bool)value1 - (bool)value2;\r
-                       else if (TempType == typeof (float))\r
-                               Result = (float)value1 - (float)value2;\r
-                       else if (TempType == typeof (double))\r
-                               Result = (double)value1 - (double)value2;\r
-                       else if (TempType == typeof (decimal))\r
-                               Result = (decimal)value1 - (decimal)value2;\r
-                       // FIXME:\r
-                       //else if (TempType == typeof (DateTime))\r
-                       //      Result = (DateTime)value1 - (DateTime)value2;\r
-                       \r
-                       return Result;\r
-               }\r
-       }\r
-\r
-       /// <summary>\r
-       ///  Class for *\r
-       /// </summary>\r
-       internal class ExpressionMultiply : ExpressionElement\r
-       {\r
-               public ExpressionMultiply (string exp1, string exp2)\r
-               {                       \r
-                       this.exp1 = exp1;\r
-                       this.exp2 = exp2;\r
-                       ParseExpression (exp1);\r
-                       ParseExpression (exp2);\r
-               }\r
-               \r
-               public override Type ResultType (DataRow Row)\r
-               {\r
-                       Type ResultType = null;\r
-                       ExpressionElement E1 = ((ExpressionElement)Elements [0]);\r
-                       ExpressionElement E2 = ((ExpressionElement)Elements [1]);\r
-                       Type t1 = E1.ResultType (Row);\r
-                       Type t2 = E2.ResultType (Row);\r
-                               \r
-                       if (t1 == typeof (string) || t2 == typeof (string))\r
-                               throw new EvaluateException ("Cannon perform '*' operation on " + t1.ToString () + \r
-                                       " and " + t2.ToString ());\r
-\r
-                       else if (t1 == typeof (long) || t2 == typeof (long))\r
-                               ResultType = typeof (long);\r
-\r
-                       else if (t1 == typeof (int) || t2 == typeof (int))\r
-                               ResultType = typeof (int);\r
-\r
-                       return ResultType;\r
-               }\r
-\r
-               public override object Result (DataRow Row) \r
-               {\r
-                       return CalculateResult (Row);\r
-               }\r
-               \r
-               public override bool Test (DataRow Row)\r
-               {\r
-                       throw new EvaluateException ();\r
-               }\r
-\r
-               protected override object Calculate (object value1, object value2, Type TempType) \r
-               {\r
-                       object Result = null;                   \r
-\r
-                       if (TempType == typeof (long))\r
-                               Result = (long)value1 * (long)value2;\r
-                       else if (TempType == typeof (int))\r
-                               Result = (int)value1 * (int)value2;\r
-                       else if (TempType == typeof (short))\r
-                               Result = (short)value1 * (short)value2;\r
-                       else if (TempType == typeof (ulong))\r
-                               Result = (ulong)value1 * (ulong)value2;\r
-                       else if (TempType == typeof (uint))\r
-                               Result = (uint)value1 * (uint)value2;\r
-                       else if (TempType == typeof (ushort))\r
-                               Result = (ushort)value1 * (ushort)value2;\r
-                       else if (TempType == typeof (byte))\r
-                               Result = (byte)value1 * (byte)value2;\r
-                       else if (TempType == typeof (sbyte))\r
-                               Result = (sbyte)value1 * (sbyte)value2;\r
-                               // FIXME:\r
-                               //else if (TempType == typeof (bool))\r
-                               //      Result = (bool)value1 * (bool)value2;\r
-                       else if (TempType == typeof (float))\r
-                               Result = (float)value1 * (float)value2;\r
-                       else if (TempType == typeof (double))\r
-                               Result = (double)value1 * (double)value2;\r
-                       else if (TempType == typeof (decimal))\r
-                               Result = (decimal)value1 * (decimal)value2;\r
-                       // FIXME:\r
-                       //else if (TempType == typeof (DateTime))\r
-                       //      Result = (DateTime)value1 * (DateTime)value2;\r
-                       \r
-                       return Result;\r
-               }\r
-\r
-       }\r
-\r
-       /// <summary>\r
-       ///  Class for *\r
-       /// </summary>\r
-       internal class ExpressionDivide : ExpressionElement\r
-       {\r
-               public ExpressionDivide (string exp1, string exp2)\r
-               {                       \r
-                       this.exp1 = exp1;\r
-                       this.exp2 = exp2;\r
-                       ParseExpression (exp1);\r
-                       ParseExpression (exp2);\r
-               }\r
-               \r
-               public override object Result (DataRow Row) \r
-               {\r
-                       return CalculateResult (Row);\r
-               }\r
-               \r
-               // This method is shouldnt never invoked\r
-               public override bool Test (DataRow Row)\r
-               {\r
-                       throw new EvaluateException ();\r
-               }\r
-\r
-               protected  override object Calculate (object value1, object value2, Type TempType) \r
-               {\r
-                       object Result = null;                   \r
-\r
-                       if (TempType == typeof (long))\r
-                               Result = (long)value1 / (long)value2;\r
-                               // FIXME: \r
-                               //else if (TempType == typeof (int))\r
-                               //      Result = (string)value1 / (string)value2;\r
-                       else if (TempType == typeof (int))\r
-                               Result = (int)value1 / (int)value2;\r
-                       else if (TempType == typeof (short))\r
-                               Result = (short)value1 / (short)value2;\r
-                       else if (TempType == typeof (ulong))\r
-                               Result = (ulong)value1 / (ulong)value2;\r
-                       else if (TempType == typeof (uint))\r
-                               Result = (uint)value1 / (uint)value2;\r
-                       else if (TempType == typeof (ushort))\r
-                               Result = (ushort)value1 / (ushort)value2;\r
-                       else if (TempType == typeof (byte))\r
-                               Result = (byte)value1 / (byte)value2;\r
-                       else if (TempType == typeof (sbyte))\r
-                               Result = (sbyte)value1 / (sbyte)value2;\r
-                               // FIXME:\r
-                               //else if (TempType == typeof (bool))\r
-                               //      Result = (bool)value1 // (bool)value2;\r
-                       else if (TempType == typeof (float))\r
-                               Result = (float)value1 / (float)value2;\r
-                       else if (TempType == typeof (double))\r
-                               Result = (double)value1 / (double)value2;\r
-                       else if (TempType == typeof (decimal))\r
-                               Result = (decimal)value1 / (decimal)value2;\r
-                       // FIXME:\r
-                       //else if (TempType == typeof (DateTime))\r
-                       //      Result = (DateTime)value1 / (DateTime)value2;\r
-                       \r
-                       return Result;\r
-               }\r
-       }\r
-\r
-       /// <summary>\r
-       ///  Class for *\r
-       /// </summary>\r
-       internal class ExpressionModulus : ExpressionElement\r
-       {\r
-               public ExpressionModulus (string exp1, string exp2)\r
-               {                       \r
-                       this.exp1 = exp1;\r
-                       this.exp2 = exp2;\r
-                       ParseExpression (exp1);\r
-                       ParseExpression (exp2);\r
-               }\r
-               \r
-               public override object Result (DataRow Row) \r
-               {\r
-                       return CalculateResult (Row);\r
-               }\r
-               \r
-               // This method is shouldnt never invoked\r
-               public override bool Test (DataRow Row)\r
-               {\r
-                       throw new EvaluateException ();\r
-               }\r
-\r
-               protected  override object Calculate (object value1, object value2, Type TempType) \r
-               {\r
-                       object Result = null;                   \r
-\r
-                       if (TempType == typeof (long))\r
-                               Result = (long)value1 % (long)value2;\r
-                               // FIXME: \r
-                               //else if (TempType == typeof (int))\r
-                               //      Result = (string)value1 % (string)value2;\r
-                       else if (TempType == typeof (int))\r
-                               Result = (int)value1 % (int)value2;\r
-                       else if (TempType == typeof (short))\r
-                               Result = (short)value1 % (short)value2;\r
-                       else if (TempType == typeof (ulong))\r
-                               Result = (ulong)value1 % (ulong)value2;\r
-                       else if (TempType == typeof (uint))\r
-                               Result = (uint)value1 % (uint)value2;\r
-                       else if (TempType == typeof (ushort))\r
-                               Result = (ushort)value1 % (ushort)value2;\r
-                       else if (TempType == typeof (byte))\r
-                               Result = (byte)value1 % (byte)value2;\r
-                       else if (TempType == typeof (sbyte))\r
-                               Result = (sbyte)value1 % (sbyte)value2;\r
-                               // FIXME:\r
-                               //else if (TempType == typeof (bool))\r
-                               //      Result = (bool)value1 // (bool)value2;\r
-                       else if (TempType == typeof (float))\r
-                               Result = (float)value1 % (float)value2;\r
-                       else if (TempType == typeof (double))\r
-                               Result = (double)value1 % (double)value2;\r
-                       else if (TempType == typeof (decimal))\r
-                               Result = (decimal)value1 % (decimal)value2;\r
-                       // FIXME:\r
-                       //else if (TempType == typeof (DateTime))\r
-                       //      Result = (DateTime)value1 / (DateTime)value2;\r
-                       \r
-                       return Result;\r
-               }\r
-       }\r
-\r
-       //\r
-       // _____A_G_G_R_E_G_A_T_E_S_____\r
-       //\r
-\r
-       internal class ExpressionAggregate : ExpressionElement\r
-       {\r
-               \r
-               public ExpressionAggregate()\r
-               {\r
-               }\r
-\r
-               public ExpressionAggregate(string s)\r
-               {\r
-                       s = ExpressionElement.ValidateExpression (s);\r
-                       ParseExpression (s);\r
-               }\r
-\r
-               \r
-               public override bool Test (DataRow Row)\r
-               {\r
-                       throw new EvaluateException ();\r
-               }\r
-\r
-               public override object Result(DataRow Row)\r
-               {\r
-                       DataRow[] rows = new DataRow[Row.Table.Rows.Count];\r
-                       Row.Table.Rows.CopyTo(rows, 0);\r
-                       return ((ExpressionAggregate)Elements[0]).Result(rows);\r
-               }\r
-\r
-               public virtual object Result(DataRow[] rows)\r
-               {\r
-                       return ((ExpressionAggregate)Elements[0]).Result(rows);\r
-               }\r
-\r
-\r
-               protected virtual void ParseParameters (string s)\r
-               {\r
-                       string stemp = s.ToLower ();\r
-                       bool inString = false;\r
-                       string p1 = null;\r
-\r
-                       // find (\r
-                       while (!s.StartsWith ("("))\r
-                               s = s.Remove (0, 1);\r
-                       \r
-                       // remove (\r
-                       s = s.Remove (0, 1);\r
-\r
-                       int parentheses = 0;\r
-                       for (int i = 0; i < s.Length; i++) \r
-                       {\r
-\r
-                               if (s [i] == '\'')\r
-                                       inString = !inString;\r
-                               else if (s [i] == '(')\r
-                                       parentheses++;\r
-                               else if (s [i] == ')')\r
-                                       parentheses--;\r
-\r
-                               if ((s [i] == ',' ||  s [i] == ')') && !inString && parentheses == -1) \r
-                               { // Parameter changed\r
-\r
-                                       if (p1 == null) \r
-                                       {\r
-                                               p1 = s.Substring (0, i);\r
-                                               break;\r
-                                       }\r
-                               }\r
-                       }\r
-\r
-                       if (p1 == null)\r
-                               throw new Exception ();\r
-\r
-                       ParseExpression (p1);           \r
-               }\r
-               \r
-       }\r
-\r
-       /// <summary>\r
-       ///  Class for Sum (column_Name)\r
-       /// </summary\r
-       internal class ExpressionSum : ExpressionAggregate\r
-       {\r
-               public ExpressionSum (string exp1)\r
-               {\r
-                       ParseParameters (exp1);\r
-               }\r
-\r
-               public override object Result(DataRow[] rows)\r
-               {\r
-                       ExpressionElement E1 = (ExpressionElement)Elements [0];\r
-                       object value1 = E1.Result (rows[0]);\r
-                       Type t1 = value1.GetType ();\r
-                       object result = 0;\r
-                       \r
-                       // This could be optimized. If E1 is single element (Not child or parent) the\r
-                       // result of Sum() aggregate is allways same\r
-\r
-                       if (E1 is ExpressionSingleElement) \r
-                       {\r
-                               \r
-                               // This should be optimized somehow\r
-                               for (int i = 0; i < rows.Length; i++) \r
-                               {\r
-\r
-                                       // TODO: other types and exceptions\r
-                                       object v = E1.Result (rows[i]);\r
-                                       t1 = v.GetType ();\r
-\r
-                                       if (v == null || v == DBNull.Value)\r
-                                               continue;\r
-\r
-                                       if (t1 == typeof (long)) \r
-                                       {\r
-                                               result = (long)result + (long)v;\r
-                                       }\r
-                                       else if (t1 == typeof (int)) \r
-                                       {\r
-                                               result = (int)result + (int)v;\r
-                                       }\r
-                                       else if (t1 == typeof (short)) \r
-                                       {\r
-                                               result = (short)result + (short)v;\r
-                                       }\r
-                                       else if (t1 == typeof (double)) \r
-                                       {\r
-                                               result = (double)result + (double)v;\r
-                                       }\r
-                                       else if (t1 == typeof (float)) \r
-                                       {\r
-                                               result = (float)result + (float)v;\r
-                                       }\r
-                                       else\r
-                                               throw new NotImplementedException ();\r
-                               }\r
-                       }\r
-                       \r
-                       return result;\r
-               }\r
-\r
-               \r
-               //\r
-               // Copy: This method is copy-paste in every Aggregate class.\r
-               //\r
-       }\r
-\r
-       /// <summary>\r
-       ///  Class for Avg (column_Name)\r
-       /// </summary\r
-       internal class ExpressionAvg : ExpressionAggregate\r
-       {\r
-               public ExpressionAvg (string exp1)\r
-               {\r
-                       ParseParameters (exp1);\r
-               }\r
-\r
-               public override object Result(DataRow[] rows)\r
-               {\r
-                       ExpressionElement E1 = (ExpressionElement)Elements [0];\r
-                       object value1 = E1.Result (rows[0]);\r
-                       Type original = value1.GetType ();\r
-                       object result = null;\r
-                       \r
-                       if (E1 is ExpressionSingleElement) \r
-                       {\r
-                               \r
-                               Type t1 = null;\r
-                               // This should be optimized somehow\r
-                               for (int i = 0; i < rows.Length; i++) \r
-                               {\r
-                                      \r
-                                       // TODO: other types and exceptions\r
-                                       object v = E1.Result (rows[i]);\r
-\r
-                                       if (v == null || v == DBNull.Value)\r
-                                               continue;\r
-\r
-                                       t1 = v.GetType ();\r
-\r
-                                       if (result == null)\r
-                                               result = 0;\r
-                                       \r
-                                       if (t1 == typeof (long)) \r
-                                       {\r
-                                               result = (long)result + (long)v;\r
-                                       }\r
-                                       else if (t1 == typeof (int)) \r
-                                       {\r
-                                               result = (int)result + (int)v;\r
-                                       }\r
-                                       else if (t1 == typeof (short)) \r
-                                       {\r
-                                               result = (short)result + (short)v;\r
-                                       }\r
-                                       else if (t1 == typeof (double)) \r
-                                       {\r
-                                               result = (double)result + (double)v;\r
-                                       }\r
-                                       else if (t1 == typeof (float)) \r
-                                       {\r
-                                               result = (float)result + (float)v;\r
-                                       }\r
-                                       else\r
-                                               throw new NotImplementedException ();\r
-                               }\r
-\r
-                               // TODO: types\r
-\r
-                               if (t1 == typeof (long))\r
-                                       result = (long)result / rows.Length;\r
-                               else if (t1 == typeof (int))\r
-                                       result = (int)result / rows.Length;\r
-                               else if (t1 == typeof (short))\r
-                                       result = (short)result / rows.Length;\r
-                               else if (t1 == typeof (double))\r
-                                       result = (double)result / rows.Length;\r
-                       }\r
-                       \r
-                       return result;\r
-               }\r
-\r
-               /// <summary>\r
-               ///  This is used from ExpressionStdDev for evaluating avg.\r
-               /// </summary>\r
-               public ExpressionAvg (ExpressionElement E)\r
-               {\r
-                       Elements.Add (E);\r
-               }\r
-       \r
-       }\r
-\r
-       /// <summary>\r
-       ///  Class for Min (column_Name)\r
-       /// </summary\r
-       internal class ExpressionMin : ExpressionAggregate\r
-       {\r
-               public ExpressionMin (string exp1)\r
-               {\r
-                       ParseParameters (exp1);\r
-               }\r
-\r
-               public override object Result(DataRow[] rows)\r
-               {\r
-                       ExpressionElement E1 = (ExpressionElement)Elements [0];\r
-                       object value1 = E1.Result (rows[0]);\r
-                       Type original = value1.GetType ();\r
-                       object result = null;\r
-                       \r
-                       if (E1 is ExpressionSingleElement) \r
-                       {\r
-                               \r
-                               Type t1 = null;\r
-                               // This should be optimized somehow\r
-                               for (int i = 0; i < rows.Length; i++)\r
-                               {\r
-                                      \r
-                                       // TODO: other types and exceptions\r
-                                       object v = E1.Result (rows[i]);\r
-\r
-                                       if (v == null || v == DBNull.Value)\r
-                                               continue;\r
-\r
-                                       t1 = v.GetType ();\r
-\r
-                                       if (result == null)\r
-                                               result = 0;\r
-\r
-                                       object CompResult = t1.InvokeMember ("CompareTo", BindingFlags.Default | \r
-                                               BindingFlags.InvokeMethod, null, \r
-                                               v, \r
-                                               new object [] {result});\r
-\r
-                                       if ((int)CompResult < 0)\r
-                                               result = v;\r
-\r
-                               }\r
-                       }\r
-                       \r
-                       return result;\r
-               }\r
-\r
-               \r
-       }\r
-\r
-       /// <summary>\r
-       ///  Class for Max (column_Name)\r
-       /// </summary\r
-       internal class ExpressionMax : ExpressionAggregate\r
-       {\r
-               public ExpressionMax (string exp1)\r
-               {\r
-                       ParseParameters (exp1);\r
-               }\r
-\r
-               public override object Result(DataRow[] rows)\r
-               {\r
-                       ExpressionElement E1 = (ExpressionElement)Elements [0];\r
-                       object value1 = E1.Result (rows[0]);\r
-                       Type original = value1.GetType ();\r
-                       object result = null;\r
-                       \r
-                       if (E1 is ExpressionSingleElement) \r
-                       {\r
-                               \r
-                               Type t1 = null;\r
-                               // This should be optimized somehow\r
-                               for (int i = 0; i < rows.Length; i++) \r
-                               {\r
-                                      \r
-                                       // TODO: other types and exceptions\r
-                                       object v = E1.Result (rows[i]);\r
-\r
-                                       if (v == null || v == DBNull.Value)\r
-                                               continue;\r
-\r
-                                       t1 = v.GetType ();\r
-\r
-                                       if (result == null)\r
-                                               result = 0;\r
-\r
-                                       object CompResult = t1.InvokeMember ("CompareTo", BindingFlags.Default | \r
-                                               BindingFlags.InvokeMethod, null, \r
-                                               v, \r
-                                               new object [] {result});\r
-\r
-                                       if ((int)CompResult > 0)\r
-                                               result = v;\r
-\r
-                               }\r
-                       }\r
-                       \r
-                       return result;\r
-               }\r
-\r
-               \r
-       }\r
-\r
-\r
-       /// <summary>\r
-       ///  Class for count (column)\r
-       /// </summary>\r
-       internal class ExpressionCount : ExpressionAggregate\r
-       {\r
-               public ExpressionCount (string exp1)\r
-               {\r
-                       ParseParameters (exp1);\r
-               }\r
-               \r
-               public override object Result(DataRow[] rows)\r
-               {\r
-                       ExpressionElement E1 = (ExpressionElement)Elements [0];\r
-                       int count = 0;\r
-\r
-                       if (E1 is ExpressionSingleElement) \r
-                               count = rows.Length;\r
-                       \r
-                       return count;\r
-               }\r
-\r
-               public override object Result (DataRow Row) \r
-               {\r
-                       ExpressionElement E1 = (ExpressionElement)Elements [0];\r
-                       int count = 0;\r
-\r
-                       if (E1 is ExpressionSingleElement) \r
-                       {\r
-                               \r
-                               count = Row.Table.Rows.Count;\r
-                       }\r
-                       \r
-                       return count;\r
-               }\r
-       }\r
-\r
-\r
-       /// <summary>\r
-       ///  Class for StdDev (column)\r
-       /// </summary>\r
-       internal class ExpressionStdev : ExpressionAggregate\r
-       {\r
-               public ExpressionStdev (string exp1)\r
-               {               \r
-                       ParseParameters (exp1);\r
-               }\r
-\r
-               public override object Result(DataRow[] rows)\r
-               {\r
-                       ExpressionElement E1 = (ExpressionElement)Elements [0];\r
-                       ExpressionAvg Avg = new ExpressionAvg (E1);\r
-\r
-                       object tempAvg = Avg.Result (rows[0]);\r
-                       double avg = 0;\r
-                       double sum = 0;\r
-                       double result = 0;\r
-\r
-                       if (tempAvg.GetType () == typeof (int))\r
-                               avg = (double)(int)tempAvg;\r
-                       \r
-                       if (E1 is ExpressionSingleElement) \r
-                       {\r
-\r
-                               for (int i = 0; i <rows.Length; i++)\r
-                               {\r
-                                       // (value - avg)²\r
-                                       object v = E1.Result (rows[i]);\r
-\r
-                                       if (v == null || v == DBNull.Value)\r
-                                               continue;\r
-\r
-                                       if (v.GetType () == typeof (long))\r
-                                               sum = avg - (long)v;\r
-                                       else if (v.GetType () == typeof (int))\r
-                                               sum = avg - (int)v;\r
-                                       else if (v.GetType () == typeof (short))\r
-                                               sum = avg - (short)v;\r
-                                       else\r
-                                               throw new NotImplementedException ();\r
-\r
-                                       result += Math.Pow (sum, 2);\r
-                               }\r
-                               \r
-                               result = result / (rows.Length - 1);\r
-                               result = Math.Sqrt (result);\r
-                       }\r
-\r
-                       return result;\r
-               }\r
-               \r
-               \r
-       }\r
-\r
-       /// <summary>\r
-       ///  Class for Var (column)\r
-       /// </summary>\r
-       internal class ExpressionVar : ExpressionAggregate\r
-       {\r
-               public ExpressionVar (string exp1)\r
-               {\r
-                       ParseParameters (exp1);\r
-               }\r
-\r
-               public override object Result(DataRow[] rows)\r
-               {\r
-                       ExpressionElement E1 = (ExpressionElement)Elements [0];\r
-                       ExpressionAvg Avg = new ExpressionAvg (E1);\r
-\r
-                       object tempAvg = Avg.Result (rows[0]);\r
-                       double avg = 0;\r
-                       double sum = 0;\r
-                       double result = 0;\r
-\r
-                       if (tempAvg.GetType () == typeof (int))\r
-                               avg = (double)(int)tempAvg;\r
-                       \r
-                       if (E1 is ExpressionSingleElement) \r
-                       {\r
-\r
-                               for (int i = 0; i < rows.Length; i++)\r
-                               {\r
-\r
-                                      \r
-                                       // (value - avg)²\r
-                                       object v = E1.Result (rows[i]);\r
-\r
-                                       if (v == null || v == DBNull.Value)\r
-                                               continue;\r
-\r
-                                       if (v.GetType () == typeof (long))\r
-                                               sum = avg - (long)v;\r
-                                       else if (v.GetType () == typeof (int))\r
-                                               sum = avg - (int)v;\r
-                                       else if (v.GetType () == typeof (short))\r
-                                               sum = avg - (short)v;\r
-                                       else\r
-                                               throw new NotImplementedException ();\r
-\r
-                                       result += Math.Pow (sum, 2);\r
-                               }\r
-                               \r
-                               result = result / (rows.Length - 1);\r
-                       }\r
-\r
-                       return result;\r
-               }\r
-               \r
-               \r
-       }\r
-\r
-       // \r
-       // _____F_U_ N_C_T_I_O_N_S_______\r
-       //\r
-\r
-       /// <summary>\r
-       ///  Class for len (string) function\r
-       /// </summary>\r
-       internal class ExpressionLen : ExpressionElement\r
-       {\r
-               public ExpressionLen (string exp1)\r
-               {                       \r
-                       _ResultType = typeof (int);\r
-                       ParseParameters (exp1);\r
-               }\r
-               \r
-               public override object Result (DataRow Row) \r
-               {\r
-                       ExpressionElement E1 = ((ExpressionElement)Elements [0]);\r
-                       object value1 = E1.Result (Row);\r
-                       \r
-                       return value1.ToString ().Length;\r
-               }\r
-               \r
-               public override bool Test (DataRow Row)\r
-               {\r
-                       throw new EvaluateException ();\r
-               }\r
-\r
-               public void ParseParameters (string s)\r
-               {\r
-                       string stemp = s.ToLower ();\r
-                       bool inString = false;\r
-                       string p1 = null;\r
-\r
-                       // find (\r
-                       while (!s.StartsWith ("("))\r
-                               s = s.Remove (0, 1);\r
-\r
-                       // remove (\r
-                       s = s.Remove (0, 1);\r
-                       int parentheses = 0;\r
-                       for (int i = 0; i < s.Length; i++) \r
-                       {\r
-\r
-                               if (s [i] == '\'')\r
-                                       inString = !inString;\r
-                               else if (s [i] == '(')\r
-                                       parentheses++;\r
-                               else if (s [i] == ')')\r
-                                       parentheses--;\r
-\r
-                               if ((s [i] == ',' ||  s [i] == ')') && !inString && parentheses == -1) \r
-                               { // Parameter changed\r
-\r
-                                       if (p1 == null) \r
-                                       {\r
-                                               p1 = s.Substring (0, i);\r
-                                               break;\r
-                                       }\r
-                               }\r
-                       }\r
-\r
-                       if (p1 == null)\r
-                               throw new Exception ();\r
-\r
-                       ParseExpression (p1);           \r
-               }\r
-       }\r
-\r
-       /// <summary>\r
-       ///  Class for iif (exp1, truepart, falsepart) function\r
-       /// </summary>\r
-       internal class ExpressionIif : ExpressionElement\r
-       {\r
-               public ExpressionIif (string exp)\r
-               {       \r
-                       ParseParameters (exp);\r
-               }\r
-\r
-               public override object Result (DataRow Row) \r
-               {\r
-                       ExpressionElement E1 = ((ExpressionElement)Elements [0]);\r
-                       ExpressionElement E2 = ((ExpressionElement)Elements [1]);\r
-                       ExpressionElement E3 = ((ExpressionElement)Elements [2]);\r
-\r
-                       if (E1.Test (Row)) // expression\r
-                               return E2.Result (Row); // truepart\r
-                       else\r
-                               return E3.Result (Row); // false part                   \r
-               }\r
-               \r
-               // This method is shouldnt never invoked\r
-               public override bool Test (DataRow Row)\r
-               {\r
-                       throw new EvaluateException ();\r
-               }\r
-\r
-               public override Type ResultType (DataRow Row)\r
-               {                                               \r
-                       ExpressionElement E1 = ((ExpressionElement)Elements [0]);\r
-                       ExpressionElement E2 = ((ExpressionElement)Elements [1]);\r
-                       ExpressionElement E3 = ((ExpressionElement)Elements [2]);\r
-                       \r
-                       if (E1.Test (Row)) // expression\r
-                               return E2.Result (Row).GetType (); // truepart\r
-                       else\r
-                               return E3.Result (Row).GetType (); // false part                        \r
-               }\r
-\r
-               /// <summary>\r
-               ///  Parses expressions in parameters (exp, truepart, falsepart)\r
-               /// </summary>\r
-               private void ParseParameters (string s)\r
-               {\r
-                       bool inString = false;\r
-                       string stemp = s.ToLower ();\r
-                       string p1 = null;\r
-                       string p2 = null;\r
-                       string p3 = null;\r
-                       s = s.Substring (stemp.IndexOf ("iif") + 3);\r
-\r
-                       // find (\r
-                       while (!s.StartsWith ("("))\r
-                               s = s.Remove (0, 1);\r
-\r
-                       // remove (\r
-                       s = s.Remove (0, 1);\r
-                       int parentheses = 0;\r
-                       for (int i = 0; i < s.Length; i++) \r
-                       {\r
-\r
-                               if (s [i] == '\'')\r
-                                       inString = !inString;\r
-                               else if (s [i] == '(')\r
-                                       parentheses++;\r
-                               else if (s [i] == ')')\r
-                                       parentheses--;\r
-\r
-                               if ((s [i] == ',' && !inString && parentheses == 0) || \r
-                                       (s [i] == ')' && i == (s.Length -1))) \r
-                               { // Parameter changed\r
-\r
-                                       if (p1 == null) \r
-                                       {\r
-                                               p1 = s.Substring (0, i);\r
-                                               s = s.Substring (i + 1);\r
-                                               i = 0;\r
-                                       }\r
-\r
-                                       else if (p2 == null) \r
-                                       {\r
-                                               p2 = s.Substring (0, i);\r
-                                               s = s.Substring (i + 1);\r
-                                               i = 0;\r
-                                       }\r
-\r
-                                       else if (p3 == null) \r
-                                       {\r
-                                               p3 = s.Substring (0, i);\r
-                                               s = s.Substring (i + 1);\r
-                                               i = 0;\r
-                                       }\r
-\r
-                                       else\r
-                                               throw new Exception (); // FIXME: What exception\r
-                               }\r
-                       }\r
-\r
-                       if (p1 == null || p2 == null || p3 == null)\r
-                               throw new Exception ();\r
-\r
-                       ParseExpression (p1);\r
-                       ParseExpression (p2);\r
-                       ParseExpression (p3);\r
-               }\r
-       }\r
-\r
-       /// <summary>\r
-       ///  Class for isnull (expression, returnvalue) function\r
-       /// </summary>\r
-       internal class ExpressionIsNull : ExpressionElement\r
-       {\r
-               public ExpressionIsNull (string exp)\r
-               {                       \r
-                       ParseParameters (exp);\r
-               }\r
-               \r
-               public override object Result (DataRow Row) \r
-               {\r
-                       ExpressionElement E1 = (ExpressionElement)Elements [0];\r
-                       ExpressionElement E2 = (ExpressionElement)Elements [1];\r
-                       \r
-                       object R1 = E1.Result (Row);\r
-                       object value1 = null;\r
-                       if (R1 == null || R1 == DBNull.Value)\r
-                               return E2.Result (Row);\r
-                       else\r
-                               return R1;\r
-               }\r
-\r
-               public override Type ResultType (DataRow Row)\r
-               {\r
-                       ExpressionElement E1 = (ExpressionElement)Elements [0];\r
-                       ExpressionElement E2 = (ExpressionElement)Elements [1];\r
-                       \r
-                       object R1 = E1.Result (Row);\r
-                       object value1 = null;\r
-                       if (R1 == null || R1 == DBNull.Value)\r
-                               return E2.Result (Row).GetType ();\r
-                       else\r
-                               return R1.GetType ();\r
-               }\r
-               \r
-               /// <summary>\r
-               ///  IsNull function does not return boolean value, so throw exception\r
-               /// </summary>\r
-               public override bool Test (DataRow Row)\r
-               {\r
-                       throw new EvaluateException ();\r
-               }\r
-\r
-               /// <summary>\r
-               ///  Parses parameters of function and invoke ParseExpression methods\r
-               /// </summary>\r
-               private void ParseParameters (string s)\r
-               {\r
-                       bool inString = false;\r
-                       string stemp = s.ToLower ();\r
-                       string p1 = null;\r
-                       string p2 = null;\r
-\r
-                       s = s.Substring (stemp.IndexOf ("isnull") + 6);\r
-\r
-                       // find (\r
-                       while (!s.StartsWith ("("))\r
-                               s = s.Remove (0, 1);\r
-\r
-                       // remove (\r
-                       s = s.Remove (0, 1);\r
-                       int parentheses = 0;\r
-                       for (int i = 0; i < s.Length; i++) \r
-                       {\r
-\r
-                               if (s [i] == '\'')\r
-                                       inString = !inString;\r
-                               else if (s [i] == '(')\r
-                                       parentheses++;\r
-                               else if (s [i] == ')')\r
-                                       parentheses--;\r
-\r
-                               if ((s [i] == ',' && !inString && parentheses == 0) || \r
-                                       (s [i] == ')' && i == (s.Length -1))) \r
-                               { // Parameter changed\r
-\r
-                                       if (p1 == null) \r
-                                       {\r
-                                               p1 = s.Substring (0, i);\r
-                                               s = s.Substring (i + 1);\r
-                                               i = 0;\r
-                                       }\r
-\r
-                                       else if (p2 == null) \r
-                                       {\r
-                                               p2 = s.Substring (0, i);\r
-                                               s = s.Substring (i + 1);\r
-                                               i = 0;\r
-                                       }\r
-\r
-                                       else\r
-                                               throw new Exception (); // FIXME: What exception\r
-                               }\r
-                       }\r
-\r
-                       if (p1 == null || p2 == null)\r
-                               throw new Exception ();\r
-\r
-                       ParseExpression (p1);\r
-                       ParseExpression (p2);\r
-               }\r
-       }\r
-\r
-       /// <summary>\r
-       ///  Class for Substring (expression, start, length) function\r
-       /// </summary>\r
-       internal class ExpressionSubstring : ExpressionElement\r
-       {\r
-               public ExpressionSubstring (string exp)\r
-               {                       \r
-                       ParseParameters (exp);\r
-                       _ResultType = typeof (string);\r
-               }\r
-               \r
-               public override object Result (DataRow Row) \r
-               {\r
-                       ExpressionElement E1 = (ExpressionElement)Elements [0];\r
-                       ExpressionElement E2 = (ExpressionElement)Elements [1];\r
-                       ExpressionElement E3 = (ExpressionElement)Elements [2];\r
-                       \r
-                       object value1 = E1.Result (Row);\r
-                       object value2 = E2.Result (Row);\r
-                       object value3 = E3.Result (Row);\r
-                       Type t1 = value1.GetType ();\r
-                       Type t2 = value2.GetType ();\r
-                       Type t3 = value3.GetType ();\r
-\r
-                       if (value1 == null || value2 == null || value3 == null \r
-                               || value1 == DBNull.Value || value2 == DBNull.Value || value3 == DBNull.Value)\r
-                               return string.Empty;\r
-\r
-                       if (t1 != typeof (string))\r
-                               throw new Exception (); // FIXME: what exception\r
-                       else if (t2 != typeof (int))\r
-                               throw new EvaluateException ("Type mismatch is function argument: Substring (), argument 2, excepted System.Int32");\r
-                       else if (t3 != typeof (int))\r
-                               throw new EvaluateException ("Type mismatch is function argument: Substring (), argument 3, excepted System.Int32");\r
-\r
-                       string str = value1.ToString ();\r
-                       int start = (int)value2;\r
-                       int length = (int)value3;\r
-\r
-                       if (str.Length < start)\r
-                               str =  string.Empty;\r
-                       else \r
-                       {\r
-                               if ((start + length - 1) > str.Length)\r
-                                       str = str.Substring (start - 1);\r
-                               else\r
-                                       str = str.Substring (start - 1, length);\r
-                       }\r
-\r
-                       return str;\r
-               }\r
-\r
-               /// <summary>\r
-               ///  IsNull function does not return boolean value, so throw exception\r
-               /// </summary>\r
-               public override bool Test (DataRow Row)\r
-               {\r
-                       throw new EvaluateException ();\r
-               }\r
-\r
-               /// <summary>\r
-               ///  Parses parameters of function and invoke ParseExpression methods\r
-               /// </summary>\r
-               private void ParseParameters (string s)\r
-               {\r
-                       bool inString = false;\r
-                       string stemp = s.ToLower ();\r
-                       string p1 = null;\r
-                       string p2 = null;\r
-                       string p3 = null;\r
-\r
-                       s = s.Substring (stemp.IndexOf ("substring") + 9);\r
-\r
-                       // find (\r
-                       while (!s.StartsWith ("("))\r
-                               s = s.Remove (0, 1);\r
-\r
-                       // remove (\r
-                       s = s.Remove (0, 1);\r
-                       int parentheses = 0;\r
-                       for (int i = 0; i < s.Length; i++) \r
-                       {\r
-\r
-                               if (s [i] == '\'')\r
-                                       inString = !inString;\r
-                               else if (s [i] == '(')\r
-                                       parentheses++;\r
-                               else if (s [i] == ')')\r
-                                       parentheses--;\r
-\r
-\r
-                               if ((s [i] == ',' && !inString && parentheses == 0) || \r
-                                       (s [i] == ')' && i == (s.Length -1))) \r
-                               { // Parameter changed\r
-\r
-                                       if (p1 == null) \r
-                                       {\r
-                                               p1 = s.Substring (0, i);\r
-                                               s = s.Substring (i + 1);\r
-                                               i = 0;\r
-                                       }\r
-\r
-                                       else if (p2 == null) \r
-                                       {\r
-                                               p2 = s.Substring (0, i);\r
-                                               s = s.Substring (i + 1);\r
-                                               i = 0;\r
-                                       }\r
-\r
-                                       else if (p3 == null) \r
-                                       {\r
-                                               p3 = s.Substring (0, i);\r
-                                               s = s.Substring (i + 1);\r
-                                               i = 0;\r
-                                       }\r
-\r
-                                       else\r
-                                               throw new Exception (); // FIXME: What exception\r
-                               }\r
-                       }\r
-\r
-                       if (p1 == null || p2 == null)\r
-                               throw new Exception ();\r
-\r
-                       ParseExpression (p1);\r
-                       ParseExpression (p2);\r
-                       ParseExpression (p3);                   \r
-               }\r
-       }\r
-\r
-       /// <summary>\r
-       ///  Class for In (exp, exp, exp, ...) function\r
-       /// </summary>\r
-       internal class ExpressionIn : ExpressionElement\r
-       {\r
-               public ExpressionIn (string exp1, string exp2)\r
-               {       \r
-                       ParseExpression(exp1);\r
-                       ParseParameters (exp2);\r
-               }\r
-\r
-               /// <summary>\r
-               ///  IsNull function does not return boolean value, so throw exception\r
-               /// </summary>\r
-               public override bool Test (DataRow Row) \r
-               {\r
-                       ExpressionElement E;\r
-                       ExpressionElement columnElement = (ExpressionElement)Elements [0];\r
-\r
-                       ExpressionElementComparer comparer = new ExpressionElementComparer(columnElement, Row);\r
-\r
-                       for (int i = 1; i < Elements.Count; i++)\r
-                       {\r
-                               E = (ExpressionElement)Elements [i];\r
-                               if(comparer.CompareTo(E) == 0)\r
-                                       return true;\r
-                       }\r
-                       return false;\r
-               }\r
-\r
-               /// <summary>\r
-               ///  Parses parameters of function and invoke ParseExpression methods\r
-               /// </summary>\r
-               private void ParseParameters (string s)\r
-               {\r
-                       bool inString = false;\r
-                       ArrayList parameters = new ArrayList();\r
-                       \r
-                       // find (\r
-                       while (!s.StartsWith ("("))\r
-                               s = s.Remove (0, 1);\r
-\r
-                       // remove (\r
-                       s = s.Remove (0, 1);\r
-                       int parentheses = 0;\r
-                       for (int i = 0; i < s.Length; i++) \r
-                       {\r
-\r
-                               if (s [i] == '\'')\r
-                                       inString = !inString;\r
-                               else if (s [i] == '(')\r
-                                       parentheses++;\r
-                               else if (s [i] == ')')\r
-                                       parentheses--;\r
-\r
-\r
-                               if ((s [i] == ',' && !inString && parentheses == 0) || \r
-                                       (s [i] == ')' && i == (s.Length -1))) \r
-                               {\r
-                                       parameters.Add(s.Substring (0, i));\r
-                                       s = s.Substring (i + 1);\r
-                                       i = 0;\r
-                               }\r
-                       }\r
-                       \r
-                       for (int i = 0; i < parameters.Count; i++)\r
-                               ParseExpression((string)parameters[i]);\r
-               }\r
-       }\r
-\r
-       /// <summary>\r
-       ///  Class for just one element for example string, int, ...\r
-       /// </summary>\r
-       internal class ExpressionSingleElement : ExpressionElement\r
-       {               \r
-               private object Element = null;\r
-               \r
-               public ExpressionSingleElement (string s)\r
-               {\r
-                       // TODO: Every type should be checked\r
-                       if (s.StartsWith ("'") && s.EndsWith ("'")) \r
-                       {\r
-                               Element = s.Substring (1, s.Length - 2);\r
-                               _ResultType = typeof (string);\r
-                       }\r
-                       else if (!Char.IsDigit (s [0]) && s [0] != '-' && s [0] != '+') \r
-                       {\r
-                               Element = s;\r
-                               _ResultType = typeof (DataColumn);\r
-                       }\r
-                       else if (s.StartsWith ("#") && s.EndsWith ("#")) \r
-                       {\r
-                               Element = DateTime.Parse (s.Substring (1, s.Length - 2));\r
-                               _ResultType = typeof (DateTime);\r
-                       }\r
-                       else \r
-                       {\r
-                               try \r
-                               {\r
-                                       Element = int.Parse (s);\r
-                                       _ResultType = typeof (int);\r
-                               } \r
-                               catch \r
-                               {\r
-                                       Element = Decimal.Parse (s);\r
-                                       _ResultType = typeof (Decimal);\r
-                               }\r
-                       }                               \r
-               }\r
-\r
-               public override object Result (DataRow Row)\r
-               {\r
-                       object Result = null;\r
-                       if (ResultType (Row) == typeof (DataColumn)) \r
-                       {\r
-                               \r
-                               if (!Row.Table.Columns.Contains (Element.ToString ()))\r
-                                       throw new EvaluateException ("Column name '" + Element.ToString () + "' not found.");\r
-                               else\r
-                               {\r
-                                       DataRowVersion rowVersion = DataRowVersion.Default;\r
-                                       // if this row is deleted we get the original version, or else we get an exception.\r
-                                       if (Row.RowState == DataRowState.Deleted)\r
-                                               rowVersion = DataRowVersion.Original;\r
-                                       Result = Row [Element.ToString (), rowVersion];\r
-                               }\r
-                       }\r
-                       else\r
-                               Result = Element;\r
-                               \r
-                       return Result;\r
-               }\r
-               \r
-               public override bool Test (DataRow Row)\r
-               {\r
-                       throw new EvaluateException ();\r
-               }               \r
-       }\r
-\r
-       /// <summary>\r
-       ///  Parent class of all the elements of expression\r
-       /// </summary>\r
-       internal abstract class ExpressionElement\r
-       {        \r
-               enum OP {OPERATOR, OPERAND};\r
-               enum OPERATOR_TYPE {SYMBOLIC, LITERAL, UNDEFINED};\r
-               enum OPERAND_TYPE {NUMERIC, STRING, UNDEFINED};\r
-\r
-               // \r
-               // TODO/FIXME: This class should be inherited more than once. I mean own subclass for operators, functions,...\r
-               //\r
-\r
-               protected string exp1;\r
-               protected string exp2;\r
-               protected  Type _ResultType;\r
-\r
-               protected ArrayList Elements = new ArrayList ();\r
-\r
-               enum AGGREGATE {SUM, AVG, MIN, MAX, COUNT, STDEV, VAR}\r
-               //protected ArrayList Singles = new ArrayList ();\r
-               \r
-               /// <summary>\r
-               /// Tells does the current expressions match to current DataRow\r
-               /// </summary>\r
-               abstract public bool Test (DataRow Row);\r
-\r
-               public virtual object Result (DataRow Row) {return null;}\r
-                \r
-               public virtual Type ResultType (DataRow Row)\r
-               {\r
-                       return _ResultType;\r
-               }\r
-\r
-               protected object CalculateResult (DataRow Row)\r
-               {\r
-                       ExpressionElement E1 = ((ExpressionElement)Elements [0]);\r
-                       ExpressionElement E2 = ((ExpressionElement)Elements [1]);\r
-                       object Result = null;\r
-                       object value1 = E1.Result (Row);\r
-                       object value2 = E2.Result (Row);\r
-                       Type t1 = value1.GetType ();\r
-                       Type t2 = value2.GetType ();\r
-                       \r
-                       // Check nulls\r
-                       if (value1 ==  DBNull.Value && value2 == DBNull.Value)\r
-                               return null;\r
-                       \r
-                       // TODO: More types\r
-                       \r
-                       if (t1 == typeof (string) || t2 == typeof (string)) \r
-                       {\r
-                               \r
-                               if (t1 != typeof (string))\r
-                                       value1 = Convert.ChangeType (value1, Type.GetTypeCode (t2));\r
-                               else if (t2 != typeof (string))\r
-                                       value2 = Convert.ChangeType (value2, Type.GetTypeCode (t1));\r
-                       }\r
-                       \r
-                       if (t1 != t2)\r
-                               value2 = Convert.ChangeType (value2, Type.GetTypeCode (t1));\r
-                       \r
-                       Result = Calculate (value1, value2, t1);\r
-                       \r
-                       return Result; \r
-               }\r
-               protected virtual object Calculate (object value1, object value2, Type TempType)\r
-               {\r
-                       return null;\r
-               }\r
-               \r
-               /// <summary>\r
-               ///  static method for comparing two ExpressionElement. This is used in =, <, >, <>, <=, >= elements.\r
-               ///  If elements are equal returns 0, if E1 is less that E2, return -1 else if E1 is greater 1 \r
-               /// </summary>\r
-               protected static int Compare (ExpressionElement E1, ExpressionElement E2, DataRow Row)\r
-               { \r
-                       ExpressionElementComparer comparer = new ExpressionElementComparer(E1, Row);\r
-\r
-                       return comparer.CompareTo(E2);\r
-               }\r
-\r
-               /// <summary>\r
-               ///  Checks syntax of expression and throws exception if needed.\r
-               ///  Also removes whitespaces between operator elements for example: age < = 64 --> age <= 64\r
-               /// </summary>\r
-               internal static string ValidateExpression (string s)\r
-               {                       \r
-                       //\r
-                       // TODO: find out nice way to do this. This is NOT nice way :-P\r
-                       //\r
-                       //string temp = "";\r
-                       OP op = OP.OPERAND;\r
-                       OPERATOR_TYPE operatorType = OPERATOR_TYPE.UNDEFINED;\r
-\r
-                       StringBuilder strOperator = new StringBuilder();\r
-                       StringBuilder strOperand = new StringBuilder();\r
-                       int quotes = 0;\r
-                       int parentheses = 0;\r
-                       StringBuilder newExp = new StringBuilder();\r
-                       bool isDigit = false;\r
-                       //bool litOperator = false;\r
-                       s = s.Trim();\r
-                       \r
-                       for (int i = 0; i < s.Length; i++) \r
-                       {\r
-\r
-                               char c = s [i];\r
-                               \r
-                               if (c == '\'')\r
-                                       quotes++;\r
-\r
-                               if ((c == '\n' || c == '\t') && quotes == 0)\r
-                                       c = ' ';\r
-\r
-                               if (op == OP.OPERAND && c == '(')\r
-                                       parentheses++;\r
-                               else if (op == OP.OPERAND && c == ')')\r
-                                       parentheses--;\r
-\r
-                               if (c == ' ' && op ==  OP.OPERAND && (quotes % 2) == 0 && parentheses == 0) \r
-                               {\r
-                                       \r
-                                       op = OP.OPERATOR;\r
-                                       int max = strOperand.Length;\r
-                                       for (int it = 0; it < max; it++)\r
-                                               newExp.Append(strOperand[it]);\r
-                                       strOperand.Remove(0, max);\r
-                                       strOperator.Append(' ');\r
-                               }\r
-\r
-                               if (op == OP.OPERAND) \r
-                               {\r
-\r
-                                       if (!Char.IsDigit (c) && isDigit && (quotes % 2) == 0) \r
-                                       {\r
-                                               int max = strOperand.Length;\r
-                                               for (int it = 0; it < max; it++)\r
-                                                       newExp.Append(strOperand[it]);\r
-                                               strOperand.Remove(0, max);\r
-                                               op = OP.OPERATOR;\r
-                                               operatorType = OPERATOR_TYPE.UNDEFINED;\r
-                                       }\r
-                                       else\r
-                                               strOperand.Append(c);\r
-                               }\r
-\r
-                               if (op == OP.OPERATOR) \r
-                               {\r
-\r
-                                       isDigit = false;\r
-                                       if (operatorType == OPERATOR_TYPE.UNDEFINED) \r
-                                       {\r
-\r
-                                               if (c == '<' || c == '=' || c == '>' || c == '*' || c == '/' || c == '%' \r
-                                                       || c == '-' || c == '+')\r
-\r
-                                                       operatorType = OPERATOR_TYPE.SYMBOLIC;\r
-                                               else if (c != ' ')\r
-                                                       operatorType = OPERATOR_TYPE.LITERAL;\r
-                                       }\r
-                                       else if (operatorType == OPERATOR_TYPE.SYMBOLIC) \r
-                                       {\r
-                                               \r
-                                               //Checking for operators following one another\r
-                                               if ((c == '=' || c== '<' || c== '>') &&\r
-                                                       (strOperator.Length == 2) &&\r
-                                                       (strOperator[0] == ' '))\r
-                                               {\r
-                                                       char chSecond = strOperator[1];\r
-                                                       if (chSecond == '+' ||\r
-                                                               chSecond == '-' ||\r
-                                                               chSecond == '%' ||\r
-                                                               chSecond == '*')\r
-                                                       throw new SyntaxErrorException (\r
-                                                               "The operator " + strOperator.ToString() + c + " is not valid");\r
-                                               }\r
-\r
-                                               // this is COPY-PASTE\r
-                                               op = OP.OPERAND;\r
-                                               if (newExp[newExp.Length - 1] != ' '  && \r
-                                                       strOperator[0] != ' ')\r
-                                                       newExp.Append(' ');\r
-\r
-                                               int max = strOperator.Length;\r
-                                               for (int it = 0; it < max; it++)\r
-                                                       newExp.Append(strOperator[it]);\r
-                                               strOperator.Remove(0, max);\r
-\r
-                                               if (Char.IsDigit (c))\r
-                                                       isDigit = true;\r
-                                                       \r
-                                               strOperand.Remove(0, strOperand.Length);\r
-                                               strOperand.Append(c);\r
-                                               \r
-                                               continue;\r
-\r
-                                       }\r
-\r
-                                       if (operatorType == OPERATOR_TYPE.LITERAL && c == ' ') \r
-                                       {\r
-                                               op = OP.OPERAND;\r
-                                               int max = strOperator.Length;\r
-                                               for (int it = 0; it < max; it++)\r
-                                                       newExp.Append(strOperator[it]);\r
-                                               strOperator.Remove(0, max);\r
-\r
-                                               strOperand.Append(' ');\r
-                                       }\r
-\r
-\r
-                                       if (Char.IsDigit (c) && operatorType != OPERATOR_TYPE.LITERAL) \r
-                                       {\r
-\r
-                                               op = OP.OPERAND;\r
-                                               if (newExp[newExp.Length - 1] != ' '  && \r
-                                                       strOperator[0] != ' ')\r
-                                                       newExp.Append(' ');\r
-\r
-                                               int max = strOperator.Length;\r
-                                               for (int it = 0; it < max; it++)\r
-                                                       newExp.Append(strOperator[it]);\r
-                                               strOperator.Remove(0, max);\r
-\r
-                                               if (Char.IsDigit (c))\r
-                                                       isDigit = true;\r
-                                                       \r
-                                               strOperand.Remove(0, strOperand.Length);\r
-                                               strOperand.Append(c);\r
-                                       }\r
-\r
-                                       else if (c != ' ')\r
-                                               strOperator.Append(c);                                  \r
-                               }\r
-                       }\r
-\r
-                       if (op == OP.OPERATOR)\r
-                               throw new SyntaxErrorException (\r
-                                       "Missing operand after '" + strOperator.ToString() + "' operator");\r
-                       else\r
-                       {\r
-                               int max = strOperand.Length;\r
-                               for (int it = 0; it < max; it++)\r
-                                       newExp.Append(strOperand[it]);\r
-                       }\r
-\r
-                       return newExp.ToString();\r
-               }\r
-\r
-               /// <summary>\r
-               ///  Finds and creates Expression elements.\r
-               ///  This presumes that expression is valid.\r
-               /// </summary>\r
-               protected void ParseExpression (string s)\r
-               {       \r
-                       //\r
-                       // TODO/FIXME: IMHO, this should be done with different kind of parsing:\r
-                       // char by char not operand by operand. \r
-                       // fixed the easy places, should consider better parsing\r
-                       //\r
-\r
-                       string inside = String.Empty; // stores string betwee parentheses like a = 12 and (b = 1 or b = 2)\r
-                       string lower = s.ToLower();\r
-                       //string function = ""; // stores fuction paramters like substring (this, are, paramters)\r
-                       //string s1 = "";\r
-                       //string s2 = "";\r
-                       int startIndex = lower.IndexOf ('(');\r
-                       \r
-                       // Find parenthesis\r
-                       if (startIndex != -1) \r
-                       {\r
-                               string functionName = String.Empty;\r
-                               if (startIndex > 0)\r
-                               {\r
-                                       int functionStart = lower.LastIndexOf('=', startIndex-1, startIndex);\r
-                                       if (functionStart < 0)\r
-                                               functionStart++;\r
-                                       functionName = lower.Substring(functionStart, startIndex);\r
-\r
-                                       functionName = functionName.Trim ();\r
-                               }\r
-\r
-                               // check if previous element is a function\r
-                               if (functionName.Length == 0 || (!functionName.EndsWith ("convert") && !functionName.EndsWith ("len") &&\r
-                                       !functionName.EndsWith ("isnull") && !functionName.EndsWith ("iif") &&\r
-                                       !functionName.EndsWith ("trim") && !functionName.EndsWith ("substring") &&\r
-                                       !functionName.EndsWith ("sum") && !functionName.EndsWith ("avg") &&\r
-                                       !functionName.EndsWith ("min") && !functionName.EndsWith ("max") &&\r
-                                       !functionName.EndsWith ("count") && !functionName.EndsWith ("stdev") &&\r
-                                       !functionName.EndsWith ("var")&& !functionName.EndsWith ("in"))) \r
-                               {\r
-                                       \r
-                                       \r
-                                       int i = startIndex + 1;\r
-                                       int max = lower.Length;\r
-                       \r
-                                       for (int par = 1; par > 0 && i < max; i++) \r
-                                       {\r
-\r
-                                               char c = s [i];\r
-                                               if (c == '(')\r
-                                                       par++;\r
-                                               else\r
-                                               if (c == ')')\r
-                                                       par--;\r
-                                       }\r
-                                       \r
-                                       inside = s.Substring(startIndex + 1, i - startIndex - 2); \r
-                                       lower = lower.Remove (startIndex, i - startIndex);\r
-                                       s = s.Remove (startIndex, i - startIndex);\r
-                               }               \r
-                                            \r
-                       }\r
-                       \r
-                       string string1 = null;\r
-                       string string2 = null;\r
-                       if (FindOrElement (s, lower, ref string1, ref string2))         \r
-                               CreateOrElement (string1, string2, inside);\r
-\r
-                       else if (FindAndElement (s, lower, ref string1, ref string2))\r
-                               CreateAndElement (string1, string2, inside);\r
-\r
-                               // find LIKE\r
-                       else if (FindLikeElement (s, lower, ref string1, ref string2))\r
-                               CreateLikeElement (string1, string2, inside);\r
-                       \r
-                               // find IN\r
-                       else if (FindInElement (s, lower, ref string1, ref string2))\r
-                               CreateInElement (string1, string2, inside);\r
-\r
-                               // find =\r
-                       else if (FindEqualElement (s, lower, ref string1, ref string2))\r
-                               CreateEqualsElement (string1, string2, inside);\r
-\r
-                               // find <>\r
-                       else if (FindUnequalElement (s, lower, ref string1, ref string2))\r
-                               CreateUnequalsElement (string1, string2, inside);\r
-\r
-                               // find <=\r
-                       else if (FindLessThanOrEqualElement (s, lower, ref string1, ref string2))\r
-                               CreateLessThanOrEqualElement (string1, string2, inside);\r
-\r
-                               // find <\r
-                       else if (FindLessThanElement (s, lower, ref string1, ref string2))\r
-                               CreateLessThanElement (string1, string2, inside);\r
-\r
-                               // find >=\r
-                       else if (FindGreaterThanOrEqualElement (s, lower, ref string1, ref string2))\r
-                               CreateGreaterThanOrEqualElement (string1, string2, inside);\r
-\r
-                               // find >\r
-                       else if (FindGreaterThanElement (s, lower, ref string1, ref string2))\r
-                               CreateGreaterThanElement (string1, string2,  inside);\r
-\r
-                               // if there wasn't any operators like 'and' or 'not' there still could be\r
-                               // arithmetic operators like '+' or '-' or functions like 'iif' or 'substring'\r
-\r
-                               // find *\r
-                       else if (FindMultiplyElement (s, lower, ref string1, ref string2))\r
-                               CreateMultiplyElement (string1, string2, inside);\r
-                       \r
-                               // find /\r
-                       else if (FindDivideElement (s, lower, ref string1, ref string2))\r
-                               CreateDivideElement (string1, string2, inside);\r
-\r
-\r
-                               // find +\r
-                       else if (FindAdditionElement (s, lower, ref string1, ref string2))\r
-                               CreateAdditionElement (string1, string2, inside);\r
-\r
-                               // find -\r
-                       else if (FindSubtractElement (s, lower, ref string1, ref string2))\r
-                               CreateSubtractionElement (string1, string2, inside);\r
-\r
-                               // find %\r
-                       else if (FindModulusElement (s, lower, ref string1, ref string2))\r
-                               CreateModulusElement (string1, string2, inside);\r
-\r
-                               // find sum ()\r
-                       else if (FindAggregateElement (s, lower, AGGREGATE.SUM))\r
-                               Elements.Add (new ExpressionSum (s.Trim ()));\r
-\r
-                               // find avg ()\r
-                       else if (FindAggregateElement (s, lower, AGGREGATE.AVG))\r
-                               Elements.Add (new ExpressionAvg (s.Trim ()));\r
-\r
-                               // find min ()\r
-                       else if (FindAggregateElement (s, lower, AGGREGATE.MIN))\r
-                               Elements.Add (new ExpressionMin (s.Trim ()));\r
-\r
-                               // find max ()\r
-                       else if (FindAggregateElement (s, lower, AGGREGATE.MAX))\r
-                               Elements.Add (new ExpressionMax (s.Trim ()));\r
-\r
-                               // find count ()\r
-                       else if (FindAggregateElement (s, lower, AGGREGATE.COUNT))\r
-                               Elements.Add (new ExpressionCount (s.Trim ()));                            \r
-\r
-                               // find stdev ()\r
-                       else if (FindAggregateElement (s, lower, AGGREGATE.STDEV))\r
-                               Elements.Add (new ExpressionStdev (s.Trim ()));\r
-\r
-                               // find var ()\r
-                       else if (FindAggregateElement (s, lower, AGGREGATE.VAR))\r
-                               Elements.Add (new ExpressionVar (s.Trim ()));\r
-\r
-                               // find len\r
-                       else if (FindLenElement (s, lower))\r
-                               Elements.Add (new ExpressionLen (s.Trim ()));\r
-\r
-                               // find iif\r
-                       else if (FindIifElement (s, lower))\r
-                               Elements.Add (new ExpressionIif (s.Trim ()));\r
-\r
-                               // find isnull\r
-                       else if (FindIsNullElement (s, lower))\r
-                               Elements.Add (new ExpressionIsNull (s.Trim ()));\r
-\r
-                               // find substring\r
-                       else if (FindSubstringElement (s, lower))\r
-                               Elements.Add (new ExpressionSubstring (s.Trim ()));\r
-\r
-                               // if expression is like '(something someoperator something)'\r
-                       else if (inside.Trim () != string.Empty)\r
-                               ParseExpression (inside);\r
-\r
-                               // At least, if it wasnt any of the above it is just normat string or int\r
-                               // or....                       \r
-                       else\r
-                               Elements.Add (new ExpressionSingleElement (s.Trim ()));                 \r
-               }\r
-\r
-               #region CheckElement methods\r
-\r
-               //\r
-               // These methods are temporary for now\r
-               //\r
-\r
-               private bool FindOrElement (string s, string lower, ref string s1, ref string s2)\r
-               {\r
-                       string stemp = lower;\r
-                       int indexOf = stemp.IndexOf("or");\r
-\r
-                       if (indexOf == -1)\r
-                               return false;\r
-\r
-                       // Test if or is between ''\r
-                       int oldIndex = -1;                      \r
-                       while ((indexOf = stemp.IndexOf ("or", oldIndex + 1)) != -1 && indexOf > oldIndex) \r
-                       {\r
-                               \r
-                               oldIndex = indexOf;\r
-\r
-                               // check is the 'or' element part of string element\r
-                               if (IsPartOfStringElement (stemp, indexOf))\r
-                                       continue;\r
-                               \r
-                               // Check is or part of something else for example column name\r
-                               if (indexOf != 0) \r
-                               {\r
-                                       \r
-                                       if (stemp [indexOf - 1] != ' ' && stemp [indexOf - 1] != '\'')\r
-                                               continue;\r
-                               }\r
-                               \r
-                               if (indexOf < s.Length + 2) \r
-                               {\r
-                                       \r
-                                       if (stemp [indexOf + 2] != ' ' && stemp [indexOf + 2] != '\'')\r
-                                               continue;\r
-                               }\r
-\r
-                               if (IsPartOfFunction (stemp, indexOf))\r
-                                       continue;\r
-\r
-                               s1 = s.Substring (0, indexOf).Trim ();\r
-                               s2 = s.Substring (indexOf + 2).Trim ();\r
-\r
-                               return true;\r
-                       }\r
-\r
-                       return false;\r
-               }\r
-               \r
-               private bool FindAndElement (string s, string lower, ref string s1, ref string s2)\r
-               {\r
-                       string stemp = lower;\r
-                       int indexOf = stemp.IndexOf("and");\r
-\r
-                       if (indexOf == -1)\r
-                               return false;\r
-\r
-                       // Test if or is between ''\r
-                       int oldIndex = -1;\r
-                       while ((indexOf = stemp.IndexOf ("and", oldIndex + 1)) != -1 && indexOf > oldIndex) \r
-                       {\r
-                               \r
-                               oldIndex = indexOf;\r
-                               \r
-                               // check is the 'and' element part of string element\r
-                               if (IsPartOfStringElement (stemp, indexOf))\r
-                                       continue;\r
-\r
-\r
-                               // Check is or part of something else for example column name\r
-                               if (indexOf != 0) \r
-                               {\r
-                                       \r
-                                       if (stemp [indexOf - 1] != ' ' && stemp [indexOf - 1] != '\'')\r
-                                               continue;\r
-                               }\r
-                               \r
-                               if (indexOf < stemp.Length + 3) \r
-                               {\r
-                                       \r
-                                       if (stemp [indexOf + 3] != ' ' && stemp [indexOf + 3] != '\'')\r
-                                               continue;\r
-                               }\r
-\r
-                               if (IsPartOfFunction (stemp, indexOf))\r
-                                       continue;\r
-\r
-\r
-                               s1 = s.Substring (0, indexOf).Trim ();\r
-                               s2 = s.Substring (indexOf + 3).Trim ();\r
-                               return true;\r
-                       }\r
-\r
-                       return false;\r
-               }\r
-\r
-               private bool FindLikeElement (string s, string lower, ref string s1, ref string s2)\r
-               {\r
-                       string stemp = lower;\r
-                       int indexOf = stemp.IndexOf("like");\r
-\r
-                       if (indexOf == -1)\r
-                               return false;\r
-\r
-                       // Test if or is between ''\r
-                       int oldIndex = -1;\r
-                       while ((indexOf = stemp.IndexOf ("like", oldIndex + 1)) != -1 && indexOf > oldIndex) \r
-                       {\r
-                               \r
-                               oldIndex = indexOf;\r
-                               \r
-                               // check is the 'and' element part of string element\r
-                               if (IsPartOfStringElement (stemp, indexOf))\r
-                                       continue;\r
-\r
-\r
-                               // Check is or part of something else for example column name\r
-                               if (indexOf != 0) \r
-                               {\r
-                                       \r
-                                       if (stemp [indexOf - 1] != ' ' && stemp [indexOf - 1] != '\'')\r
-                                               continue;\r
-                               }\r
-                               \r
-                               if (indexOf < stemp.Length + 4) \r
-                               {\r
-                                       \r
-                                       if (stemp [indexOf + 4] != ' ' && stemp [indexOf + 4] != '\'')\r
-                                               continue;\r
-                               }\r
-\r
-                               if (IsPartOfFunction (stemp, indexOf))\r
-                                       continue;\r
-\r
-\r
-                               s1 = s.Substring (0, indexOf).Trim ();\r
-                               s2 = s.Substring (indexOf + 4).Trim ();\r
-                               return true;\r
-                       }\r
-\r
-                       return false;\r
-               }\r
-\r
-               private bool FindEqualElement (string s, string lower, ref string s1, ref string s2)\r
-               {\r
-                       string stemp = lower;\r
-                       int indexOf = stemp.IndexOf ("=");\r
-\r
-                       if (indexOf == -1)\r
-                               return false;\r
-                       \r
-                       int oldIndex = -1;\r
-\r
-                       while ((indexOf = stemp.IndexOf ("=", oldIndex + 1)) != -1 && indexOf > oldIndex) \r
-                       {\r
-\r
-                               oldIndex = indexOf;\r
-\r
-                               // Check is the = part of <= or >=\r
-                               if (stemp [indexOf - 1] == '<' || stemp [indexOf - 1] == '>')\r
-                                       continue;\r
-\r
-                               // Check is the = element part of string element\r
-                               if (IsPartOfStringElement (stemp, indexOf))\r
-                                       continue;\r
-\r
-                               // Check is or part of column name\r
-                               if (IsPartOfColumnName (stemp, indexOf))\r
-                                       continue;\r
-                                       \r
-                               if (IsPartOfFunction (stemp, indexOf))\r
-                                       continue;\r
-\r
-                               s1 = s.Substring (0, indexOf).Trim ();\r
-                               s2 = s.Substring (indexOf + 1).Trim ();\r
-                               \r
-                               return true;\r
-                       }\r
-\r
-                       return false;\r
-               }\r
-\r
-               private bool FindUnequalElement (string s, string lower, ref string s1, ref string s2)\r
-               {\r
-                       string stemp = lower;\r
-                       int indexOf = stemp.IndexOf ("<>");\r
-\r
-                       if (stemp.IndexOf ("<>") == -1)\r
-                               return false;\r
-                      \r
-                       int oldIndex = -1;\r
-                       while ((indexOf = stemp.IndexOf ("<>", oldIndex + 1)) != -1 && indexOf > oldIndex) \r
-                       {\r
-\r
-                               oldIndex = indexOf;\r
-\r
-                               // test if next charachter is something else than ' '\r
-                               bool failed = false;\r
-\r
-                               // Check is the <> element part of string element\r
-                               if (IsPartOfStringElement (stemp, indexOf))\r
-                                       continue;\r
-\r
-                               // Check is or part of column name\r
-                               if (IsPartOfColumnName (stemp, indexOf))\r
-                                       continue;\r
-                                       \r
-                               if (IsPartOfFunction (stemp, indexOf))\r
-                                       continue;\r
-\r
-                               s1 = s.Substring (0, indexOf).Trim ();\r
-                               s2 = s.Substring (indexOf + 2).Trim ();\r
-                               \r
-                               return true;\r
-                       }\r
-\r
-                       return false;\r
-                       \r
-               }\r
-\r
-\r
-               private bool FindLessThanElement (string s, string lower, ref string s1, ref string s2)\r
-               {\r
-                       string stemp = lower;\r
-                       int indexOf = stemp.IndexOf ("<");\r
-\r
-                       if (indexOf == -1)\r
-                               return false;\r
-\r
-                       int oldIndex = -1;\r
-                       while ((indexOf = stemp.IndexOf ("<", oldIndex + 1)) != -1 && indexOf > oldIndex) \r
-                       {\r
-\r
-                               oldIndex = indexOf;\r
-\r
-                               // if < is part of <> or <=\r
-                               if (stemp [indexOf + 1] == '>' || stemp [indexOf + 1] == '=')\r
-                                       continue;\r
-\r
-                               // Test is < element part of string element\r
-                               if (IsPartOfStringElement (stemp, indexOf))\r
-                                       continue;\r
-\r
-                               // Check is or part of column name\r
-                               if (IsPartOfColumnName (stemp, indexOf))\r
-                                       continue;\r
-\r
-                               if (IsPartOfFunction (stemp, indexOf))\r
-                                       continue;\r
-\r
-                               s1 = s.Substring (0, indexOf).Trim ();\r
-                               s2 = s.Substring (indexOf + 1).Trim ();\r
-\r
-                               return true;\r
-                       }\r
-               \r
-                       return false;                   \r
-               }\r
-\r
-               private bool FindLessThanOrEqualElement (string s, string lower, ref string s1, ref string s2)\r
-               {\r
-                       string stemp = lower;\r
-                       int indexOf = stemp.IndexOf ("<=");\r
-\r
-                       if (indexOf == -1)\r
-                               return false;\r
-\r
-                       int oldIndex = -1;\r
-                       while ((indexOf = stemp.IndexOf ("<=", oldIndex + 1)) != -1 && indexOf > oldIndex) \r
-                       {\r
-\r
-                               oldIndex = indexOf;\r
-                               // Test is <= element part of string element\r
-                               if (IsPartOfStringElement (stemp, indexOf))\r
-                                       continue;\r
-\r
-                               // Check is or part of column name\r
-                               if (IsPartOfColumnName (stemp, indexOf))\r
-                                       continue;\r
-\r
-                               if (IsPartOfFunction (stemp, indexOf))\r
-                                       continue;\r
-\r
-                               s1 = s.Substring (0, indexOf).Trim ();\r
-                               s2 = s.Substring (indexOf + 2).Trim ();\r
-\r
-                               return true;\r
-                       }\r
-               \r
-                       return false;                   \r
-               }\r
-\r
-               private bool FindGreaterThanElement (string s, string lower, ref string s1, ref string s2)\r
-               {\r
-                       string stemp = lower;\r
-                       int indexOf = stemp.IndexOf (">");\r
-\r
-                       if (indexOf == -1)\r
-                               return false;\r
-\r
-                       int oldIndex = -1;\r
-                       while ((indexOf = stemp.IndexOf (">", oldIndex + 1)) != -1 && indexOf > oldIndex) \r
-                       {\r
-\r
-                               oldIndex = indexOf;\r
-\r
-                               // if < is part of <> or <=\r
-                               if (stemp [indexOf - 1] == '<' || stemp [indexOf + 1] == '=')\r
-                                       continue;\r
-\r
-                               // Test is < element part of string element\r
-                               if (IsPartOfStringElement (stemp, indexOf))\r
-                                       continue;\r
-\r
-                               // Check is or part of column name\r
-                               if (IsPartOfColumnName (stemp, indexOf))\r
-                                       continue;\r
-\r
-                               if (IsPartOfFunction (stemp, indexOf))\r
-                                       continue;\r
-\r
-                               s1 = s.Substring (0, indexOf).Trim ();\r
-                               s2 = s.Substring (indexOf + 1).Trim ();\r
-                               return true;\r
-                       }\r
-               \r
-                       return false;                   \r
-               }\r
-\r
-               private bool FindGreaterThanOrEqualElement (string s, string lower, ref string s1, ref string s2)\r
-               {\r
-                       string stemp = lower;\r
-                       int indexOf = stemp.IndexOf (">=");\r
-\r
-                       if (indexOf == -1)\r
-                               return false;\r
-\r
-                       int oldIndex = -1;\r
-                       while ((indexOf = stemp.IndexOf (">=", oldIndex + 1)) != -1 && indexOf > oldIndex) \r
-                       {\r
-\r
-                               oldIndex = indexOf;\r
-                               bool failed = false;\r
-                               // Test is <= element part of string element\r
-\r
-                               // Check is or part of column name\r
-                               if (IsPartOfColumnName (stemp, indexOf))\r
-                                       continue;\r
-\r
-                               // is the element part of string element\r
-                               if (IsPartOfStringElement (stemp, indexOf))\r
-                                       continue;\r
-\r
-                               if (IsPartOfFunction (stemp, indexOf))\r
-                                       continue;\r
-\r
-                               s1 = s.Substring (0, indexOf).Trim ();\r
-                               s2 = s.Substring (indexOf + 2).Trim ();\r
-\r
-                               return true;\r
-                       }\r
-               \r
-                       return false;                   \r
-               }\r
-\r
-               private bool FindAdditionElement (string s, string lower, ref string s1, ref string s2)\r
-               {\r
-                       string stemp = lower;\r
-                       int indexOf = stemp.IndexOf ("+");\r
-\r
-                       if (indexOf == -1)\r
-                               return false;\r
-\r
-                       int oldIndex = -1;\r
-                       while ((indexOf = stemp.IndexOf ("+", oldIndex + 1)) != -1 && indexOf > oldIndex) \r
-                       {\r
-\r
-                               // FIXME: if '+' represents sign of integer\r
-\r
-                               oldIndex = indexOf;\r
-                               bool failed = false;\r
-\r
-                               // Check is or part of column name\r
-                               if (IsPartOfColumnName (stemp, indexOf))\r
-                                       continue;\r
-\r
-                               // is the element part of string element\r
-                               if (IsPartOfStringElement (stemp, indexOf))\r
-                                       continue;\r
-\r
-                               if (IsPartOfFunction (stemp, indexOf))\r
-                                       continue;\r
-\r
-                               s1 = s.Substring (0, indexOf).Trim ();\r
-                               s2 = s.Substring (indexOf + 1).Trim ();\r
-\r
-                               return true;\r
-                       }\r
-               \r
-                       return false;                   \r
-               }\r
-\r
-               private bool FindSubtractElement (string s, string lower, ref string s1, ref string s2)\r
-               {\r
-                       string stemp = lower;\r
-                       int indexOf = stemp.IndexOf ("-");\r
-\r
-                       if (indexOf == -1)\r
-                               return false;\r
-\r
-                       int oldIndex = -1;\r
-                       while ((indexOf = stemp.IndexOf ("-", oldIndex + 1)) != -1 && indexOf > oldIndex) \r
-                       {\r
-\r
-                               oldIndex = indexOf;\r
-                               bool failed = false;\r
-\r
-                               // check is this lonely element         \r
-                               failed = true;\r
-                               for (int i = indexOf - 1; i >= 0; i--) \r
-                               {\r
-                                       if (stemp [i] != ' ') \r
-                                       {\r
-                                               failed = false;\r
-                                               break;\r
-                                       }\r
-                               }\r
-                                       \r
-                               if (failed)\r
-                                       continue;\r
-\r
-                               // Check is or part of column name\r
-                               if (IsPartOfColumnName (stemp, indexOf))\r
-                                       continue;\r
-\r
-                               // is the element part of string element\r
-                               if (IsPartOfStringElement (stemp, indexOf))\r
-                                       continue;\r
-\r
-                               if (IsPartOfFunction (stemp, indexOf))\r
-                                       continue;\r
-\r
-                               s1 = s.Substring (0, indexOf).Trim ();\r
-                               s2 = s.Substring (indexOf + 1).Trim ();\r
-\r
-                               return true;\r
-                       }\r
-               \r
-                       return false;                   \r
-               }\r
-\r
-               private bool FindMultiplyElement (string s, string lower, ref string s1, ref string s2)\r
-               {\r
-                       string stemp = lower;\r
-                       int indexOf = stemp.IndexOf ("*");\r
-\r
-                       if (indexOf == -1)\r
-                               return false;\r
-\r
-                       int oldIndex = -1;\r
-                       while ((indexOf = stemp.IndexOf ("*", oldIndex + 1)) != -1 && indexOf > oldIndex) \r
-                       {\r
-\r
-\r
-                               oldIndex = indexOf;\r
-                               bool failed = false;\r
-\r
-                               // FIXME: If there is a divide operator before multiply operator.\r
-\r
-                               // Check is or part of column name\r
-                               if (IsPartOfColumnName (stemp, indexOf))\r
-                                       continue;\r
-\r
-                               // is the element part of string element\r
-                               if (IsPartOfStringElement (stemp, indexOf))\r
-                                       continue;\r
-\r
-                               if (IsPartOfFunction (stemp, indexOf))\r
-                                       continue;\r
-\r
-                               s1 = s.Substring (0, indexOf).Trim ();\r
-                               s2 = s.Substring (indexOf + 1).Trim ();\r
-\r
-                               return true;\r
-                       }\r
-               \r
-                       return false;                   \r
-               }\r
-\r
-               private bool FindDivideElement (string s, string lower, ref string s1, ref string s2)\r
-               {\r
-                       string stemp = lower;\r
-                       int indexOf = stemp.IndexOf ("/");\r
-\r
-                       if (indexOf == -1)\r
-                               return false;\r
-\r
-                       int oldIndex = -1;\r
-                       while ((indexOf = stemp.IndexOf ("/", oldIndex + 1)) != -1 && indexOf > oldIndex) \r
-                       {\r
-\r
-\r
-                               oldIndex = indexOf;\r
-                               bool failed = false;\r
-\r
-                               // FIXME: If there is a multiply operator before divide operator.\r
-\r
-                               // Check is or part of column name\r
-                               if (IsPartOfColumnName (stemp, indexOf))\r
-                                       continue;\r
-\r
-                               // is the element part of string element\r
-                               if (IsPartOfStringElement (stemp, indexOf))\r
-                                       continue;\r
-\r
-                               if (IsPartOfFunction (stemp, indexOf))\r
-                                       continue;\r
-                                   \r
-                               s1 = s.Substring (0, indexOf).Trim ();\r
-                               s2 = s.Substring (indexOf + 1).Trim ();\r
-\r
-                               return true;\r
-                       }\r
-               \r
-                       return false;                   \r
-               }\r
-\r
-               private bool FindModulusElement (string s, string lower, ref string s1, ref string s2)\r
-               {\r
-                       string stemp = lower;\r
-                       int indexOf = stemp.IndexOf ("%");\r
-\r
-                       if (indexOf == -1)\r
-                               return false;\r
-\r
-                       int oldIndex = -1;\r
-                       while ((indexOf = stemp.IndexOf ("%", oldIndex + 1)) != -1 && indexOf > oldIndex) \r
-                       {\r
-\r
-\r
-                               oldIndex = indexOf;\r
-                               bool failed = false;\r
-\r
-                               // FIXME: If there is a multiply operator before divide operator.\r
-\r
-                               // Check is or part of column name\r
-                               if (IsPartOfColumnName (stemp, indexOf))\r
-                                       continue;\r
-\r
-                               // is the element part of string element\r
-                               if (IsPartOfStringElement (stemp, indexOf))\r
-                                       continue;\r
-\r
-                               s1 = s.Substring (0, indexOf).Trim ();\r
-                               s2 = s.Substring (indexOf + 1).Trim ();\r
-\r
-                               return true;\r
-                       }\r
-               \r
-                       return false;                   \r
-               }\r
-\r
-               private bool FindAggregateElement (string s, string lower, AGGREGATE aggregate)\r
-               {\r
-                       string agg = null;\r
-\r
-                       switch (aggregate) \r
-                       {\r
-\r
-                               case AGGREGATE.SUM:\r
-                                       agg = "sum";\r
-                                       break;\r
-                               case AGGREGATE.AVG:\r
-                                       agg = "avg";\r
-                                       break;\r
-                               case AGGREGATE.MIN:\r
-                                       agg = "min";\r
-                                       break;\r
-                               case AGGREGATE.MAX:\r
-                                       agg = "max";\r
-                                       break;\r
-                               case AGGREGATE.COUNT:\r
-                                       agg = "count";\r
-                                       break;\r
-                               case AGGREGATE.STDEV:\r
-                                       agg = "stdev";\r
-                                       break;\r
-                               case AGGREGATE.VAR:\r
-                                       agg = "var";\r
-                                       break;\r
-                               default:\r
-                                       throw new NotImplementedException ();\r
-                       }\r
-                              \r
-                               \r
-                       string stemp = lower;\r
-                       int indexOf = stemp.IndexOf (agg);\r
-\r
-                       if (indexOf == -1)\r
-                               return false;\r
-\r
-                       int oldIndex = -1;\r
-                       while ((indexOf = stemp.IndexOf (agg, oldIndex + 1)) != -1 && indexOf > oldIndex) \r
-                       {\r
-\r
-                               oldIndex = indexOf;\r
-                               bool failed = false;\r
-\r
-                               // Check is or part of column name\r
-                               if (indexOf != 0 && stemp [indexOf - 1] != ' ')\r
-                                       continue;\r
-\r
-                               // is the element part of string element\r
-                               if (IsPartOfStringElement (stemp, indexOf))\r
-                                       continue;\r
-\r
-\r
-                               return true;\r
-                       }\r
-               \r
-                       return false;                   \r
-\r
-               }\r
-               \r
-               private bool FindSumElement (string s, string lower)\r
-               {\r
-                       string stemp = lower;\r
-                       int indexOf = stemp.IndexOf ("sum");\r
-\r
-                       if (indexOf == -1)\r
-                               return false;\r
-\r
-                       int oldIndex = -1;\r
-                       while ((indexOf = stemp.IndexOf ("sum", oldIndex + 1)) != -1 && indexOf > oldIndex) \r
-                       {\r
-\r
-                               oldIndex = indexOf;\r
-                               bool failed = false;\r
-\r
-                               // Check is or part of column name\r
-                               if (indexOf != 0 && stemp [indexOf - 1] != ' ')\r
-                                       continue;\r
-\r
-                               // is the element part of string element\r
-                               if (IsPartOfStringElement (stemp, indexOf))\r
-                                       continue;\r
-\r
-\r
-                               return true;\r
-                       }\r
-               \r
-                       return false;                   \r
-               }\r
-\r
-               private bool FindAvgElement (string s, string lower)\r
-               {\r
-                       string stemp = lower;\r
-                       int indexOf = stemp.IndexOf ("avg");\r
-\r
-                       if (indexOf == -1)\r
-                               return false;\r
-\r
-                       int oldIndex = -1;\r
-                       while ((indexOf = stemp.IndexOf ("avg", oldIndex + 1)) != -1 && indexOf > oldIndex) \r
-                       {\r
-\r
-                               oldIndex = indexOf;\r
-                               bool failed = false;\r
-\r
-                               // Check is or part of column name\r
-                               if (indexOf != 0 && stemp [indexOf - 1] != ' ')\r
-                                       continue;\r
-\r
-                               // is the element part of string element\r
-                               if (IsPartOfStringElement (stemp, indexOf))\r
-                                       continue;\r
-\r
-                               return true;\r
-                       }\r
-               \r
-                       return false;                   \r
-               }\r
-\r
-               private bool FindMinElement (string s, string lower)\r
-               {\r
-                       string stemp = lower;\r
-                       int indexOf = stemp.IndexOf ("min");\r
-\r
-                       if (indexOf == -1)\r
-                               return false;\r
-\r
-                       int oldIndex = -1;\r
-                       while ((indexOf = stemp.IndexOf ("min", oldIndex + 1)) != -1 && indexOf > oldIndex) \r
-                       {\r
-\r
-                               oldIndex = indexOf;\r
-                               bool failed = false;\r
-\r
-                               // Check is or part of column name\r
-                               if (indexOf != 0 && stemp [indexOf - 1] != ' ')\r
-                                       continue;\r
-\r
-                               // is the element part of string element\r
-                               if (IsPartOfStringElement (stemp, indexOf))\r
-                                       continue;\r
-\r
-                               return true;\r
-                       }\r
-               \r
-                       return false;                   \r
-               }\r
-\r
-               private bool FindMaxElement (string s, string lower)\r
-               {\r
-                       string stemp = lower;\r
-                       int indexOf = stemp.IndexOf ("max");\r
-\r
-                       if (indexOf == -1)\r
-                               return false;\r
-\r
-                       int oldIndex = -1;\r
-                       while ((indexOf = stemp.IndexOf ("max", oldIndex + 1)) != -1 && indexOf > oldIndex) \r
-                       {\r
-\r
-                               oldIndex = indexOf;\r
-                               bool failed = false;\r
-\r
-                               // Check is or part of column name\r
-                               if (indexOf != 0 && stemp [indexOf - 1] != ' ')\r
-                                       continue;\r
-\r
-                               // is the element part of string element\r
-                               if (IsPartOfStringElement (stemp, indexOf))\r
-                                       continue;\r
-\r
-                               return true;\r
-                       }\r
-               \r
-                       return false;                   \r
-               }\r
-\r
-               private bool FindCountElement (string s, string lower)\r
-               {\r
-                       string stemp = lower;\r
-                       int indexOf = stemp.IndexOf ("count");\r
-\r
-                       if (indexOf == -1)\r
-                               return false;\r
-\r
-                       int oldIndex = -1;\r
-                       while ((indexOf = stemp.IndexOf ("count", oldIndex + 1)) != -1 && indexOf > oldIndex) \r
-                       {\r
-\r
-                               oldIndex = indexOf;\r
-                               bool failed = false;\r
-\r
-                               // Check is or part of column name\r
-                               if (indexOf != 0 && stemp [indexOf - 1] != ' ')\r
-                                       continue;\r
-\r
-                               // is the element part of string element\r
-                               if (IsPartOfStringElement (stemp, indexOf))\r
-                                       continue;\r
-\r
-                               return true;\r
-                       }\r
-               \r
-                       return false;                   \r
-               }\r
-\r
-               private bool FindStdevElement (string s, string lower)\r
-               {\r
-                       string stemp = lower;\r
-                       int indexOf = stemp.IndexOf ("stdev");\r
-\r
-                       if (indexOf == -1)\r
-                               return false;\r
-\r
-                       int oldIndex = -1;\r
-                       while ((indexOf = stemp.IndexOf ("stdev", oldIndex + 1)) != -1 && indexOf > oldIndex) \r
-                       {\r
-\r
-                               oldIndex = indexOf;\r
-                               bool failed = false;\r
-\r
-                               // Check is or part of column name\r
-                               if (indexOf != 0 && stemp [indexOf - 1] != ' ')\r
-                                       continue;\r
-\r
-                               // is the element part of string element\r
-                               if (IsPartOfStringElement (stemp, indexOf))\r
-                                       continue;\r
-\r
-                               return true;\r
-                       }\r
-               \r
-                       return false;                   \r
-               }\r
-\r
-               private bool FindVarElement (string s, string lower)\r
-               {\r
-                       string stemp = lower;\r
-                       int indexOf = stemp.IndexOf ("var");\r
-\r
-                       if (indexOf == -1)\r
-                               return false;\r
-\r
-                       int oldIndex = -1;\r
-                       while ((indexOf = stemp.IndexOf ("var", oldIndex + 1)) != -1 && indexOf > oldIndex) \r
-                       {\r
-\r
-                               oldIndex = indexOf;\r
-                               bool failed = false;\r
-\r
-                               // Check is or part of column name\r
-                               if (indexOf != 0 && stemp [indexOf - 1] != ' ')\r
-                                       continue;\r
-\r
-                               // is the element part of string element\r
-                               if (IsPartOfStringElement (stemp, indexOf))\r
-                                       continue;\r
-\r
-                               return true;\r
-                       }\r
-               \r
-                       return false;                   \r
-               }\r
-\r
-               private bool FindLenElement (string s, string lower)\r
-               {\r
-                       string stemp = lower;\r
-                       int indexOf = stemp.IndexOf ("len");\r
-\r
-                       if (indexOf == -1)\r
-                               return false;\r
-\r
-                       int oldIndex = -1;\r
-                       while ((indexOf = stemp.IndexOf ("len", oldIndex + 1)) != -1 && indexOf > oldIndex) \r
-                       {\r
-\r
-                               oldIndex = indexOf;\r
-                               bool failed = false;\r
-\r
-                               // Check is or part of column name\r
-                               if (indexOf != 0 && stemp [indexOf - 1] != ' ')\r
-                                       continue;\r
-\r
-                               // is the element part of string element\r
-                               if (IsPartOfStringElement (stemp, indexOf))\r
-                                       continue;\r
-\r
-\r
-                               return true;\r
-                       }\r
-               \r
-                       return false;                   \r
-               }\r
-\r
-               private bool FindIifElement (string s, string lower)\r
-               {\r
-                       string stemp = lower;\r
-                       int indexOf = stemp.IndexOf ("iif");\r
-\r
-                       if (indexOf == -1)\r
-                               return false;\r
-\r
-                       int oldIndex = -1;\r
-                       while ((indexOf = stemp.IndexOf ("iif", oldIndex + 1)) != -1 && indexOf > oldIndex) \r
-                       {\r
-\r
-                               oldIndex = indexOf;\r
-                               bool failed = false;\r
-\r
-                               // Check is or part of column name\r
-                               if (indexOf != 0 && stemp [indexOf - 1] != ' ')\r
-                                       continue;\r
-\r
-                               // is the element part of string element\r
-                               if (IsPartOfStringElement (stemp, indexOf))\r
-                                       continue;\r
-\r
-                               return true;\r
-                       }\r
-               \r
-                       return false;                   \r
-               }\r
-\r
-               private bool FindIsNullElement (string s, string lower)\r
-               {\r
-                       string stemp = lower;\r
-                       int indexOf = stemp.IndexOf ("isnull");\r
-\r
-                       if (indexOf == -1)\r
-                               return false;\r
-\r
-                       int oldIndex = -1;\r
-                       while ((indexOf = stemp.IndexOf ("isnull", oldIndex + 1)) != -1 && indexOf > oldIndex) \r
-                       {\r
-\r
-                               oldIndex = indexOf;\r
-                               bool failed = false;\r
-\r
-                               // Check is or part of column name\r
-                               if (indexOf != 0 && stemp [indexOf - 1] != ' ')\r
-                                       continue;\r
-\r
-                               // is the element part of string element\r
-                               if (IsPartOfStringElement (stemp, indexOf))\r
-                                       continue;\r
-                               \r
-                               return true;\r
-                       }\r
-               \r
-                       return false;                   \r
-               }\r
-\r
-               private bool FindSubstringElement (string s, string lower)\r
-               {\r
-                       string stemp = lower;\r
-                       int indexOf = stemp.IndexOf ("substring");\r
-\r
-                       if (indexOf == -1)\r
-                               return false;\r
-\r
-                       int oldIndex = -1;\r
-                       while ((indexOf = stemp.IndexOf ("substring", oldIndex + 1)) != -1 && indexOf > oldIndex) \r
-                       {\r
-\r
-                               oldIndex = indexOf;\r
-                               bool failed = false;\r
-\r
-                               // Check is or part of column name\r
-                               if (indexOf != 0 && stemp [indexOf - 1] != ' ')\r
-                                       continue;\r
-\r
-                               // is the element part of string element\r
-                               if (IsPartOfStringElement (stemp, indexOf))\r
-                                       continue;\r
-\r
-                               return true;\r
-                       }\r
-               \r
-                       return false;                   \r
-               }\r
-\r
-               private bool FindInElement (string s, string lower, ref string s1, ref string s2)\r
-               {\r
-                       string stemp = lower;\r
-                       int indexOf = stemp.IndexOf ("in");\r
-\r
-                       if (indexOf == -1)\r
-                               return false;\r
-\r
-                       int oldIndex = -1;\r
-                       while ((indexOf = stemp.IndexOf ("in", oldIndex + 1)) != -1 && indexOf > oldIndex) \r
-                       {\r
-                               oldIndex = indexOf;\r
-                               \r
-                               // check is the 'and' element part of string element\r
-                               if (IsPartOfStringElement (stemp, indexOf))\r
-                                       continue;\r
-\r
-\r
-                               // Check is or part of something else for example column name\r
-                               if (indexOf != 0) \r
-                               {       \r
-                                       if (stemp [indexOf - 1] != ' ' && stemp [indexOf - 1] != '\'')\r
-                                               continue;\r
-                               }\r
-                               \r
-                               if (indexOf < stemp.Length + 2) \r
-                               {\r
-                                       if (stemp [indexOf + 2] != ' ' && stemp [indexOf + 2] != '\'')\r
-                                               continue;\r
-                               }\r
-\r
-                               if (IsPartOfFunction (stemp, indexOf))\r
-                                       continue;\r
-\r
-                               s1 = s.Substring (0, indexOf).Trim ();\r
-                               s2 = s.Substring (indexOf + 2).Trim ();\r
-                               return true;\r
-                       }\r
-               \r
-                       return false;                   \r
-               }\r
-\r
-               \r
-               #endregion // CheckElement methods\r
-\r
-               #region CreateElement methods\r
-\r
-               // \r
-               // These methods are going to be removed when way of parsing is changed\r
-               //\r
-\r
-               private void CreateOrElement (string s1, string s2, string inside) \r
-               {\r
-                       CheckParenthesis (inside, ref s1, ref s2);\r
-                       Elements.Add (new ExpressionOr (s1.Trim (), s2.Trim ()));\r
-               }\r
-\r
-               private void CreateAndElement (string s1, string s2, string inside)\r
-               {\r
-                       CheckParenthesis (inside, ref s1, ref s2);\r
-                       Elements.Add (new ExpressionAnd (s1.Trim (), s2.Trim ()));\r
-               }\r
-\r
-               private void CreateLikeElement (string s1, string s2, string inside)\r
-               {\r
-                       CheckParenthesis (inside, ref s1, ref s2);\r
-                       Elements.Add (new ExpressionLike (s1.Trim (), s2.Trim ()));\r
-               }\r
-\r
-               private void CreateInElement (string s1, string s2, string inside)\r
-               {\r
-                       CheckParenthesis (inside, ref s1, ref s2);\r
-                       Elements.Add (new ExpressionIn (s1.Trim (), s2.Trim ()));\r
-               }\r
-\r
-               private void CreateEqualsElement (string s1, string s2, string inside)\r
-               {\r
-                       CheckParenthesis (inside, ref s1, ref s2);\r
-                       Elements.Add (new ExpressionEquals (s1.Trim (), s2.Trim ()));                   \r
-               }\r
-\r
-               private void CreateUnequalsElement (string s1, string s2, string inside)\r
-               {\r
-                       CheckParenthesis (inside, ref s1, ref s2);\r
-                       Elements.Add (new ExpressionUnequals (s1.Trim (), s2.Trim ()));\r
-               }\r
-\r
-               private void CreateLessThanElement (string s1, string s2, string inside)\r
-               {\r
-                       CheckParenthesis (inside, ref s1, ref s2);\r
-                       Elements.Add (new ExpressionLessThan (s1.Trim (), s2.Trim ()));\r
-               }\r
-\r
-               private void CreateLessThanOrEqualElement (string s1, string s2, string inside)\r
-               {\r
-                       CheckParenthesis (inside, ref s1, ref s2);\r
-                       Elements.Add (new ExpressionLessThanOrEqual (s1.Trim (), s2.Trim ()));\r
-               }\r
-\r
-               private void CreateGreaterThanElement (string s1, string s2, string inside)\r
-               {\r
-                       CheckParenthesis (inside, ref s1, ref s2);\r
-                       Elements.Add (new ExpressionGreaterThan (s1.Trim (), s2.Trim ()));\r
-               }\r
-\r
-\r
-               private void CreateGreaterThanOrEqualElement (string s1, string s2, string inside)\r
-               {\r
-                       CheckParenthesis (inside, ref s1, ref s2);\r
-                       Elements.Add (new ExpressionGreaterThanOrEqual (s1.Trim (), s2.Trim ()));\r
-               }\r
-\r
-               private void CreateAdditionElement (string s1, string s2,  string inside)\r
-               {\r
-                       CheckParenthesis (inside, ref s1, ref s2);                      \r
-                       Elements.Add (new ExpressionAddition (s1.Trim (), s2.Trim ()));\r
-               }\r
-\r
-               private void CreateSubtractionElement (string s1, string s2,  string inside)\r
-               {\r
-                       CheckParenthesis (inside, ref s1, ref s2);                      \r
-                       Elements.Add (new ExpressionSubtraction (s1.Trim (), s2.Trim ()));\r
-               }\r
-\r
-               private void CreateMultiplyElement (string s1, string s2, string inside)\r
-               {\r
-                       CheckParenthesis (inside, ref s1, ref s2);\r
-                       Elements.Add (new ExpressionMultiply (s1.Trim (), s2.Trim ()));\r
-               }\r
-\r
-               private void CreateDivideElement (string s1, string s2, string inside)\r
-               {\r
-                       CheckParenthesis (inside, ref s1, ref s2);\r
-                       Elements.Add (new ExpressionDivide (s1.Trim (), s2.Trim ()));\r
-               }\r
-\r
-               private void CreateModulusElement (string s1, string s2, string inside)\r
-               {\r
-                       CheckParenthesis (inside, ref s1, ref s2);\r
-                       Elements.Add (new ExpressionModulus (s1.Trim (), s2.Trim ()));\r
-               }                       \r
-\r
-               #endregion // CreateElemnt methods\r
-\r
-               #region Little helppers\r
-\r
-               private void CheckParenthesis (string inside, ref string s1, ref string s2)\r
-               {\r
-                       if (s1 == string.Empty && inside != string.Empty)\r
-                               s1 = inside;\r
-                       else if (s2 == string.Empty && inside != string.Empty)\r
-                               s2 = inside;    \r
-               }\r
-\r
-\r
-               /// <summary>\r
-               ///  Checks is the element part of stringelement\r
-               /// </summary>\r
-               private bool IsPartOfStringElement (string s, int indexOf)\r
-               {\r
-                       // count how many '-charachters are before or. If count is odd it means or IS between quotes\r
-                       int quotes = 0;\r
-                       for (int i = indexOf - 1; i >= 0; i--) \r
-                       {\r
-                               if (s [i] == '\'')\r
-                                       quotes++;\r
-                       }\r
-                       \r
-                       if ((quotes & 1) != 0)\r
-                               return true;\r
-                       else \r
-                               return false;\r
-               }\r
-\r
-               /// <summary>\r
-               ///  Checks is the element part of column table\r
-               /// </summary>\r
-               private bool IsPartOfColumnName (string s, int indexOf)\r
-               {\r
-                       for (int i = indexOf; i >= 0; i--) \r
-                       {\r
-                               \r
-                               // If the element is between [] it is part of columnname\r
-                               if (s [i] == '\'' || s [i] == ']') \r
-                               {\r
-                                       break;\r
-                               }\r
-                               else if (s [i] == '[') \r
-                               {\r
-                                       return true;\r
-                               }\r
-                       }\r
-\r
-                       return false;\r
-               }\r
-\r
-\r
-               /// <summary>\r
-               ///  Checks are element part of function\r
-               /// </summary>\r
-               private bool IsPartOfFunction (string s, int indexOf)\r
-               {\r
-\r
-                       // \r
-                       // If ',' or '\''  comes before '(' this element is not part of function's parameters\r
-                       //\r
-                       \r
-                       for (int i = indexOf; i >= 0; i--) \r
-                       {\r
-                               \r
-                               if (s [i] == '(' || s [i] == ',') \r
-                               {\r
-                                       return true;\r
-                               }\r
-                               else if (s [i] == ')') \r
-                               {\r
-                                       break;\r
-                               }\r
-                       }\r
-\r
-                       return false;\r
-               }\r
-\r
-               #endregion // Little helppers\r
-\r
-               #region ExpressionElementComparer\r
-               protected sealed class ExpressionElementComparer\r
-               {\r
-                       object _value1 = null;\r
-                       Type _t1 = null;\r
-                       Type _RT1 = null;\r
-                       DataRow _row = null;\r
-\r
-                       public ExpressionElementComparer(ExpressionElement E1, DataRow Row)\r
-                       {\r
-                               _value1 = E1.Result (Row);\r
-\r
-                               _row = Row;\r
-\r
-                               if (_value1 == null || _value1 == DBNull.Value)\r
-                                       return;\r
-\r
-                               _t1 = _value1.GetType ();\r
-                               _RT1 = E1.ResultType (Row);\r
-                       }\r
-\r
-                       public int CompareTo (ExpressionElement E2)\r
-                       {\r
-                               object value1 = _value1;\r
-                               object value2 = E2.Result (_row);\r
-\r
-                               if ((value1 == null || value1 == DBNull.Value) && (value2 == null || value2 == DBNull.Value))\r
-                                       return 0;\r
-                               else if (value2 == null || value2 == DBNull.Value)\r
-                                       return 1;\r
-                               else if (value1 == null || value1 == DBNull.Value)\r
-                                       return -1;\r
-\r
-                               Type t2 = value2.GetType ();\r
-                       \r
-                               Type RT2 = E2.ResultType (_row);\r
-\r
-                               if (_t1 == typeof (string) || t2 == typeof (string)) \r
-                               {\r
-                                       // FIXME: If one of elements are string they both should be???\r
-                                       return String.Compare(value1.ToString(), value2.ToString(), !_row.Table.CaseSensitive);\r
-                               }\r
-\r
-                               if (_t1 != t2) \r
-                               {\r
-                                       value2 = Convert.ChangeType (value2, Type.GetTypeCode (_t1));\r
-                               }\r
-\r
-                               if (value1 is IComparable)\r
-                                       return ((IComparable)value1).CompareTo(value2);\r
-\r
-                               return (int) _t1.InvokeMember ("CompareTo", BindingFlags.Default | \r
-                                       BindingFlags.InvokeMethod, null, \r
-                                       value1, \r
-                                       new object [] {value2});\r
-                       }\r
-               }\r
-               #endregion\r
-       }    \r
-       #endif    \r
-}\r
diff --git a/mcs/class/System.Data/System.Data/FillErrorEventArgs.cs b/mcs/class/System.Data/System.Data/FillErrorEventArgs.cs
deleted file mode 100644 (file)
index 559a30e..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-//
-// System.Data.FillErrorEventArgs.cs
-//
-// Author:
-//   Miguel de Icaza <miguel@ximian.com>
-//
-// (C) Ximian, Inc 2002
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace System.Data
-{
-       public class FillErrorEventArgs : EventArgs {
-               DataTable data_table;
-               object [] values;
-               Exception errors;
-               bool f_continue;
-
-               public FillErrorEventArgs (DataTable dataTable, object [] values)
-               {
-                       this.data_table = dataTable;
-                       this.values = values;
-               }
-
-               public bool Continue {
-                       get {
-                               return f_continue;
-                       }
-
-                       set {
-                               f_continue = value;
-                       }
-               }
-
-               public DataTable DataTable {
-                       get {
-                               return data_table;
-                       }
-               }
-
-               public Exception Errors {
-                       get {
-                               return errors;
-                       }
-
-                       set {
-                               errors = value;
-                       }
-               }
-
-               public object [] Values {
-                       get {
-                               return values;
-                       }
-               }
-       }
-}
diff --git a/mcs/class/System.Data/System.Data/FillErrorEventHandler.cs b/mcs/class/System.Data/System.Data/FillErrorEventHandler.cs
deleted file mode 100644 (file)
index 6e44835..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-//
-// System.Data.FillErrorEventHandler.cs
-//
-// Author:
-//   Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System.Data
-{
-       /// <summary>
-       /// Represents the method that will handle the FillError event.
-       /// </summary>
-       public delegate void FillErrorEventHandler(object sender, FillErrorEventArgs e);
-
-}
\ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/FillOptions.cs b/mcs/class/System.Data/System.Data/FillOptions.cs
deleted file mode 100644 (file)
index 497b97f..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-//
-// System.Data.FillOptions.cs
-//
-// Author:
-//   Tim Coleman (tim@timcoleman.com)
-//
-// Copyright (C) Tim Coleman, 2003
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-namespace System.Data {
-       public enum FillOptions 
-       {
-               None,
-               FillChildren,
-               FillExtendedSchema,
-               FillWithoutExtendedMetaData
-       }
-}
-
-
diff --git a/mcs/class/System.Data/System.Data/ForeignKeyConstraint.cs b/mcs/class/System.Data/System.Data/ForeignKeyConstraint.cs
deleted file mode 100644 (file)
index 122200e..0000000
+++ /dev/null
@@ -1,559 +0,0 @@
-//
-// System.Data.ForeignKeyConstraint.cs
-//
-// Author:
-//   Franklin Wise <gracenote@earthlink.net>
-//   Daniel Morgan <danmorg@sc.rr.com>
-//
-// (C) 2002 Franklin Wise
-// (C) 2002 Daniel Morgan
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections;
-using System.ComponentModel;
-using System.Runtime.InteropServices;
-using System.Data.Common;
-
-namespace System.Data {
-       [Editor ("Microsoft.VSDesigner.Data.Design.ForeignKeyConstraintEditor, " + Consts.AssemblyMicrosoft_VSDesigner,
-                "System.Drawing.Design.UITypeEditor, " + Consts.AssemblySystem_Drawing)]
-       [DefaultProperty ("ConstraintName")]
-       public class ForeignKeyConstraint : Constraint 
-       {
-               private UniqueConstraint _parentUniqueConstraint;
-               //FIXME: create a class which will wrap this collection
-               private DataColumn [] _parentColumns;
-               //FIXME: create a class which will wrap this collection
-               private DataColumn [] _childColumns;
-               private Rule _deleteRule = Rule.Cascade;
-               private Rule _updateRule = Rule.Cascade;
-               private AcceptRejectRule _acceptRejectRule = AcceptRejectRule.None;
-               private string _parentTableName;
-               private string _parentTableNamespace;
-               private string _childTableName;
-
-               //FIXME: remove those; and use only DataColumns[]
-               private string [] _parentColumnNames;
-               private string [] _childColumnNames;
-                       
-               #region Constructors
-
-               public ForeignKeyConstraint(DataColumn parentColumn, DataColumn childColumn) 
-               {
-                       if (null == parentColumn || null == childColumn) {
-                               throw new NullReferenceException("Neither parentColumn or" +
-                                       " childColumn can be null.");
-                       }
-                       _foreignKeyConstraint(null, new DataColumn[] {parentColumn},
-                                       new DataColumn[] {childColumn});
-               }
-
-               public ForeignKeyConstraint(DataColumn[] parentColumns, DataColumn[] childColumns) 
-               {
-                       _foreignKeyConstraint(null, parentColumns, childColumns);
-               }
-
-               public ForeignKeyConstraint(string constraintName, DataColumn parentColumn, DataColumn childColumn) 
-               {
-                       if (null == parentColumn || null == childColumn) {
-                               throw new NullReferenceException("Neither parentColumn or" +
-                                       " childColumn can be null.");
-                       }
-
-                       _foreignKeyConstraint(constraintName, new DataColumn[] {parentColumn},
-                                       new DataColumn[] {childColumn});
-               }
-
-               public ForeignKeyConstraint(string constraintName, DataColumn[] parentColumns, DataColumn[] childColumns) 
-               {
-                       _foreignKeyConstraint(constraintName, parentColumns, childColumns);
-               }
-
-               //special case
-               [Browsable (false)]
-               public ForeignKeyConstraint(string constraintName, string parentTableName, string[] parentColumnNames, string[] childColumnNames, AcceptRejectRule acceptRejectRule, Rule deleteRule, Rule updateRule) 
-               {
-                       int i;
-                       InitInProgress = true;
-                       base.ConstraintName = constraintName;
-
-                       // "parentTableName" is searched in the "DataSet" to which the "DataTable"
-                       // from which AddRange() is called
-                       // childTable is the "DataTable" which calls AddRange()
-
-                       // Keep reference to parentTableName to resolve later
-                       _parentTableName = parentTableName;
-
-                       // Keep a copy of parentColumnNames to resolve later
-                       _parentColumnNames = new string [parentColumnNames.Length];
-                       for (i = 0; i < parentColumnNames.Length; i++)
-                              _parentColumnNames[i] = parentColumnNames[i];
-                       
-                       // Keep a copy of childColumnNames to resolve later
-                       _childColumnNames = new string [childColumnNames.Length];
-                       for (i = 0; i < childColumnNames.Length; i++)
-                              _childColumnNames[i] = childColumnNames[i];
-                       
-
-                       _acceptRejectRule = acceptRejectRule;
-                       _deleteRule = deleteRule;
-                       _updateRule = updateRule;
-               }
-
-               internal override void FinishInit (DataTable childTable)
-               {
-                       if (childTable.DataSet == null)
-                               throw new InvalidConstraintException ("ChildTable : " + childTable.TableName + " does not belong to any DataSet");
-
-                       DataSet dataSet = childTable.DataSet;
-                       _childTableName = childTable.TableName;
-
-                       if (!dataSet.Tables.Contains (_parentTableName))
-                               throw new InvalidConstraintException ("Table : " + _parentTableName + "does not exist in DataSet : " + dataSet);
-
-                       DataTable parentTable = dataSet.Tables [_parentTableName];
-
-                       int i = 0, j = 0;
-
-                       if (_parentColumnNames.Length < 0 || _childColumnNames.Length < 0)
-                               throw new InvalidConstraintException ("Neither parent nor child columns can be zero length");
-
-                       if (_parentColumnNames.Length != _childColumnNames.Length)
-                               throw new InvalidConstraintException ("Both parent and child columns must be of same length");                                                                                                    
-                       DataColumn[] parentColumns = new DataColumn [_parentColumnNames.Length];
-                       DataColumn[] childColumns = new DataColumn [_childColumnNames.Length];
-
-                       foreach (string parentCol in _parentColumnNames){
-                               if (!parentTable.Columns.Contains (parentCol))
-                                       throw new InvalidConstraintException ("Table : " + _parentTableName + "does not contain the column :" + parentCol);
-                               parentColumns [i++] = parentTable. Columns [parentCol];
-                       }
-
-                       foreach (string childCol in _childColumnNames){
-                               if (!childTable.Columns.Contains (childCol))
-                                       throw new InvalidConstraintException ("Table : " + _childTableName + "does not contain the column : " + childCol);
-                               childColumns [j++] = childTable.Columns [childCol];
-                       }
-                       _validateColumns (parentColumns, childColumns);
-                       _parentColumns = parentColumns;
-                       _childColumns = childColumns;
-                       parentTable.Namespace = _parentTableNamespace;
-                       InitInProgress = false;
-               }
-
-               [Browsable (false)]
-               public ForeignKeyConstraint (string constraintName, string parentTableName, string parentTableNamespace, string[] parentColumnNames, string[] childColumnNames, AcceptRejectRule acceptRejectRule, Rule deleteRule, Rule updateRule)
-               {
-                       InitInProgress = true;
-                       base.ConstraintName = constraintName;
-
-                       // "parentTableName" is searched in the "DataSet" to which the "DataTable"
-                       // from which AddRange() is called
-                       // childTable is the "DataTable" which calls AddRange()
-
-                       // Keep reference to parentTableName to resolve later
-                       _parentTableName = parentTableName;
-                       _parentTableNamespace = parentTableNamespace;
-
-                       // Keep reference to parentColumnNames to resolve later
-                       _parentColumnNames = parentColumnNames;
-
-                       // Keep reference to childColumnNames to resolve later
-                       _childColumnNames = childColumnNames;
-
-                       _acceptRejectRule = acceptRejectRule;
-                       _deleteRule = deleteRule;
-                       _updateRule = updateRule;
-               }
-
-               private void _foreignKeyConstraint(string constraintName, DataColumn[] parentColumns,
-                               DataColumn[] childColumns)
-               {
-                       int i;
-                       //Validate 
-                       _validateColumns(parentColumns, childColumns);
-
-                       //Set Constraint Name
-                       base.ConstraintName = constraintName;   
-
-                       //copy the columns - Do not keep reference #672113
-                       _parentColumns = new DataColumn [parentColumns.Length];
-                       for (i = 0; i < parentColumns.Length; i++)
-                              _parentColumns[i] = parentColumns[i];
-                       
-                       _childColumns = new DataColumn [childColumns.Length];                   
-                       for (i = 0; i < childColumns.Length; i++)
-                              _childColumns[i] = childColumns[i];
-               }
-
-#endregion // Constructors
-
-#region Helpers
-
-               private void _validateColumns(DataColumn[] parentColumns, DataColumn[] childColumns)
-               {
-                       //not null
-                       if (null == parentColumns || null == childColumns) 
-                               throw new ArgumentNullException();
-
-                       //at least one element in each array
-                       if (parentColumns.Length < 1 || childColumns.Length < 1)
-                               throw new ArgumentException("Neither ParentColumns or ChildColumns can't be" +
-                                               " zero length.");
-                               
-                       //same size arrays
-                       if (parentColumns.Length != childColumns.Length)
-                               throw new ArgumentException("Parent columns and child columns must be the same length.");
-                       
-
-                       DataTable ptable = parentColumns[0].Table;
-                       DataTable ctable = childColumns[0].Table;
-
-                       for (int i = 0; i < parentColumns.Length; i++) {
-                               DataColumn pc = parentColumns[i];
-                               DataColumn cc = childColumns[i];
-
-                               //not null check
-                               if (null == pc.Table) 
-                                       throw new ArgumentException("All columns must belong to a table." + 
-                                               " ColumnName: " + pc.ColumnName + " does not belong to a table.");
-                               
-                               //All columns must belong to the same table
-                               if (ptable != pc.Table)
-                                       throw new InvalidConstraintException("Parent columns must all belong to the same table.");
-
-                               //not null check
-                               if (null == cc.Table) 
-                                       throw new ArgumentException("All columns must belong to a table." + 
-                                               " ColumnName: " + pc.ColumnName + " does not belong to a table.");
-
-                               //All columns must belong to the same table.
-                               if (ctable != cc.Table)
-                                       throw new InvalidConstraintException("Child columns must all belong to the same table.");
-
-                               if (pc.CompiledExpression != null)
-                                       throw new ArgumentException(String.Format("Cannot create a constraint based on Expression column {0}.", pc.ColumnName));
-
-                               if (cc.CompiledExpression != null)
-                                       throw new ArgumentException(String.Format("Cannot create a constraint based on Expression column {0}.", cc.ColumnName));
-                               
-                       }
-
-                        //Same dataset.  If both are null it's ok
-                       if (ptable.DataSet != ctable.DataSet)
-                       {
-                               //LAMESPEC: spec says InvalidConstraintExceptoin
-                               //      impl does InvalidOperationException
-                               throw new InvalidOperationException("Parent column and child column must belong to" + 
-                                               " tables that belong to the same DataSet.");
-                                               
-                       }       
-
-
-                       int identicalCols = 0;
-                       for (int i = 0; i < parentColumns.Length; i++)
-                       {
-                               DataColumn pc = parentColumns[i];
-                               DataColumn cc = childColumns[i];
-                               
-                               if (pc == cc) {
-                                       identicalCols++;
-                                       continue;
-                               }
-
-                               if (!pc.DataTypeMatches (cc)) {
-                                       //LAMESPEC: spec says throw InvalidConstraintException
-                                       //              implementation throws InvalidOperationException
-                                       throw new InvalidOperationException ("Parent column is not type compatible with it's child"
-                                               + " column.");
-                               }
-                       }
-                       if (identicalCols == parentColumns.Length)
-                               throw new InvalidOperationException ("Property not accessible because 'ParentKey and ChildKey are identical.'.");
-                       
-               }
-               
-               //Checks to see if a related unique constraint exists
-               //if it doesn't then a unique constraint is created.
-               //if a unique constraint can't be created an exception will be thrown
-               private void _ensureUniqueConstraintExists(ConstraintCollection collection,
-                               DataColumn [] parentColumns)
-               {
-                       //not null
-                       if (null == parentColumns) throw new ArgumentNullException(
-                                       "ParentColumns can't be null");
-
-                       UniqueConstraint uc = null;
-                       
-                       //see if unique constraint already exists
-                       //if not create unique constraint
-                       if(parentColumns[0] != null)
-                               uc = UniqueConstraint.GetUniqueConstraintForColumnSet(parentColumns[0].Table.Constraints, parentColumns);
-
-                       if (null == uc) {
-                               uc = new UniqueConstraint(parentColumns, false); //could throw
-                               parentColumns [0].Table.Constraints.Add (uc);
-                       }
-
-                       //keep reference
-                       _parentUniqueConstraint = uc;
-                       _parentUniqueConstraint.ChildConstraint = this;
-               }
-               
-               
-               #endregion //Helpers
-               
-               #region Properties
-
-               [DataCategory ("Data")]
-               [DefaultValue (AcceptRejectRule.None)]
-               public virtual AcceptRejectRule AcceptRejectRule {
-                       get { return _acceptRejectRule; }
-                       set { _acceptRejectRule = value; }
-               }
-
-               [DataCategory ("Data")]
-               [ReadOnly (true)]
-               public virtual DataColumn[] Columns {
-                       get { return _childColumns; }
-               }
-
-               [DataCategory ("Data")]
-               [DefaultValue (Rule.Cascade)]
-               public virtual Rule DeleteRule {
-                       get { return _deleteRule; }
-                       set { _deleteRule = value; }
-               }
-
-               [DataCategory ("Data")]
-               [DefaultValue (Rule.Cascade)]
-               public virtual Rule UpdateRule {
-                       get { return _updateRule; }
-                       set { _updateRule = value; }
-               }
-
-               [DataCategory ("Data")] 
-               [ReadOnly (true)]
-               public virtual DataColumn[] RelatedColumns {
-                       get { return _parentColumns; }
-               }
-
-               [DataCategory ("Data")] 
-               [ReadOnly (true)]
-               public virtual DataTable RelatedTable {
-                       get {
-                               if (_parentColumns != null)
-                                       if (_parentColumns.Length > 0)
-                                               return _parentColumns[0].Table;
-
-                               throw new InvalidOperationException ("Property not accessible because 'Object reference not set to an instance of an object'");
-                       }
-               }
-
-               [DataCategory ("Data")]
-               [ReadOnly (true)]
-               public override DataTable Table {
-                       get {
-                               if (_childColumns != null)
-                                       if (_childColumns.Length > 0)
-                                               return _childColumns[0].Table;
-
-                               throw new InvalidOperationException ("Property not accessible because 'Object reference not set to an instance of an object'");
-                       }
-               }
-
-               internal UniqueConstraint ParentConstraint {
-                       get { return _parentUniqueConstraint; }
-               }
-
-               #endregion // Properties
-
-               #region Methods
-
-               public override bool Equals(object key) 
-               {
-                       ForeignKeyConstraint fkc = key as ForeignKeyConstraint;
-                       if (null == fkc) return false;
-
-                       //if the fk constrains the same columns then they are equal
-                       if (! DataColumn.AreColumnSetsTheSame( this.RelatedColumns, fkc.RelatedColumns))
-                               return false;
-                       if (! DataColumn.AreColumnSetsTheSame( this.Columns, fkc.Columns) )
-                               return false;
-
-                       return true;
-               }
-
-               public override int GetHashCode()
-               {
-                       //initialize hash1 and hash2 with default hashes
-                       //any two DIFFERENT numbers will do here
-                       int hash1 = 32, hash2 = 88;
-                       int i;
-
-                       //derive the hash code from the columns that way
-                       //Equals and GetHashCode return Equal objects to be the
-                       //same
-
-                       //Get the first parent column hash
-                       if (this.Columns.Length > 0)
-                               hash1 ^= this.Columns[0].GetHashCode();
-                       
-                       //get the rest of the parent column hashes if there any
-                       for (i = 1; i < this.Columns.Length; i++)
-                       {
-                               hash1 ^= this.Columns[1].GetHashCode();
-                               
-                       }
-                       
-                       //Get the child column hash
-                       if (this.RelatedColumns.Length > 0)
-                               hash2 ^= this.Columns[0].GetHashCode();
-                       
-                       for (i = 1; i < this.RelatedColumns.Length; i++)
-                       {
-                               hash2 ^= this.RelatedColumns[1].GetHashCode();
-                       }
-
-                       //combine the two hashes
-                       return hash1 ^ hash2;
-               }
-
-               internal override void AddToConstraintCollectionSetup(
-                               ConstraintCollection collection)
-               {                       
-                       if (collection.Table != Table)
-                               throw new InvalidConstraintException("This constraint cannot be added since ForeignKey doesn't belong to table " + RelatedTable.TableName + ".");
-
-                       //run Ctor rules again
-                       _validateColumns(_parentColumns, _childColumns);
-                       
-                       //we must have a unique constraint on the parent
-                       _ensureUniqueConstraintExists(collection, _parentColumns);
-                       
-                       if ( (Table.DataSet != null && Table.DataSet.EnforceConstraints)
-                            || (Table.DataSet == null && Table.EnforceConstraints)) {
-                               if (IsConstraintViolated())
-                                       throw new ArgumentException("This constraint cannot be enabled as not all values have corresponding parent values.");
-                       }
-                       //FIXME : if this fails and we created a unique constraint
-                       //we should probably roll it back
-                       // and remove index form Table                  
-               }
-                                       
-               internal override void RemoveFromConstraintCollectionCleanup( 
-                               ConstraintCollection collection)
-               {
-                       _parentUniqueConstraint.ChildConstraint = null;
-                       Index = null;
-               }
-               
-               internal override bool IsConstraintViolated()
-               {
-                       if (Table.DataSet == null || RelatedTable.DataSet == null) 
-                               return false;
-                       
-                       bool hasErrors = false;
-                       foreach (DataRow row in Table.Rows) {
-                               if (row.RowState == DataRowState.Deleted)
-                                       continue;
-                               
-                               // we check if all values in _childColumns place are nulls.
-                               // if yes we return.
-                               if (row.IsNullColumns(_childColumns))
-                                       continue;
-
-                               // check whenever there is (at least one) parent row  in RelatedTable
-                               if(!RelatedTable.RowsExist(_parentColumns,_childColumns,row)) { 
-                                       // if no parent row exists - constraint is violated
-                                       hasErrors = true;
-                                       string[] values = new string[_childColumns.Length];
-                                       for (int i = 0; i < _childColumns.Length; i++){
-                                               DataColumn col = _childColumns[i];
-                                               values[i] = row[col].ToString();
-                                       }
-
-                                       row.RowError = String.Format("ForeignKeyConstraint {0} requires the child key values ({1}) to exist in the parent table.",
-                                               ConstraintName, String.Join(",", values));
-                               }
-                       }
-
-                       if (hasErrors)
-                               //throw new ConstraintException("Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.");
-                               return true;
-
-                       return false;
-               }
-               
-               internal override void AssertConstraint(DataRow row)
-               {
-                       // first we check if all values in _childColumns place are nulls.
-                       // if yes we return.
-                       if (row.IsNullColumns(_childColumns))
-                               return;
-
-                       // check whenever there is (at least one) parent row  in RelatedTable
-                       if(!RelatedTable.RowsExist(_parentColumns,_childColumns,row)) { 
-                               // if no parent row exists - constraint is violated
-                               throw new InvalidConstraintException(GetErrorMessage(row));
-                       }
-               }
-
-               internal override bool IsColumnContained(DataColumn column)
-               {
-                       for (int i = 0; i < _parentColumns.Length; i++)
-                               if (column == _parentColumns[i])
-                                       return true;
-
-                       for (int i = 0; i < _childColumns.Length; i++)
-                               if (column == _childColumns[i])
-                                       return true;
-
-                       return false;
-               }
-
-               internal override bool CanRemoveFromCollection(ConstraintCollection col, bool shouldThrow){
-                       return true;
-               }
-
-               private string GetErrorMessage(DataRow row)
-               {
-                       System.Text.StringBuilder sb = new System.Text.StringBuilder();
-                       for (int i = 0; i < _childColumns.Length; i++) {
-                               sb.Append(row[_childColumns[0]].ToString());
-                               if (i != _childColumns.Length - 1) {
-                                       sb.Append(',');
-                               }
-                       }
-                       string valStr = sb.ToString();
-                       return "ForeignKeyConstraint " + ConstraintName + " requires the child key values (" + valStr + ") to exist in the parent table.";
-               }               
-                
-               #endregion // Methods
-       }
-
-}
diff --git a/mcs/class/System.Data/System.Data/IColumnMapping.cs b/mcs/class/System.Data/System.Data/IColumnMapping.cs
deleted file mode 100644 (file)
index 3841853..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-//
-// System.Data.IColumnMapping.cs
-//
-// Author:
-//   Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System.Data
-{
-       /// <summary>
-       /// Associates a data source column with a DataSet column, and is implemented by the DataColumnMapping class, which is used in common by .NET data providers.
-       /// </summary>
-       public interface IColumnMapping
-       {
-               /// <summary>
-               /// Gets or sets the name of the column within the DataSet to map to.
-               /// </summary>
-               string DataSetColumn
-               {
-                       get;
-                       set;
-               }
-
-               /// <summary>
-               /// Gets or sets the name of the column within the data source to map from. The name is case-sensitive.
-               /// </summary>
-               string SourceColumn
-               {
-                       get;
-                       set;
-               }
-       }
-}
\ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/IColumnMappingCollection.cs b/mcs/class/System.Data/System.Data/IColumnMappingCollection.cs
deleted file mode 100644 (file)
index 780fd1e..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-//
-// System.Data.IColumnMappingCollection.cs
-//
-// Author:
-//   Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Collections;
-
-namespace System.Data
-{
-       /// <summary>
-       /// Contains a collection of ColumnMapping objects, and is implemented by the DataColumnMappingCollection, which is used in common by .NET data providers.
-       /// </summary>
-       public interface IColumnMappingCollection : IList, ICollection, IEnumerable
-       {
-               IColumnMapping Add(string sourceColumnName, string dataSetColumnName);
-
-               bool Contains(string sourceColumnName);
-
-               IColumnMapping GetByDataSetColumn(string dataSetColumnName);
-
-               int IndexOf(string sourceColumnName);
-
-               void RemoveAt(string sourceColumnName);
-               
-               object this[string index]
-               {
-                       get;
-                       set;
-               }
-       }
-}
diff --git a/mcs/class/System.Data/System.Data/IDataAdapter.cs b/mcs/class/System.Data/System.Data/IDataAdapter.cs
deleted file mode 100644 (file)
index dde7af0..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-//
-// System.Data.IDataAdapter.cs
-//
-// Author:
-//   Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System.Data
-{
-       /// <summary>
-       /// Allows an object to implement a DataAdapter, and represents a set of methods and mapping action-related properties used to fill and refresh a DataSet and update a data source.
-       /// </summary>
-       public interface IDataAdapter
-       {
-               int Fill(DataSet dataSet);
-
-               DataTable[] FillSchema(DataSet dataSet, SchemaType schemaType);
-
-               IDataParameter[] GetFillParameters();
-
-               int Update(DataSet dataSet);
-               
-               MissingMappingAction MissingMappingAction{get;set;}
-
-               MissingSchemaAction MissingSchemaAction{get;set;}
-
-               ITableMappingCollection TableMappings{get;}
-
-
-       }
-}
\ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/IDataParameter.cs b/mcs/class/System.Data/System.Data/IDataParameter.cs
deleted file mode 100644 (file)
index 82941b0..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-//
-// System.Data.IDataParameter.cs
-//
-// Author:
-//   Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace System.Data
-{
-       /// <summary>
-       /// Represents a parameter to a Command object, and optionally, its mapping to DataSet columns; and is implemented by .NET data providers that access data sources.
-       /// </summary>
-       public interface IDataParameter
-       {
-               
-               DbType DbType{get;set;}
-
-               ParameterDirection Direction{get;set;}
-
-               bool IsNullable{get;}
-
-               string ParameterName{get;set;}
-
-               string SourceColumn{get;set;}
-
-               DataRowVersion SourceVersion {get;set;}
-
-               object Value {get;set;}
-
-
-       }
-}
\ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/IDataParameterCollection.cs b/mcs/class/System.Data/System.Data/IDataParameterCollection.cs
deleted file mode 100644 (file)
index 8cf0ce1..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-//
-// System.Data.IDataParameterCollection.cs
-//
-// Author:
-//   Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections;
-
-namespace System.Data
-{
-       /// <summary>
-       /// Collects all parameters relevant to a Command object and their mappings to DataSet columns, and is implemented by .NET data providers that access data sources.
-       /// </summary>
-       public interface IDataParameterCollection : IList, ICollection, IEnumerable
-       {
-               void RemoveAt(string parameterName);
-               
-               int IndexOf(string parameterName);
-               
-               bool Contains(string parameterName);
-
-               object this[string parameterName]{get; set;}
-       }
-}
diff --git a/mcs/class/System.Data/System.Data/IDataReader.cs b/mcs/class/System.Data/System.Data/IDataReader.cs
deleted file mode 100644 (file)
index 22f60b3..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-//
-// System.Data.IDataReader.cs
-//
-// Author:
-//   Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System.Data
-{
-       /// <summary>
-       /// Provides a means of reading one or more forward-only streams of result sets obtained by executing a command at a data source, and is implemented by .NET data providers that access relational databases.
-       /// </summary>
-       public interface IDataReader  : IDisposable, IDataRecord
-       {
-               void Close();
-               
-               DataTable GetSchemaTable();
-               
-               bool NextResult();
-
-               bool Read();
-
-               int Depth{get;}
-
-               bool IsClosed{get;}
-
-               int RecordsAffected{get;}
-
-
-       }
-}
\ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/IDataRecord.cs b/mcs/class/System.Data/System.Data/IDataRecord.cs
deleted file mode 100644 (file)
index c8e8725..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-//
-// System.Data.IDataRecord.cs
-//
-// Author:
-//   Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System.Data
-{
-       /// <summary>
-       /// Provides access to the column values within 
-       /// each row for a DataReader, and is implemented by .NET data 
-       /// providers that access relational databases.
-       /// </summary>
-       public interface IDataRecord
-       {
-               bool GetBoolean(int i);
-
-               byte GetByte(int i);
-
-               long GetBytes(int i, long fieldOffset, byte[] buffer,
-                       int bufferoffset, int length);
-
-               char GetChar(int i);
-
-               long GetChars (int i, long fieldoffset, char [] buffer,
-                       int bufferoffset, int length);
-
-               IDataReader GetData(int i);
-
-               string GetDataTypeName(int i);
-
-               DateTime GetDateTime(int i);
-
-               decimal GetDecimal(int i);
-
-               double GetDouble(int i);
-
-               Type GetFieldType(int i);
-
-               float GetFloat(int i);
-
-               Guid GetGuid(int i);
-
-               short GetInt16(int i);
-
-               int GetInt32(int i);
-
-               long GetInt64(int i);
-
-               string GetName(int i);
-
-               int GetOrdinal(string name);
-
-               string GetString(int i);
-
-               object GetValue(int i);
-
-               int GetValues(object[] values);
-
-               bool IsDBNull(int i);
-
-               int FieldCount{get;}
-
-               object this[string name]{get;}
-               
-               object this[int i]{get;}
-       }
-}
diff --git a/mcs/class/System.Data/System.Data/IDbCommand.cs b/mcs/class/System.Data/System.Data/IDbCommand.cs
deleted file mode 100644 (file)
index 16bdb6e..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-//
-// System.Data.IDBCommand.cs
-//
-// Author:
-//   Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace System.Data
-{
-       /// <summary>
-       /// Represents a SQL statement that is executed while connected to a data source, and is implemented by .NET data providers that access relational databases.
-       /// </summary>
-       public interface IDbCommand : IDisposable
-       {
-               void Cancel();
-               
-               IDbDataParameter CreateParameter();
-               
-               int ExecuteNonQuery();
-
-               IDataReader ExecuteReader();
-
-               IDataReader ExecuteReader(CommandBehavior behavior);
-
-               object ExecuteScalar();
-
-               void Prepare();
-
-               string CommandText{get; set;}
-
-               int CommandTimeout{get; set;}
-
-               CommandType CommandType{get; set;}
-
-               IDbConnection Connection{get; set;}
-
-               IDataParameterCollection Parameters{get;}
-
-               IDbTransaction Transaction{get; set;}
-
-               UpdateRowSource UpdatedRowSource{get; set;}
-       }
-}
diff --git a/mcs/class/System.Data/System.Data/IDbConnection.cs b/mcs/class/System.Data/System.Data/IDbConnection.cs
deleted file mode 100644 (file)
index 7d26729..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-//
-// System.Data.IDBConnection.cs
-//
-// Author:
-//   Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace System.Data
-{
-       /// <summary>
-       /// Represents an open connection to a data source, and is implemented by .NET data providers that access relational databases.
-       /// </summary>
-       public interface IDbConnection : IDisposable
-       {
-               IDbTransaction BeginTransaction();
-
-               IDbTransaction BeginTransaction(IsolationLevel il);
-
-               void ChangeDatabase(string databaseName);
-
-               void Close();
-
-               IDbCommand CreateCommand();
-
-               void Open();
-
-
-               string ConnectionString{get; set;}
-
-               int ConnectionTimeout{get;}
-
-               string Database{get;}
-
-               ConnectionState State{get;}
-
-       }
-}
diff --git a/mcs/class/System.Data/System.Data/IDbDataAdapter.cs b/mcs/class/System.Data/System.Data/IDbDataAdapter.cs
deleted file mode 100644 (file)
index 6bbcddc..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-//
-// System.Data.IDbDataAdapter.cs
-//
-// Author:
-//   Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System.Data
-{
-       /// <summary>
-       /// Represents a set of command-related properties that are used to fill the DataSet and update a data source, and is implemented by .NET data providers that access relational databases.
-       /// </summary>
-       public interface IDbDataAdapter : IDataAdapter
-       {
-               IDbCommand DeleteCommand{get; set;}
-
-               IDbCommand InsertCommand{get; set;}
-
-               IDbCommand SelectCommand{get; set;}
-
-               IDbCommand UpdateCommand{get; set;}
-       }
-}
\ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/IDbDataParameter.cs b/mcs/class/System.Data/System.Data/IDbDataParameter.cs
deleted file mode 100644 (file)
index c6f2717..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-//
-// System.Data.IDbDataParameter.cs
-//
-// Author:
-//   Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace System.Data
-{
-       /// <summary>
-       /// Used by the Visual Basic .NET Data Designers to represent a parameter to a Command object, and optionally, its mapping to DataSet columns.
-       /// </summary>
-       public interface IDbDataParameter : IDataParameter
-       {
-               byte Precision{get; set;}
-
-               byte Scale{get; set;}
-
-               int Size{get; set;}
-       }       
-}
\ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/IDbTransaction.cs b/mcs/class/System.Data/System.Data/IDbTransaction.cs
deleted file mode 100644 (file)
index d8c0751..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-//
-// System.Data.IDbTransaction.cs
-//
-// Author:
-//   Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace System.Data
-{
-       /// <summary>
-       /// Represents a transaction to be performed at a data source, and is implemented by .NET data providers that access relational databases.
-       /// </summary>
-       public interface IDbTransaction : IDisposable
-       {
-               void Commit();
-
-               void Rollback();
-               
-               IDbConnection Connection{get;}
-
-               IsolationLevel IsolationLevel{get;}
-       }       
-}
\ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/ISafeDataRecord.cs b/mcs/class/System.Data/System.Data/ISafeDataRecord.cs
deleted file mode 100644 (file)
index a76969b..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-//
-// System.Data.ISafeDataRecord
-//
-// Author:
-//   Boris Kirzner (borisk@mainsoft.com)
-//
-using System;
-
-namespace System.Data
-{
-       internal interface ISafeDataRecord : IDataRecord
-       {
-               bool GetBooleanSafe(int i);
-
-               byte GetByteSafe(int i);
-
-               //long GetBytes(int i, long fieldOffset, byte[] buffer, int bufferOffset, int length);
-
-               char GetCharSafe(int i);
-
-               //long GetChars(int i, long fieldOffset, char[] buffer, int bufferOffset, int length);
-
-               //IDataReader GetData(int i);
-
-               //string GetDataTypeName(int i);
-
-               DateTime GetDateTimeSafe(int i);
-
-               decimal GetDecimalSafe(int i);
-
-               double GetDoubleSafe(int i);
-
-               //Type GetFieldType(int i);
-
-               float GetFloatSafe(int i);
-
-               //Guid GetGuid(int i);
-
-               short GetInt16Safe(int i);
-
-               int GetInt32Safe(int i);
-
-               long GetInt64Safe(int i);
-
-               //string GetName(int i);
-
-               //int GetOrdinal(string name);
-
-               string GetStringSafe(int i);
-
-               //object GetValue(int i);
-
-               //int GetValues(object[] values);
-
-               //bool IsDBNull(int i);
-
-               //int FieldCount{get;}
-
-               //object this[string name]{get;}
-               
-               //object this[int i]{get;}
-       }
-}
diff --git a/mcs/class/System.Data/System.Data/ITableMapping.cs b/mcs/class/System.Data/System.Data/ITableMapping.cs
deleted file mode 100644 (file)
index 85dd4b0..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-//
-// System.Data.ITableMapping.cs
-//
-// Author:
-//   Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System.Data
-{
-       /// <summary>
-       /// Associates a source table with a table in a DataSet, and is implemented by the DataTableMapping class, which is used in common by .NET data providers.
-       /// </summary>
-       public interface ITableMapping
-       {
-               IColumnMappingCollection ColumnMappings{get;}
-
-               string DataSetTable{get; set;}
-
-               string SourceTable{get; set;}
-       }
-}
\ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/ITableMappingCollection.cs b/mcs/class/System.Data/System.Data/ITableMappingCollection.cs
deleted file mode 100644 (file)
index 243edae..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-//
-// System.Data.ITableMappingCollection.cs
-//
-// Author:
-//   Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Collections;
-
-namespace System.Data
-{
-       /// <summary>
-       /// Contains a collection of TableMapping objects, and is implemented by the DataTableMappingCollection, which is used in common by .NET data providers.
-       /// </summary>
-       public interface ITableMappingCollection : IList, ICollection, IEnumerable
-       {
-               ITableMapping Add(string sourceTableName, string dataSetTableName);
-               
-               bool Contains(string sourceTableName);
-               
-               ITableMapping GetByDataSetTable(string dataSetTableName);
-               
-               int IndexOf(string sourceTableName);
-               
-               void RemoveAt(string sourceTableName);
-               
-               object this[string index]{get; set;}
-       }
-}
diff --git a/mcs/class/System.Data/System.Data/InRowChangingEventException.cs b/mcs/class/System.Data/System.Data/InRowChangingEventException.cs
deleted file mode 100644 (file)
index 505aa72..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// System.Data.InRowChangingEventException.cs
-//
-// Author: Duncan Mak  (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System.Data
-{
-       [Serializable]
-       public class InRowChangingEventException : DataException
-       {
-               public InRowChangingEventException ()
-                       : base (Locale.GetText ("Cannot EndEdit within a RowChanging event"))
-               {
-               }
-
-               public InRowChangingEventException (string s)
-                       : base (s)
-               {
-               }
-
-               public InRowChangingEventException (string message, Exception innerException)
-                       : base (message, innerException)
-               {
-               }
-
-               protected InRowChangingEventException (SerializationInfo info, StreamingContext context)
-                       : base (info, context)
-               {
-               }
-       }
-}
diff --git a/mcs/class/System.Data/System.Data/InternalDataCollectionBase.cs b/mcs/class/System.Data/System.Data/InternalDataCollectionBase.cs
deleted file mode 100644 (file)
index 7cfe50e..0000000
+++ /dev/null
@@ -1,147 +0,0 @@
-//
-// System.Data.InternalDataCollectionBase.cs
-//
-// Base class for:
-//     DataRowCollection
-//     DataColumnCollection
-//     DataTableCollection
-//     DataRelationCollection
-//     DataConstraintCollection
-//
-// Author:
-//   Daniel Morgan <danmorg@sc.rr.com>
-//   Tim Coleman <tim@timcoleman.com>
-//
-// (C) Copyright 2002 Daniel Morgan
-// (C) Copyright 2002 Tim Coleman
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections;
-using System.ComponentModel;
-
-namespace System.Data
-{
-       /// <summary>
-       /// Base class for System.Data collection classes
-       /// that are used within a DataTable object
-       /// to represent a collection of
-       /// relations, tables, rows, columns, and constraints
-       /// </summary>
-
-       public class InternalDataCollectionBase : ICollection, IEnumerable {
-               #region Fields
-
-               private ArrayList list = null;
-               private bool readOnly = false;
-               private bool synchronized = false;
-
-               #endregion
-
-               #region Constructors
-
-               public InternalDataCollectionBase ()
-               {
-                       list = new ArrayList();
-               }
-
-               #endregion
-
-               #region Properties
-
-               /// <summary>
-               /// Gets the total number of elements in a collection.
-               /// </summary>
-               [Browsable (false)]
-               public virtual int Count {
-                       get { return list.Count; }
-               }
-
-               /// <summary>
-               /// Gets a value indicating whether the InternalDataCollectionBase is read-only.
-               /// </summary>
-               [Browsable (false)]
-               public bool IsReadOnly {
-                       get { return readOnly; }
-               }
-
-               /// <summary>
-               /// Gets a value indicating whether the InternalDataCollectionBase is synchronized.
-               /// </summary>
-               [Browsable (false)]
-               public bool IsSynchronized {
-                       get { return synchronized; }
-               }
-
-               /// <summary>
-               /// Gets the items of the collection as a list.
-               /// </summary>
-               protected virtual ArrayList List {
-                       get { return list; }
-               }
-
-               /// <summary>
-               /// Gets an object that can be used to synchronize the collection.
-               /// </summary>
-               [Browsable (false)]
-               public object SyncRoot {
-                       get { return this; }
-               }
-
-
-               #endregion
-
-               #region Methods
-
-               /// <summary>
-               /// Copies all the elements in the current InternalDataCollectionBase to a one-
-               /// dimensional Array, starting at the specified InternalDataCollectionBase index.
-               /// </summary>
-               public
-               virtual
-               void CopyTo (Array ar, int index)
-               {
-                       list.CopyTo (ar, index);
-               }
-
-               /// <summary>
-               /// Gets an IEnumerator for the collection.
-               /// </summary>
-               public
-               virtual
-               IEnumerator GetEnumerator ()
-               {
-                       return list.GetEnumerator ();
-               }
-
-               internal Array ToArray (Type type)
-               {
-                       return list.ToArray (type);
-               }
-
-               #endregion
-       }
-}
diff --git a/mcs/class/System.Data/System.Data/InvalidConstraintException.cs b/mcs/class/System.Data/System.Data/InvalidConstraintException.cs
deleted file mode 100644 (file)
index dab06ac..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-//
-// System.Data.InvalidConstraintException.cs
-//
-// Author: Duncan Mak  (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System.Data
-{
-       [Serializable]
-       public class InvalidConstraintException : DataException
-       {
-               public InvalidConstraintException ()
-                       : base (Locale.GetText ("Cannot access or create this relation"))
-               {
-               }
-
-               public InvalidConstraintException (string s)
-                       : base (s)
-               {
-               }
-
-               public InvalidConstraintException (string message, Exception innerException)
-                       : base (message, innerException)
-               {
-               }
-               protected InvalidConstraintException (SerializationInfo info, StreamingContext context)
-                       : base (info, context)
-               {
-               }
-       }
-}
diff --git a/mcs/class/System.Data/System.Data/InvalidExpressionException.cs b/mcs/class/System.Data/System.Data/InvalidExpressionException.cs
deleted file mode 100644 (file)
index 187cdd0..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// System.Data.InvalidExpressionException.cs
-//
-// Author: Duncan Mak  (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System.Data
-{
-       [Serializable]
-       public class InvalidExpressionException : DataException
-       {
-               public InvalidExpressionException ()
-                       : base (Locale.GetText ("This Expression is invalid"))
-               {
-               }
-
-               public InvalidExpressionException (string s)
-                       : base (s)
-               {
-               }
-
-               public InvalidExpressionException (string message, Exception innerException)
-                       : base (message, innerException)
-               {
-               }
-
-               protected InvalidExpressionException (SerializationInfo info, StreamingContext context)
-                       : base (info, context)
-               {
-               }
-       }
-}
diff --git a/mcs/class/System.Data/System.Data/IsolationLevel.cs b/mcs/class/System.Data/System.Data/IsolationLevel.cs
deleted file mode 100644 (file)
index e36660d..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-// System.Data.IsolationLevel.cs
-//
-// Author:
-//   Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System.Data
-{
-       /// <summary>
-       /// Specifies the transaction locking behavior for the connection.
-       /// This enumeration has a FlagsAttribute that allows a bitwise combination of its member values.
-       /// </summary>
-       public enum IsolationLevel
-       {
-               Chaos = 16,
-               ReadUncommitted = 256,
-               ReadCommitted = 4096,           
-               RepeatableRead = 65536,
-               Serializable = 1048576,
-               Snapshot = 16777216,
-               Unspecified = -1
-       }
-}
\ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/LoadOption.cs b/mcs/class/System.Data/System.Data/LoadOption.cs
deleted file mode 100644 (file)
index 825dab5..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-//
-// System.Data.LoadOption.cs
-//
-// Author:
-//   Tim Coleman (tim@timcoleman.com)
-//   Sureshkumar T <tsureshkumar@novell.com>
-//
-// Copyright (C) Tim Coleman, 2003
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-namespace System.Data {
-       public enum LoadOption 
-       {
-                OverwriteChanges        = 1,
-                PreserveChanges         = 2,
-                Upsert                  = 3
-       }
-}
-
diff --git a/mcs/class/System.Data/System.Data/MappingType.cs b/mcs/class/System.Data/System.Data/MappingType.cs
deleted file mode 100644 (file)
index 9d6219f..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-// System.Data.MappingType.cs
-//
-// Author:
-//   Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace System.Data
-{
-       /// <summary>
-       /// Specifies how a DataColumn is mapped.
-       /// </summary>
-       [Serializable]
-       public enum MappingType
-       {
-               Element = 1,
-               Attribute = 2,
-               SimpleContent = 3,
-               Hidden = 4
-               
-       }
-}
\ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/MergeFailedEventArgs.cs b/mcs/class/System.Data/System.Data/MergeFailedEventArgs.cs
deleted file mode 100644 (file)
index e7b2a2b..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-//
-// System.Data.MergeFailedEventArgs.cs
-//
-// Author:
-//   Miguel de Icaza <miguel@ximian.com>
-//   Tim Coleman (tim@timcoleman.com)
-//
-// (C) Ximian, Inc 2002
-// Copyright (C) Tim Coleman, 2002
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace System.Data
-{
-       public class MergeFailedEventArgs : EventArgs
-       {
-               #region Fields
-
-               readonly DataTable data_table;
-               readonly string conflict;
-
-               #endregion // Fields
-
-               #region Constructors
-
-               public MergeFailedEventArgs (DataTable table, string conflict)
-               {
-                       this.data_table = table;
-                       this.conflict = conflict;
-               }
-
-               #endregion // Constructors
-
-               #region Properties
-
-               public DataTable Table {
-                       get { return data_table; }
-               }
-
-               public string Conflict {
-                       get { return conflict; }
-               }
-
-               #endregion // Properties
-       }
-}
diff --git a/mcs/class/System.Data/System.Data/MergeFailedEventHandler.cs b/mcs/class/System.Data/System.Data/MergeFailedEventHandler.cs
deleted file mode 100644 (file)
index b62b7dc..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-//
-// System.Data.MergeFailedEventHandler.cs
-//
-// Author:
-//   Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System.Data
-{
-       /// <summary>
-       /// Represents the method that will handle the MergeFailed event.
-       /// </summary>
-       public delegate void MergeFailedEventHandler(object sender, MergeFailedEventArgs e);
-
-}
\ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/MergeManager.cs b/mcs/class/System.Data/System.Data/MergeManager.cs
deleted file mode 100644 (file)
index 911ca37..0000000
+++ /dev/null
@@ -1,406 +0,0 @@
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.Collections;
-
-namespace System.Data
-{
-       /// <summary>
-       /// Summary description for MergeManager.
-       /// </summary>
-       internal class MergeManager
-       {
-               internal static void Merge(DataSet targetSet, DataSet sourceSet, bool preserveChanges, MissingSchemaAction missingSchemaAction)
-               {
-                       if(targetSet == null)
-                               throw new ArgumentNullException("targetSet");
-                       if(sourceSet == null)
-                               throw new ArgumentNullException("sourceSet");
-                       if (sourceSet == targetSet)
-                               return;
-
-                       bool prevEC = targetSet.EnforceConstraints;
-                       targetSet.EnforceConstraints = false;
-
-                       foreach (DataTable t in sourceSet.Tables)
-                               MergeManager.Merge(targetSet, t, preserveChanges, missingSchemaAction);
-
-                       AdjustSchemaRelations (targetSet, sourceSet, missingSchemaAction);
-                       targetSet.EnforceConstraints = prevEC;
-               }
-
-               internal static void Merge(DataSet targetSet, DataTable sourceTable, bool preserveChanges, MissingSchemaAction missingSchemaAction)
-               {
-                       if(targetSet == null)
-                               throw new ArgumentNullException("targetSet");
-                       if(sourceTable == null)
-                               throw new ArgumentNullException("sourceTable");
-                       if (sourceTable.DataSet == targetSet)
-                               return;
-
-                       bool savedEnfoceConstraints = targetSet.EnforceConstraints;
-                       targetSet.EnforceConstraints = false;
-
-                       DataTable targetTable = null;
-                       if (!AdjustSchema(targetSet, sourceTable, missingSchemaAction,ref targetTable))
-                               return;
-                       if (targetTable != null)
-                               fillData(targetTable, sourceTable, preserveChanges);
-                       targetSet.EnforceConstraints = savedEnfoceConstraints;
-               }
-
-               internal static void Merge (DataTable targetTable, 
-                                           DataTable sourceTable, 
-                                           bool preserveChanges, 
-                                           MissingSchemaAction missingSchemaAction)
-               {
-                       if(targetTable== null)
-                               throw new ArgumentNullException("targetTable");
-                       if(sourceTable == null)
-                               throw new ArgumentNullException("sourceTable");
-                       if (sourceTable == targetTable)
-                               return;
-
-                       bool savedEnforceConstraints = targetTable.EnforceConstraints;
-                       targetTable.EnforceConstraints = false;
-
-                       if (!AdjustSchema(targetTable, sourceTable, missingSchemaAction))
-                               return;
-
-                       fillData(targetTable, sourceTable, preserveChanges);
-                       targetTable.EnforceConstraints = savedEnforceConstraints;
-               }
-
-               internal static void Merge(DataSet targetSet, DataRow[] sourceRows, bool preserveChanges, MissingSchemaAction missingSchemaAction)
-               {
-                       if(targetSet == null)
-                               throw new ArgumentNullException("targetSet");
-                       if(sourceRows == null)
-                               throw new ArgumentNullException("sourceRows");
-
-                       bool savedEnfoceConstraints = targetSet.EnforceConstraints;
-                       targetSet.EnforceConstraints = false;
-
-                       ArrayList targetTables = new ArrayList();
-                       for (int i = 0; i < sourceRows.Length; i++) {
-                               DataRow row = sourceRows[i];
-                               DataTable sourceTable = row.Table;
-                               DataTable targetTable = null;
-                               if (!AdjustSchema(targetSet, sourceTable, missingSchemaAction,ref targetTable))
-                                       return;
-                               if (targetTable != null) {
-                                       MergeRow(targetTable, row, preserveChanges);
-                                       if (!(targetTables.IndexOf(targetTable) >= 0))
-                                               targetTables.Add(targetTable);
-                               }
-                       }
-
-                       targetSet.EnforceConstraints = savedEnfoceConstraints;
-               }
-
-               // merge a row into a target table.
-               private static void MergeRow(DataTable targetTable, DataRow row, bool preserveChanges)
-               {
-                       DataColumn[] primaryKeys = targetTable.PrimaryKey;
-                       DataRow targetRow = null;
-                       DataRowVersion version = DataRowVersion.Default;
-                       if (row.RowState == DataRowState.Deleted)
-                               version = DataRowVersion.Original;
-
-                       if (primaryKeys != null && primaryKeys.Length > 0) // if there are any primary key.
-                       {
-                               // initiate an array that has the values of the primary keys.
-                               object[] keyValues = new object[primaryKeys.Length];
-                               
-                               for (int j = 0; j < keyValues.Length; j++)
-                               {
-                                       keyValues[j] = row[primaryKeys[j].ColumnName, version];
-                               }
-                       
-                               // find the row in the target table.
-                               targetRow = targetTable.Rows.Find(keyValues, DataViewRowState.OriginalRows);
-                               if (targetRow == null)
-                                       targetRow = targetTable.Rows.Find(keyValues);
-                       }
-                       // row doesn't exist in target table, or there are no primary keys.
-                       // create new row and copy values from source row to the new row.
-                       if (targetRow == null)
-                       { 
-                               DataRow newRow = targetTable.NewNotInitializedRow();
-                               // Don't check for ReadOnly, when cloning data to new uninitialized row.
-                               row.CopyValuesToRow(newRow, false);
-                               targetTable.Rows.AddInternal (newRow);
-                       }
-                       // row exists in target table, and presere changes is false - 
-                       // change the values of the target row to the values of the source row.
-                       else
-                       {
-                               row.MergeValuesToRow(targetRow, preserveChanges);
-                       }
-               }
-                       
-               private static bool AdjustSchemaRelations (DataSet targetSet, DataSet sourceSet, MissingSchemaAction missingSchemaAction)
-               {
-                       if (missingSchemaAction == MissingSchemaAction.Ignore)
-                               return true;
-
-                       foreach(DataTable sourceTable in sourceSet.Tables) {
-
-                               DataTable targetTable = targetSet.Tables[sourceTable.TableName];
-                               if (targetTable == null)
-                                       continue;
-
-                               foreach (Constraint constraint in sourceTable.Constraints) {
-
-                                       Constraint targetConstraint = null;
-
-                                       string constraintName = constraint.ConstraintName;
-                                       if (targetTable.Constraints.Contains (constraintName))
-                                               constraintName = "";
-
-                                       UniqueConstraint uc = constraint as UniqueConstraint;
-                                       // PrimaryKey is already taken care of while merging the table
-                                       // ForeignKey constraint takes care of Parent Unique Constraints
-                                       if (uc != null) {
-                                               if (uc.IsPrimaryKey || uc.ChildConstraint != null)
-                                                       continue;
-                                               DataColumn[] columns = ResolveColumns (targetTable, uc.Columns);
-                                               targetConstraint = new UniqueConstraint (constraintName, columns, false);
-                                       }
-
-                                       ForeignKeyConstraint fc = constraint as ForeignKeyConstraint;
-                                       if (fc != null) {
-                                               DataColumn[] columns = ResolveColumns (targetTable, fc.Columns);
-                                               DataColumn[] relatedColumns = ResolveColumns (targetSet.Tables [fc.RelatedTable.TableName],
-                                                                                       fc.RelatedColumns);
-                                               targetConstraint = new ForeignKeyConstraint (constraintName, relatedColumns, columns);
-                                       }
-
-                                       bool dupConstraintFound = false;
-                                       foreach (Constraint cons in targetTable.Constraints) {
-                                       if (!targetConstraint.Equals (cons))
-                                               continue;
-                                       dupConstraintFound = true;
-                                       break;
-                                       }
-
-                                       // If equivalent-constraint already exists, then just do nothing
-                                       if (dupConstraintFound)
-                                               continue;
-
-                                       if (missingSchemaAction == MissingSchemaAction.Error)
-                                               throw new DataException ("Target DataSet missing " + targetConstraint.GetType () +
-                                                               targetConstraint.ConstraintName);
-                                       else
-                                               targetTable.Constraints.Add (targetConstraint);
-                               }
-                       }
-
-                       foreach (DataRelation relation in sourceSet.Relations) {
-                               DataRelation targetRelation = targetSet.Relations [relation.RelationName];
-                               if (targetRelation == null) {
-                                       if (missingSchemaAction == MissingSchemaAction.Error)
-                                               throw new ArgumentException ("Target DataSet mising definition for " +
-                                                               relation.RelationName);
-
-                                       DataColumn[] parentColumns = ResolveColumns (targetSet.Tables [relation.ParentTable.TableName],
-                                                       relation.ParentColumns);
-                                       DataColumn[] childColumns = ResolveColumns (targetSet.Tables [relation.ChildTable.TableName],
-                                                       relation.ChildColumns);
-                                       targetRelation = targetSet.Relations.Add (relation.RelationName, parentColumns,
-                                                       childColumns, relation.createConstraints);
-                                       targetRelation.Nested = relation.Nested;
-                               } else if (!CompareColumnArrays (relation.ParentColumns, targetRelation.ParentColumns) ||
-                                               !CompareColumnArrays (relation.ChildColumns, targetRelation.ChildColumns)) {
-                                       RaiseMergeFailedEvent (null, "Relation " + relation.RelationName +
-                                               " cannot be merged, because keys have mismatch columns.");
-                               }
-                       }
-
-                       return true;
-               }
-
-               private static DataColumn[] ResolveColumns(DataTable targetTable, DataColumn[] sourceColumns)
-               {
-                       if (sourceColumns != null && sourceColumns.Length > 0) {
-                               // lets just assume that all columns are from the Same table
-                               if (targetTable != null) {
-                                       int i=0;
-                                       DataColumn[] targetColumns = new DataColumn[sourceColumns.Length];
-
-                                       DataColumn tmpCol ;
-                                       foreach(DataColumn sourceColumn in sourceColumns) {
-                                               tmpCol = targetTable.Columns[sourceColumn.ColumnName];
-                                               if (tmpCol == null)
-                                                       throw new DataException ("Column " + sourceColumn.ColumnName  + 
-                                                                       " does not belong to table " + targetTable.TableName);
-                                               targetColumns [i++] = tmpCol;
-                                       }
-                                       return targetColumns;
-                               }
-                       }
-                       return null;
-               }
-
-
-               // adjust the table schema according to the missingschemaaction param.
-               // return false if adjusting fails.
-               private static bool AdjustSchema(DataSet targetSet, DataTable sourceTable, MissingSchemaAction missingSchemaAction, ref DataTable newTable)
-               {
-                       // if the source table not exists in the target dataset
-                       // we act according to the missingschemaaction param.
-                       DataTable targetTable = targetSet.Tables [sourceTable.TableName];
-                       if (targetTable == null) {
-                               if (missingSchemaAction == MissingSchemaAction.Ignore)
-                                       return true;
-
-                               if (missingSchemaAction == MissingSchemaAction.Error)
-                                       throw new ArgumentException ("Target DataSet missing definition for " +
-                                                       sourceTable.TableName + ".");
-
-                               targetTable = (DataTable)sourceTable.Clone();
-                               targetSet.Tables.Add(targetTable);
-                       }
-
-                       AdjustSchema (targetTable, sourceTable, missingSchemaAction);
-
-                       newTable = targetTable;
-                       return true;
-               }
-
-
-               private static bool AdjustSchema(DataTable targetTable, DataTable sourceTable, MissingSchemaAction missingSchemaAction)
-               {
-                       if (missingSchemaAction == MissingSchemaAction.Ignore)
-                               return true;
-
-                       for (int i = 0; i < sourceTable.Columns.Count; i++) {
-                               DataColumn sourceColumn = sourceTable.Columns[i];
-                               // if a column from the source table doesn't exists in the target table
-                               // we act according to the missingschemaaction param.
-                               DataColumn targetColumn = targetTable.Columns [sourceColumn.ColumnName];
-                               if(targetColumn == null) {
-                                       if (missingSchemaAction == MissingSchemaAction.Error)
-                                               throw new DataException ("Target table " + targetTable.TableName +
-                                                               " missing definition for column " + sourceColumn.ColumnName);
-                                       
-                                       targetColumn = new DataColumn(sourceColumn.ColumnName, sourceColumn.DataType, 
-                                                               sourceColumn.Expression, sourceColumn.ColumnMapping);
-                                       targetTable.Columns.Add(targetColumn);
-                               }
-
-                               if(sourceColumn.AutoIncrement) {
-                                       targetColumn.AutoIncrement = sourceColumn.AutoIncrement;
-                                       targetColumn.AutoIncrementSeed = sourceColumn.AutoIncrementSeed;
-                                       targetColumn.AutoIncrementStep = sourceColumn.AutoIncrementStep;
-                               }
-                       }
-
-                       if (!AdjustPrimaryKeys(targetTable, sourceTable))
-                               return false;
-
-                       checkColumnTypes (targetTable, sourceTable);
-
-                       return true;
-               }
-       
-       
-               // find if there is a valid matching between the targetTable PrimaryKey and the
-               // sourceTable primatyKey.
-               // return true if there is a match, else return false and raise a MergeFailedEvent.
-               private static bool AdjustPrimaryKeys(DataTable targetTable, DataTable sourceTable)
-               {
-                       if (sourceTable.PrimaryKey.Length == 0)
-                               return true;
-
-                       // If targetTable does not have a PrimaryKey, just import the sourceTable PrimaryKey
-                       if (targetTable.PrimaryKey.Length == 0) {
-                               DataColumn[] targetColumns = ResolveColumns (targetTable, sourceTable.PrimaryKey);
-                               targetTable.PrimaryKey = targetColumns;
-                               return true;
-                       }
-                       
-                       // If both the tables have a primary key, verify that they are equivalent.
-                       // raise a MergeFailedEvent if the keys are not equivalent
-                       if (targetTable.PrimaryKey.Length != sourceTable.PrimaryKey.Length) {
-                               RaiseMergeFailedEvent (targetTable, "<target>.PrimaryKey and <source>.PrimaryKey have different Length.");
-                               return false;
-                       }
-
-                       for (int i=0; i < targetTable.PrimaryKey.Length; ++i) {
-                               if (targetTable.PrimaryKey [i].ColumnName.Equals (sourceTable.PrimaryKey [i].ColumnName))
-                                       continue;
-                               RaiseMergeFailedEvent (targetTable, "Mismatch columns in the PrimaryKey : <target>." + 
-                                       targetTable.PrimaryKey [i].ColumnName + " versus <source>." + sourceTable.PrimaryKey [i].ColumnName);
-                               return false;
-                       }
-                       return true;
-               }
-
-               // fill the data from the source table to the target table
-               private static void fillData(DataTable targetTable, DataTable sourceTable, bool preserveChanges)
-               {
-                       for (int i = 0; i < sourceTable.Rows.Count; i++)
-                       {
-                               DataRow row = sourceTable.Rows[i];
-                               MergeRow(targetTable, row, preserveChanges);
-                       }
-               }
-
-               // check tha column from 2 tables that has the same name also has the same datatype.
-               private static void checkColumnTypes(DataTable targetTable, DataTable sourceTable)
-               {
-                       for (int i = 0; i < sourceTable.Columns.Count; i++)
-                       {
-                               DataColumn fromCol = sourceTable.Columns[i];
-                               DataColumn toCol = targetTable.Columns[fromCol.ColumnName];
-                               if (toCol == null)
-                                       continue;
-                               if (toCol.DataTypeMatches (fromCol))
-                                       continue;
-                               throw new DataException("<target>." + fromCol.ColumnName + " and <source>." + 
-                                               fromCol.ColumnName + " have conflicting properties: DataType " + 
-                                               " property mismatch.");
-                       }
-               }
-
-               private static bool CompareColumnArrays (DataColumn[] arr1, DataColumn[] arr2)
-               {
-                       if (arr1.Length != arr2.Length)
-                               return false;
-
-                       for (int i=0; i < arr1.Length; ++i)
-                               if (!arr1 [i].ColumnName.Equals (arr2 [i].ColumnName))
-                                       return false;
-                       return true;
-               }
-
-               private static void RaiseMergeFailedEvent (DataTable targetTable, string errMsg)
-               {
-                       MergeFailedEventArgs args = new MergeFailedEventArgs (targetTable, errMsg);
-                       if (targetTable.DataSet != null)
-                               targetTable.DataSet.OnMergeFailed (args);
-               }
-       }
-}
diff --git a/mcs/class/System.Data/System.Data/MissingMappingAction.cs b/mcs/class/System.Data/System.Data/MissingMappingAction.cs
deleted file mode 100644 (file)
index 2fbb73c..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-//
-// System.Data.MissingMappingAction.cs
-//
-// Author:
-//   Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace System.Data
-{
-       /// <summary>
-       /// Determines the action that occurs when a mapping is missing from a source table or a source column.
-       /// </summary>
-       public enum MissingMappingAction
-       {
-               Passthrough = 1,
-               Ignore = 2,
-               Error = 3
-       }
-}
\ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/MissingPrimaryKeyException.cs b/mcs/class/System.Data/System.Data/MissingPrimaryKeyException.cs
deleted file mode 100644 (file)
index 517c01d..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// System.Data.MissingPrimaryKeyException.cs
-//
-// Author: Duncan Mak  (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System.Data
-{
-       [Serializable]
-       public class MissingPrimaryKeyException : DataException
-       {
-               public MissingPrimaryKeyException ()
-                       : base (Locale.GetText ("This table has no primary key"))
-               {
-               }
-
-               public MissingPrimaryKeyException (string s)
-                       : base (s)
-               {
-               }
-
-               public MissingPrimaryKeyException (string message, Exception innerException)
-                       : base (message, innerException)
-               {
-               }
-
-               protected MissingPrimaryKeyException (SerializationInfo info, StreamingContext context)
-                       : base (info, context)
-               {
-               }
-       }
-}
diff --git a/mcs/class/System.Data/System.Data/MissingSchemaAction.cs b/mcs/class/System.Data/System.Data/MissingSchemaAction.cs
deleted file mode 100644 (file)
index cb06e0e..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-//
-// System.Data.MissingSchemaAction.cs
-//
-// Author:
-//   Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace System.Data
-{
-       /// <summary>
-       /// Specifies the action to take when adding data to the DataSet and the required DataTable or DataColumn is missing.
-       /// </summary>
-       public enum MissingSchemaAction
-       {
-               Add = 1,
-               Ignore = 2,
-               Error = 3,
-               AddWithKey = 4
-       }
-}
\ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/NoNullAllowedException.cs b/mcs/class/System.Data/System.Data/NoNullAllowedException.cs
deleted file mode 100644 (file)
index 28940be..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// System.Data.NoNullAllowedException.cs
-//
-// Author: Duncan Mak  (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System.Data
-{
-       [Serializable]
-       public class NoNullAllowedException : DataException
-       {
-               public NoNullAllowedException ()
-                       : base (Locale.GetText ("Cannot insert a NULL value"))
-               {
-               }
-
-               public NoNullAllowedException (string s)
-                       : base (s)
-               {
-               }
-
-               public NoNullAllowedException (string message, Exception innerException)
-                       : base (message, innerException)
-               {
-               }
-
-               protected NoNullAllowedException (SerializationInfo info, StreamingContext context)
-                       : base (info, context)
-               {
-               }
-       }
-}
diff --git a/mcs/class/System.Data/System.Data/Node.cs b/mcs/class/System.Data/System.Data/Node.cs
deleted file mode 100644 (file)
index 4bcbffe..0000000
+++ /dev/null
@@ -1,166 +0,0 @@
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-
-namespace System.Data
-{
-       /// <summary>
-       /// Summary description for Node.
-       /// </summary>
-       internal class Node
-       {
-               protected int _iBalance;    // currently, -2 means 'deleted'
-               internal Node _nNext;       // node of next index (nNext==null || nNext.iId=iId+1)
-               protected Node _nLeft;
-               protected Node _nRight;
-               protected Node _nParent;
-
-               protected DataRow _row;
-               
-               public Node(DataRow row)
-               {
-                       _row = row;
-               }
-
-               internal int GetBalance()
-               {
-                       if (_iBalance == -2)
-                               throw new SystemException ("Node is deleted.");
-
-                       return _iBalance;
-               }
-
-               internal void Delete()
-               {
-                       _iBalance = -2;
-                       _nLeft = null;
-                       _nRight = null;
-                       _nParent = null;
-               }
-
-
-               internal DataRow Row
-               {
-                       get {
-                               return _row;
-                       }
-               }
-
-               internal Node Left
-               {
-                       get {
-                               if (_iBalance == -2)
-                                       throw new SystemException ("Node is deleted.");
-
-                               return _nLeft;
-                       }
-
-                       set {
-                               if (_iBalance == -2)
-                                       throw new SystemException ("Node is deleted.");
-
-                               _nLeft = value;
-                       }
-               }
-
-               internal Node Right
-               {
-                       get {
-                               if (_iBalance == -2)
-                                       throw new SystemException ("Node is deleted.");
-                               return _nRight;
-                       }
-
-                       set {
-                               if (_iBalance == -2)
-                                       throw new SystemException ("Node is deleted.");
-
-                               _nRight = value;
-                       }
-               }
-
-
-               internal Node Parent
-               {
-                       get {
-                               if (_iBalance == -2)
-                                       throw new SystemException ("Node is deleted.");
-
-                               return _nParent;
-                       }
-
-                       set {
-                               if (_iBalance == -2)
-                                       throw new SystemException ("Node is deleted.");
-                               _nParent = value;
-                       }
-               }
-
-               internal bool IsRoot()
-               {
-                       return _nParent == null;
-               }
-
-
-               internal void SetBalance(int b)
-               {
-
-                       if (_iBalance == -2)
-                               throw new SystemException ("Node is deleted.");
-
-                       _iBalance = b;
-               }
-
-               internal bool From()
-               {
-
-                       if (this.IsRoot()){
-                               return true;
-                       }
-
-                       if (_iBalance == -2)
-                               throw new SystemException ("Node is deleted.");
-                       Node parent = Parent;
-
-                       return Equals(parent.Left);
-               }
-
-               internal Object[] GetData()
-               {
-
-                       if (_iBalance == -2)
-                               throw new SystemException ("Node is deleted.");
-                       return _row.ItemArray;
-               }
-
-               internal bool Equals(Node n)
-               {
-
-                       if (_iBalance == -2)
-                               throw new SystemException ("Node is deleted.");
-
-                       return n == this;
-               }
-       }
-}
diff --git a/mcs/class/System.Data/System.Data/OperationAbortedException.cs b/mcs/class/System.Data/System.Data/OperationAbortedException.cs
deleted file mode 100644 (file)
index 1ed8104..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-//
-// System.Data.OperationAbortedException.cs
-//
-// Author:
-//   Tim Coleman (tim@timcoleman.com)
-//
-// Copyright (C) Tim Coleman, 2003
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System.Data {
-       [Serializable]
-       public sealed class OperationAbortedException : SystemException
-       {
-               #region Constructors
-
-               internal OperationAbortedException ()
-                       : base (Locale.GetText ("An OperationAbortedException has occurred."))
-               {
-               }
-
-               internal OperationAbortedException (string s)
-                       : base (s)
-               {
-               }
-
-               internal OperationAbortedException (string s, Exception innerException)
-                       : base (s, innerException)
-               {
-               }
-
-               internal OperationAbortedException (SerializationInfo info, StreamingContext context)
-                       : base (info, context)
-               {
-               }
-
-               #endregion // Constructors
-       }
-}
-
diff --git a/mcs/class/System.Data/System.Data/ParameterDirection.cs b/mcs/class/System.Data/System.Data/ParameterDirection.cs
deleted file mode 100644 (file)
index 36410f1..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-//
-// System.Data.ParameterDirection.cs
-//
-// Author:
-//   Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace System.Data
-{
-       /// <summary>
-       /// Specifies the type of a parameter within a query relative to the DataSet.
-       /// </summary>
-       public enum ParameterDirection
-       {
-               Input = 1,
-               Output = 2,
-               InputOutput = 3,
-               ReturnValue = 6
-       }
-}
\ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/PropertyAttributes.cs b/mcs/class/System.Data/System.Data/PropertyAttributes.cs
deleted file mode 100644 (file)
index df03689..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-//
-// System.Data.PropertyAttributes.cs
-//
-// Author:
-//   Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace System.Data
-{
-       /// <summary>
-       /// Specifies the attributes of a property.
-       /// This enumeration has a FlagsAttribute that allows a bitwise combination of its member values
-       /// </summary>
-       [Flags]
-       [Obsolete]
-       [ComponentModel.EditorBrowsable (ComponentModel.EditorBrowsableState.Never)]
-       public enum PropertyAttributes
-       {
-               NotSupported = 0,
-               Required = 1,
-               Optional = 2,
-               Read = 512,
-               Write = 1024
-       }
-}
\ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/PropertyCollection.cs b/mcs/class/System.Data/System.Data/PropertyCollection.cs
deleted file mode 100644 (file)
index d70040d..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-//
-// System.Data.PropertyCollection.cs
-//
-// Author:
-//    Daniel Morgan <danmorg@sc.rr.com>
-//
-// (c) Ximian, Inc. 2002
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections;
-using System.ComponentModel;
-
-namespace System.Data
-{
-       /// <summary>
-       /// a collection of properties that can be added to 
-       /// DataColumn, DataSet, or DataTable.
-       /// The ExtendedProperties property of a 
-       /// DataColumn, DataSet, or DataTable class can
-       /// retrieve a PropertyCollection.
-       /// </summary>
-       [Serializable]
-       public class PropertyCollection : Hashtable {
-               public PropertyCollection() 
-               {
-               }
-
-               protected PropertyCollection(System.Runtime.Serialization.SerializationInfo info,
-                                            System.Runtime.Serialization.StreamingContext context)
-                       : base (info, context)
-               {
-               }
-
-               // the only public methods and properties 
-               // are all inherited from Hashtable
-       }
-}
diff --git a/mcs/class/System.Data/System.Data/ReadOnlyException.cs b/mcs/class/System.Data/System.Data/ReadOnlyException.cs
deleted file mode 100644 (file)
index 17bd57b..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// System.Data.ReadOnlyException.cs
-//
-// Author: Duncan Mak  (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System.Data
-{
-       [Serializable]
-       public class ReadOnlyException : DataException
-       {
-               public ReadOnlyException ()
-                       : base (Locale.GetText ("Cannot change a value in a read-only column"))
-               {
-               }
-
-               public ReadOnlyException (string s)
-                       : base (s)
-               {
-               }
-
-               public ReadOnlyException (string message, Exception innerException)
-                       : base (message, innerException)
-               {
-               }
-
-               protected ReadOnlyException (SerializationInfo info, StreamingContext context)
-                       : base (info, context)
-               {
-               }
-       }
-}
diff --git a/mcs/class/System.Data/System.Data/RelatedDataView.cs b/mcs/class/System.Data/System.Data/RelatedDataView.cs
deleted file mode 100644 (file)
index f96243b..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-//\r
-// System.Data.RelatedDataView\r
-//\r
-// Author:\r
-//   Konstantin Triger (kostat@mainsoft.com)\r
-//\r
-\r
-using System;\r
-using System.Collections;\r
-using Mono.Data.SqlExpressions;\r
-using System.Data.Common;\r
-\r
-namespace System.Data\r
-{\r
-       /// <summary>\r
-       /// Summary description for RelatedDataView.\r
-       /// </summary>\r
-       internal class RelatedDataView : DataView, IExpression\r
-       {\r
-               #region Fields\r
-               \r
-               object[] _keyValues;\r
-               DataColumn[] _columns;\r
-\r
-               #endregion // Fields\r
-\r
-               #region Constructors\r
-               internal RelatedDataView(DataColumn[] relatedColumns,object[] keyValues)\r
-               {\r
-                       dataTable = relatedColumns[0].Table;\r
-                       rowState = DataViewRowState.CurrentRows;\r
-                       _columns = relatedColumns;\r
-                       _keyValues = keyValues;\r
-\r
-                       Open();\r
-               }\r
-\r
-               #endregion // Constructors\r
-\r
-               #region Methods\r
-\r
-               internal override IExpression FilterExpression {\r
-                       get {\r
-                               return this;\r
-                       }\r
-               }\r
-\r
-\r
-               #endregion // Methods\r
-\r
-               public override bool Equals(object obj)\r
-               {\r
-                       if (!(obj is RelatedDataView)) {\r
-                               if (base.FilterExpression == null)\r
-                                       return false;\r
-                               return base.FilterExpression.Equals (obj);\r
-                       }\r
-\r
-                       RelatedDataView other = (RelatedDataView) obj;\r
-                       if (_columns.Length != other._columns.Length)\r
-                               return false;\r
-            \r
-                       for (int i = 0; i < _columns.Length; i++)\r
-                               if (!_columns[i].Equals(other._columns [i]) ||\r
-                    !_keyValues[i].Equals(other._keyValues [i]))\r
-                                       return false;\r
-                       \r
-                       if (!other.FilterExpression.Equals (base.FilterExpression))\r
-                               return false;\r
-\r
-                       return true;\r
-               }\r
-\r
-               public override int GetHashCode()\r
-               {\r
-                       int hashCode = 0;\r
-                       for (int i = 0; i < _columns.Length; i++) {\r
-                               hashCode ^= _columns [i].GetHashCode ();\r
-                               hashCode ^= _keyValues [i].GetHashCode ();\r
-                       }\r
-\r
-                       if (base.FilterExpression != null)\r
-                               hashCode ^= base.FilterExpression.GetHashCode ();\r
-\r
-                       return hashCode;\r
-               }\r
-\r
-               #region IExpression Members\r
-\r
-               public object Eval(DataRow row) {\r
-                       return EvalBoolean(row);\r
-               }\r
-\r
-               public bool EvalBoolean(DataRow row) {\r
-                       for (int i = 0; i < _columns.Length; i++)\r
-                               if (!row[_columns[i]].Equals(_keyValues[i]))\r
-                                       return false;\r
-\r
-                       IExpression filter = base.FilterExpression;\r
-                       return filter != null ? filter.EvalBoolean(row) : true;\r
-               }\r
-\r
-               public bool DependsOn(DataColumn other) {\r
-                       for (int i = 0; i < _columns.Length; i++)\r
-                               if (_columns[i] == other)\r
-                                       return true;\r
-\r
-                       IExpression filter = base.FilterExpression;\r
-                       return filter != null ? filter.DependsOn(other) : false;\r
-               }\r
-               \r
-               void IExpression.ResetExpression()\r
-               {\r
-               }\r
-\r
-               #endregion\r
-       }\r
-}\r
diff --git a/mcs/class/System.Data/System.Data/RelationshipConverter.cs b/mcs/class/System.Data/System.Data/RelationshipConverter.cs
deleted file mode 100644 (file)
index e9e8a4d..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-//
-// System.Data.RelationshipConverter.cs
-//
-// Author:
-//   Umadevi S (sumadevi@novell.com)
-//
-// Copyright (C) Novell Inc, 2004
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.ComponentModel;
-using System.Globalization;
-
-namespace System.Data {
-       internal sealed class RelationshipConverter : ExpandableObjectConverter
-       {
-               #region Constructors
-
-               [MonoTODO]
-               public RelationshipConverter ()
-               {
-                       throw new NotImplementedException ();
-               }
-
-               #endregion // Constructors
-
-               #region Methods
-       
-               [MonoTODO]
-               public override object ConvertTo (ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               public override bool CanConvertTo (ITypeDescriptorContext context, Type destinationType)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               #endregion // Methods
-       }
-}
diff --git a/mcs/class/System.Data/System.Data/ResDescriptionAttribute.cs b/mcs/class/System.Data/System.Data/ResDescriptionAttribute.cs
deleted file mode 100644 (file)
index f25ce5c..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-// 
-// System.Data/ResDescriptionAttribute.cs
-//
-// Author:
-//   Tim Coleman (tim@timcoleman.com)
-//
-// Copyright (C) Tim Coleman, 2002
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.ComponentModel;
-
-namespace System.Data {
-       [AttributeUsage (AttributeTargets.All)]
-       internal sealed class ResDescriptionAttribute : DescriptionAttribute
-       {
-               #region Fields
-
-               string description;
-
-               #endregion // Fields
-
-               #region Constructors
-
-               public ResDescriptionAttribute (string description)
-                       : base (description)
-               {
-                       this.description = description; 
-               }
-
-               #endregion // Constructors
-
-               #region Properties
-
-               public override string Description {
-                       get { return description; }
-               }
-
-               #endregion // Properties
-       }
-}
diff --git a/mcs/class/System.Data/System.Data/ResultSetOptions.cs b/mcs/class/System.Data/System.Data/ResultSetOptions.cs
deleted file mode 100644 (file)
index 543322f..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-//
-// System.Data.ResultSetOptions.cs
-//
-// Author:
-//   Tim Coleman (tim@timcoleman.com)
-//
-// Copyright (C) Tim Coleman, 2003
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-namespace System.Data {
-       public enum ResultSetOptions 
-       {
-               None,
-               Updatable,
-               Scrollable,
-               Sensitive,
-               Insensitive
-       }
-}
-
diff --git a/mcs/class/System.Data/System.Data/ResultSetSensitivity.cs b/mcs/class/System.Data/System.Data/ResultSetSensitivity.cs
deleted file mode 100644 (file)
index 37323ef..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-//
-// System.Data.ResultSetSensitivity.cs
-//
-// Author:
-//   Tim Coleman (tim@timcoleman.com)
-//
-// Copyright (C) Tim Coleman, 2003
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-namespace System.Data {
-       public enum ResultSetSensitivity 
-       {
-               Asensitive,
-               Insensitive,
-               Sensitive
-       }
-}
-
diff --git a/mcs/class/System.Data/System.Data/RowNotInTableException.cs b/mcs/class/System.Data/System.Data/RowNotInTableException.cs
deleted file mode 100644 (file)
index 7902a4d..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// System.Data.RowNotInTableException.cs
-//
-// Author: Duncan Mak  (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System.Data
-{
-       [Serializable]
-       public class RowNotInTableException : DataException
-       {
-               public RowNotInTableException ()
-                       : base (Locale.GetText ("This DataRow is not in this DataTable"))
-               {
-               }
-
-               public RowNotInTableException (string s)
-                       : base (s)
-               {
-               }
-
-               public RowNotInTableException (string message, Exception innerException)
-                       : base (message, innerException)
-               {
-               }
-
-               protected RowNotInTableException (SerializationInfo info, StreamingContext context)
-                       : base (info, context)
-               {
-               }
-       }
-}
diff --git a/mcs/class/System.Data/System.Data/Rule.cs b/mcs/class/System.Data/System.Data/Rule.cs
deleted file mode 100644 (file)
index 4fd6f7d..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-//
-// System.Data.Rule.cs
-//
-// Author:
-//   Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace System.Data
-{
-       /// <summary>
-       /// Indicates the action that occurs when a ForeignKeyConstraint is enforced.
-       /// </summary>
-       public enum Rule
-       {
-               None = 0,
-               Cascade = 1,
-               SetNull = 2,
-               SetDefault = 3
-       }
-}
\ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/SchemaSerializationMode.cs b/mcs/class/System.Data/System.Data/SchemaSerializationMode.cs
deleted file mode 100644 (file)
index fb48a8b..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-//
-// System.Data.SchemaSerializationMode.cs
-//
-// Author:
-//   Senganal T (tsenganal@novell.com)
-//
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System.Data {
-
-       public enum SchemaSerializationMode 
-       {
-               IncludeSchema = 1,
-               ExcludeSchema = 2
-       }
-}
diff --git a/mcs/class/System.Data/System.Data/SchemaType.cs b/mcs/class/System.Data/System.Data/SchemaType.cs
deleted file mode 100644 (file)
index e787a52..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-//
-// System.Data.SchemaType.cs
-//
-// Author:
-//   Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace System.Data
-{
-       /// <summary>
-       /// Specifies how to handle existing schema mappings when performing a FillSchema operation.
-       /// </summary>
-       public enum SchemaType
-       {
-               Source = 1,
-               Mapped = 2
-       }
-}
\ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/SerializationFormat.cs b/mcs/class/System.Data/System.Data/SerializationFormat.cs
deleted file mode 100644 (file)
index 40ce830..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-// System.Data.DataColumnChangeEventHandler.cs
-//
-// Author:
-//   Senganal T <tsenganal@novell.com>
-//
-//
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-// Copyright (C) Authors.
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-
-namespace System.Data {
-       public enum SerializationFormat 
-       {
-               Xml,
-               Binary
-       }
-}
diff --git a/mcs/class/System.Data/System.Data/SqlDbType.cs b/mcs/class/System.Data/System.Data/SqlDbType.cs
deleted file mode 100644 (file)
index ce6069e..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-//
-// System.Data.SqlDbType.cs
-//
-// Author:
-//   Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace System.Data
-{
-       /// <summary>
-       /// Specifies SQL Server data types.
-       /// </summary>
-       public enum SqlDbType
-       {
-               BigInt = 0,
-               Binary = 1,
-               Bit = 2,
-               Char = 3,
-               DateTime = 4,
-               Decimal = 5,
-               Float = 6,
-               Image = 7,
-               Int = 8,
-               Money = 9,
-               NChar = 10,
-               NText = 11,
-               NVarChar = 12,
-               Real = 13,
-               UniqueIdentifier = 14,
-               SmallDateTime = 15,
-               SmallInt = 16,
-               SmallMoney = 17,
-               Text = 18,
-               Timestamp = 19,
-               TinyInt = 20,
-               VarBinary = 21,
-               VarChar = 22,
-               Variant = 23,
-               Xml = 25,
-               Udt = 29,
-               Structured = 30,
-               Date = 31,
-               Time = 32,
-               DateTime2 = 33,
-               DateTimeOffset = 34
-       }
-}
diff --git a/mcs/class/System.Data/System.Data/StateChangeEventArgs.cs b/mcs/class/System.Data/System.Data/StateChangeEventArgs.cs
deleted file mode 100644 (file)
index 6fb1ddb..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-//
-// System.Data.StateChangeEventArgs.cs
-//
-// Author:
-//   Rodrigo Moya (rodrigo@ximian.com)
-//   Daniel Morgan (danmorg@sc.rr.com)
-//   Tim Coleman (tim@timcoleman.com)
-//
-// (C) Ximian, Inc 2002
-// Copyright (C) Tim Coleman, 2002
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace System.Data {
-       public sealed class StateChangeEventArgs : EventArgs 
-       {
-               #region Fields
-
-               ConnectionState originalState;
-               ConnectionState currentState;
-
-               #endregion // Fields
-
-               #region Constructors
-
-               public StateChangeEventArgs (ConnectionState originalState, ConnectionState currentState)
-               {
-                       this.originalState = originalState;
-                       this.currentState = currentState;
-               }
-
-               #endregion // Constructors
-
-               #region Properties
-
-               public ConnectionState CurrentState {
-                       get { return currentState; }
-               }
-
-               public ConnectionState OriginalState {
-                       get { return originalState; }
-               }
-
-               #endregion // Properties
-       }
-}
diff --git a/mcs/class/System.Data/System.Data/StateChangeEventHandler.cs b/mcs/class/System.Data/System.Data/StateChangeEventHandler.cs
deleted file mode 100644 (file)
index 958030b..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-//
-// System.Data.StateChangeEventHandler.cs
-//
-// Author:
-//   Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System.Data
-{
-       /// <summary>
-       /// Represents the method that will handle the StateChange event.
-       /// </summary>
-       public delegate void StateChangeEventHandler(object sender, StateChangeEventArgs e);
-
-}
\ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/StatementCompletedEventArgs.cs b/mcs/class/System.Data/System.Data/StatementCompletedEventArgs.cs
deleted file mode 100644 (file)
index 95809b4..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-//
-// System.Data.StatementCompletedEventArgs.cs
-//
-// Author:
-//   Tim Coleman (tim@timcoleman.com)
-//
-// Copyright (C) Tim Coleman, 2003
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-namespace System.Data {
-       public sealed class StatementCompletedEventArgs : EventArgs
-       {
-               #region Fields
-
-               int recordCount;
-
-               #endregion // Fields
-
-               #region Constructors
-
-               public StatementCompletedEventArgs (int recordCount)
-               {
-                       this.recordCount = recordCount;
-               }
-
-               #endregion // Constructors
-
-               #region Properties
-
-               public int RecordCount {
-                       get { return recordCount; }
-               }
-
-               #endregion // Properties
-       }
-}
-
diff --git a/mcs/class/System.Data/System.Data/StatementCompletedEventHandler.cs b/mcs/class/System.Data/System.Data/StatementCompletedEventHandler.cs
deleted file mode 100644 (file)
index 0f2f298..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-//
-// System.Data.StatementCompletedEventHandler.cs
-//
-// Author:
-//   Tim Coleman (tim@timcoleman.com)
-//
-// Copyright (C) Tim Coleman, 2003
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-namespace System.Data {
-       public delegate void StatementCompletedEventHandler (object sender, StatementCompletedEventArgs e);
-}
-
diff --git a/mcs/class/System.Data/System.Data/StatementType.cs b/mcs/class/System.Data/System.Data/StatementType.cs
deleted file mode 100644 (file)
index 0c67d82..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-//
-// System.Data.StatementType.cs
-//
-// Author:
-//   Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace System.Data
-{
-       /// <summary>
-       /// Specifies the type of SQL query to be used by the OleDbRowUpdatedEventArgs, OleDbRowUpdatingEventArgs, SqlRowUpdatedEventArgs, or SqlRowUpdatingEventArgs class.
-       /// </summary>
-       public enum StatementType
-       {
-               Select = 0,
-               Insert = 1,
-               Update = 2,
-               Batch = 4,
-               Delete = 3
-       }
-}
diff --git a/mcs/class/System.Data/System.Data/StrongTypingException.cs b/mcs/class/System.Data/System.Data/StrongTypingException.cs
deleted file mode 100644 (file)
index 2544f38..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-//
-// System.Data.StrongTypingException.cs
-//
-// Author: Duncan Mak  (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System.Data
-{
-       [Serializable]
-       public class StrongTypingException : DataException
-       {
-               public StrongTypingException ()
-                       : base (Locale.GetText ("Trying to access a DBNull value in a strongly-typed DataSet"))
-               {
-               }
-
-               public StrongTypingException (string message) : base (message)
-               {
-               }
-
-               public StrongTypingException (string s, Exception innerException)
-                       : base (s, innerException)
-               {
-               }
-
-               protected StrongTypingException (SerializationInfo info, StreamingContext context)
-                       : base (info, context)
-               {
-               }
-       }
-}
diff --git a/mcs/class/System.Data/System.Data/SyntaxErrorException.cs b/mcs/class/System.Data/System.Data/SyntaxErrorException.cs
deleted file mode 100644 (file)
index 3d7b623..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// System.Data.SyntaxErrorException.cs
-//
-// Author: Duncan Mak  (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System.Data
-{
-       [Serializable]
-       public class SyntaxErrorException : InvalidExpressionException
-       {
-               public SyntaxErrorException ()
-                       : base (Locale.GetText ("There is a syntax error in this Expression"))
-               {
-               }
-
-               public SyntaxErrorException (string s)
-                       : base (s)
-               {
-               }
-
-               protected SyntaxErrorException (SerializationInfo info, StreamingContext context)
-                       : base (info, context)
-               {
-               }
-
-               public SyntaxErrorException (String message, Exception innerException)
-                       : base (message, innerException)
-               {
-               }
-       }
-}
diff --git a/mcs/class/System.Data/System.Data/TableAdapterSchemaInfo.cs b/mcs/class/System.Data/System.Data/TableAdapterSchemaInfo.cs
deleted file mode 100644 (file)
index 611a436..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-//
-// TableAdapterSchemaInfo.cs
-//
-// Author:
-//     Veerapuram Varadhan (vvaradhan@novell.com)
-//
-// Copyright (C) 2009 Novell, Inc.
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections;
-using System.Data;
-using System.Data.Common;
-
-namespace System.Data
-{
-       internal enum GenerateMethodsType {
-               None,
-               Get,
-               Fill,
-               Both
-       }
-       
-       internal enum QueryType {
-               NoData,
-               Rowset,
-               Scalar
-       }
-       
-       internal class DbSourceMethodInfo
-       {
-               public GenerateMethodsType MethodType;
-               public string Name;
-               public string Modifier;
-               public string QueryType;
-               public string ScalarCallRetval;
-       }
-       
-       internal class DbCommandInfo
-       {
-               public DbCommand Command;
-               public DbSourceMethodInfo[] Methods;
-       }
-       
-       internal class TableAdapterSchemaInfo
-       {
-               public TableAdapterSchemaInfo (DbProviderFactory provider) {
-                       this.Provider = provider;
-                       this.Adapter = provider.CreateDataAdapter ();
-                       this.Connection = provider.CreateConnection ();
-                       this.Commands = new ArrayList ();
-                       this.ShortCommands = false;
-               }
-               
-               public TableAdapterSchemaInfo ()
-               {
-                       this.Commands = new ArrayList ();
-                       this.ShortCommands = false;
-               }
-
-               public DbProviderFactory Provider;
-               public DbDataAdapter Adapter;
-               public DbConnection Connection;
-               public string ConnectionString;
-               public string BaseClass;
-               public string Name;
-               public bool ShortCommands;
-               // List of DbCommandInfo objects
-               public ArrayList Commands;
-       }
-}
diff --git a/mcs/class/System.Data/System.Data/TypeDataSetGeneratorException.cs b/mcs/class/System.Data/System.Data/TypeDataSetGeneratorException.cs
deleted file mode 100644 (file)
index 67ce390..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-//
-// System.Data.TypedDataSetGeneratorException.cs
-//
-// Author: Duncan Mak  (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections;
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System.Data
-{
-       [Serializable]
-       public class TypedDataSetGeneratorException : DataException
-       {
-               readonly ArrayList errorList;
-
-               #region Constructors
-
-               public TypedDataSetGeneratorException ()
-                       : base (Locale.GetText ("System error."))
-               {
-               }
-
-               public TypedDataSetGeneratorException (ArrayList list)
-                       : base (Locale.GetText ("System error."))
-               {
-                       errorList = list;
-               }
-
-               protected TypedDataSetGeneratorException (SerializationInfo info, StreamingContext context)
-                       : base (info, context)
-               {
-                       int count = info.GetInt32 ("KEY_ARRAYCOUNT");
-                       errorList = new ArrayList (count);
-
-                       for (int i=0; i < count; i++)
-                               errorList.Add (info.GetString("KEY_ARRAYVALUES" + i));
-               }
-
-               public TypedDataSetGeneratorException (String message) : base (message)
-               {
-               }
-               
-               public TypedDataSetGeneratorException (String message, Exception innerException)
-                       : base (message, innerException)
-               {
-               }
-               #endregion //Constructors
-
-               public ArrayList ErrorList {
-                       get { return errorList; }
-               }
-
-               #region Methods
-
-               public override void GetObjectData (SerializationInfo info, StreamingContext context)
-               {
-                       base.GetObjectData (info, context);
-
-                       int count = (errorList != null) ? ErrorList.Count : 0;
-                       info.AddValue ("KEY_ARRAYCOUNT", count);
-
-                       for (int i=0; i < count; i++)
-                               info.AddValue ("KEY_ARRAYVALUES" + i, ErrorList [i]);
-               }
-
-               #endregion // Methods
-       }
-}
diff --git a/mcs/class/System.Data/System.Data/TypedDataSetGenerator.cs b/mcs/class/System.Data/System.Data/TypedDataSetGenerator.cs
deleted file mode 100644 (file)
index 39c9951..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-//
-// TypedDataSetGenerator.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// (C)2004 Novell Inc.
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.CodeDom;
-using System.CodeDom.Compiler;
-using System.Collections;
-using System.Data;
-using System.Text;
-
-namespace System.Data
-{
-       [Obsolete ("TypedDataSetGenerator class will be removed in a future release. Please use System.Data.Design.TypedDataSetGenerator in System.Design.dll.")]
-       public class TypedDataSetGenerator
-       {
-               public TypedDataSetGenerator ()
-               {
-               }
-
-               public static void Generate (DataSet dataSet,
-                       CodeNamespace codeNamespace,
-                       ICodeGenerator codeGen)
-               {
-                       // See CustomDataclassGenerator.cs
-                       CustomDataClassGenerator.CreateDataSetClasses (
-                               dataSet, codeNamespace, codeGen, null);
-               }
-
-               public static string GenerateIdName (string name, ICodeGenerator codeGen)
-               {
-                       return CustomDataClassGenerator.MakeSafeName (name, codeGen);
-               }
-       }
-}
diff --git a/mcs/class/System.Data/System.Data/UniqueConstraint.cs b/mcs/class/System.Data/System.Data/UniqueConstraint.cs
deleted file mode 100644 (file)
index f1c2c0a..0000000
+++ /dev/null
@@ -1,514 +0,0 @@
-//
-// System.Data.UniqueConstraint.cs
-//
-// Author:
-//   Franklin Wise <gracenote@earthlink.net>
-//   Daniel Morgan <danmorg@sc.rr.com>
-//   Tim Coleman (tim@timcoleman.com)
-//   
-// (C) 2002 Franklin Wise
-// (C) 2002 Daniel Morgan
-// Copyright (C) Tim Coleman, 2002
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections;
-using System.ComponentModel;
-using System.Runtime.InteropServices;
-using System.Data.Common;
-
-namespace System.Data {
-       [Editor ("Microsoft.VSDesigner.Data.Design.UniqueConstraintEditor, " + Consts.AssemblyMicrosoft_VSDesigner,
-                "System.Drawing.Design.UITypeEditor, " + Consts.AssemblySystem_Drawing)]
-       [DefaultProperty ("ConstraintName")]
-       public class UniqueConstraint : Constraint 
-       {
-               private bool _isPrimaryKey = false;
-               private bool _belongsToCollection = false;
-               private DataTable _dataTable; //set by ctor except when unique case
-               
-               //FIXME: create a class which will wrap this collection
-               private DataColumn [] _dataColumns;
-
-               //TODO:provide helpers for this case
-               private string [] _dataColumnNames; //unique case
-               private ForeignKeyConstraint _childConstraint = null;
-
-               #region Constructors
-
-               public UniqueConstraint (DataColumn column) 
-               {
-                       _uniqueConstraint ("", column, false);
-               }
-
-               public UniqueConstraint (DataColumn[] columns) 
-               {
-                       _uniqueConstraint ("", columns, false);
-               }
-
-               public UniqueConstraint (DataColumn column, bool isPrimaryKey) 
-               {
-                       _uniqueConstraint ("", column, isPrimaryKey);
-               }
-
-               public UniqueConstraint (DataColumn[] columns, bool isPrimaryKey) 
-               {
-                       _uniqueConstraint ("", columns, isPrimaryKey);
-               }
-
-               public UniqueConstraint (string name, DataColumn column) 
-               {
-                       _uniqueConstraint (name, column, false);
-               }
-
-               public UniqueConstraint (string name, DataColumn[] columns) 
-               {
-                       _uniqueConstraint (name, columns, false);
-               }
-
-               public UniqueConstraint (string name, DataColumn column, bool isPrimaryKey) 
-               {
-                       _uniqueConstraint (name, column, isPrimaryKey);
-               }
-
-               public UniqueConstraint (string name, DataColumn[] columns, bool isPrimaryKey) 
-               {
-                       _uniqueConstraint (name, columns, isPrimaryKey);
-               }
-
-               //Special case.  Can only be added to the Collection with AddRange
-               [Browsable (false)]
-               public UniqueConstraint (string name, string[] columnNames, bool isPrimaryKey) 
-               {
-                       InitInProgress = true;
-                   
-                       _dataColumnNames = new string [columnNames.Length];
-                       for (int i = 0; i < columnNames.Length; i++)
-                               _dataColumnNames[i] = columnNames[i];
-                       
-                       base.ConstraintName = name;
-                       _isPrimaryKey = isPrimaryKey;
-               }
-
-               //helper ctor
-               private void _uniqueConstraint(string name, DataColumn column, bool isPrimaryKey) 
-               {
-                       //validate
-                       _validateColumn (column);
-
-                       //Set Constraint Name
-                       base.ConstraintName = name;
-
-                       _isPrimaryKey = isPrimaryKey;
-
-                       //keep reference 
-                       _dataColumns = new DataColumn [] {column};
-                       
-                       //Get table reference
-                       _dataTable = column.Table;                      
-               }
-
-               //helpter ctor  
-               private void _uniqueConstraint(string name, DataColumn[] columns, bool isPrimaryKey) 
-               {
-                       //validate
-                       _validateColumns (columns, out _dataTable);
-
-                       //Set Constraint Name
-                       base.ConstraintName = name;
-
-                       //copy the columns - Do not keep reference #672113
-                       //_dataColumns = columns;
-                       Columns = columns;
-
-                       //PK?
-                       _isPrimaryKey = isPrimaryKey;                   
-               }
-               
-               #endregion // Constructors
-
-               #region Helpers
-               
-               private void _validateColumns(DataColumn [] columns)
-               {
-                       DataTable table;
-                       _validateColumns(columns, out table);
-               }
-               
-               //Validates a collection of columns with the ctor rules
-               private void _validateColumns(DataColumn [] columns, out DataTable table) {
-                       table = null;
-
-                       //not null
-                       if (null == columns) throw new ArgumentNullException();
-                       
-                       //check that there is at least one column
-                       //LAMESPEC: not in spec
-                       if (columns.Length < 1)
-                               throw new InvalidConstraintException("Must be at least one column.");
-                       
-                       DataTable compareTable = columns[0].Table;
-                       //foreach
-                       foreach (DataColumn col in columns){
-                               
-                               //check individual column rules
-                               _validateColumn (col);
-                               
-                               
-                               //check that columns are all from the same table??
-                               //LAMESPEC: not in spec
-                               if (compareTable != col.Table)
-                                       throw new InvalidConstraintException("Columns must be from the same table.");
-                               
-                       }
-
-                       table = compareTable;
-               }
-               
-               //validates a column with the ctor rules
-               private void _validateColumn(DataColumn column) {
-       
-                       //not null
-                       if (null == column)  // FIXME: This is little weird, but here it goes...
-                               throw new NullReferenceException("Object reference not set to an instance of an object.");
-
-                       
-                       //column must belong to a table
-                       //LAMESPEC: not in spec
-                       if (null == column.Table)
-                               throw new ArgumentException ("Column must belong to a table.");                 
-               }
-
-               internal static void SetAsPrimaryKey(ConstraintCollection collection, UniqueConstraint newPrimaryKey)
-               {
-                       //not null
-                       if (null == collection) throw new ArgumentNullException("ConstraintCollection can't be null.");
-                       
-                       //make sure newPrimaryKey belongs to the collection parm unless it is null
-                       if (  collection.IndexOf(newPrimaryKey) < 0 && (null != newPrimaryKey) ) 
-                               throw new ArgumentException("newPrimaryKey must belong to collection.");
-                       
-                       //Get existing pk
-                       UniqueConstraint uc = GetPrimaryKeyConstraint(collection);
-                       
-                       //clear existing
-                       if (null != uc) uc._isPrimaryKey = false;
-
-                       //set new key
-                       if (null != newPrimaryKey) newPrimaryKey._isPrimaryKey = true;
-                       
-                       
-               }
-
-               internal static UniqueConstraint GetPrimaryKeyConstraint(ConstraintCollection collection)
-               {
-                       if (null == collection) throw new ArgumentNullException("Collection can't be null.");
-
-                       UniqueConstraint uc;
-                       IEnumerator enumer = collection.GetEnumerator();
-                       while (enumer.MoveNext())
-                       {
-                               uc = enumer.Current as UniqueConstraint;
-                               if (null == uc) continue;
-                               
-                               if (uc.IsPrimaryKey) return uc; 
-                       }
-
-                       //if we got here there was no pk
-                       return null;
-                       
-               }
-
-               internal static UniqueConstraint GetUniqueConstraintForColumnSet(ConstraintCollection collection,
-                               DataColumn[] columns)
-               {
-                       if (null == collection) throw new ArgumentNullException("Collection can't be null.");
-                       if (null == columns ) return null;
-                       
-                       foreach(Constraint constraint in collection) {
-                               if (constraint is UniqueConstraint) {
-                                       UniqueConstraint uc = constraint as UniqueConstraint;
-                                       if ( DataColumn.AreColumnSetsTheSame(uc.Columns, columns) ) {
-                                               return uc;
-                                       }
-                               }
-                       }
-                       return null;
-               }
-
-               internal ForeignKeyConstraint ChildConstraint {
-                       get { return _childConstraint; }
-                       set { _childConstraint = value; }
-               }
-
-               // Helper Special Ctor
-               // Set the _dataTable property to the table to which this instance is bound when AddRange()
-               // is called with the special constructor.
-               // Validate whether the named columns exist in the _dataTable
-               internal override void FinishInit (DataTable _setTable) 
-               {                
-                       _dataTable = _setTable;
-                       if (_isPrimaryKey == true && _setTable.PrimaryKey.Length != 0)
-                               throw new ArgumentException ("Cannot add primary key constraint since primary key" +
-                                               "is already set for the table");
-
-                       DataColumn[] cols = new DataColumn [_dataColumnNames.Length];
-                       int i = 0;
-
-                       foreach (string _columnName in _dataColumnNames) {
-                               if (_setTable.Columns.Contains (_columnName)) {
-                                       cols [i] = _setTable.Columns [_columnName];
-                                       i++;
-                                       continue;
-                               }
-                               throw(new InvalidConstraintException ("The named columns must exist in the table"));
-                       }
-                       _dataColumns = cols;
-                       _validateColumns (cols);
-                       InitInProgress = false;
-               }
-
-
-               #endregion //Helpers
-
-               #region Properties
-
-               [DataCategory ("Data")]
-               [ReadOnly (true)]
-               public virtual DataColumn[] Columns {
-                       get { return _dataColumns; }
-                       internal set {
-                              _dataColumns = new DataColumn [value.Length];
-                              for (int i = 0; i < value.Length; i++)
-                                      _dataColumns[i] = value[i];                             
-                       }
-               }
-
-               [DataCategory ("Data")]
-               public bool IsPrimaryKey {
-                       get { 
-                               if (Table == null || (!_belongsToCollection)) {
-                                       return false;
-                               }
-                               return _isPrimaryKey; 
-                       }
-               }
-
-               [DataCategory ("Data")]
-               [ReadOnly (true)]
-               public override DataTable Table {
-                       get { return _dataTable; }
-               }
-
-               #endregion // Properties
-
-               #region Methods
-
-               internal void SetIsPrimaryKey (bool value)
-               {
-                       _isPrimaryKey = value;
-               }
-
-               public override bool Equals(object key2) {
-
-                       UniqueConstraint cst = key2 as UniqueConstraint;
-                       if (null == cst) return false;
-
-                       //according to spec if the cols are equal
-                       //then two UniqueConstraints are equal
-                       return DataColumn.AreColumnSetsTheSame(cst.Columns, this.Columns);      
-
-               }
-
-               public override int GetHashCode() 
-               {
-                       //initialize hash with default value 
-                       int hash = 42;
-                       int i;
-
-                       //derive the hash code from the columns that way
-                       //Equals and GetHashCode return Equal objects to be the
-                       //same
-
-                       //Get the first column hash
-                       if (this.Columns.Length > 0)
-                               hash ^= this.Columns[0].GetHashCode();
-                       
-                       //get the rest of the column hashes if there any
-                       for (i = 1; i < this.Columns.Length; i++)
-                       {
-                               hash ^= this.Columns[1].GetHashCode();
-                               
-                       }
-                       
-                       return hash ;
-               }
-               
-               internal override void AddToConstraintCollectionSetup(
-                               ConstraintCollection collection)
-               {
-                       for (int i = 0; i < Columns.Length; i++)
-                               if (Columns[i].Table != collection.Table)
-                                       throw new ArgumentException("These columns don't point to this table.");
-                       //run Ctor rules again
-                       _validateColumns(_dataColumns);
-                       
-                       //make sure a unique constraint doesn't already exists for these columns
-                       UniqueConstraint uc = UniqueConstraint.GetUniqueConstraintForColumnSet(collection, this.Columns);       
-                       if (null != uc) throw new ArgumentException("Unique constraint already exists for these" +
-                                       " columns. Existing ConstraintName is " + uc.ConstraintName);
-
-                       //Allow only one primary key
-                       if (this.IsPrimaryKey) {
-                               uc = GetPrimaryKeyConstraint(collection);
-                               if (null != uc) uc._isPrimaryKey = false;
-                       }
-
-                       // if constraint is based on one column only
-                       // this column becomes unique
-                       if (_dataColumns.Length == 1) {
-                               _dataColumns[0].SetUnique();
-                       }
-                                       
-                       if (IsConstraintViolated())
-                               throw new ArgumentException("These columns don't currently have unique values.");
-
-                       _belongsToCollection = true;
-               }
-                                       
-               
-               internal override void RemoveFromConstraintCollectionCleanup( 
-                               ConstraintCollection collection)
-               {
-                       if (Columns.Length == 1)
-                               Columns [0].Unique = false;
-
-                       _belongsToCollection = false;
-                       Index = null;
-               }
-
-               internal override bool IsConstraintViolated()
-               {       
-                       if (Index == null) {
-                               Index = Table.GetIndex(Columns,null,DataViewRowState.None,null,false);
-                       }
-
-                       if (Index.HasDuplicates) {
-                               int[] dups = Index.Duplicates;
-                               for (int i = 0; i < dups.Length; i++){
-                                       DataRow row = Table.RecordCache[dups[i]];
-                                       ArrayList columns = new ArrayList();
-                                       ArrayList values = new ArrayList();
-                                       foreach (DataColumn col in Columns){
-                                               columns.Add(col.ColumnName);
-                                               values.Add(row[col].ToString());
-                                       }
-
-                                       string columnNames = String.Join(", ", (string[])columns.ToArray(typeof(string)));
-                                       string columnValues = String.Join(", ", (string[])values.ToArray(typeof(string)));
-
-                                       row.RowError = String.Format("Column '{0}' is constrained to be unique.  Value '{1}' is already present.", columnNames, columnValues);
-                                       for (int j=0; j < Columns.Length; ++j)
-                                               row.SetColumnError (Columns [j], row.RowError);
-                               }
-                               return true;
-                       }
-                       return false;
-               }
-
-               internal override void AssertConstraint(DataRow row)
-               {       
-                       if (IsPrimaryKey && row.HasVersion(DataRowVersion.Default)) {
-                               for (int i = 0; i < Columns.Length; i++) {
-                                       if (row.IsNull(Columns[i])) {
-                                               throw new NoNullAllowedException("Column '" + Columns[i].ColumnName + "' does not allow nulls.");
-                                       }
-                               }
-                       }
-                       
-                       if (Index == null) {
-                               Index = Table.GetIndex(Columns,null,DataViewRowState.None,null,false);
-                       }
-
-                       if (Index.HasDuplicates) {
-                               throw new ConstraintException(GetErrorMessage(row));
-                       }
-               }
-
-               internal override bool IsColumnContained(DataColumn column)
-               {
-                       for (int i = 0; i < _dataColumns.Length; i++)
-                               if (column == _dataColumns[i])
-                                       return true;
-
-                       return false;
-               }
-
-               internal override bool CanRemoveFromCollection(ConstraintCollection col, bool shouldThrow){
-                       if (IsPrimaryKey) {
-                               if (shouldThrow)
-                                       throw new ArgumentException("Cannot remove unique constraint since it's the primary key of a table.");
-
-                               return false;
-                       }
-                       
-                       if (Table.DataSet == null)
-                               return true;
-
-                       if (ChildConstraint != null) {
-                               if (!shouldThrow)
-                                       return false;
-                               throw new ArgumentException (String.Format (
-                                                               "Cannot remove unique constraint '{0}'." +
-                                                               "Remove foreign key constraint '{1}' first.",
-                                                               ConstraintName,ChildConstraint.ConstraintName));
-                       }
-                       return true;
-               }
-
-               private string GetErrorMessage(DataRow row)
-               {
-                       int i;
-                        
-                       System.Text.StringBuilder sb = new System.Text.StringBuilder(row[_dataColumns[0]].ToString());
-                       for (i = 1; i < _dataColumns.Length; i++) {
-                               sb = sb.Append(", ").Append(row[_dataColumns[i].ColumnName]);
-                       }
-                       string valStr = sb.ToString();
-                       sb = new System.Text.StringBuilder(_dataColumns[0].ColumnName);
-                       for (i = 1; i < _dataColumns.Length; i++) {
-                               sb = sb.Append(", ").Append(_dataColumns[i].ColumnName);
-                       }
-                       string colStr = sb.ToString();
-                       return "Column '" + colStr + "' is constrained to be unique.  Value '" + valStr + "' is already present.";
-               }
-                                      
-               
-               #endregion // Methods
-
-       }
-
-       
-}
diff --git a/mcs/class/System.Data/System.Data/UpdateOptions.cs b/mcs/class/System.Data/System.Data/UpdateOptions.cs
deleted file mode 100644 (file)
index 16967d2..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-//
-// System.Data.UpdateOptions.cs
-//
-// Author:
-//   Tim Coleman (tim@timcoleman.com)
-//
-// Copyright (C) Tim Coleman, 2003
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-namespace System.Data {
-       public enum UpdateOptions 
-       {
-               None,
-               DoNotAcceptChanges,
-               NotTransacted,
-               UpdateChildren
-       }
-}
-
diff --git a/mcs/class/System.Data/System.Data/UpdateRowSource.cs b/mcs/class/System.Data/System.Data/UpdateRowSource.cs
deleted file mode 100644 (file)
index 45d1af9..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-//
-// System.Data.UpdateRowSource.cs
-//
-// Author:
-//   Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace System.Data
-{
-       /// <summary>
-       /// Specifies how query command results are applied to the row being updated.
-       /// </summary>
-       public enum UpdateRowSource
-       {
-               None = 0,
-               OutputParameters = 1,
-               FirstReturnedRecord = 2,
-               Both = 3
-       }
-}
\ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/UpdateStatus.cs b/mcs/class/System.Data/System.Data/UpdateStatus.cs
deleted file mode 100644 (file)
index a2c75be..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-//
-// System.Data.UpdateStatus.cs
-//
-// Author:
-//   Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace System.Data
-{
-       /// <summary>
-       /// Specifies the action to take with regard to the current and remaining rows during an Update.
-       /// </summary>
-       public enum UpdateStatus
-       {
-               Continue = 0,
-               ErrorsOccurred = 1,
-               SkipCurrentRow = 2,
-               SkipAllRemainingRows = 3
-       }
-}
\ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/VersionNotFoundException.cs b/mcs/class/System.Data/System.Data/VersionNotFoundException.cs
deleted file mode 100644 (file)
index c158638..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// System.Data.VersionNotFoundException.cs
-//
-// Author: Duncan Mak  (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System.Data
-{
-       [Serializable]
-       public class VersionNotFoundException : DataException
-       {
-               public VersionNotFoundException ()
-                       : base (Locale.GetText ("This DataRow has been deleted"))
-               {
-               }
-
-               public VersionNotFoundException (string s)
-                       : base (s)
-               {
-               }
-
-               protected VersionNotFoundException (SerializationInfo info, StreamingContext context)
-                       : base (info, context)
-               {
-               }
-
-               public VersionNotFoundException (string message, Exception innerException)
-                       : base (message, innerException)
-               {
-               }
-       }
-}
diff --git a/mcs/class/System.Data/System.Data/XmlConstants.cs b/mcs/class/System.Data/System.Data/XmlConstants.cs
deleted file mode 100644 (file)
index e713b01..0000000
+++ /dev/null
@@ -1,128 +0,0 @@
-// 
-// System.Data/XmlConstants.cs
-//
-// Author:
-//   Stuart Caborn <stuart.caborn@virgin.net>
-//
-// (C) Stuart Caborn 2002
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Xml;
-using System.Xml.Schema;
-
-namespace System.Data 
-{
-///<summary>
-///Constants class to hold XmlSerialisation
-///strings
-///</summary>
-internal class XmlConstants
-{
-       ///<summary>The namespace prefix for the xml schema namespace</summary>
-       public const string SchemaPrefix = "xs";
-       
-       ///<summary>
-       /// The w3 XmlSchema namespace
-       /// </summary>
-       public const string SchemaNamespace = "http://www.w3.org/2001/XMLSchema";
-       
-       public const string XmlnsNS = "http://www.w3.org/2000/xmlns/";
-       public const string XmlNS = "http://www.w3.org/XML/1998/namespace";
-       
-       //xs elements and values 
-       //TODO - these must exist somwhere else???
-       public const string SchemaElement = "schema";
-       public const string AttributeFormDefault = "attributeFormDefault";
-       public const string ElementFormDefault = "elementFormDefault";
-       public const string Qualified = "qualified";
-       public const string Unqualified = "unqualified";
-       public const string Element = "element";
-       public const string Choice = "choice";
-       public const string ComplexType = "complexType";
-       public const string SimpleType = "simpleType";
-       public const string Restriction = "restriction";
-       public const string MaxLength = "maxLength";
-       public const string Sequence = "sequence";
-       public const string MaxOccurs = "maxOccurs";
-       public const string MinOccurs = "minOccurs";
-       public const string Unbounded = "unbounded";
-       public const string Name = "name";
-       public const string Type = "type";
-       public const string Id = "id";
-       public const string TargetNamespace = "targetNamespace";
-       public const string Form = "form";
-       public const string Attribute = "attribute";
-       public const string Default = "default";
-       public const string Caption = "Caption";
-       public const string Base = "base";
-       public const string Value = "value";
-       public const string DataType = "DataType";
-       public const string AutoIncrement = "AutoIncrement";
-       public const string AutoIncrementSeed = "AutoIncrementSeed";
-       public const string AutoIncrementStep = "AutoIncrementStep";
-
-       //ms schema objects     
-       public const string MsdataPrefix = "msdata";    
-       public const string MsdataNamespace = "urn:schemas-microsoft-com:xml-msdata";
-       public const string MsdatasourceNamespace = "urn:schemas-microsoft-com:xml-msdatasource";
-       public const string MspropPrefix = "msprop";    
-       public const string MspropNamespace = "urn:schemas-microsoft-com:xml-msprop";
-       public const string DiffgrPrefix = "diffgr";
-       public const string DiffgrNamespace = "urn:schemas-microsoft-com:xml-diffgram-v1";
-       public const string TnsPrefix = "mstns";
-       public const string IsDataSet = "IsDataSet";
-       public const string Locale = "Locale";
-       public const string Ordinal = "Ordinal";
-       public const string IsNested = "IsNested";
-       public const string ConstraintOnly = "ConstraintOnly";
-       public const string RelationName = "RelationName";
-       public const string ConstraintName = "ConstraintName";
-       public const string PrimaryKey = "PrimaryKey";
-       public const string ColumnName = "ColumnName";
-       public const string ReadOnly = "ReadOnly";
-       public const string UseCurrentCulture = "UseCurrentCulture";
-
-       public static XmlQualifiedName QnString = new XmlQualifiedName ("string", XmlSchema.Namespace);
-       public static XmlQualifiedName QnShort = new XmlQualifiedName ("short", XmlSchema.Namespace);
-       public static XmlQualifiedName QnInt = new XmlQualifiedName ("int", XmlSchema.Namespace);
-       public static XmlQualifiedName QnLong = new XmlQualifiedName ("long", XmlSchema.Namespace);
-       public static XmlQualifiedName QnBoolean = new XmlQualifiedName ("boolean", XmlSchema.Namespace);
-       public static XmlQualifiedName QnUnsignedByte = new XmlQualifiedName ("unsignedByte", XmlSchema.Namespace);
-       public static XmlQualifiedName QnChar = new XmlQualifiedName ("char", XmlSchema.Namespace);
-       public static XmlQualifiedName QnDateTime = new XmlQualifiedName ("dateTime", XmlSchema.Namespace);
-       public static XmlQualifiedName QnDecimal = new XmlQualifiedName ("decimal", XmlSchema.Namespace);
-       public static XmlQualifiedName QnDouble = new XmlQualifiedName ("double", XmlSchema.Namespace);
-       public static XmlQualifiedName QnSbyte = new XmlQualifiedName ("byte", XmlSchema.Namespace);
-       public static XmlQualifiedName QnFloat = new XmlQualifiedName ("float", XmlSchema.Namespace);
-       public static XmlQualifiedName QnDuration = new XmlQualifiedName ("duration", XmlSchema.Namespace);
-       public static XmlQualifiedName QnUnsignedShort = new XmlQualifiedName ("unsignedShort", XmlSchema.Namespace);
-       public static XmlQualifiedName QnUnsignedInt = new XmlQualifiedName ("unsignedInt", XmlSchema.Namespace);
-       public static XmlQualifiedName QnUnsignedLong = new XmlQualifiedName ("unsignedLong", XmlSchema.Namespace);
-       public static XmlQualifiedName QnUri = new XmlQualifiedName ("anyURI", XmlSchema.Namespace);
-       public static XmlQualifiedName QnBase64Binary = new XmlQualifiedName ("base64Binary", XmlSchema.Namespace);
-       public static XmlQualifiedName QnXmlQualifiedName = new XmlQualifiedName ("QName", XmlSchema.Namespace);
-}
-
-}
diff --git a/mcs/class/System.Data/System.Data/XmlDataInferenceLoader.cs b/mcs/class/System.Data/System.Data/XmlDataInferenceLoader.cs
deleted file mode 100644 (file)
index 03e2737..0000000
+++ /dev/null
@@ -1,864 +0,0 @@
-//\r
-// XmlDataInferenceLoader.cs\r
-//\r
-// Author:\r
-//\r
-//     Atsushi Enomoto <atsushi@ximian.com>\r
-//\r
-// (C)2004 Novell Inc.\r
-//\r
-// Design notes are the bottom of the source.\r
-//\r
-\r
-//\r
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)\r
-//\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-// \r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-// \r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
-//\r
-\r
-using System;\r
-using System.Collections;\r
-using System.Data;\r
-using System.Globalization;\r
-using System.IO; // for Driver\r
-using System.Text; // for Driver\r
-using System.Xml;\r
-using System.Xml.Schema;\r
-using System.Xml.Serialization;\r
-\r
-namespace System.Data\r
-{\r
-       internal enum ElementMappingType {\r
-               Simple,\r
-               Repeated,\r
-               Complex\r
-       }\r
-\r
-       internal class TableMappingCollection : CollectionBase\r
-       {\r
-               public void Add (TableMapping map)\r
-               {\r
-                       this.List.Add (map);\r
-               }\r
-\r
-               public TableMapping this [string name] {\r
-                       get {\r
-                               foreach (TableMapping map in List)\r
-                                       if (map.Table.TableName == name)\r
-                                               return map;\r
-                               return null;\r
-                       }\r
-               }\r
-       }\r
-\r
-       internal class TableMapping\r
-       {\r
-               private bool existsInDataSet;\r
-\r
-               public DataTable Table;\r
-               public ArrayList Elements = new ArrayList ();\r
-               public ArrayList Attributes = new ArrayList ();\r
-               public DataColumn SimpleContent;\r
-               public DataColumn PrimaryKey;\r
-               public DataColumn ReferenceKey;\r
-               public int lastElementIndex = -1;\r
-\r
-               // Parent TableMapping\r
-               public TableMapping ParentTable;\r
-\r
-               // decoded LocalName -> TableMapping\r
-               public TableMappingCollection ChildTables = new TableMappingCollection ();\r
-\r
-               public TableMapping (string name, string ns)\r
-               {\r
-                       Table = new DataTable (name);\r
-                       Table.Namespace = ns;\r
-               }\r
-\r
-               public TableMapping (DataTable dt)\r
-               {\r
-                       existsInDataSet = true;\r
-                       Table = dt;\r
-                       foreach (DataColumn col in dt.Columns) {\r
-                               switch (col.ColumnMapping) {\r
-                               case MappingType.Element:\r
-                                       Elements.Add (col);\r
-                                       break;\r
-                               case MappingType.Attribute:\r
-                                       Attributes.Add (col);\r
-                                       break;\r
-                               case MappingType.SimpleContent:\r
-                                       SimpleContent = col;\r
-                                       break;\r
-                               }\r
-                       }\r
-                       PrimaryKey = dt.PrimaryKey.Length > 0 ? dt.PrimaryKey [0] : null;\r
-               }\r
-\r
-               public bool ExistsInDataSet {\r
-                       get { return existsInDataSet; }\r
-               }\r
-\r
-               public bool ContainsColumn (string name)\r
-               {\r
-                       return GetColumn (name) != null;\r
-               }\r
-\r
-               public DataColumn GetColumn (string name)\r
-               {\r
-                       foreach (DataColumn col in Elements)\r
-                               if (col.ColumnName == name)\r
-                                       return col;\r
-                       foreach (DataColumn col in Attributes)\r
-                               if (col.ColumnName == name)\r
-                                       return col;\r
-                       if (SimpleContent != null && name == SimpleContent.ColumnName)\r
-                               return SimpleContent;\r
-                       if (PrimaryKey != null && name == PrimaryKey.ColumnName)\r
-                               return PrimaryKey;\r
-                       return null;\r
-               }\r
-\r
-               public void RemoveElementColumn (string name)\r
-               {\r
-                       foreach (DataColumn col in Elements) {\r
-                               if (col.ColumnName == name) {\r
-                                       Elements.Remove (col);\r
-                                       return;\r
-                               }\r
-                       }\r
-               }\r
-       }\r
-\r
-       internal class XmlDataInferenceLoader\r
-       {\r
-               public static void Infer (DataSet dataset, XmlDocument document, XmlReadMode mode, string [] ignoredNamespaces)\r
-               {\r
-                       new XmlDataInferenceLoader (dataset, document, mode, ignoredNamespaces).ReadXml ();\r
-               }\r
-\r
-               private XmlDataInferenceLoader (DataSet ds, XmlDocument doc, XmlReadMode mode, string [] ignoredNamespaces)\r
-               {\r
-                       dataset = ds;\r
-                       document = doc;\r
-                       this.mode = mode;\r
-                       this.ignoredNamespaces = ignoredNamespaces != null ? new ArrayList (ignoredNamespaces) : new ArrayList ();\r
-\r
-                       // Fill existing table info\r
-                       foreach (DataTable dt in dataset.Tables)\r
-                               tables.Add (new TableMapping (dt));\r
-               }\r
-\r
-               DataSet dataset;\r
-               XmlDocument document;\r
-               XmlReadMode mode;\r
-               ArrayList ignoredNamespaces;\r
-               TableMappingCollection tables = new TableMappingCollection ();\r
-               RelationStructureCollection relations = new RelationStructureCollection ();\r
-\r
-               private void ReadXml ()\r
-               {\r
-                       if (document.DocumentElement == null)\r
-                               return;\r
-\r
-                       dataset.Locale = new CultureInfo ("en-US"); // default(!)\r
-\r
-                       // If the root element is not a data table, treat \r
-                       // this element as DataSet.\r
-                       // Read one element. It might be DataSet element.\r
-                       XmlElement el = document.DocumentElement;\r
-\r
-                       if (el.NamespaceURI == XmlSchema.Namespace)\r
-                               throw new InvalidOperationException ("DataSet is not designed to handle XML Schema as data content. Please use ReadXmlSchema method instead of InferXmlSchema method.");\r
-\r
-                       if (IsDocumentElementTable ())\r
-                               InferTopLevelTable (el);\r
-                       else {\r
-                               string localName = XmlHelper.Decode (el.LocalName);\r
-                               dataset.DataSetName = localName;\r
-                               dataset.Namespace = el.NamespaceURI;\r
-                               dataset.Prefix = el.Prefix;\r
-                               foreach (XmlNode n in el.ChildNodes) {\r
-                                       if (n.NamespaceURI == XmlSchema.Namespace)\r
-                                               continue;\r
-                                       if (n.NodeType == XmlNodeType.Element)\r
-                                               InferTopLevelTable (n as XmlElement);\r
-                               }\r
-                       }\r
-\r
-                       int count = 0;                  \r
-                       foreach (TableMapping map in tables) {\r
-                               string baseName = map.PrimaryKey != null ? map.PrimaryKey.ColumnName : map.Table.TableName + "_Id";\r
-                               \r
-                               // Make sure name of RK column is unique\r
-                               string rkName = baseName;\r
-                               if (map.ChildTables [map.Table.TableName] != null) {\r
-                                       rkName = baseName + '_' + count;\r
-                                       while (map.GetColumn (rkName) != null) {\r
-                                               count++;\r
-                                               rkName = baseName + '_' + count;\r
-                                       }\r
-                               }\r
-                               \r
-                               foreach (TableMapping ct in map.ChildTables) {\r
-                                       ct.ReferenceKey = GetMappedColumn (ct, rkName, map.Table.Prefix, map.Table.Namespace, MappingType.Hidden, map.PrimaryKey != null ? map.PrimaryKey.DataType : typeof (int));\r
-                               }\r
-                       }\r
-\r
-                       foreach (TableMapping map in tables) {\r
-                               if (map.ExistsInDataSet)\r
-                                       continue;\r
-                               if (map.PrimaryKey != null)\r
-                                       map.Table.Columns.Add (map.PrimaryKey);\r
-\r
-                               foreach (DataColumn col in map.Elements) \r
-                                       map.Table.Columns.Add (col);\r
-\r
-                               foreach (DataColumn col in map.Attributes)\r
-                                       map.Table.Columns.Add (col);\r
-                               \r
-                               if (map.SimpleContent != null) \r
-                                       map.Table.Columns.Add (map.SimpleContent);\r
-                               \r
-                               if (map.ReferenceKey != null) \r
-                                       map.Table.Columns.Add (map.ReferenceKey);\r
-                               dataset.Tables.Add (map.Table);\r
-                       }\r
-\r
-                       foreach (RelationStructure rs in relations) {\r
-                               string relName = rs.ExplicitName != null ? rs.ExplicitName : rs.ParentTableName + "_" + rs.ChildTableName;\r
-                               DataTable pt = dataset.Tables [rs.ParentTableName];\r
-                               DataTable ct = dataset.Tables [rs.ChildTableName];\r
-                               DataColumn pc = pt.Columns [rs.ParentColumnName];\r
-                               DataColumn cc = null;\r
-                               \r
-                               // If both parent and child tables have same name, it is quite\r
-                               // possible to have column names suffixed with some numbers.\r
-                               if (rs.ParentTableName == rs.ChildTableName) {\r
-                                       cc = ct.Columns [rs.ChildColumnName + "_" + count];\r
-                               }\r
-                               if (cc == null)\r
-                                       cc = ct.Columns [rs.ChildColumnName];\r
-                               \r
-                               if (pt == null)\r
-                                       throw new DataException ("Parent table was not found : " + rs.ParentTableName);\r
-                               else if (ct == null)\r
-                                       throw new DataException ("Child table was not found : " + rs.ChildTableName);\r
-                               else if (pc == null)\r
-                                       throw new DataException ("Parent column was not found :" + rs.ParentColumnName);\r
-                               else if (cc == null)\r
-                                       throw new DataException ("Child column was not found :" + rs.ChildColumnName);\r
-                               DataRelation rel = new DataRelation (relName, pc, cc, rs.CreateConstraint);\r
-                               if (rs.IsNested) {\r
-                                       rel.Nested = true;\r
-                                       rel.ParentTable.PrimaryKey = rel.ParentColumns;\r
-                               }\r
-                               dataset.Relations.Add (rel);\r
-                       }\r
-               }\r
-\r
-               private void InferTopLevelTable (XmlElement el)\r
-               {\r
-                       InferTableElement (null, el);\r
-               }\r
-\r
-               private void InferColumnElement (TableMapping table, XmlElement el)\r
-               {\r
-                       string localName = XmlHelper.Decode (el.LocalName);\r
-                       DataColumn col = table.GetColumn (localName);\r
-                       if (col != null) {\r
-                               if (col.ColumnMapping != MappingType.Element)\r
-                                       throw new DataException (String.Format ("Column {0} is already mapped to {1}.", localName, col.ColumnMapping));\r
-                               table.lastElementIndex = table.Elements.IndexOf (col);\r
-                               return;\r
-                       }\r
-                       if (table.ChildTables [localName] != null)\r
-                               // Child is already mapped, or inferred as a table\r
-                               // (in that case, that takes precedence than\r
-                               // this simple column inference.)\r
-                               return;\r
-\r
-                       col = new DataColumn (localName, typeof (string));\r
-                       col.Namespace = el.NamespaceURI;\r
-                       col.Prefix = el.Prefix;\r
-                       table.Elements.Insert (++table.lastElementIndex, col);\r
-               }\r
-\r
-               private void CheckExtraneousElementColumn (TableMapping parentTable, XmlElement el)\r
-               {\r
-                       if (parentTable == null)\r
-                               return;\r
-                       string localName = XmlHelper.Decode (el.LocalName);\r
-                       DataColumn elc = parentTable.GetColumn (localName);\r
-                       if (elc != null)\r
-                               parentTable.RemoveElementColumn (localName);\r
-               }\r
-\r
-               private void PopulatePrimaryKey (TableMapping table)\r
-               {\r
-                       DataColumn col = new DataColumn (table.Table.TableName + "_Id");\r
-                       col.ColumnMapping = MappingType.Hidden;\r
-                       col.DataType = typeof (int);\r
-                       col.AllowDBNull = false;\r
-                       col.AutoIncrement = true;\r
-                       col.Namespace = table.Table.Namespace;\r
-                       col.Prefix = table.Table.Prefix;\r
-                       table.PrimaryKey = col;\r
-               }\r
-\r
-               private void PopulateRelationStructure (string parent, string child, string pkeyColumn)\r
-               {\r
-                       if (relations [parent, child] != null)\r
-                               return;\r
-                       RelationStructure rs = new RelationStructure ();\r
-                       rs.ParentTableName = parent;\r
-                       rs.ChildTableName = child;\r
-                       rs.ParentColumnName = pkeyColumn;\r
-                       rs.ChildColumnName = pkeyColumn;\r
-                       rs.CreateConstraint = true;\r
-                       rs.IsNested = true;\r
-                       relations.Add (rs);\r
-               }\r
-\r
-               private void InferRepeatedElement (TableMapping parentTable, XmlElement el)\r
-               {\r
-                       string localName = XmlHelper.Decode (el.LocalName);\r
-                       // FIXME: can be checked later\r
-                       CheckExtraneousElementColumn (parentTable, el);\r
-                       TableMapping table = GetMappedTable (parentTable, localName, el.NamespaceURI);\r
-\r
-                       // If the mapping is actually complex type (not simple\r
-                       // repeatable), then ignore it.\r
-                       if (table.Elements.Count > 0)\r
-                               return;\r
-\r
-                       // If simple column already exists, do nothing\r
-                       if (table.SimpleContent != null)\r
-                               return;\r
-\r
-                       GetMappedColumn (table, localName + "_Column", el.Prefix, el.NamespaceURI, MappingType.SimpleContent, null);\r
-               }\r
-\r
-               private void InferTableElement (TableMapping parentTable, XmlElement el)\r
-               {\r
-                       // If parent table already has the same name column but\r
-                       // mapped as Element, that must be removed.\r
-                       // FIXME: This can be done later (doing it here is\r
-                       // loss of performance.\r
-                       CheckExtraneousElementColumn (parentTable, el);\r
-\r
-                       string localName = XmlHelper.Decode (el.LocalName);\r
-                       TableMapping table = GetMappedTable (parentTable, localName, el.NamespaceURI);\r
-\r
-                       bool hasChildElements = false;\r
-                       bool hasAttributes = false;\r
-                       bool hasText = false;\r
-                       bool isElementRepeated = false;\r
-\r
-                       foreach (XmlAttribute attr in el.Attributes) {\r
-                               if (attr.NamespaceURI == XmlConstants.XmlnsNS\r
-                                       || attr.NamespaceURI == XmlConstants.XmlNS\r
-                                       )\r
-                                       continue;\r
-                               if (ignoredNamespaces != null &&\r
-                                       ignoredNamespaces.Contains (attr.NamespaceURI))\r
-                                       continue;\r
-\r
-                               hasAttributes = true;\r
-                               GetMappedColumn (table,\r
-                                       XmlHelper.Decode (attr.LocalName),\r
-                                       attr.Prefix,\r
-                                       attr.NamespaceURI,\r
-                                       MappingType.Attribute,\r
-                                       null); \r
-                       }\r
-\r
-                       foreach (XmlNode n in el.ChildNodes) {\r
-                               switch (n.NodeType) {\r
-                               case XmlNodeType.Comment:\r
-                               case XmlNodeType.ProcessingInstruction: // ignore\r
-                                       continue;\r
-                               default: // text content\r
-                                       hasText = true;\r
-                                       if (GetElementMappingType (el, ignoredNamespaces, null) == ElementMappingType.Repeated)\r
-                                               isElementRepeated = true;\r
-                                       break;\r
-                               case XmlNodeType.Element: // child\r
-                                       hasChildElements = true;\r
-                                       XmlElement cel = n as XmlElement;\r
-                                       string childLocalName = XmlHelper.Decode (cel.LocalName);\r
-\r
-                                       switch (GetElementMappingType (cel, ignoredNamespaces, null)) {\r
-                                       case ElementMappingType.Simple:\r
-                                               InferColumnElement (table, cel);\r
-                                               break;\r
-                                       case ElementMappingType.Repeated:\r
-                                               if (table.PrimaryKey == null)\r
-                                                       PopulatePrimaryKey (table);\r
-                                               PopulateRelationStructure (table.Table.TableName, childLocalName, table.PrimaryKey.ColumnName);\r
-                                               InferRepeatedElement (table, cel);\r
-                                               break;\r
-                                       case ElementMappingType.Complex:\r
-                                               if (table.PrimaryKey == null)\r
-                                                       PopulatePrimaryKey (table);\r
-                                               PopulateRelationStructure (table.Table.TableName, childLocalName, table.PrimaryKey.ColumnName);\r
-                                               InferTableElement (table, cel);\r
-                                               break;\r
-                                       }\r
-                                       break;\r
-                               }\r
-                       }\r
-\r
-                       // Attributes + !Children + Text = SimpleContent\r
-                       if (table.SimpleContent == null // no need to create\r
-                               && !hasChildElements && hasText && (hasAttributes || isElementRepeated)) {\r
-                               GetMappedColumn (table, table.Table.TableName + "_Text", String.Empty, String.Empty, MappingType.SimpleContent, null);\r
-                       }\r
-               }\r
-\r
-               private TableMapping GetMappedTable (TableMapping parent, string tableName, string ns)\r
-               {\r
-                       TableMapping map = tables [tableName];\r
-                       if (map != null) {\r
-                               if (parent != null && map.ParentTable != null && map.ParentTable != parent)\r
-                                       throw new DataException (String.Format ("The table '{0}' is already allocated as a child of another table '{1}'. Cannot set table '{2}' as parent table.", tableName, map.ParentTable.Table.TableName, parent.Table.TableName));\r
-                       } else {\r
-                               map = new TableMapping (tableName, ns);\r
-                               map.ParentTable = parent;\r
-                               tables.Add (map);\r
-                       }\r
-                       if (parent != null) {\r
-                               bool shouldAdd = true;\r
-                               foreach (TableMapping child in parent.ChildTables) {\r
-                                       if (child.Table.TableName == tableName) {\r
-                                               shouldAdd = false;\r
-                                               break;\r
-                                       }\r
-                               }\r
-                               if (shouldAdd)\r
-                                       parent.ChildTables.Add (map);\r
-                       }\r
-                       return map;\r
-               }\r
-\r
-               private DataColumn GetMappedColumn (TableMapping table, string name, string prefix, string ns, MappingType type, Type optColType)\r
-               {\r
-                       DataColumn col = table.GetColumn (name);\r
-                       // Infer schema\r
-                       if (col == null) {\r
-                               col = new DataColumn (name);\r
-                               col.Prefix = prefix;\r
-                               col.Namespace = ns;\r
-                               col.ColumnMapping = type;\r
-                               switch (type) {\r
-                               case MappingType.Element:\r
-                                       table.Elements.Add (col);\r
-                                       break;\r
-                               case MappingType.Attribute:\r
-                                       table.Attributes.Add (col);\r
-                                       break;\r
-                               case MappingType.SimpleContent:\r
-                                       table.SimpleContent = col;\r
-                                       break;\r
-                               case MappingType.Hidden:\r
-                                       // To generate parent key\r
-                                       col.DataType = optColType;\r
-                                       table.ReferenceKey = col;\r
-                                       break;\r
-                               }\r
-                       }\r
-                       else if (col.ColumnMapping != type) // Check mapping type\r
-                               throw new DataException (String.Format ("There are already another column that has different mapping type. Column is {0}, existing mapping type is {1}", col.ColumnName, col.ColumnMapping));\r
-\r
-                       return col;\r
-               }\r
-\r
-               private static void SetAsExistingTable (XmlElement el, Hashtable existingTables)\r
-               {\r
-                       if (existingTables == null)\r
-                               return;\r
-                       ArrayList al = existingTables [el.NamespaceURI] as ArrayList;\r
-                       if (al == null) {\r
-                               al = new ArrayList ();\r
-                               existingTables [el.NamespaceURI] = al;\r
-                       }\r
-                       if (al.Contains (el.LocalName))\r
-                               return;\r
-                       al.Add (el.LocalName);\r
-               }\r
-\r
-               private static ElementMappingType GetElementMappingType (\r
-                       XmlElement el, ArrayList ignoredNamespaces, Hashtable existingTables)\r
-               {\r
-                       if (existingTables != null) {\r
-                               ArrayList al = existingTables [el.NamespaceURI] as ArrayList;\r
-                               if (al != null && al.Contains (el.LocalName))\r
-                                       // this is not precise, but it is enough\r
-                                       // for IsDocumentElementTable().\r
-                                       return ElementMappingType.Complex;\r
-                       }\r
-\r
-                       foreach (XmlAttribute attr in el.Attributes) {\r
-                               if (attr.NamespaceURI == XmlConstants.XmlnsNS \r
-                                       || attr.NamespaceURI == XmlConstants.XmlNS\r
-                                       )\r
-                                       continue;\r
-                               if (ignoredNamespaces != null && ignoredNamespaces.Contains (attr.NamespaceURI))\r
-                                       continue;\r
-                               SetAsExistingTable (el, existingTables);\r
-                               return ElementMappingType.Complex;\r
-                       }\r
-                       foreach (XmlNode n in el.ChildNodes) {\r
-                               if (n.NodeType == XmlNodeType.Element) {\r
-                                       SetAsExistingTable (el, existingTables);\r
-                                       return ElementMappingType.Complex;\r
-                               }\r
-                       }\r
-\r
-                       for (XmlNode n = el.NextSibling; n != null; n = n.NextSibling) {\r
-                               if (n.NodeType == XmlNodeType.Element && n.LocalName == el.LocalName) {\r
-                                       SetAsExistingTable (el, existingTables);\r
-                                       return GetElementMappingType (n as XmlElement,\r
-                                               ignoredNamespaces, null)\r
-                                               == ElementMappingType.Complex ?\r
-                                               ElementMappingType.Complex :\r
-                                               ElementMappingType.Repeated;\r
-                               }\r
-                       }\r
-\r
-                       return ElementMappingType.Simple;\r
-               }\r
-\r
-               private bool IsDocumentElementTable ()\r
-               {\r
-                       return IsDocumentElementTable (\r
-                               document.DocumentElement,\r
-                               ignoredNamespaces);\r
-               }\r
-\r
-               internal static bool IsDocumentElementTable (XmlElement top,\r
-                       ArrayList ignoredNamespaces)\r
-               {\r
-                       foreach (XmlAttribute attr in top.Attributes) {\r
-                               if (attr.NamespaceURI == XmlConstants.XmlnsNS\r
-                                       || attr.NamespaceURI == XmlConstants.XmlNS\r
-                                       )\r
-                                       continue;\r
-                               if (ignoredNamespaces != null &&\r
-                                       ignoredNamespaces.Contains (attr.NamespaceURI))\r
-                                       continue;\r
-                               // document element has attributes other than xmlns\r
-                               return true;\r
-                       }\r
-                       Hashtable existingTables = new Hashtable ();\r
-                       foreach (XmlNode n in top.ChildNodes) {\r
-                               XmlElement el = n as XmlElement;\r
-                               if (el == null)\r
-                                       continue;\r
-                               if (GetElementMappingType (el, ignoredNamespaces,\r
-                                       existingTables)\r
-                                       == ElementMappingType.Simple)\r
-                                       return true;\r
-                       }\r
-                       return false;\r
-               }\r
-\r
-               // Returns if it "might" be a column element (this method is\r
-               // called per child element, thus it might still consist of\r
-               // table, since it might be repeated).\r
-               /*\r
-               private bool IsPossibleColumnElement (XmlElement el)\r
-               {\r
-                       foreach (XmlAttribute attr in el.Attributes) {\r
-                               if (attr.NamespaceURI == XmlConstants.XmlnsNS\r
-                                       || attr.NamespaceURI == XmlConstants.XmlNS\r
-                                       )\r
-                                       continue;\r
-                               return false;\r
-                       }\r
-                       foreach (XmlNode n in el.ChildNodes)\r
-                               if (n.NodeType == XmlNodeType.Element)\r
-                                       return false;\r
-                       return true;\r
-               }\r
-               */\r
-       }\r
-}\r
-\r
-\r
-#if TEST_STANDALONE_INFERENCE\r
-internal class Driver\r
-{\r
-       private static void DumpDataTable (DataTable dt)\r
-       {\r
-               Console.WriteLine ("<Table>");\r
-               Console.WriteLine (dt.TableName);\r
-               Console.WriteLine ("ChildRelationCount: " + dt.ChildRelations.Count);\r
-               Console.WriteLine ("ConstraintsCount: " + dt.Constraints.Count);\r
-               Console.WriteLine ("ParentRelationCount: " + dt.ParentRelations.Count);\r
-               Console.WriteLine ("Prefix: " + dt.Prefix);\r
-               Console.WriteLine ("Namespace: " + dt.Namespace);\r
-               Console.WriteLine ("Site: " + dt.Site);\r
-               Console.WriteLine ("RowCount: " + dt.Rows.Count);\r
-               Console.WriteLine ("<Columns count='" + dt.Columns.Count + "'>");\r
-               foreach (DataColumn col in dt.Columns)\r
-                       DumpDataColumn (col);\r
-               Console.WriteLine ("</Columns>");\r
-               Console.WriteLine ("</Table>");\r
-       }\r
-\r
-       private static void DumpDataRelation (DataRelation rel)\r
-       {\r
-               Console.WriteLine ("<Relation>");\r
-               Console.WriteLine (rel.RelationName);\r
-               Console.WriteLine (rel.Nested);\r
-               Console.Write ("  <ParentColumns>");\r
-               foreach (DataColumn col in rel.ParentColumns)\r
-                       Console.Write (col.ColumnName + " ");\r
-               Console.WriteLine ("</ParentColumns>");\r
-               Console.Write ("  <ChildColumns>");\r
-               foreach (DataColumn col in rel.ChildColumns)\r
-                       Console.Write (col.ColumnName + " ");\r
-               Console.WriteLine ("</ChildColumns>");\r
-               if (rel.ParentKeyConstraint != null) {\r
-                       Console.WriteLine ("  <ParentKeyConstraint>");\r
-                       DumpUniqueConstraint (rel.ParentKeyConstraint);\r
-                       Console.WriteLine ("  </ParentKeyConstraint>");\r
-               }\r
-               if (rel.ChildKeyConstraint != null) {\r
-                       Console.WriteLine ("  <ChildKeyConstraint>");\r
-                       DumpForeignKeyConstraint (rel.ChildKeyConstraint);\r
-                       Console.WriteLine ("  </ChildKeyConstraint>");\r
-               }\r
-               Console.WriteLine ("</Relation>");\r
-       }\r
-\r
-       public static void DumpUniqueConstraint (UniqueConstraint uc)\r
-       {\r
-               Console.WriteLine ("Name " + uc.ConstraintName);\r
-               Console.WriteLine ("PK? " + uc.IsPrimaryKey);\r
-               Console.Write ("  <Columns>");\r
-               foreach (DataColumn col in uc.Columns)\r
-                       Console.Write (col.ColumnName + " ");\r
-               Console.WriteLine ("</Columns>");\r
-       }\r
-\r
-       public static void DumpForeignKeyConstraint (ForeignKeyConstraint fk)\r
-       {\r
-               Console.WriteLine ("Name " + fk.ConstraintName);\r
-               Console.WriteLine ("  <Rules>" + fk.AcceptRejectRule + ", " +\r
-                       fk.DeleteRule + ", " + fk.UpdateRule + "</Rules>");\r
-               Console.Write ("  <Columns>");\r
-               foreach (DataColumn col in fk.Columns)\r
-                       Console.Write (col.ColumnName + " ");\r
-               Console.WriteLine ("</Columns>");\r
-               Console.Write ("  <RelatedColumns>");\r
-               foreach (DataColumn col in fk.RelatedColumns)\r
-                       Console.Write (col.ColumnName + " ");\r
-               Console.WriteLine ("</RelatedColumns>");\r
-       }\r
-\r
-       private static void DumpDataSet (DataSet ds)\r
-       {\r
-               Console.WriteLine ("-----------------------");\r
-               Console.WriteLine ("name: " + ds.DataSetName);\r
-               Console.WriteLine ("ns: " + ds.Namespace);\r
-               Console.WriteLine ("prefix: " + ds.Prefix);\r
-               Console.WriteLine ("extprop: " + ds.ExtendedProperties.Count);\r
-               Console.WriteLine ("<Tables count='" + ds.Tables.Count + "'>");\r
-               foreach (DataTable dt in ds.Tables)\r
-                       DumpDataTable (dt);\r
-               Console.WriteLine ("</Tables>");\r
-               Console.WriteLine ("<Relations count='" + ds.Relations.Count + "'>");\r
-               foreach (DataRelation rel in ds.Relations)\r
-                       DumpDataRelation (rel);\r
-               Console.WriteLine ("</Relations>");\r
-       }\r
-\r
-       public static void DumpDataColumn (DataColumn col)\r
-       {\r
-               Console.WriteLine ("<Column>");\r
-               Console.WriteLine ("  ColumnName: " + col.ColumnName);\r
-               Console.WriteLine ("  AllowDBNull? " + col.AllowDBNull);\r
-               Console.WriteLine ("  AutoIncrement? " + col.AutoIncrement);\r
-               Console.WriteLine ("    Seed: " + col.AutoIncrementSeed);\r
-               Console.WriteLine ("    Step: " + col.AutoIncrementStep);\r
-               Console.WriteLine ("  Caption " + col.Caption);\r
-               Console.WriteLine ("  Mapping: " + col.ColumnMapping);\r
-               Console.WriteLine ("  Type: " + col.DataType);\r
-               Console.WriteLine ("  DefaultValue: " + (col.DefaultValue == DBNull.Value ? "(DBNull)" : col.DefaultValue));\r
-               Console.WriteLine ("  Expression: " + (col.Expression == "" ? "(empty)" : col.Expression));\r
-               Console.WriteLine ("  MaxLength: " + col.MaxLength);\r
-               Console.WriteLine ("  Namespace: " + (col.Namespace == null ? "(null)" : col.Namespace));\r
-               Console.WriteLine ("  Ordinal: " + col.Ordinal);\r
-               Console.WriteLine ("  Prefix: " + (col.Prefix == null ? "(null)" : col.Prefix));\r
-               Console.WriteLine ("  ReadOnly: " + col.ReadOnly);\r
-               Console.WriteLine ("  Unique: " + col.Unique);\r
-               Console.WriteLine ("</Column>");\r
-       }\r
-\r
-       public static void Main (string [] args)\r
-       {\r
-               if (args.Length < 1) {\r
-                       Console.WriteLine ("reader.exe xmlfilename");\r
-                       return;\r
-               }\r
-               try {\r
-                       XmlSerializer ser = new XmlSerializer (typeof (DataSet));\r
-\r
-                       DataSet ds = new DataSet ();\r
-                       XmlTextReader xtr = new XmlTextReader (args [0]);\r
-                       ds.ReadXml (xtr, XmlReadMode.Auto);\r
-DumpDataSet (ds);\r
-                       TextWriter sw = new StringWriter ();\r
-                       ser.Serialize (sw, ds);\r
-                       using (TextWriter w = new StreamWriter (Path.ChangeExtension (args [0], "ms.txt"), false, Encoding.ASCII)) {\r
-                               w.WriteLine (sw.ToString ());\r
-                       }\r
-\r
-                       ds = new DataSet ();\r
-                       xtr = new XmlTextReader (args [0]);\r
-                       XmlDocument doc = new XmlDocument ();\r
-                       doc.Load (xtr);\r
-                       XmlDataInferenceLoader.Infer (ds, doc, XmlReadMode.Auto, null);\r
-DumpDataSet (ds);\r
-                       sw = new StringWriter ();\r
-sw = Console.Out;\r
-                       ser.Serialize (sw, ds);\r
-                       using (TextWriter w = new StreamWriter (Path.ChangeExtension (args [0], "my.txt"), false, Encoding.ASCII)) {\r
-                               w.WriteLine (sw.ToString ());\r
-                       }\r
-\r
-               } catch (Exception ex) {\r
-                       Console.WriteLine (ex);\r
-               }\r
-       }\r
-}\r
-\r
-#endif\r
-\r
-//\r
-// * Design Notes\r
-//\r
-//     This class is used to implement DataSet's ReadXml() and \r
-//     InferXmlSchema() methods. That is, 1) to infer dataset schema \r
-//     structure and 2) to read data rows.\r
-//\r
-//     It is instantiated from DataSet, XmlReader and XmlReadMode.\r
-//\r
-//\r
-// ** General Design\r
-//\r
-// *** Read mode\r
-//\r
-//     Data rows are not read when XmlReadMode is ReadSchema or InferSchema\r
-//     (well, actually ReadSchema should not be passed).\r
-//\r
-//     Schema inference is done only when XmlReadMode is Auto or InferSchema.\r
-//\r
-// *** Information Set\r
-//\r
-//     Only elements, "attributes", and "text" are considered. Here "text" \r
-//     includes text node and CDATA section, but does not include whitespace\r
-//     and even significant whitespace (as MS does). Also, here "attributes"\r
-//     does not include "namespace" nodes.\r
-//\r
-//\r
-// ** Inference Design\r
-//\r
-// *** MappingType\r
-//\r
-//     There are four type of mapping in MappingType enumeration:\r
-//\r
-//     Element : Mapped to a simple type element.\r
-//     Attribute : Mapped to an attribute\r
-//     SimpleContent : Mapped to the text content of complex type element.\r
-//                     (i.e. xs:element/xs:complexType/xs:simpleContent)\r
-//     Hidden : Used for both key and reference, for auto-generated columns.\r
-//\r
-// *** Mapping strategy\r
-//\r
-//     Attributes are always (except for namespace nodes) inferred as \r
-//     DataColumn (of MappingType.Attribute).\r
-//\r
-//     When an element has attributes, it always becomes a DataTable.\r
-//     Otherwise if there is a child element, it becomes DataTable as well.\r
-//\r
-//     When there is a text content, 1) if the container element has \r
-//     attribute(s), the text content becomes a SimpleContent DataColumn\r
-//     in the container "table" element (yes, it becomes a DataTable).\r
-//     2) if the container has no attribute, the element becomes DataColumn.\r
-//\r
-//     If there are both text content and child element(s), the text content\r
-//     is ignored (thus, it always become DataTable).\r
-//\r
-// *** Mapping conflicts\r
-//\r
-//     If there has been already a different MappingType of DataColumn,\r
-//     it is DataException. For example, it is an error if there are an\r
-//     attribute and an element child those names are the same.\r
-//\r
-//     Name remapping will never be done. It introduces complicated rules.\r
-//\r
-// *** Upgrading from DataColumn to DataTable\r
-//\r
-//     If there has been the same Element type of mapping (that is, when\r
-//     the same-name child elements appeared in the element), then the\r
-//     child elements become a DataTable (so here must be a conversion\r
-//     from DataColumn/value_DataRow to DataTable/value_DataRow in the new\r
-//     table and reference_to_new_table in the old DataColumn.\r
-//\r
-//\r
-// ** Implementation\r
-//\r
-// *** XmlReader based implementation\r
-//\r
-//     This class uses XmlReader to avoid having the entire XML document\r
-//     object. The basic stategy is\r
-//\r
-//             1) handle attributes at startElement\r
-//             2) store text content (if it "stores" in data rows) while\r
-//                EndElement\r
-//             3) dispose of elements at endElement\r
-//             4) Empty element without attributes is equal to a column \r
-//                that holds "".\r
-//\r
-//     In XmlSchemaMapper.cs (by Ville Palo) there is an enumeration type\r
-//     ElementType (undefined, table, column). This concept is nice to reuse.\r
-//\r
-// *** Top level inference\r
-//\r
-//     The process starts with ReadElement() for the top-level element.\r
-//     (considering Fragment mode, it might not be the document element.\r
-//     However, no inference is done in that mode.)\r
-//\r
-//     If the top level element was not a DataTable and there is\r
-//     no more content, the element is regarded as DataSet with no tables.\r
-//\r
-// *** First child of the DataSet element\r
-//\r
-//     There are some special cases.\r
-//\r
-// *** ReadElement()\r
-//\r
-//     The main inference process is ReadElement(). This method consumes\r
-//     (should consume) exactly one element and interpret it as either\r
-//     DataTable or DataColumn.\r
-//\r
diff --git a/mcs/class/System.Data/System.Data/XmlDataLoader.cs b/mcs/class/System.Data/System.Data/XmlDataLoader.cs
deleted file mode 100644 (file)
index 825e7e2..0000000
+++ /dev/null
@@ -1,482 +0,0 @@
-//
-// mcs/class/System.Data/System.Data/XmlDataLoader.cs
-//
-// Purpose: Loads XmlDocument to DataSet 
-//
-// class: XmlDataLoader
-// assembly: System.Data.dll
-// namespace: System.Data
-//
-// Author:
-//     Ville Palo <vi64pa@koti.soon.fi>
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// (c)copyright 2002 Ville Palo
-// (C)2004 Novell Inc.
-//
-// XmlDataLoader is included within the Mono Class Library.
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Data;
-using System.Xml;
-using System.Collections;
-using System.Globalization;
-
-namespace System.Data 
-{
-
-       internal class XmlDataLoader
-       {
-       
-               private DataSet DSet;
-
-               public XmlDataLoader (DataSet set) 
-               {
-                       DSet = set;
-               }
-
-               public XmlReadMode LoadData (XmlReader reader, XmlReadMode mode)
-               {
-                       XmlReadMode Result = mode;
-
-                       switch (mode) {
-                       case XmlReadMode.Auto:
-                               Result = DSet.Tables.Count == 0 ? XmlReadMode.InferSchema : XmlReadMode.IgnoreSchema;
-                               ReadModeSchema (reader, DSet.Tables.Count == 0 ? XmlReadMode.Auto : XmlReadMode.IgnoreSchema);
-                               break;
-                       case XmlReadMode.InferSchema:
-                               Result = XmlReadMode.InferSchema;
-                               ReadModeSchema (reader, mode);
-                               break;
-                       case XmlReadMode.IgnoreSchema:
-                               Result = XmlReadMode.IgnoreSchema;
-                               ReadModeSchema (reader, mode);
-                               break;
-                       default:
-                               reader.Skip ();
-                               break;
-                       }
-
-                       return Result;
-               }
-
-               #region reading
-
-               // Read information from the reader.
-               private void ReadModeSchema (XmlReader reader, XmlReadMode mode)
-               {
-                       bool inferSchema = mode == XmlReadMode.InferSchema || mode == XmlReadMode.Auto;
-                       bool fillRows = mode != XmlReadMode.InferSchema;
-                       // This check is required for full DiffGram.
-                       // It is not described in MSDN and it is impossible
-                       // with WriteXml(), but when writing XML using
-                       // XmlSerializer, the output is like this:
-                       // <dataset>
-                       //  <schema>...</schema>
-                       //  <diffgram>...</diffgram>
-                       // </dataset>
-                       //
-                       // FIXME: This, this check should (also) be done
-                       // after reading the top-level element.
-
-                       //check if the current element is schema.
-                       if (reader.LocalName == "schema") {
-                               if (mode != XmlReadMode.Auto)
-                                       reader.Skip(); // skip the schema node.
-                               else
-                                       DSet.ReadXmlSchema(reader);
-                               
-                               reader.MoveToContent();
-                       }
-
-                       // load an XmlDocument from the reader.
-                       XmlDocument doc = new XmlDocument ();
-                       doc.Load (reader);
-                       if (doc.DocumentElement == null)
-                               return;
-
-                       // treatment for .net compliancy :
-                       // if xml representing dataset has exactly depth of 2 elements,
-                       // than the root element actually represents datatable and not dataset
-                       // so we add new root element to doc 
-                       // in order to create an element representing dataset.
-                       //
-                       // FIXME: Consider attributes. 
-                       // <root a='1' b='2' /> is regarded as a valid DataTable.
-                       int rootNodeDepth = XmlNodeElementsDepth(doc.DocumentElement);
-                       switch (rootNodeDepth) {
-                       case 1:
-                               if (inferSchema) {
-                                       DSet.DataSetName = doc.DocumentElement.LocalName;
-                                       DSet.Prefix = doc.DocumentElement.Prefix;
-                                       DSet.Namespace = doc.DocumentElement.NamespaceURI;
-                               }
-                               return;
-                       case 2:
-                               // create new document
-                               XmlDocument newDoc = new XmlDocument();
-                               // create element for dataset
-                               XmlElement datasetElement = newDoc.CreateElement("dummy");
-                               // make the new created element to be the new doc root
-                               newDoc.AppendChild(datasetElement);
-                               // import all the elements from doc and insert them into new doc
-                               XmlNode root = newDoc.ImportNode(doc.DocumentElement,true);
-                               datasetElement.AppendChild(root);
-                               doc = newDoc;
-                               break;
-                       default:
-                               if (inferSchema) {
-                                       DSet.DataSetName = doc.DocumentElement.LocalName;
-                                       DSet.Prefix = doc.DocumentElement.Prefix;
-                                       DSet.Namespace = doc.DocumentElement.NamespaceURI;
-                               }
-                               break;
-                       }
-
-                       // set EnforceConstraint to false - we do not want any validation during 
-                       // load time.
-                       bool origEnforceConstraint = DSet.EnforceConstraints;
-                       DSet.EnforceConstraints = false;
-
-                       // The childs are tables.
-                       XmlNodeList nList = doc.DocumentElement.ChildNodes;
-
-                       // FIXME: When reading DataTable (not DataSet), 
-                       // the nodes are column items, not rows.
-                       for (int i = 0; i < nList.Count; i++) {
-                               XmlNode node = nList[i];
-                               // node represents a table onky if it is of type XmlNodeType.Element
-                               if (node.NodeType == XmlNodeType.Element) {
-                                       AddRowToTable(node, null, inferSchema, fillRows);
-                               }
-                       }
-                       // set the EnforceConstraints to original value;
-                       DSet.EnforceConstraints = origEnforceConstraint;
-               }
-
-               #endregion // reading
-
-               #region Private helper methods
-/*             
-               private void ReadColumns (XmlReader reader, DataRow row, DataTable table, string TableName)
-               {
-                       do {
-                               if (reader.NodeType == XmlNodeType.Element) {
-                                       DataColumn col = table.Columns [reader.LocalName];
-                                       if (col != null) {
-                                               row [col] = StringToObject (col.DataType, reader.Value);
-                                       }
-                                       reader.Read ();
-                               }
-                               else {
-                                       reader.Read ();
-                               }
-                               
-                       } while (table.TableName != reader.LocalName 
-                               || reader.NodeType != XmlNodeType.EndElement);
-               }
-*/
-               internal static object StringToObject (Type type, string value)
-               {
-                       if (type == null) return value;
-
-                       switch (Type.GetTypeCode (type)) {
-                               case TypeCode.Boolean: return XmlConvert.ToBoolean (value);
-                               case TypeCode.Byte: return XmlConvert.ToByte (value);
-                               case TypeCode.Char: return (char)XmlConvert.ToInt32 (value);
-                               case TypeCode.DateTime: return XmlConvert.ToDateTime (value, XmlDateTimeSerializationMode.Unspecified);
-                               case TypeCode.Decimal: return XmlConvert.ToDecimal (value);
-                               case TypeCode.Double: return XmlConvert.ToDouble (value);
-                               case TypeCode.Int16: return XmlConvert.ToInt16 (value);
-                               case TypeCode.Int32: return XmlConvert.ToInt32 (value);
-                               case TypeCode.Int64: return XmlConvert.ToInt64 (value);
-                               case TypeCode.SByte: return XmlConvert.ToSByte (value);
-                               case TypeCode.Single: return XmlConvert.ToSingle (value);
-                               case TypeCode.UInt16: return XmlConvert.ToUInt16 (value);
-                               case TypeCode.UInt32: return XmlConvert.ToUInt32 (value);
-                               case TypeCode.UInt64: return XmlConvert.ToUInt64 (value);
-                       }
-
-                       if (type == typeof (TimeSpan)) return XmlConvert.ToTimeSpan (value);
-                       if (type == typeof (Guid)) return XmlConvert.ToGuid (value);
-                       if (type == typeof (byte[])) return Convert.FromBase64String (value);
-                       if (type == typeof (System.Type)) return System.Type.GetType (value);
-
-                       return Convert.ChangeType (value, type);
-               }
-
-               private void AddRowToTable(XmlNode tableNode, DataColumn relationColumn, bool inferSchema, bool fillRows)
-               {
-                       Hashtable rowValue = new Hashtable();
-                       DataTable table;
-
-                       // Check if the table exists in the DataSet. If not create one.
-                       if (DSet.Tables.Contains(tableNode.LocalName))
-                               table = DSet.Tables[tableNode.LocalName];
-                       else if (inferSchema) {
-                               table = new DataTable(tableNode.LocalName);
-                               DSet.Tables.Add(table);
-                       }
-                       else
-                               return;
-
-                       // For elements that are inferred as tables and that contain text 
-                       // but have no child elements, a new column named "TableName_Text" 
-                       // is created for the text of each of the elements. 
-                       // If an element is inferred as a table and has text, but also has child elements,
-                       // the text is ignored.
-                       // Note : if an element is inferred as a table and has text 
-                       // and has no child elements, 
-                       // but the repeated ements of this table have child elements, 
-                       // then the text is ignored.
-                       if(!HaveChildElements(tableNode) && HaveText(tableNode) &&
-                               !IsRepeatedHaveChildNodes(tableNode)) {
-                               string columnName = tableNode.Name + "_Text";
-                               if (!table.Columns.Contains(columnName)) {
-                                       table.Columns.Add(columnName);
-                               }
-                               rowValue.Add(columnName, tableNode.InnerText);
-                       }
-                       
-                       // Get the child nodes of the table. Any child can be one of the following tow:
-                       // 1. DataTable - if there was a relation with another table..
-                       // 2. DataColumn - column of the current table.
-                       XmlNodeList childList = tableNode.ChildNodes;
-                       for (int i = 0; i < childList.Count; i++) {
-                               XmlNode childNode = childList[i];
-
-                               // we are looping through elements only
-                               // Note : if an element is inferred as a table and has text, but also has child elements,
-                               // the text is ignored.
-                               if (childNode.NodeType != XmlNodeType.Element)
-                                       continue;
-                               
-                               // Elements that have attributes are inferred as tables. 
-                               // Elements that have child elements are inferred as tables. 
-                               // Elements that repeat are inferred as a single table. 
-                               if (IsInferredAsTable(childNode)) {
-                                       // child node inferred as table
-                                       if (inferSchema) {
-                                               // We need to create new column for the relation between the current
-                                               // table and the new table we found (the child table).
-                                               string newRelationColumnName = table.TableName + "_Id";
-                                               if (!table.Columns.Contains(newRelationColumnName)) {
-                                                       DataColumn newRelationColumn = new DataColumn(newRelationColumnName, typeof(int));
-                                                       newRelationColumn.AllowDBNull = false;
-                                                       newRelationColumn.AutoIncrement = true;
-                                                       // we do not want to serialize this column so MappingType is Hidden.
-                                                       newRelationColumn.ColumnMapping = MappingType.Hidden;
-                                                       table.Columns.Add(newRelationColumn);
-                                               }
-                                               // Add a row to the new table we found.
-                                               AddRowToTable(childNode, table.Columns[newRelationColumnName], inferSchema, fillRows);
-                                       }
-                                       else
-                                               AddRowToTable(childNode, null, inferSchema, fillRows);
-                                       
-                               }
-                               else {
-                                       // Elements that have no attributes or child elements, and do not repeat, 
-                                       // are inferred as columns.
-                                       object val = null;
-                                       if (childNode.FirstChild != null)
-                                               val = childNode.FirstChild.Value;
-                                       else
-                                               val = "";
-                                       if (table.Columns.Contains(childNode.LocalName))
-                                               rowValue.Add(childNode.LocalName, val);
-                                       else if (inferSchema) {
-                                               table.Columns.Add(childNode.LocalName);
-                                               rowValue.Add(childNode.LocalName, val);
-                                       }
-                               }
-                                               
-                       }
-
-                       // Column can be attribute of the table element.
-                       XmlAttributeCollection aCollection = tableNode.Attributes;
-                       for (int i = 0; i < aCollection.Count; i++) {
-                               XmlAttribute attr = aCollection[i];
-                               //the atrribute can be the namespace.
-                               if (attr.Prefix.Equals("xmlns"))
-                                       table.Namespace = attr.Value;
-                               else { // the attribute is a column.
-                                       if (!table.Columns.Contains(attr.LocalName)) {
-                                               DataColumn col = table.Columns.Add(attr.LocalName);
-                                               col.ColumnMapping = MappingType.Attribute;
-                                       }
-                                       table.Columns[attr.LocalName].Namespace = table.Namespace;
-
-                                       rowValue.Add(attr.LocalName, attr.Value);
-                               }
-                       }
-
-                       // If the current table is a child table we need to add a new column for the relation
-                       // and add a new relation to the DataSet.
-                       if (relationColumn != null) {
-                               if (!table.Columns.Contains(relationColumn.ColumnName)) {
-                                       DataColumn dc = new DataColumn(relationColumn.ColumnName, typeof(int));
-                                       // we do not want to serialize this column so MappingType is Hidden.
-                                       dc.ColumnMapping = MappingType.Hidden;
-                                       table.Columns.Add(dc);
-                                       // Convention of relation name is: ParentTableName_ChildTableName
-                                       DataRelation dr = new DataRelation(relationColumn.Table.TableName + "_" + dc.Table.TableName, relationColumn, dc);
-                                       dr.Nested = true;
-                                       DSet.Relations.Add(dr);
-                                       UniqueConstraint.SetAsPrimaryKey (dr.ParentTable.Constraints, dr.ParentKeyConstraint);
-                               }
-                               rowValue.Add (relationColumn.ColumnName, relationColumn.GetAutoIncrementValue());
-                       }
-
-                       // Create new row and add all values to the row.
-                       // then add it to the table.
-                       DataRow row = table.NewRow ();
-                                       
-                       IDictionaryEnumerator enumerator = rowValue.GetEnumerator ();
-                       while (enumerator.MoveNext ()) {
-                               row [enumerator.Key.ToString ()] = StringToObject (table.Columns[enumerator.Key.ToString ()].DataType, enumerator.Value.ToString ());
-                       }
-
-                       if (fillRows)
-                               table.Rows.Add (row);
-                       
-               }
-
-               // this method calculates the depth of child nodes tree
-               // and it counts nodes of type XmlNodeType.Element only
-               private static int XmlNodeElementsDepth(XmlNode node)
-               {
-                       int maxDepth = -1;
-            if ((node != null)) {
-                               if  ((node.HasChildNodes) && (node.FirstChild.NodeType == XmlNodeType.Element)) {
-                                       for (int i=0; i<node.ChildNodes.Count; i++) {
-                                               if (node.ChildNodes[i].NodeType == XmlNodeType.Element) {
-                                                       int childDepth = XmlNodeElementsDepth(node.ChildNodes[i]);
-                                                       maxDepth = (maxDepth < childDepth) ? childDepth : maxDepth;
-                                               }
-                                       }
-                               }
-                               else {
-                                       return 1;
-                               }
-                       }
-                       else {
-                               return -1;
-                       }
-
-                       return (maxDepth + 1);
-               }
-
-               private bool HaveChildElements(XmlNode node)
-               {
-                       bool haveChildElements = true;
-                       if(node.ChildNodes.Count > 0) {
-                               foreach(XmlNode childNode in node.ChildNodes) {
-                                       if (childNode.NodeType != XmlNodeType.Element) {
-                                               haveChildElements = false;
-                                               break;
-                                       }
-                               }
-                       }
-                       else {
-                               haveChildElements = false;
-                       }
-                       return haveChildElements;
-               }
-
-               private bool HaveText(XmlNode node)
-               {
-                       bool haveText = true;
-                       if(node.ChildNodes.Count > 0) {
-                               foreach(XmlNode childNode in node.ChildNodes) {
-                                       if (childNode.NodeType != XmlNodeType.Text) {
-                                               haveText = false;
-                                               break;
-                                       }
-                               }
-                       }
-                       else {
-                               haveText = false;
-                       }
-                       return haveText;
-               }
-
-               private bool IsRepeat(XmlNode node)
-               {
-                       bool isRepeat = false;
-                       if(node.ParentNode != null) {
-                               foreach(XmlNode childNode in node.ParentNode.ChildNodes) {
-                                       if(childNode != node && childNode.Name == node.Name) {
-                                               isRepeat = true;
-                                               break;
-                                       }
-                               }
-                       }
-                       return isRepeat;
-               }
-
-               private bool HaveAttributes(XmlNode node)
-               {
-                       return (node.Attributes != null && node.Attributes.Count > 0);
-               }
-
-               private bool IsInferredAsTable(XmlNode node)
-               {
-                       // Elements that have attributes are inferred as tables. 
-                       // Elements that have child elements are inferred as tables. 
-                       // Elements that repeat are inferred as a single table. 
-                       return (HaveChildElements(node) || HaveAttributes(node) ||
-                                       IsRepeat(node));
-               }
-
-               /// <summary>
-               /// Returns true is any node that is repeated node for the node supplied
-               /// (i.e. is child node of node's parent, have the same name and is not the node itself)
-               /// have child elements
-               /// </summary>
-               private bool IsRepeatedHaveChildNodes(XmlNode node)
-               {
-                       bool isRepeatedHaveChildElements = false;
-                       if(node.ParentNode != null) {
-                               foreach(XmlNode childNode in node.ParentNode.ChildNodes) {
-                                       if(childNode != node && childNode.Name == node.Name) {
-                                               if (HaveChildElements(childNode)) {
-                                                       isRepeatedHaveChildElements = true;
-                                                       break;
-                                               }
-                                       }
-                               }
-                       }
-                       return isRepeatedHaveChildElements;
-               }
-
-               #endregion // Private helper methods
-
-               
-       }
-
-}
diff --git a/mcs/class/System.Data/System.Data/XmlDataReader.cs b/mcs/class/System.Data/System.Data/XmlDataReader.cs
deleted file mode 100644 (file)
index f4d4b8f..0000000
+++ /dev/null
@@ -1,399 +0,0 @@
-\r
-//\r
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)\r
-//\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-// \r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-// \r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
-//\r
-\r
-using System;\r
-using System.IO;\r
-using System.Data;\r
-using System.Xml;\r
-using System.Xml.Serialization;\r
-\r
-\r
-namespace System.Data\r
-{\r
-#if STANDALONE_DRIVER_TEST\r
-       public class Driver\r
-       {\r
-               public static void Main (string [] args)\r
-               {\r
-                       if (args.Length == 0) {\r
-                               Console.WriteLine ("usage: mono xmldatareader.exe filename");\r
-                               return;\r
-                       }\r
-\r
-                       Console.WriteLine ("Target file: " + args [0]);\r
-\r
-                       DataSet ds = new DataSet ();\r
-//                     ds.InferXmlSchema (args [0], null);\r
-\r
-                       try {\r
-                               ds.ReadXml (args [0]);\r
-                       } catch (Exception ex) {\r
-                               Console.WriteLine ("ReadXml() borked: " + ex.Message);\r
-                               return;\r
-                       }\r
-                       Console.WriteLine ("---- DataSet ----------------");\r
-                       StringWriter sw = new StringWriter ();\r
-                       PrintDataSet (ds, sw);\r
-                       PrintDataSet (ds, Console.Out);\r
-\r
-                       ds = new DataSet ();\r
-                       ds.InferXmlSchema (args [0], null);\r
-                       XmlDataReader.ReadXml (ds, new XmlTextReader (args [0]));\r
-                       Console.WriteLine ("---- XmlDataReader ----------------");\r
-                       StringWriter sw2 = new StringWriter ();\r
-                       PrintDataSet (ds, sw2);\r
-\r
-                       if (sw.ToString () == sw2.ToString ())\r
-                               Console.WriteLine ("Successful.");\r
-                       else\r
-                               Console.WriteLine ("Different *************************************************\n" + sw2);\r
-               }\r
-\r
-               private static void PrintDataSet (DataSet ds, TextWriter tw)\r
-               {\r
-                       tw.WriteLine ("DS::" + ds.DataSetName + ", " + ds.Tables.Count + ", " + ds.Relations.Count);\r
-                       foreach (DataTable dt in ds.Tables)\r
-                               tw.WriteLine ("DT:" + dt.TableName + ", " + dt.Columns.Count + ", " + dt.Rows.Count);\r
-\r
-                       ds.WriteXml (tw);\r
-                       tw.WriteLine ();\r
-               }\r
-       }\r
-#endif\r
-\r
-       internal class XmlDataReader\r
-       {\r
-               const string xmlnsNS = "http://www.w3.org/2000/xmlns/";\r
-\r
-               public static void ReadXml (\r
-                       DataSet dataset, XmlReader reader, XmlReadMode mode)\r
-               {\r
-                       new XmlDataReader (dataset, reader, mode).Process ();\r
-               }\r
-\r
-               DataSet dataset;\r
-               XmlReader reader;\r
-               XmlReadMode mode;\r
-\r
-               public XmlDataReader (DataSet ds, XmlReader xr, XmlReadMode m)\r
-               {\r
-                       dataset = ds;\r
-                       reader =xr;\r
-                       mode = m;\r
-               }\r
-\r
-               private void Process ()\r
-               {\r
-                       bool savedEnforceConstraints =\r
-                               dataset.EnforceConstraints;\r
-                       try {\r
-                       dataset.EnforceConstraints = false;\r
-                       reader.MoveToContent ();\r
-\r
-                       if (mode == XmlReadMode.Fragment) {\r
-                                       while (reader.NodeType == XmlNodeType.Element && !reader.EOF) {\r
-                                               ReadTopLevelElement ();\r
-                                       }\r
-                               }\r
-                               else\r
-                                       ReadTopLevelElement ();\r
-                       } finally {\r
-                               dataset.EnforceConstraints = \r
-                                       savedEnforceConstraints;\r
-                       }\r
-               }\r
-\r
-               private bool IsTopLevelDataSet ()\r
-               {\r
-                       string local = XmlHelper.Decode (reader.LocalName);\r
-\r
-                       // No need to check DataSetName. In fact, it is ignored.\r
-\r
-                       DataTable dt = dataset.Tables [local];\r
-                       if (dt == null)\r
-                               return true;\r
-\r
-                       XmlDocument doc = new XmlDocument ();\r
-                       XmlElement el = (XmlElement) doc.ReadNode (reader);\r
-                       doc.AppendChild (el);\r
-                       reader = new XmlNodeReader (el);\r
-                       reader.MoveToContent ();\r
-\r
-                       return !XmlDataInferenceLoader.IsDocumentElementTable (\r
-                               el, null);\r
-               }\r
-\r
-               private void ReadTopLevelElement ()\r
-               {\r
-                       if (mode == XmlReadMode.Fragment &&\r
-                               (XmlHelper.Decode (reader.LocalName) !=\r
-                               dataset.DataSetName ||\r
-                               reader.NamespaceURI != dataset.Namespace))\r
-                               reader.Skip ();\r
-                       else if (mode == XmlReadMode.Fragment ||\r
-                               IsTopLevelDataSet ()) {\r
-                       int depth = reader.Depth;\r
-                       reader.Read ();\r
-                       reader.MoveToContent ();\r
-                       do {\r
-                               ReadDataSetContent ();\r
-                       } while (reader.Depth > depth && !reader.EOF);\r
-                       if (reader.NodeType == XmlNodeType.EndElement)\r
-                               reader.ReadEndElement ();\r
-                       reader.MoveToContent ();\r
-               }\r
-                       else\r
-                               ReadDataSetContent ();\r
-               }\r
-\r
-               private void ReadDataSetContent ()\r
-               {\r
-                       DataTable table = dataset.Tables [XmlHelper.Decode (reader.LocalName)];\r
-                       if (table == null || table.Namespace != reader.NamespaceURI) {\r
-                               reader.Skip ();\r
-                               reader.MoveToContent ();\r
-                               return; // skip if there is no matching table\r
-                       }\r
-\r
-                       // skip if namespace does not match.\r
-                       if (table.Namespace != reader.NamespaceURI) {\r
-                               reader.Skip ();\r
-                               reader.MoveToContent ();\r
-                               return; // skip if there is no matching table\r
-                       }\r
-\r
-                       DataRow row = table.NewRow ();\r
-                       ReadElement (row);\r
-                       table.Rows.Add (row);\r
-               }\r
-\r
-               private void ReadElement (DataRow row)\r
-               {\r
-                       // Consume attributes\r
-                       if (reader.MoveToFirstAttribute ()) {\r
-                               do {\r
-                                       if (reader.NamespaceURI == XmlConstants.XmlnsNS\r
-                                       || reader.NamespaceURI == XmlConstants.XmlNS\r
-                                               )\r
-                                               continue;\r
-                                       ReadElementAttribute (row);\r
-                               } while (reader.MoveToNextAttribute ());\r
-                               reader.MoveToElement ();\r
-                       }\r
-\r
-                       // If not empty element, read content.\r
-                       if (reader.IsEmptyElement) {\r
-                               reader.Skip ();\r
-                               reader.MoveToContent ();\r
-                       } else {\r
-                               int depth = reader.Depth;\r
-                               reader.Read ();\r
-                               reader.MoveToContent ();\r
-                               do {\r
-                                       ReadElementContent (row);\r
-                               } while (reader.Depth > depth && !reader.EOF);\r
-                               if (reader.IsEmptyElement)\r
-                                       reader.Read ();\r
-                               if (reader.NodeType == XmlNodeType.EndElement)\r
-                                       reader.ReadEndElement ();\r
-                               reader.MoveToContent ();\r
-                       }\r
-               }\r
-\r
-               private void ReadElementAttribute (DataRow row)\r
-               {\r
-                       DataColumn col = row.Table.Columns [XmlHelper.Decode (reader.LocalName)];\r
-                       if (col == null || col.Namespace != reader.NamespaceURI)\r
-                               return;\r
-                       row [col] = StringToObject (col.DataType, reader.Value);\r
-               }\r
-\r
-               private void ReadElementContent (DataRow row)\r
-               {\r
-                       switch (reader.NodeType) {\r
-\r
-                       case XmlNodeType.EndElement:\r
-                               // This happens when the content was only whitespace (and skipped by MoveToContent()).\r
-                               return;\r
-\r
-                       case XmlNodeType.Element:\r
-                               ReadElementElement (row);\r
-                               break;\r
-\r
-                       case XmlNodeType.Text:\r
-                       case XmlNodeType.CDATA:\r
-                       case XmlNodeType.SignificantWhitespace:\r
-                               DataColumn simple = null;\r
-                               DataColumnCollection cols = row.Table.Columns;\r
-                               for (int i = 0; i < cols.Count; i++) {\r
-                                       DataColumn col = cols [i];\r
-                                       if (col.ColumnMapping ==\r
-                                               MappingType.SimpleContent) {\r
-                                               simple = col;\r
-                                               break;\r
-                                       }\r
-                               }\r
-                               string s = reader.ReadString ();\r
-                               reader.MoveToContent ();\r
-#if SILLY_MS_COMPATIBLE\r
-// As to MS, "test string" and "test <!-- comment -->string" are different :P\r
-                               if (simple != null && row.IsNull (simple))\r
-                                       row [simple] = StringToObject (simple.DataType, s);\r
-#else\r
-// But it does not mean we support "123<!-- comment -->456". just allowed for string\r
-                               if (simple != null)\r
-                                       row [simple] += s;\r
-#endif\r
-                               break;\r
-                       case XmlNodeType.Whitespace:\r
-                               reader.ReadString ();\r
-                               break;\r
-                       }\r
-               }\r
-\r
-               private void ReadElementElement (DataRow row)\r
-               {\r
-                       // This child element (for row) might be either simple\r
-                       // content element, or child element\r
-\r
-                       // MS.NET crashes here... but it seems just a bug.\r
-                       DataColumn col = row.Table.Columns [XmlHelper.Decode (reader.LocalName)];\r
-                       if (col == null ||  col.Namespace != reader.NamespaceURI)\r
-                               col = null;\r
-\r
-                       // if col exists, then it should be MappingType.Element\r
-                       if (col != null\r
-                               && col.ColumnMapping == MappingType.Element) {\r
-\r
-                               // TODO: This part is suspicious for\r
-                               // MS compatibility (test required)\r
-                               if (col.Namespace != reader.NamespaceURI) {\r
-                                       reader.Skip ();\r
-                                       return;\r
-                               }\r
-\r
-                               bool wasEmpty = reader.IsEmptyElement;\r
-                               int depth = reader.Depth;\r
-\r
-                               if (typeof (IXmlSerializable).IsAssignableFrom (col.DataType)) {\r
-                                       try {\r
-                                               // NOTE: ReadElementString works fine with proper XML with CDATA etc,\r
-                                               // however doesn't behave well with XMLs like the one in \r
-                                               // https://bugzilla.novell.com/show_bug.cgi?id=377146 which is \r
-                                               // apparently supported by MS.NET - to maintain compatibility,\r
-                                               // If the obj implements IXmlSerializable, let obj's ReadXml do the reading\r
-                                               IXmlSerializable obj = (IXmlSerializable) Activator.CreateInstance (col.DataType, new object [0]);\r
-                                               if (!reader.IsEmptyElement) {\r
-                                                       obj.ReadXml (reader);\r
-                                                       reader.ReadEndElement ();\r
-                                               } else {\r
-                                                       reader.Skip ();\r
-                                               }                                               \r
-                                               row [col] = obj;\r
-                                       } catch (XmlException) {\r
-                                               // XML is not in accordance to expected standards, try reading the content as an xml doc\r
-                                               row [col] = reader.ReadInnerXml ();\r
-                                       } catch (InvalidOperationException) {\r
-\r
-                                               row [col] = reader.ReadInnerXml ();\r
-                                       }\r
-                               } else {\r
-                                       row [col] = StringToObject (col.DataType, reader.ReadElementString ());\r
-                               }\r
-                                       \r
-                               if (!wasEmpty && reader.Depth > depth) {\r
-                               // This means, instance does not match with\r
-                               // the schema (because the instance element\r
-                               // contains complex content, while specified as\r
-                               // simple), so just skip to the end of the\r
-                               // element.\r
-                                       while (reader.Depth > depth)\r
-                                               reader.Read ();\r
-                                       reader.Read ();\r
-                               }\r
-                               reader.MoveToContent ();\r
-                               return;\r
-                       } else if (col != null) {\r
-                               // Mismatch column type. Just skip\r
-                               reader.Skip ();\r
-                               reader.MoveToContent ();\r
-                               return;\r
-                       }\r
-\r
-                       // Otherwise, it might be child table element\r
-                       DataRelationCollection rels = row.Table.ChildRelations;\r
-                       for (int i = 0; i < rels.Count; i++) {\r
-                               DataRelation rel = rels [i];\r
-                               if (!rel.Nested)\r
-                                       continue;\r
-                               DataTable ct = rel.ChildTable;\r
-                               if (ct.TableName != XmlHelper.Decode (reader.LocalName) || ct.Namespace != reader.NamespaceURI)\r
-                                       continue;\r
-\r
-                               DataRow childRow = rel.ChildTable.NewRow ();\r
-                               ReadElement (childRow);\r
-\r
-                               for (int c = 0; c < rel.ChildColumns.Length; c++) {\r
-                                       childRow [rel.ChildColumns [c]]\r
-                                               = row [rel.ParentColumns [c]];\r
-                               }\r
-                               rel.ChildTable.Rows.Add (childRow);\r
-                               return;\r
-                       }\r
-\r
-                       // Matched neither of the above: just skip\r
-                       reader.Skip ();\r
-                       reader.MoveToContent ();\r
-               }\r
-\r
-               internal static object StringToObject (Type type, string value)\r
-               {\r
-                       if (type == null) return value;\r
-\r
-                       switch (Type.GetTypeCode (type)) {\r
-                               case TypeCode.Boolean: return XmlConvert.ToBoolean (value);\r
-                               case TypeCode.Byte: return XmlConvert.ToByte (value);\r
-                               case TypeCode.Char: return (char)XmlConvert.ToInt32 (value);\r
-                               case TypeCode.DateTime: return XmlConvert.ToDateTime (value, XmlDateTimeSerializationMode.Unspecified);\r
-                               case TypeCode.Decimal: return XmlConvert.ToDecimal (value);\r
-                               case TypeCode.Double: return XmlConvert.ToDouble (value);\r
-                               case TypeCode.Int16: return XmlConvert.ToInt16 (value);\r
-                               case TypeCode.Int32: return XmlConvert.ToInt32 (value);\r
-                               case TypeCode.Int64: return XmlConvert.ToInt64 (value);\r
-                               case TypeCode.SByte: return XmlConvert.ToSByte (value);\r
-                               case TypeCode.Single: return XmlConvert.ToSingle (value);\r
-                               case TypeCode.UInt16: return XmlConvert.ToUInt16 (value);\r
-                               case TypeCode.UInt32: return XmlConvert.ToUInt32 (value);\r
-                               case TypeCode.UInt64: return XmlConvert.ToUInt64 (value);\r
-                       }\r
-\r
-                       if (type == typeof (TimeSpan)) return XmlConvert.ToTimeSpan (value);\r
-                       if (type == typeof (Guid)) return XmlConvert.ToGuid (value);\r
-                       if (type == typeof (byte[])) return Convert.FromBase64String (value);\r
-                       if (type == typeof (System.Type)) return System.Type.GetType (value);\r
-\r
-                       return Convert.ChangeType (value, type);\r
-               }\r
-       }\r
-}\r
diff --git a/mcs/class/System.Data/System.Data/XmlDiffLoader.cs b/mcs/class/System.Data/System.Data/XmlDiffLoader.cs
deleted file mode 100644 (file)
index 1f09303..0000000
+++ /dev/null
@@ -1,365 +0,0 @@
-//
-// mcs/class/System.Data/System.Data/XmlDiffLoader.cs
-//
-// Purpose: Loads XmlDiffGrams to DataSet 
-//
-// class: XmlDiffLoader
-// assembly: System.Data.dll
-// namespace: System.Data
-//
-// Author:
-//     Ville Palo <vi64pa@koti.soon.fi>
-//     Lluis Sanchez Gual (lluis@ximian.com)
-//
-// (c)copyright 2003 Ville Palo
-// Copyright 2011 Xamarin Inc.
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.Data;
-using System.Xml;
-using System.Xml.Schema;
-using System.Xml.XPath;
-using System.Collections;
-using System.Globalization;
-
-namespace System.Data {
-
-       internal class XmlDiffLoader 
-       {
-
-               #region Fields
-               private DataSet DSet;
-               private DataTable table;
-               private Hashtable DiffGrRows = new Hashtable ();
-               private Hashtable ErrorRows = new Hashtable ();
-
-               #endregion // Fields
-
-               #region ctors
-
-               public XmlDiffLoader (DataSet DSet) 
-               {
-                       this.DSet = DSet;
-               }
-
-               public XmlDiffLoader (DataTable table) 
-               {
-                       this.table = table;
-               }
-
-               #endregion //ctors
-
-               #region Public methods
-
-               public void Load (XmlReader reader) 
-               {
-                       bool origEnforceConstraint = false;
-                       if (DSet != null) {
-                               origEnforceConstraint = DSet.EnforceConstraints;
-                               DSet.EnforceConstraints = false;
-                       }
-                       
-                       reader.MoveToContent ();
-                       if (reader.IsEmptyElement) {
-                               reader.Skip ();
-                               return;
-                       }
-                       
-                       reader.ReadStartElement ("diffgram", XmlConstants.DiffgrNamespace);
-                       reader.MoveToContent ();
-                       
-                       while (reader.NodeType != XmlNodeType.EndElement)
-                       {
-                               if (reader.NodeType == XmlNodeType.Element)
-                               {
-                                       if (reader.LocalName == "before" && reader.NamespaceURI == XmlConstants.DiffgrNamespace)
-                                               LoadBefore (reader);
-                                       else if (reader.LocalName == "errors" && reader.NamespaceURI == XmlConstants.DiffgrNamespace)
-                                               LoadErrors (reader);
-                                       else
-                                               LoadCurrent (reader);
-                               }
-                               else
-                                       reader.Skip ();
-                       }
-                       
-                       reader.ReadEndElement ();
-                       
-                       if (DSet != null)
-                               DSet.EnforceConstraints = origEnforceConstraint;
-               }
-
-               #endregion // Public methods
-
-               #region Private methods
-
-               private void LoadCurrent (XmlReader reader) 
-               {
-                       if (reader.IsEmptyElement) {
-                               reader.Skip();
-                               return;
-                       }
-                       reader.ReadStartElement ();             // Dataset root
-                       reader.MoveToContent ();
-
-                       while (reader.NodeType != XmlNodeType.EndElement)
-                       {
-                               if (reader.NodeType == XmlNodeType.Element)
-                               {
-                                       DataTable t = GetTable (reader.LocalName);
-                                       if (t != null)
-                                               LoadCurrentTable (t, reader);
-#if true
-                                       else
-                                               reader.Skip ();
-#else
-                                       else 
-                                               throw new DataException (Locale.GetText ("Cannot load diffGram. Table '" + reader.LocalName + "' is missing in the destination dataset"));      
-#endif
-                               }
-                               else
-                                       reader.Skip ();
-                       }
-                       
-                       reader.ReadEndElement ();
-               }
-
-               private void LoadBefore (XmlReader reader) 
-               {
-                       if (reader.IsEmptyElement) {
-                               reader.Skip ();
-                               return;
-                       }
-                       reader.ReadStartElement ();
-                       reader.MoveToContent ();
-
-                       while (reader.NodeType != XmlNodeType.EndElement)
-                       {
-                               if (reader.NodeType == XmlNodeType.Element)
-                               {
-                                       DataTable t = GetTable (reader.LocalName);
-                                       if (t != null)
-                                               LoadBeforeTable(t, reader);
-                                       else
-                                               throw new DataException (Locale.GetText ("Cannot load diffGram. Table '" + reader.LocalName + "' is missing in the destination dataset"));
-                               }
-                               else
-                                       reader.Skip ();
-                       }
-                       
-                       reader.ReadEndElement ();
-               }                                
-                               
-                                          
-               private void LoadErrors (XmlReader reader) 
-               {
-                       if (reader.IsEmptyElement) {
-                               reader.Skip ();
-                               return;
-                       }
-                       reader.ReadStartElement ();
-                       reader.MoveToContent ();
-
-                       while (reader.NodeType != XmlNodeType.EndElement)
-                       {
-                               if (reader.NodeType == XmlNodeType.Element)
-                               {
-                                       DataRow Row = null;
-               
-                                       // find the row in 'current' section
-                                       
-                                       string id = reader.GetAttribute ("id", XmlConstants.DiffgrNamespace);
-                                       
-                                       if (id != null)
-                                               Row = (DataRow) ErrorRows [id];
-               
-                                       if (reader.IsEmptyElement) continue;
-                                       reader.ReadStartElement ();
-                                       while (reader.NodeType != XmlNodeType.EndElement)
-                                       {
-                                               if (reader.NodeType == XmlNodeType.Element) {
-                                                       string error = reader.GetAttribute ("Error", XmlConstants.DiffgrNamespace);
-                                                       Row.SetColumnError (reader.LocalName, error);
-                                               }
-                                               reader.Read ();
-                                       }
-                               }
-                               else
-                                       reader.Skip ();
-                       }
-                       reader.ReadEndElement ();
-               }
-
-               private void LoadColumns (DataTable Table, DataRow Row, 
-                       XmlReader reader, DataRowVersion loadType)
-               {
-                       // attributes
-                       LoadColumnAttributes (Table, Row, reader, loadType);
-                       LoadColumnChildren (Table, Row, reader, loadType);
-               }
-
-               private void LoadColumnAttributes (DataTable Table, DataRow Row,
-                       XmlReader reader, DataRowVersion loadType)
-               {
-                       if (!reader.HasAttributes // this check will be faster
-                               || !reader.MoveToFirstAttribute ())
-                               return;
-                       do {
-                               switch (reader.NamespaceURI) {
-                               case XmlConstants.XmlnsNS:
-                               case XmlConstants.XmlNS:
-                               case XmlConstants.DiffgrNamespace:
-                               case XmlConstants.MsdataNamespace:
-                               case XmlConstants.MspropNamespace:
-                               case XmlSchema.Namespace:
-                                       continue;
-                               }
-                               DataColumn c = Table.Columns [XmlHelper.Decode (reader.LocalName)];
-                               if (c == null ||
-                                       c.ColumnMapping != MappingType.Attribute)                                       continue;
-                               if (c.Namespace == null && reader.NamespaceURI == String.Empty ||
-                                       c.Namespace == reader.NamespaceURI) {
-                                       object data = XmlDataLoader.StringToObject (c.DataType, reader.Value);
-                                       if (loadType == DataRowVersion.Current)
-                                               Row [c] = data;
-                                       else
-                                               Row.SetOriginalValue (c.ColumnName, data);
-                               } // otherwise just ignore as well as unknown elements.
-                       } while (reader.MoveToNextAttribute ());
-                       reader.MoveToElement ();
-               }
-
-               private void LoadColumnChildren (DataTable Table, DataRow Row,
-                       XmlReader reader, DataRowVersion loadType) 
-               {
-                       // children
-                       if (reader.IsEmptyElement) {
-                               reader.Skip ();
-                               return;
-                       }
-                       reader.ReadStartElement ();
-                       reader.MoveToContent ();
-                       
-                       while (reader.NodeType != XmlNodeType.EndElement)
-                       {
-                               if (reader.NodeType != XmlNodeType.Element) { reader.Read (); continue; }
-                               
-                               string colName = XmlHelper.Decode (reader.LocalName);
-                               if (Table.Columns.Contains (colName)) 
-                               {
-                                       object data = XmlDataLoader.StringToObject (Table.Columns[colName].DataType, reader.ReadString ());
-                                       
-                                       if (loadType == DataRowVersion.Current) Row [colName] = data;
-                                       else Row.SetOriginalValue (colName, data);
-                                       reader.Read ();
-                               }
-                               else 
-                               {
-                                       DataTable t = GetTable (reader.LocalName);
-                                       if (t != null) {
-                                               if (loadType == DataRowVersion.Original)
-                                                       LoadBeforeTable (t, reader);
-                                               else if (loadType == DataRowVersion.Current)
-                                                       LoadCurrentTable (t, reader);
-                                       } else
-                                               reader.Skip ();
-                               }
-                       }
-                       
-                       reader.ReadEndElement ();
-               }
-
-               private void LoadBeforeTable (DataTable Table, XmlReader reader) 
-               {
-                       string id = reader.GetAttribute ("id", XmlConstants.DiffgrNamespace);
-                       string rowOrder = reader.GetAttribute ("rowOrder", XmlConstants.MsdataNamespace);
-                       DataRow Row = (DataRow) DiffGrRows [id];
-                       
-                       if (Row == null)
-                       {
-                               // Deleted row
-                               Row = Table.NewRow ();
-                               LoadColumns (Table, Row, reader, DataRowVersion.Current);
-                               Table.Rows.InsertAt (Row, int.Parse (rowOrder));
-                               Row.AcceptChanges ();
-                               Row.Delete ();
-                       }
-                       else
-                       {
-                               LoadColumns (Table, Row, reader, DataRowVersion.Original);
-                       }
-               }
-
-               private void LoadCurrentTable (DataTable Table, XmlReader reader) 
-               {
-                       DataRowState state;
-                       DataRow Row = Table.NewRow ();
-
-                       string id = reader.GetAttribute  ("id", XmlConstants.DiffgrNamespace);
-                       string error = reader.GetAttribute ("hasErrors");
-                       string changes = reader.GetAttribute ("hasChanges", XmlConstants.DiffgrNamespace);
-                       
-                       if (changes != null)
-                       {
-                               if (string.Compare (changes, "modified", true, CultureInfo.InvariantCulture) == 0) {
-                                       DiffGrRows.Add (id, Row); // for later use
-                                       state = DataRowState.Modified;
-                               }
-                               else if (string.Compare (changes, "inserted", true, CultureInfo.InvariantCulture) == 0) {
-                                       state = DataRowState.Added;
-                               }
-                               else
-                                       throw new InvalidOperationException ("Invalid row change state");
-                       }
-                       else
-                               state = DataRowState.Unchanged;
-                       
-                       // If row had errors add row to hashtable for later use
-                       if (error != null && string.Compare (error, "true", true, CultureInfo.InvariantCulture) == 0)
-                               ErrorRows.Add (id, Row);
-               
-                       LoadColumns (Table, Row, reader, DataRowVersion.Current);
-                       Table.Rows.Add (Row);
-                       
-                       if (state != DataRowState.Added)
-                               Row.AcceptChanges ();
-               }
-
-               DataTable GetTable (string name)
-               {
-                       name = XmlConvert.DecodeName (name);
-                       if (DSet != null) 
-                               return DSet.Tables [name];
-                       else if (name == table.TableName) 
-                               return table;
-                       else
-                               return null;
-               }
-
-
-               #endregion // Private methods
-       }
-}
diff --git a/mcs/class/System.Data/System.Data/XmlHelper.cs b/mcs/class/System.Data/System.Data/XmlHelper.cs
deleted file mode 100644 (file)
index d55a651..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-// 
-// System.Data/XmlHelper.cs
-//
-// Author:
-//   Senganal T <tsenganal@novell.com>
-//
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-using System;
-using System.Xml;
-using System.Collections;
-
-internal class XmlHelper {
-
-       static Hashtable localSchemaNameCache = new Hashtable ();
-       static Hashtable localXmlNameCache = new Hashtable ();
-
-       internal static string Decode (string xmlName)
-       {
-               string s = (string) localSchemaNameCache [xmlName];
-               if (s == null) {
-                       s = XmlConvert.DecodeName (xmlName);
-                       localSchemaNameCache [xmlName] = s;
-               }
-               return s;
-       }
-
-       internal static string Encode (string schemaName)
-       {
-               string s = (string) localXmlNameCache [schemaName];
-               if (s == null) {
-                       s = XmlConvert.EncodeLocalName (schemaName);
-                       localXmlNameCache [schemaName] = s;
-               }
-               return s;
-       }
-
-       internal static void ClearCache ()
-       {
-               localSchemaNameCache.Clear ();
-               localXmlNameCache.Clear ();
-       }
-}
diff --git a/mcs/class/System.Data/System.Data/XmlReadMode.cs b/mcs/class/System.Data/System.Data/XmlReadMode.cs
deleted file mode 100644 (file)
index 0047f87..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-//
-// System.Data.XmlReadMode.cs
-//
-// Author:
-//   Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace System.Data
-{
-       /// <summary>
-       /// Specifies how to read XML data and a relational schema into a DataSet.
-       /// </summary>
-       public enum XmlReadMode
-       {
-               Auto = 0,
-               ReadSchema = 1,
-               IgnoreSchema = 2,
-               InferSchema = 3,
-               DiffGram = 4,
-               InferTypedSchema=6,
-               Fragment =5
-       }
-}
diff --git a/mcs/class/System.Data/System.Data/XmlSchemaDataImporter.cs b/mcs/class/System.Data/System.Data/XmlSchemaDataImporter.cs
deleted file mode 100644 (file)
index 141ac9e..0000000
+++ /dev/null
@@ -1,1560 +0,0 @@
-//
-// XmlSchemaDataImporter.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// (C)2004 Novell Inc.
-//
-//
-// ***** The design note became somewhat obsolete. Should be rewritten. *****
-//
-// * Design Notes
-//
-// ** Abstract
-//
-//     This class is used to import an XML Schema into a DataSet schema.
-//
-//     Only XmlReader is acceptable as the input to the class.
-//     This class is not expected to read XML Schema multi time.
-//
-// ** Targetable Schema Components
-//
-//     Only global global elements that hold complex type are converted 
-//     into a table. 
-//     <del>
-//     The components of the type of the element are subsequently converted
-//     into a table, BUT there is an exception. As for "DataSet elements",
-//     the type is just ignored (see "DataSet Element definition" below).
-//     </del><ins>
-//     The components of the type of the element are subsequently converted
-//     into a table. As for "DataSet elements", its complex type is also 
-//     handled.
-//     </ins>
-//
-//     Unused complex types are never be converted.
-//
-//     Global simple types and global attributes are never converted.
-//     They cannot be a table.
-//     Local complex types are also converted into a table.
-//
-//     Local elements are converted into either a table or a column in
-//     the "context DataTable". Simple-typed element is not always converted
-//     into a DataColumn; if maxOccurs > 1, it will be converted as a table.
-//
-// ** Name Convention
-//
-//     Ignore this section. Microsoft.NET was buggy enough to confuse
-//     against these name conflicts.
-//
-//     Since local complex types are anonymous, we have to name for each
-//     component. Thus, and since complex types and elements can have the 
-//     same name each other, we have to manage a table for mappings from 
-//     a name to a component. The names must be also used in DataRelation
-//     definitions correctly.
-//
-// ** DataSet element definition
-//
-//     "DataSet element" is 1) such element that has an attribute 
-//     msdata:IsDataSet (where prefix "msdata" is bound to 
-//     urn:schemas-microsoft-com:xml-msdata), or 2) the only one
-//     element definition in the schema.
-//
-//     There is another complicated rule. 1) If there is only one element EL 
-//     in the schema, and 2) if the type of EL is complex named CT, and 3)
-//     the content of the CT is a group base, and 4) the group base contains 
-//     an element EL2, and finally 5) if EL2 is complex, THEN the element is
-//     the DataSet element.
-//
-//     Only the first global element that matches the condition above is
-//     regarded as DataSet element (by necessary design or just a bug?) 
-//     instead of handling as an error.
-//
-//     All global elements are considered as an alternative in the dataset
-//     element.
-//
-//     For local elements, msdata:IsDataSet are just ignored.
-//
-// ** Importing Complex Types as Columns
-//
-//     When an xs:element is going to be mapped, its complex type (remember
-//     that only complex-typed elements are targettable) are expanded to
-//     DataColumn.
-//
-//     DataColumn has a property MappingType that shows whether this column
-//      came from attribute or element.
-//
-//     [Question: How about MappingType.Simple? How is it used?]
-//
-//     Additionally, for particle elements, it might also create another
-//     DataTable (but for the particle elements in context DataTable, it
-//     will create an index to the new table).
-//
-//     For group base particles (XmlSchemaGroupBase; sequence, choice, all)
-//     each component in those groups are mapped to a column. Even if you
-//     import "choice" or "all" components, DataSet.WriteXmlSchema() will
-//     output them just as a "sequence".
-//
-//     Columns cannot be added directly to current context DataTable; they
-//     need to be added after processing all the columns, because they may
-//     have msdata:Ordinal attribute that specifies the order of the columns
-//     in the DataTable.
-//
-//     "Nested elements" are not allowed. (Clarification required?)
-//
-// ** Identity Constraints and DataRelations
-//
-// *** DataRelations from element identity constraints
-//
-//     Only constraints on "DataSet element" is considered. All other
-//     constraint definitions are ignored. Note that it is DataSet that has
-//     the property Relations (of type DataRelationCollection).
-//
-//     xs:key and xs:unique are handled as the same (then both will be
-//     serialized as xs:unique).
-//
-//     The XPath expressions in the constraints are strictly limited; they
-//     are expected to be expandable enough to be mappable for each
-//
-//             * selector to "any_valid_XPath/is/OK/blah" 
-//               where "blah" is one of the DataTable name. It looks that
-//               only the last QName section is significant and any heading
-//               XPath step is OK (even if the mapped node does not exist).
-//             * field to QName that is mapped to DataColumn in the DataTable
-//               (even ./QName is not allowed)
-//
-// *** DataRelations from annotations
-//
-//     See http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/_mapping_relationship_specified_for_nested_elements.asp and http://msdn.microsoft.com/library/en-us/cpguide/html/_specifying_relationship_between_elements_with_no_nesting.asp
-//
-// ** Informative References
-//
-// Generating DataSet Relational Structure from XML Schema (XSD)
-// http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/_generating_dataset_relational_structure_from_xsd.asp
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections;
-using System.Data;
-using System.Data.Common;
-using System.Globalization;
-using System.Xml;
-using System.Xml.Schema;
-
-
-namespace System.Data
-{
-       internal class TableStructureCollection : CollectionBase
-       {
-               public void Add (TableStructure table)
-               {
-                       List.Add (table);
-               }
-
-               public TableStructure this [int i] {
-                       get { return List [i] as TableStructure; }
-               }
-
-               public TableStructure this [string name] {
-                       get {
-                               foreach (TableStructure ts in List)
-                                       if (ts.Table.TableName == name)
-                                               return ts;
-                               return null;
-                       }
-               }
-       }
-
-       internal class RelationStructureCollection : CollectionBase
-       {
-               public void Add (RelationStructure rel)
-               {
-                       List.Add (rel);
-               }
-
-               public RelationStructure this [int i] {
-                       get { return List [i] as RelationStructure; }
-               }
-
-               public RelationStructure this [string parent, string child] {
-                       get {
-                               foreach (RelationStructure rel in List)
-                                       if (rel.ParentTableName == parent && rel.ChildTableName == child)
-                                               return rel;
-                               return null;
-                       }
-               }
-       }
-       
-       internal class TableStructure
-       {
-               public TableStructure (DataTable table)
-               {
-                       this.Table = table;
-               }
-
-               // The columns and orders which will be added to the context
-               // table (See design notes; Because of the ordinal problem)
-               public DataTable Table;
-               public Hashtable OrdinalColumns = new Hashtable ();
-               public ArrayList NonOrdinalColumns = new ArrayList ();
-               public DataColumn PrimaryKey;
-
-               public bool ContainsColumn (string name)
-               {
-                       foreach (DataColumn col in NonOrdinalColumns)
-                               if (col.ColumnName == name)
-                                       return true;
-                       foreach (DataColumn col in OrdinalColumns.Keys)
-                               if (col.ColumnName == name)
-                                       return true;
-                       return false;
-               }
-       }
-
-       internal class RelationStructure
-       {
-               public string ExplicitName;
-               public string ParentTableName;
-               public string ChildTableName;
-               public string ParentColumnName;
-               public string ChildColumnName;
-               public bool IsNested;
-               public bool CreateConstraint;
-       }
-
-       internal class ConstraintStructure
-       {
-               public readonly string TableName;
-               public readonly string [] Columns;
-               public readonly bool [] IsAttribute;
-               public readonly string ConstraintName;
-               public readonly bool IsPrimaryKey;
-               public readonly string ReferName;
-               public readonly bool IsNested;
-               public readonly bool IsConstraintOnly;
-
-               public ConstraintStructure (string tname, string [] cols, bool [] isAttr, string cname, bool isPK, string refName, bool isNested, bool isConstraintOnly)
-               {
-                       TableName = tname;
-                       Columns = cols;
-                       IsAttribute = isAttr;
-                       ConstraintName = XmlHelper.Decode (cname);
-                       IsPrimaryKey = isPK;
-                       ReferName = refName;
-                       IsNested = isNested;
-                       IsConstraintOnly = isConstraintOnly;
-               }
-       }
-
-       internal class XmlSchemaDataImporter
-       {
-               static readonly XmlSchemaDatatype schemaIntegerType;
-               static readonly XmlSchemaDatatype schemaDecimalType;
-               static readonly XmlSchemaComplexType schemaAnyType;
-
-               static XmlSchemaDataImporter ()
-               {
-                       XmlSchema s = new XmlSchema ();
-                       XmlSchemaAttribute a = new XmlSchemaAttribute ();
-                       a.Name = "foo";
-                       a.SchemaTypeName = new XmlQualifiedName ("integer", XmlSchema.Namespace);
-                       s.Items.Add (a);
-                       XmlSchemaAttribute b = new XmlSchemaAttribute ();
-                       b.Name = "bar";
-                       b.SchemaTypeName = new XmlQualifiedName ("decimal", XmlSchema.Namespace);
-                       s.Items.Add (b);
-                       XmlSchemaElement e = new XmlSchemaElement ();
-                       e.Name = "bar";
-                       s.Items.Add (e);
-                       s.Compile (null);
-                       schemaIntegerType = ((XmlSchemaSimpleType) a.AttributeSchemaType).Datatype;
-                       schemaDecimalType = ((XmlSchemaSimpleType) b.AttributeSchemaType).Datatype;
-                       schemaAnyType = e.ElementSchemaType as XmlSchemaComplexType;
-               }
-
-               #region Fields
-
-               DataSet dataset;
-               bool forDataSet;
-               XmlSchema schema;
-
-               ArrayList relations = new ArrayList ();
-               Hashtable reservedConstraints = new Hashtable ();
-
-               // such element that has an attribute msdata:IsDataSet="true"
-               XmlSchemaElement datasetElement;
-
-               // choice alternatives in the "dataset element"
-               ArrayList topLevelElements = new ArrayList ();
-
-               // import target elements
-               ArrayList targetElements = new ArrayList ();
-
-               TableStructure currentTable;
-       
-               // TODO: Do we need a collection here?
-               TableAdapterSchemaInfo currentAdapter;
-               #endregion
-
-               // .ctor()
-
-               public XmlSchemaDataImporter (DataSet dataset, XmlReader reader, bool forDataSet)
-               {
-                       this.dataset = dataset;
-                       this.forDataSet = forDataSet;
-                       dataset.DataSetName = "NewDataSet"; // Initialize always
-                       schema = XmlSchema.Read (reader, null);
-                       if (reader.NodeType == XmlNodeType.EndElement && reader.LocalName == "schema" && reader.NamespaceURI == XmlSchema.Namespace)
-                               reader.ReadEndElement ();
-                       schema.Compile (null);
-               }
-
-               // properties
-               internal TableAdapterSchemaInfo CurrentAdapter {
-                       get { return currentAdapter; }
-               }
-               
-               // methods
-
-               public void Process ()
-               {
-                       if (schema.Id != null)
-                               dataset.DataSetName = schema.Id; // default. Overridable by "DataSet element"
-                       dataset.Namespace = schema.TargetNamespace;
-
-                       // Find dataset element
-                       foreach (XmlSchemaObject obj in schema.Items) {
-                               XmlSchemaElement el = obj as XmlSchemaElement;
-                               if (el != null) {
-                                       if (datasetElement == null &&
-                                               IsDataSetElement (el))
-                                               datasetElement = el;
-                                       if (el.ElementSchemaType is XmlSchemaComplexType &&
-                                           el.ElementSchemaType != schemaAnyType)
-                                               targetElements.Add (obj);
-                               }
-                       }
-
-                       // make reservation of identity constraints
-                       if (datasetElement != null) {
-                               // keys/uniques.
-                               foreach (XmlSchemaObject obj in datasetElement.Constraints)
-                                       if (! (obj is XmlSchemaKeyref))
-                                               ReserveSelfIdentity ((XmlSchemaIdentityConstraint) obj);
-                               // keyrefs.
-                               foreach (XmlSchemaObject obj in datasetElement.Constraints)
-                                       if (obj is XmlSchemaKeyref)
-                                               ReserveRelationIdentity (datasetElement, (XmlSchemaKeyref) obj);
-                       }
-
-                       foreach (XmlSchemaObject obj in schema.Items) {
-                               if (obj is XmlSchemaElement) {
-                                       XmlSchemaElement el = obj as XmlSchemaElement;
-                                       if (el.ElementSchemaType is XmlSchemaComplexType &&
-                                           el.ElementSchemaType != schemaAnyType)
-                                               targetElements.Add (obj);
-                               }
-                       }
-
-                       // This collection will grow up while processing elements.
-                       int globalElementCount = targetElements.Count;
-
-                       for (int i = 0; i < globalElementCount; i++)
-                               ProcessGlobalElement ((XmlSchemaElement) targetElements [i]);
-
-                       // Rest are local elements.
-                       for (int i = globalElementCount; i < targetElements.Count; i++)
-                               ProcessDataTableElement ((XmlSchemaElement) targetElements [i]);
-
-                       // Handle relation definitions written as xs:annotation.
-                       // See detail: http://msdn.microsoft.com/library/shared/happyUrl/fnf_msdn.asp?Redirect=%22http://msdn.microsoft.com/404/default.asp%22
-                       foreach (XmlSchemaObject obj in schema.Items)
-                               if (obj is XmlSchemaAnnotation)
-                                       HandleAnnotations ((XmlSchemaAnnotation) obj, false);
-
-                       if (datasetElement != null) {
-                               // Handle constraints in the DataSet element. First keys.
-                               foreach (XmlSchemaObject obj in datasetElement.Constraints)
-                                       if (! (obj is XmlSchemaKeyref))
-                                               ProcessSelfIdentity (reservedConstraints [obj] as ConstraintStructure);
-                               // Then keyrefs.
-                               foreach (XmlSchemaObject obj in datasetElement.Constraints)
-                                       if (obj is XmlSchemaKeyref)
-                                               ProcessRelationIdentity (datasetElement, reservedConstraints [obj] as ConstraintStructure);
-                       }
-
-                       foreach (RelationStructure rs in this.relations)
-                               dataset.Relations.Add (GenerateRelationship (rs));
-               }
-
-               private bool IsDataSetElement (XmlSchemaElement el)
-               {
-                       if (el.UnhandledAttributes != null) {
-                               foreach (XmlAttribute attr in el.UnhandledAttributes) {
-                                       if (attr.LocalName == "IsDataSet" &&
-                                               attr.NamespaceURI == XmlConstants.MsdataNamespace) {
-                                               switch (attr.Value) {
-                                               case "true": // case sensitive
-                                                       return true;
-                                               case "false":
-                                                       break;
-                                               default:
-                                                       throw new DataException (String.Format ("Value {0} is invalid for attribute 'IsDataSet'.", attr.Value));
-                                               }
-                                       }
-                               }
-                       }
-
-                       if (schema.Elements.Count != 1)
-                               return false;
-                       if (!(el.SchemaType is XmlSchemaComplexType))
-                               return false;
-                       XmlSchemaComplexType ct = (XmlSchemaComplexType) el.SchemaType;
-                       if (ct.AttributeUses.Count > 0)
-                               return false;
-                       XmlSchemaGroupBase gb = ct.ContentTypeParticle as XmlSchemaGroupBase;
-                       if (gb == null || gb.Items.Count == 0)
-                               return false;
-                       foreach (XmlSchemaParticle p in gb.Items) {
-                               if (ContainsColumn (p))
-                                       return false;
-                       }
-                       return true;
-               }
-
-               private bool ContainsColumn (XmlSchemaParticle p)
-               {
-                       XmlSchemaElement el = p as XmlSchemaElement;
-                       if (el != null) {
-                               XmlSchemaComplexType ct = null;
-                               ct = el.ElementSchemaType as XmlSchemaComplexType;
-                               if (ct == null || ct == schemaAnyType)
-                                       return true; // column element
-                               if (ct.AttributeUses.Count > 0)
-                                       return false; // table element
-                               if (ct.ContentType == XmlSchemaContentType.TextOnly)
-                                       return true; // column element
-                               else
-                                       return false; // table element
-                       }
-                       XmlSchemaGroupBase gb = p as XmlSchemaGroupBase;
-                       for (int i = 0; i < gb.Items.Count; i++) {
-                               if (ContainsColumn ((XmlSchemaParticle) gb.Items [i]))
-                                       return true;
-                       }
-                       return false;
-               }
-
-               private void ProcessGlobalElement (XmlSchemaElement el)
-               {
-                       // If it is already registered (by resolving reference
-                       // in previously-imported elements), just ignore.
-                       if (dataset.Tables.Contains (el.QualifiedName.Name))
-                               return;
-
-                       // If type is not complex, just skip this element
-                       if (! (el.ElementSchemaType is XmlSchemaComplexType && el.ElementSchemaType != schemaAnyType))
-                               return;
-
-                       if (IsDataSetElement (el)) {
-                               ProcessDataSetElement (el);
-                               return;
-                       }
-                       else
-                               dataset.Locale = CultureInfo.CurrentCulture;
-
-                       // Register as a top-level element
-                       topLevelElements.Add (el);
-                       // Create DataTable for this element
-                       ProcessDataTableElement (el);
-               }
-
-               private void ProcessDataSetElement (XmlSchemaElement el)
-               {
-                       dataset.DataSetName = el.Name;
-                       this.datasetElement = el;
-
-                       // Search for locale attributes
-                       bool useCurrent = false;
-                       if (el.UnhandledAttributes != null) {
-                               foreach (XmlAttribute attr in el.UnhandledAttributes) {
-                                       if (attr.LocalName == "UseCurrentLocale" &&
-                                               attr.NamespaceURI == XmlConstants.MsdataNamespace)
-                                               useCurrent = true;
-
-                                       if (attr.NamespaceURI == XmlConstants.MspropNamespace && 
-                                           !dataset.ExtendedProperties.ContainsKey(attr.LocalName))
-                                       {
-                                               dataset.ExtendedProperties.Add (attr.LocalName, attr.Value);
-                                               continue;
-                                       }
-                                       
-                                       if (attr.LocalName == "Locale" &&
-                                               attr.NamespaceURI == XmlConstants.MsdataNamespace) {
-                                               CultureInfo ci = new CultureInfo (attr.Value);
-                                               dataset.Locale = ci;
-                                       }
-                               }
-                       }
-                       if (!useCurrent && !dataset.LocaleSpecified) // then set current culture instance _explicitly_
-                               dataset.Locale = CultureInfo.CurrentCulture;
-
-                       // Process content type particle (and create DataTable)
-                       XmlSchemaComplexType ct = null;
-                       ct = el.ElementSchemaType as XmlSchemaComplexType;
-                       XmlSchemaParticle p = ct != null ? ct.ContentTypeParticle : null;
-                       if (p != null)
-                               HandleDataSetContentTypeParticle (p);
-               }
-
-               private void HandleDataSetContentTypeParticle (XmlSchemaParticle p)
-               {
-                       XmlSchemaElement el = p as XmlSchemaElement;
-                       if (el != null) {
-                               if (el.ElementSchemaType is XmlSchemaComplexType && el.RefName != el.QualifiedName)
-                                       ProcessDataTableElement (el);
-                       }
-                       else if (p is XmlSchemaGroupBase) {
-                               foreach (XmlSchemaParticle pc in ((XmlSchemaGroupBase) p).Items)
-                                       HandleDataSetContentTypeParticle (pc);
-                       }
-               }
-
-               private void ProcessDataTableElement (XmlSchemaElement el)
-               {
-                       string tableName = XmlHelper.Decode (el.QualifiedName.Name);
-                       // If it is already registered, just ignore.
-                       if (dataset.Tables.Contains (tableName))
-                               return;
-
-                       DataTable table = new DataTable (tableName);
-                       table.Namespace = el.QualifiedName.Namespace;
-                       TableStructure oldTable = currentTable;
-                       currentTable = new TableStructure (table);
-
-                       dataset.Tables.Add (table);
-
-                       // Find Locale
-                       if (el.UnhandledAttributes != null) {
-                               foreach (XmlAttribute attr in el.UnhandledAttributes) {
-
-                                       if (attr.NamespaceURI == XmlConstants.MspropNamespace)
-                                       {
-                                               table.ExtendedProperties.Add (attr.LocalName, attr.Value);
-                                               continue;
-                                       }
-
-                                       if (attr.LocalName == "Locale" &&
-                                               attr.NamespaceURI == XmlConstants.MsdataNamespace)
-                                               table.Locale = new CultureInfo (attr.Value);
-                               }
-                       }
-
-                       // Handle complex type (NOTE: It is (or should be)
-                       // impossible the type is other than complex type).
-                       XmlSchemaComplexType ct = null;
-                       ct = (XmlSchemaComplexType) el.ElementSchemaType;
-
-                       // Handle attributes
-                       foreach (DictionaryEntry de in ct.AttributeUses)
-                               ImportColumnAttribute ((XmlSchemaAttribute) de.Value);
-
-                       // Handle content type particle
-                       if (ct.ContentTypeParticle is XmlSchemaElement)
-                               ImportColumnElement (el, (XmlSchemaElement) ct.ContentTypeParticle);
-                       else if (ct.ContentTypeParticle is XmlSchemaGroupBase)
-                               ImportColumnGroupBase (el, (XmlSchemaGroupBase) ct.ContentTypeParticle);
-                       // else if null then do nothing.
-
-                       // Handle simple content
-                       switch (ct.ContentType) {
-                       case XmlSchemaContentType.TextOnly:
-//                     case XmlSchemaContentType.Mixed:
-                               // LAMESPEC: When reading from XML Schema, it maps to "_text", while on the data inference, it is mapped to "_Text" (case ignorant).
-                               string simpleName = el.QualifiedName.Name + "_text";
-                               DataColumn simple = new DataColumn (simpleName);
-                               simple.Namespace = el.QualifiedName.Namespace;
-                               simple.AllowDBNull = (el.MinOccurs == 0);
-                               simple.ColumnMapping = MappingType.SimpleContent;
-                               simple.DataType = ConvertDatatype (ct.Datatype);
-                               currentTable.NonOrdinalColumns.Add (simple);
-                               break;
-                       }
-
-                       // add columns to the table in specified order 
-                       // (by msdata:Ordinal attributes)
-                       SortedList sd = new SortedList ();
-                       foreach (DictionaryEntry de in currentTable.OrdinalColumns)
-                               sd.Add (de.Value, de.Key);
-                       foreach (DictionaryEntry de in sd)
-                               table.Columns.Add ((DataColumn) de.Value);
-                       foreach (DataColumn dc in currentTable.NonOrdinalColumns)
-                               table.Columns.Add (dc);
-
-                       currentTable = oldTable;
-               }
-
-               private DataRelation GenerateRelationship (RelationStructure rs)
-               {
-                       DataTable ptab = dataset.Tables [rs.ParentTableName];
-                       DataTable ctab = dataset.Tables [rs.ChildTableName];
-
-                       DataRelation rel ;
-                       string name = rs.ExplicitName != null ? rs.ExplicitName : XmlHelper.Decode (ptab.TableName) + '_' + XmlHelper.Decode (ctab.TableName);
-
-                       // Annotation Relations belonging to a DataSet can contain multiple colnames
-                       // in parentkey and childkey.
-                       if (datasetElement != null) {
-                               String[] pcolnames = rs.ParentColumnName.Split (null);
-                               String[] ccolnames = rs.ChildColumnName.Split (null);
-
-                               DataColumn[] pcol = new DataColumn [pcolnames.Length];
-                               for (int i=0; i<pcol.Length; ++i)
-                                       pcol [i] = ptab.Columns [XmlHelper.Decode (pcolnames [i])];
-
-                               DataColumn[] ccol = new DataColumn [ccolnames.Length];
-                               for (int i=0; i < ccol.Length; ++i) {
-                                       ccol [i] = ctab.Columns [XmlHelper.Decode (ccolnames [i])];
-                                       if (ccol [i] == null)
-                                               ccol [i] = CreateChildColumn (pcol [i], ctab);
-                               }
-                               rel = new DataRelation (name, pcol, ccol, rs.CreateConstraint);
-                       } else {
-                               DataColumn pcol = ptab.Columns [XmlHelper.Decode (rs.ParentColumnName)];
-                               DataColumn ccol = ctab.Columns [XmlHelper.Decode (rs.ChildColumnName)];
-                               if (ccol == null) 
-                                       ccol = CreateChildColumn (pcol, ctab);
-                               rel = new DataRelation (name, pcol, ccol, rs.CreateConstraint);
-                       }
-                       rel.Nested = rs.IsNested;
-                       if (rs.CreateConstraint)
-                               rel.ParentTable.PrimaryKey = rel.ParentColumns;
-                       return rel;
-               }
-
-               private DataColumn CreateChildColumn (DataColumn parentColumn, DataTable childTable)
-               {
-                       DataColumn col = childTable.Columns.Add (parentColumn.ColumnName, 
-                                                               parentColumn.DataType);
-                       col.Namespace = String.Empty;
-                       col.ColumnMapping = MappingType.Hidden;
-                       return col;
-               }
-
-               private void ImportColumnGroupBase (XmlSchemaElement parent, XmlSchemaGroupBase gb)
-               {
-                       foreach (XmlSchemaParticle p in gb.Items) {
-                               XmlSchemaElement el = p as XmlSchemaElement;
-                               if (el != null)
-                                       ImportColumnElement (parent, el);
-                               else if (p is XmlSchemaGroupBase)
-                                       ImportColumnGroupBase (parent, (XmlSchemaGroupBase) p);
-                               // otherwise p is xs:any
-                       }
-               }
-
-               private XmlSchemaDatatype GetSchemaPrimitiveType (object type)
-               {
-                       if (type is XmlSchemaComplexType)
-                               return null; // It came here, so that maybe it is xs:anyType
-                       XmlSchemaDatatype dt = type as XmlSchemaDatatype;
-                       if (dt == null && type != null)
-                               dt = ((XmlSchemaSimpleType) type).Datatype;
-                       return dt;
-               }
-
-               // Note that this column might be Hidden
-               private void ImportColumnAttribute (XmlSchemaAttribute attr)
-               {
-                       DataColumn col = new DataColumn ();
-                       col.ColumnName = attr.QualifiedName.Name;
-                       col.Namespace = attr.QualifiedName.Namespace;
-                       XmlSchemaDatatype dt = null;
-                       dt = GetSchemaPrimitiveType (((XmlSchemaSimpleType) attr.AttributeSchemaType).Datatype);
-                       // This complicated check comes from the fact that
-                       // MS.NET fails to map System.Object to anyType (that
-                       // will cause ReadTypedObject() fail on XmlValidatingReader).
-                       // ONLY In DataSet context, we set System.String for
-                       // simple ur-type.
-                       col.DataType = ConvertDatatype (dt);
-                       if (col.DataType == typeof (object))
-                               col.DataType = typeof (string);
-                       // When attribute use="prohibited", then it is regarded as 
-                       // Hidden column.
-                       if (attr.Use == XmlSchemaUse.Prohibited)
-                               col.ColumnMapping = MappingType.Hidden;
-                       else {
-                               col.ColumnMapping = MappingType.Attribute;
-                               col.DefaultValue = GetAttributeDefaultValue (attr);
-                       }
-                       if (attr.Use == XmlSchemaUse.Required)
-                               col.AllowDBNull = false;
-
-                       FillFacet (col, attr.AttributeSchemaType as XmlSchemaSimpleType);
-
-                       // Call this method after filling the name
-                       ImportColumnMetaInfo (attr, attr.QualifiedName, col);
-                       AddColumn (col);
-               }
-
-               private void ImportColumnElement (XmlSchemaElement parent, XmlSchemaElement el)
-               {
-                       // FIXME: element nest check
-
-                       DataColumn col = new DataColumn ();
-                       col.DefaultValue = GetElementDefaultValue (el);
-                       col.AllowDBNull = (el.MinOccurs == 0);
-
-                       if (el.ElementSchemaType is XmlSchemaComplexType && el.ElementSchemaType != schemaAnyType)
-                               FillDataColumnComplexElement (parent, el, col);
-                       else if (el.MaxOccurs != 1)
-                               FillDataColumnRepeatedSimpleElement (parent, el, col);
-                       else
-                               FillDataColumnSimpleElement (el, col);
-               }
-
-               // common process for element and attribute
-               private void ImportColumnMetaInfo (XmlSchemaAnnotated obj, XmlQualifiedName name, DataColumn col)
-               {
-                       if (obj.UnhandledAttributes != null) {
-                               foreach (XmlAttribute attr in obj.UnhandledAttributes) {
-                                       if (attr.NamespaceURI == XmlConstants.MspropNamespace)
-                                       {
-                                               col.ExtendedProperties.Add (attr.LocalName, attr.Value);
-                                               continue;
-                                       }
-
-                                       if (attr.NamespaceURI != XmlConstants.MsdataNamespace)
-                                               continue;
-                                       switch (attr.LocalName) {
-                                       case XmlConstants.Caption:
-                                               col.Caption = attr.Value;
-                                               break;
-                                       case XmlConstants.DataType:
-                                               col.DataType = Type.GetType (attr.Value);
-                                               break;
-                                       case XmlConstants.AutoIncrement:
-                                               col.AutoIncrement = bool.Parse (attr.Value);
-                                               break;
-                                       case XmlConstants.AutoIncrementSeed:
-                                               col.AutoIncrementSeed = int.Parse (attr.Value);
-                                               break;
-                                       case XmlConstants.AutoIncrementStep:
-                                               col.AutoIncrementStep = int.Parse (attr.Value);
-                                               break;
-                                       case XmlConstants.ReadOnly:
-                                               col.ReadOnly = XmlConvert.ToBoolean (attr.Value);
-                                               break;
-                                       case XmlConstants.Ordinal:
-                                               int ordinal = int.Parse (attr.Value);
-                                               break;
-                                       }
-                               }
-                       }
-               }
-
-               private void FillDataColumnComplexElement (XmlSchemaElement parent, XmlSchemaElement el, DataColumn col)
-               {
-                       if (targetElements.Contains (el))
-                               return; // do nothing
-
-                       string elName = XmlHelper.Decode (el.QualifiedName.Name);
-                       if (elName == dataset.DataSetName)
-                               // Well, why it is ArgumentException :-?
-                               throw new ArgumentException ("Nested element must not have the same name as DataSet's name.");
-
-                       if (el.Annotation != null)
-                               HandleAnnotations (el.Annotation, true);
-                       // If xsd:keyref xsd:key for this table exists, then don't add
-                       // relation here manually.
-                       else if (!DataSetDefinesKey (elName)) {
-                               AddParentKeyColumn (parent, el, col);
-
-                               RelationStructure rel = new RelationStructure ();
-                               rel.ParentTableName = XmlHelper.Decode (parent.QualifiedName.Name);
-                               rel.ChildTableName = elName;
-                               rel.ParentColumnName = col.ColumnName;
-                               rel.ChildColumnName = col.ColumnName;
-                               rel.CreateConstraint = true;
-                               rel.IsNested = true;
-                               relations.Add (rel);
-                       }
-
-                       // If the element is not referenced one, the element will be handled later.
-                       if (el.RefName == XmlQualifiedName.Empty)
-                               ProcessDataTableElement (el);
-
-               }
-
-               private bool DataSetDefinesKey (string name)
-               {
-                       foreach (ConstraintStructure c in reservedConstraints.Values)
-                               if (c.TableName == name && (c.IsPrimaryKey || c.IsNested))
-                                       return true;
-                       return false;
-               }
-
-               private void AddParentKeyColumn (XmlSchemaElement parent, XmlSchemaElement el, DataColumn col)
-               {
-                       // check existing primary key
-                       if (currentTable.Table.PrimaryKey.Length > 0)
-                               throw new DataException (String.Format ("There is already primary key columns in the table \"{0}\".", currentTable.Table.TableName));
-
-                       if (currentTable.PrimaryKey != null) {
-                               // fill pk column info and return
-                               col.ColumnName = currentTable.PrimaryKey.ColumnName;
-                               col.ColumnMapping = currentTable.PrimaryKey.ColumnMapping;
-                               col.Namespace = currentTable.PrimaryKey.Namespace;
-                               col.DataType = currentTable.PrimaryKey.DataType;
-                               col.AutoIncrement = currentTable.PrimaryKey.AutoIncrement;
-                               col.AllowDBNull = currentTable.PrimaryKey.AllowDBNull;
-                               
-                               ImportColumnMetaInfo (el, el.QualifiedName, col);
-                               return;
-                       }
-
-                       // check name identity
-                       string name = XmlHelper.Decode (parent.QualifiedName.Name) + "_Id";
-                       int count = 0;
-                       while (currentTable.ContainsColumn (name))
-                               name = String.Format ("{0}_{1}", name, count++);
-
-                       col.ColumnName = name;
-                       col.ColumnMapping = MappingType.Hidden;
-                       col.Namespace = parent.QualifiedName.Namespace;
-                       col.DataType = typeof (int);
-                       col.AutoIncrement = true;
-                       col.AllowDBNull = false;
-                       ImportColumnMetaInfo (el, el.QualifiedName, col);
-                       
-                       AddColumn (col);
-                       currentTable.PrimaryKey = col;
-               }
-
-               private void FillDataColumnRepeatedSimpleElement (XmlSchemaElement parent, XmlSchemaElement el, DataColumn col)
-               {
-                       if (targetElements.Contains (el))
-                               return; // do nothing
-
-                       AddParentKeyColumn (parent, el, col);
-                       DataColumn pkey = currentTable.PrimaryKey;
-
-                       string elName = XmlHelper.Decode (el.QualifiedName.Name);
-                       string parentName = XmlHelper.Decode (parent.QualifiedName.Name);
-
-                       DataTable dt = new DataTable ();
-                       dt.TableName = elName;
-                       dt.Namespace = el.QualifiedName.Namespace;
-                       // reference key column to parent
-                       DataColumn cc = new DataColumn ();
-                       cc.ColumnName = parentName + "_Id";
-                       cc.Namespace = parent.QualifiedName.Namespace;
-                       cc.ColumnMapping = MappingType.Hidden;
-                       cc.DataType = typeof (int);
-
-                       // repeatable content simple element
-                       DataColumn cc2 = new DataColumn ();
-                       cc2.ColumnName = elName + "_Column";
-                       cc2.Namespace = el.QualifiedName.Namespace;
-                       cc2.ColumnMapping = MappingType.SimpleContent;
-                       cc2.AllowDBNull = false;
-                       cc2.DataType = ConvertDatatype (GetSchemaPrimitiveType (el.ElementSchemaType));
-
-                       dt.Columns.Add (cc2);
-                       dt.Columns.Add (cc);
-                       dataset.Tables.Add (dt);
-
-                       RelationStructure rel = new RelationStructure ();
-                       rel.ParentTableName = parentName;
-                       rel.ChildTableName = dt.TableName;
-                       rel.ParentColumnName = pkey.ColumnName;
-                       rel.ChildColumnName = cc.ColumnName;
-                       rel.IsNested = true;
-                       rel.CreateConstraint = true;
-                       relations.Add (rel);
-               }
-
-               private void FillDataColumnSimpleElement (XmlSchemaElement el, DataColumn col)
-               {
-                       col.ColumnName = XmlHelper.Decode (el.QualifiedName.Name);
-                       col.Namespace = el.QualifiedName.Namespace;
-                       col.ColumnMapping = MappingType.Element;
-                       col.DataType = ConvertDatatype (GetSchemaPrimitiveType (el.ElementSchemaType));
-                       FillFacet (col, el.ElementSchemaType as XmlSchemaSimpleType);
-
-                       ImportColumnMetaInfo (el, el.QualifiedName, col);
-
-                       AddColumn (col);
-               }
-
-               private void AddColumn (DataColumn col)
-               {
-                       if (col.Ordinal < 0)
-                               currentTable.NonOrdinalColumns.Add (col);
-                       else
-                               currentTable.OrdinalColumns.Add (col, col.Ordinal);
-               }
-
-               private void FillFacet (DataColumn col, XmlSchemaSimpleType st)
-               {
-                       if (st == null || st.Content == null)
-                               return;
-
-                       // Handle restriction facets
-
-                       XmlSchemaSimpleTypeRestriction restriction = st == null ? null : st.Content as XmlSchemaSimpleTypeRestriction;
-                       if (restriction == null)
-                               throw new DataException ("DataSet does not suport 'list' nor 'union' simple type.");
-
-                       foreach (XmlSchemaFacet f in restriction.Facets) {
-                               if (f is XmlSchemaMaxLengthFacet)
-                                       // There is no reason why MaxLength is limited to int, except for the fact that DataColumn.MaxLength property is int.
-                                       col.MaxLength = int.Parse (f.Value);
-                       }
-               }
-
-               private Type ConvertDatatype (XmlSchemaDatatype dt)
-               {
-                       if (dt == null)
-                               return typeof (string);
-                       else if (dt.ValueType == typeof (decimal)) {
-                               // LAMESPEC: MSDN documentation says it is based 
-                               // on ValueType. However, in the System.Xml.Schema
-                               // context, xs:integer is mapped to Decimal, while
-                               // in DataSet context it is mapped to Int64.
-                               if (dt == schemaDecimalType)
-                                       return typeof (decimal);
-                               else if (dt == schemaIntegerType)
-                                       return typeof (long);
-                               else
-                                       return typeof (ulong);
-                       }
-                       else
-                               return dt.ValueType;
-               }
-
-               // This method cuts out the local name of the last step from XPath.
-               // It is nothing more than hack. However, MS looks to do similar.
-               private string GetSelectorTarget (string xpath)
-               {
-                       string tableName = xpath;
-                       int index = tableName.LastIndexOf ('/');
-                       // '>' is enough. If XPath [0] = '/', it is invalid. 
-                       // Selector can specify only element axes.
-                       if (index > 0)
-                               tableName = tableName.Substring (index + 1);
-
-                       // Round QName to NSName
-                       index = tableName.LastIndexOf (':');
-                       if (index > 0)
-                               tableName = tableName.Substring (index + 1);
-
-                       return XmlHelper.Decode (tableName);
-               }
-
-               private void ReserveSelfIdentity (XmlSchemaIdentityConstraint ic)
-               {
-                       string tableName = GetSelectorTarget (ic.Selector.XPath);
-
-                       string [] cols = new string [ic.Fields.Count];
-                       bool [] isAttrSpec = new bool [cols.Length];
-
-                       int i = 0;
-                       foreach (XmlSchemaXPath Field in ic.Fields) {
-                               string colName = Field.XPath;
-                               bool isAttr = colName.Length > 0 && colName [0] == '@';
-                               int index = colName.LastIndexOf (':');
-                               if (index > 0)
-                                       colName = colName.Substring (index + 1);
-                               else if (isAttr)
-                                       colName = colName.Substring (1);
-
-                               colName = XmlHelper.Decode (colName);
-                               cols [i] = colName;
-                               isAttrSpec [i] = isAttr;
-                               i++;
-                       }
-                       
-                       bool isPK = false;
-                       // find if there is an attribute with the constraint name
-                       // if not use the XmlSchemaConstraint's name.
-                       string constraintName = ic.Name;
-                       if (ic.UnhandledAttributes != null) {
-                               foreach (XmlAttribute attr in ic.UnhandledAttributes) {
-                                       if (attr.NamespaceURI != XmlConstants.MsdataNamespace)
-                                               continue;
-                                       switch (attr.LocalName) {
-                                       case XmlConstants.ConstraintName:
-                                               constraintName = attr.Value;
-                                               break;
-                                       case XmlConstants.PrimaryKey:
-                                               isPK = bool.Parse(attr.Value);
-                                               break;
-                                       }
-                               }
-                       }
-                       reservedConstraints.Add (ic,
-                               new ConstraintStructure (tableName, cols,
-                                       isAttrSpec, constraintName, isPK, null, false, false));
-               }
-
-               private void ProcessSelfIdentity (ConstraintStructure c)
-               {
-                       // Basic concept came from XmlSchemaMapper.cs
-
-                       string tableName = c.TableName;
-                       
-                       DataTable dt = dataset.Tables [tableName];
-                       if (dt == null) {
-                               if (forDataSet)
-                                       throw new DataException (String.Format ("Invalid XPath selection inside selector. Cannot find: {0}", tableName));
-                               else
-                                       // nonexistent table name. .NET ignores it for DataTable.ReadXmlSchema().
-                                       return;
-                       }
-
-                       DataColumn [] cols = new DataColumn [c.Columns.Length];
-                       for (int i = 0; i < cols.Length; i++) {
-                               string colName = c.Columns [i];
-                               bool isAttr = c.IsAttribute [i];
-                               DataColumn col = dt.Columns [colName];
-                               if (col == null)
-                                       throw new DataException (String.Format ("Invalid XPath selection inside field. Cannot find: {0}", tableName));
-                               if (isAttr && col.ColumnMapping != MappingType.Attribute)
-                                       throw new DataException ("The XPath specified attribute field, but mapping type is not attribute.");
-                               if (!isAttr && col.ColumnMapping != MappingType.Element)
-                                       throw new DataException ("The XPath specified simple element field, but mapping type is not simple element.");
-
-                               cols [i] = dt.Columns [colName];
-                       }
-                       
-                       bool isPK = c.IsPrimaryKey;
-                       string constraintName = c.ConstraintName;
-                       dt.Constraints.Add (new UniqueConstraint (
-                               constraintName, cols, isPK));
-               }
-
-               private void ReserveRelationIdentity (XmlSchemaElement element, XmlSchemaKeyref keyref)
-               {
-                       // Basic concept came from XmlSchemaMapper.cs
-
-                       string tableName = GetSelectorTarget (keyref.Selector.XPath);
-
-                       string [] cols = new string [keyref.Fields.Count];
-                       bool [] isAttrSpec = new bool [cols.Length];
-                       int i = 0;
-                       foreach (XmlSchemaXPath Field in keyref.Fields) {
-                               string colName = Field.XPath;
-                               bool isAttr = colName.Length > 0 && colName [0] == '@';
-                               int index = colName.LastIndexOf (':');
-                               if (index > 0)
-                                       colName = colName.Substring (index + 1);
-                               else if (isAttr)
-                                       colName = colName.Substring (1);
-
-                               colName = XmlHelper.Decode (colName);
-                               cols [i] = colName;
-                               isAttrSpec [i] = isAttr;
-                               i++;
-                       }
-                       string constraintName = keyref.Name;
-                       bool isNested = false;
-                       bool isConstraintOnly = false;
-                       if (keyref.UnhandledAttributes != null) {
-                               foreach (XmlAttribute attr in keyref.UnhandledAttributes) {
-                                       if (attr.NamespaceURI != XmlConstants.MsdataNamespace)
-                                               continue;
-                                       switch (attr.LocalName) {
-                                       case XmlConstants.ConstraintName:
-                                               constraintName = attr.Value;
-                                               break;
-                                       case XmlConstants.IsNested:
-                                               if (attr.Value == "true")
-                                                       isNested = true;
-                                               break;
-                                       case XmlConstants.ConstraintOnly:
-                                               if (attr.Value == "true")
-                                                       isConstraintOnly = true;
-                                               break;
-                                       }
-                               }
-                       }
-
-                       reservedConstraints.Add (keyref, new ConstraintStructure (
-                               tableName, cols, isAttrSpec, constraintName,
-                               false, keyref.Refer.Name, isNested, isConstraintOnly));
-               }
-
-               private void ProcessRelationIdentity (XmlSchemaElement element, ConstraintStructure c)
-               {
-                       // Basic concept came from XmlSchemaMapper.cs
-
-                       string tableName = c.TableName;
-
-                       DataColumn [] cols;
-                       DataTable dt = dataset.Tables [tableName];
-                       if (dt == null)
-                               throw new DataException (String.Format ("Invalid XPath selection inside selector. Cannot find: {0}", tableName));
-
-                       cols = new DataColumn [c.Columns.Length];
-                       for (int i = 0; i < cols.Length; i++) {
-                               string colName = c.Columns [i];
-                               bool isAttr = c.IsAttribute [i];
-                               DataColumn col = dt.Columns [colName];
-                               if (isAttr && col.ColumnMapping != MappingType.Attribute)
-                                       throw new DataException ("The XPath specified attribute field, but mapping type is not attribute.");
-                               if (!isAttr && col.ColumnMapping != MappingType.Element)
-                                       throw new DataException ("The XPath specified simple element field, but mapping type is not simple element.");
-                               cols [i] = col;
-                       }
-                       string name = c.ReferName;
-                       // get the unique constraint for the releation
-                       UniqueConstraint uniq = FindConstraint (name, element);
-                       // generate the FK.
-                       ForeignKeyConstraint fkc = new ForeignKeyConstraint(c.ConstraintName, uniq.Columns, cols);
-                       dt.Constraints.Add (fkc);
-
-                       if (!c.IsConstraintOnly) {
-                               // generate the relation.
-                               DataRelation rel = new DataRelation (c.ConstraintName, uniq.Columns, cols, true);
-                               rel.Nested = c.IsNested;
-                               rel.SetParentKeyConstraint (uniq);
-                               rel.SetChildKeyConstraint (fkc);
-
-                               dataset.Relations.Add (rel);
-                       }
-               }
-
-               // get the unique constraint for the relation.
-               // name - the name of the XmlSchemaUnique element
-               private UniqueConstraint FindConstraint (string name, XmlSchemaElement element)
-               {
-                       // Copied from XmlSchemaMapper.cs
-
-                       // find the element in the constraint collection.
-                       foreach (XmlSchemaIdentityConstraint c in element.Constraints) {
-                               if (c is XmlSchemaKeyref)
-                                       continue;
-
-                               if (c.Name == name) {
-                                       string tableName = GetSelectorTarget (c.Selector.XPath);
-
-                                       // find the table in the dataset.
-                                       DataTable dt = dataset.Tables [tableName];
-
-                                       string constraintName = c.Name;
-                                       // find if there is an attribute with the constraint name
-                                       // if not use the XmlSchemaUnique name.
-                                       if (c.UnhandledAttributes != null)
-                                               foreach (XmlAttribute attr in c.UnhandledAttributes)
-                                                       if (attr.LocalName == "ConstraintName" && attr.NamespaceURI == XmlConstants.MsdataNamespace)
-                                                               constraintName = attr.Value;
-                                       return (UniqueConstraint) dt.Constraints [constraintName];
-                               }
-                       }
-                       throw new DataException ("Target identity constraint was not found: " + name);
-               }
-
-               private void HandleAnnotations (XmlSchemaAnnotation an, bool nested)
-               {
-                       foreach (XmlSchemaObject content in an.Items) {
-                               XmlSchemaAppInfo ai = content as XmlSchemaAppInfo;
-                               if (ai != null) {
-                                       foreach (XmlNode n in ai.Markup) {
-                                               XmlElement el = n as XmlElement;
-                                               
-                                               // #325464 debugging
-                                               //Console.WriteLine ("Name: " + el.LocalName + " NS: " + el.NamespaceURI + " Const: " + XmlConstants.MsdataNamespace);
-                                               if (el != null && el.LocalName == "Relationship" && el.NamespaceURI == XmlConstants.MsdataNamespace)
-                                                       HandleRelationshipAnnotation (el, nested);
-                                               if (el != null && el.LocalName == "DataSource" && el.NamespaceURI == XmlConstants.MsdatasourceNamespace)
-                                                       HandleDataSourceAnnotation (el, nested);
-                                       }
-                               }
-                       }
-               }
-
-               private void HandleDataSourceAnnotation (XmlElement el, bool nested)
-               {
-                       // Handle: Connections and Tables
-                       // For Tables: extract the provider information from connection and use
-                       // the corresponding providerfactory to create the adapter and et al objects 
-                       // and populate them
-                       
-                       // #325464 debugging
-                       //Console.WriteLine ("In HandleDataSourceAnnotation... ");
-                       string providerName = null;
-                       string connString = null;
-                       DbProviderFactory provider = null;
-                       XmlElement e, tablesElement = null, firstChild;
-                       
-                       foreach (XmlNode n in el.ChildNodes) {
-                               e = n as XmlElement;
-                               
-                               if (e == null)
-                                       continue;
-                               
-#if !MOBILE
-                               if (e.LocalName == "Connections" && (firstChild = e.FirstChild as XmlElement) != null) {
-                                       providerName = firstChild.GetAttribute ("Provider");
-                                       connString = firstChild.GetAttribute ("AppSettingsPropertyName");
-                                       provider = DbProviderFactories.GetFactory (providerName);
-                                       continue;
-                               }
-#endif
-                               // #325464 debugging
-                               //Console.WriteLine ("ProviderName: " + providerName + "Connstr: " + connString);
-                               
-                               if (e.LocalName == "Tables")
-                                       tablesElement = e;
-                       }
-                               
-                       if (tablesElement != null && provider != null) {
-                               foreach (XmlNode node in tablesElement.ChildNodes) {
-                                       ProcessTableAdapter (node as XmlElement, provider, connString);
-                               }
-                       }
-               }
-               
-               private void ProcessTableAdapter (XmlElement el, DbProviderFactory provider, string connStr)
-               {
-                       XmlElement e;
-                       string datasetTableName = null;
-                       
-                       if (el == null)
-                               return;
-                       
-                       // #325464 debugging
-                       //Console.WriteLine ("in ProcessTableAdapters...");
-                       currentAdapter = new TableAdapterSchemaInfo (provider); 
-                       currentAdapter.ConnectionString = connStr;
-                       
-                       //Console.WriteLine ("Provider: {0}, connection: {1}, adapter: {2}", 
-                       //                   provider, currentAdapter.Connection, currentAdapter.Adapter);
-                       currentAdapter.BaseClass = el.GetAttribute ("BaseClass");
-                       datasetTableName = el.GetAttribute ("Name");
-                       currentAdapter.Name = el.GetAttribute ("GeneratorDataComponentClassName");
-                       
-                       if (String.IsNullOrEmpty (currentAdapter.Name))
-                               currentAdapter.Name = el.GetAttribute ("DataAccessorName");
-
-                       //Console.WriteLine ("Name: "+currentAdapter.Name);
-                       foreach (XmlNode n in el.ChildNodes) {
-                               e = n as XmlElement;
-                               
-                               //Console.WriteLine ("Children of Tables: "+e.LocalName);
-                               if (e == null)
-                                       continue;
-                               
-                               switch (e.LocalName) {
-                                       case "MainSource": 
-                                       case "Sources": 
-                                               foreach (XmlNode msn in e.ChildNodes)
-                                                       ProcessDbSource (msn as XmlElement);
-                                               break;
-                                       
-                                       case "Mappings":
-                                               DataTableMapping tableMapping = new DataTableMapping ();
-                                               tableMapping.SourceTable = "Table";
-                                               tableMapping.DataSetTable = datasetTableName;
-                                               
-                                               foreach (XmlNode mps in e.ChildNodes)
-                                                       ProcessColumnMapping (mps as XmlElement, tableMapping);
-                                               
-                                               currentAdapter.Adapter.TableMappings.Add (tableMapping);
-                                               break;                                          
-                               }
-                       }
-               }
-               
-               private void ProcessDbSource (XmlElement el)
-               {
-                       string tmp = null;
-                       XmlElement e;
-                       
-                       if (el == null)
-                               return;
-                       
-                       //Console.WriteLine ("ProcessDbSources: "+el.LocalName);
-
-                       tmp = el.GetAttribute ("GenerateShortCommands");
-                       //Console.WriteLine ("GenerateShortCommands: {0}", tmp);
-                       if (!String.IsNullOrEmpty (tmp))
-                               currentAdapter.ShortCommands = Convert.ToBoolean (tmp);
-               
-                       DbCommandInfo cmdInfo = new DbCommandInfo ();
-                       tmp = el.GetAttribute ("GenerateMethods");
-                       if (!String.IsNullOrEmpty (tmp)) {
-                               DbSourceMethodInfo mthdInfo = null;
-                               
-                               switch ((GenerateMethodsType) Enum.Parse (typeof (GenerateMethodsType), tmp)) {
-                               case GenerateMethodsType.Get:
-                                       mthdInfo = new DbSourceMethodInfo ();
-                                       mthdInfo.Name = el.GetAttribute ("GetMethodName");
-                                       mthdInfo.Modifier = el.GetAttribute ("GetMethodModifier");
-                                       if (String.IsNullOrEmpty (mthdInfo.Modifier))
-                                               mthdInfo.Modifier = "Public";
-                                       mthdInfo.ScalarCallRetval = el.GetAttribute ("ScalarCallRetval");
-                                       mthdInfo.QueryType = el.GetAttribute ("QueryType");
-                                       mthdInfo.MethodType = GenerateMethodsType.Get;
-                                       cmdInfo.Methods = new DbSourceMethodInfo [1];
-                                       cmdInfo.Methods[0] = mthdInfo;
-                                       break;
-                                       
-                               case GenerateMethodsType.Fill:
-                                       mthdInfo = new DbSourceMethodInfo ();
-                                       mthdInfo.Name = el.GetAttribute ("FillMethodName");
-                                       mthdInfo.Modifier = el.GetAttribute ("FillMethodModifier");
-                                       if (String.IsNullOrEmpty (mthdInfo.Modifier))
-                                               mthdInfo.Modifier = "Public";
-                                       mthdInfo.ScalarCallRetval = null;
-                                       mthdInfo.QueryType = null;
-                                       mthdInfo.MethodType = GenerateMethodsType.Fill;
-                                       cmdInfo.Methods = new DbSourceMethodInfo [1];
-                                       cmdInfo.Methods[0] = mthdInfo;
-                                       break;
-                                       
-                               case GenerateMethodsType.Both:
-                                       mthdInfo = new DbSourceMethodInfo ();
-                                       // Get
-                                       mthdInfo.Name = el.GetAttribute ("GetMethodName");
-                                       mthdInfo.Modifier = el.GetAttribute ("GetMethodModifier");
-                                       if (String.IsNullOrEmpty (mthdInfo.Modifier))
-                                               mthdInfo.Modifier = "Public";
-                                       mthdInfo.ScalarCallRetval = el.GetAttribute ("ScalarCallRetval");
-                                       mthdInfo.QueryType = el.GetAttribute ("QueryType");
-                                       mthdInfo.MethodType = GenerateMethodsType.Get;
-                                       cmdInfo.Methods = new DbSourceMethodInfo [2];
-                                       cmdInfo.Methods[0] = mthdInfo;
-                                       
-                                       // Fill
-                                       mthdInfo = new DbSourceMethodInfo ();
-                                       mthdInfo.Name = el.GetAttribute ("FillMethodName");
-                                       mthdInfo.Modifier = el.GetAttribute ("FillMethodModifier");
-                                       if (String.IsNullOrEmpty (mthdInfo.Modifier))
-                                               mthdInfo.Modifier = "Public";
-                                       mthdInfo.ScalarCallRetval = null;
-                                       mthdInfo.QueryType = null;
-                                       mthdInfo.MethodType = GenerateMethodsType.Fill;
-                                       cmdInfo.Methods[1] = mthdInfo;
-                                       break;
-                               }
-                       } else {
-                               // no Get or Fill methods - non <MainSource> sources
-                               DbSourceMethodInfo mthdInfo = new DbSourceMethodInfo ();
-                               mthdInfo.Name = el.GetAttribute ("Name");
-                               mthdInfo.Modifier = el.GetAttribute ("Modifier");
-                               if (String.IsNullOrEmpty (mthdInfo.Modifier))
-                                       mthdInfo.Modifier = "Public";
-                               mthdInfo.ScalarCallRetval = el.GetAttribute ("ScalarCallRetval");
-                               mthdInfo.QueryType = el.GetAttribute ("QueryType");
-                               mthdInfo.MethodType = GenerateMethodsType.None;
-                               // Add MethodInfo to DbCommandInfo
-                               cmdInfo.Methods = new DbSourceMethodInfo [1];
-                               cmdInfo.Methods[0] = mthdInfo;
-                       }
-                       
-                       foreach (XmlNode n in el.ChildNodes) {
-                               e = n as XmlElement;
-                               
-                               if (e == null) 
-                                       continue;
-                               
-                               switch (e.LocalName) {
-                                       case "SelectCommand": 
-                                               cmdInfo.Command = ProcessDbCommand (e.FirstChild as XmlElement);
-                                               currentAdapter.Commands.Add (cmdInfo);
-                                               break;
-                                       case "InsertCommand": 
-                                               currentAdapter.Adapter.InsertCommand = ProcessDbCommand (e.FirstChild as XmlElement);
-                                               break;
-                                       case "UpdateCommand": 
-                                               currentAdapter.Adapter.UpdateCommand = ProcessDbCommand (e.FirstChild as XmlElement);
-                                               break;
-                                       case "DeleteCommand": 
-                                               currentAdapter.Adapter.DeleteCommand = ProcessDbCommand (e.FirstChild as XmlElement);
-                                               break;
-                               }
-                       }
-               }
-               
-               private DbCommand ProcessDbCommand (XmlElement el)
-               {
-                       XmlElement e;
-                       //Console.WriteLine (el.LocalName);
-                       string cmdText = null;
-                       string cmdType = null;
-                       ArrayList parameters = null;
-                       
-                       if (el == null)
-                               return null;
-                       
-                       cmdType = el.GetAttribute ("CommandType");
-                       foreach (XmlNode n in el.ChildNodes) {
-                               e = n as XmlElement;
-                               if (e != null && e.LocalName == "CommandText")
-                                       cmdText = e.InnerText;
-                               else if (e != null && e.LocalName == "Parameters" && !e.IsEmpty)
-                                       parameters = ProcessDbParameters (e);
-                       }
-                       
-                       DbCommand cmd = currentAdapter.Provider.CreateCommand ();
-                       cmd.CommandText = cmdText;
-                       if (cmdType == "StoredProcedure")
-                               cmd.CommandType = CommandType.StoredProcedure;
-                       else
-                               cmd.CommandType = CommandType.Text;
-
-                       if (parameters != null)
-                               cmd.Parameters.AddRange (parameters.ToArray ());
-                       
-                       //Console.WriteLine ("Parameters count: {0}", cmd.Parameters.Count);
-                       return cmd;
-               }
-               
-               private ArrayList ProcessDbParameters (XmlElement el)
-               {
-                       //Console.WriteLine ("ProcessDbParameters: "+el.LocalName);
-                       string tmp = null;
-                       XmlElement e;
-                       DbParameter param = null;
-                       ArrayList parameters = new ArrayList ();
-                       
-                       if (el == null)
-                               return parameters;
-                       
-                       foreach (XmlNode n in el.ChildNodes) {
-                               e = n as XmlElement;
-                               
-                               if (e == null)
-                                       continue;
-                               param = currentAdapter.Provider.CreateParameter ();
-
-                               tmp = e.GetAttribute ("AllowDbNull");
-                               if (!String.IsNullOrEmpty (tmp))
-                                       param.IsNullable = Convert.ToBoolean (tmp);
-                               
-                               param.ParameterName = e.GetAttribute ("ParameterName");
-                               tmp = e.GetAttribute ("ProviderType");
-                               if (!String.IsNullOrEmpty (tmp))
-                                       tmp = e.GetAttribute ("DbType");
-                               param.FrameworkDbType = tmp;
-                               
-                               tmp = e.GetAttribute ("Direction");
-                               param.Direction = (ParameterDirection) Enum.Parse (typeof (ParameterDirection), tmp);
-                               
-                               ((IDbDataParameter)param).Precision = Convert.ToByte (e.GetAttribute ("Precision"));
-                               ((IDbDataParameter)param).Scale = Convert.ToByte (e.GetAttribute ("Scale"));
-                               param.Size = Convert.ToInt32 (e.GetAttribute ("Size"));
-                               param.SourceColumn = e.GetAttribute ("SourceColumn");
-                               
-                               tmp = e.GetAttribute ("SourceColumnNullMapping");
-                               if (!String.IsNullOrEmpty (tmp))
-                                       param.SourceColumnNullMapping = Convert.ToBoolean (tmp);
-                               
-                               tmp = e.GetAttribute ("SourceVersion");
-                               param.SourceVersion = (DataRowVersion) Enum.Parse (typeof (DataRowVersion), tmp);                               
-                               parameters.Add (param);
-                       }
-                       
-                       return parameters;
-               }
-
-               private void ProcessColumnMapping (XmlElement el, DataTableMapping tableMapping)
-               {
-                       if (el == null)
-                               return;
-                       
-                       tableMapping.ColumnMappings.Add (el.GetAttribute ("SourceColumn"), 
-                                                        el.GetAttribute ("DataSetColumn"));
-               }
-               
-               
-               private void HandleRelationshipAnnotation (XmlElement el, bool nested)
-               {
-                       string name = el.GetAttribute ("name");
-                       string ptn = el.GetAttribute ("parent", XmlConstants.MsdataNamespace);
-                       string ctn = el.GetAttribute ("child", XmlConstants.MsdataNamespace);
-                       string pkn = el.GetAttribute ("parentkey", XmlConstants.MsdataNamespace);
-                       string fkn = el.GetAttribute ("childkey", XmlConstants.MsdataNamespace);
-
-                       RelationStructure rel = new RelationStructure ();
-                       rel.ExplicitName = XmlHelper.Decode (name);
-                       rel.ParentTableName = XmlHelper.Decode (ptn);
-                       rel.ChildTableName = XmlHelper.Decode (ctn);
-                       // ColumnNames will be decoded wherever they are used as they can
-                       // contain 'space' separated list of column-names.
-                       rel.ParentColumnName = pkn;
-                       rel.ChildColumnName = fkn;
-                       rel.IsNested = nested;
-                       rel.CreateConstraint = false; // by default?
-                       relations.Add (rel);
-               }
-
-               private object GetElementDefaultValue (XmlSchemaElement elem)
-               {
-                       // Unlike attribute, element cannot have a default value.
-                       if (elem.RefName == XmlQualifiedName.Empty)
-                               return elem.DefaultValue;
-                       XmlSchemaElement referenced = schema.Elements [elem.RefName] as XmlSchemaElement;
-                       if (referenced == null) // considering missing sub components
-                               return null;
-                       return referenced.DefaultValue;
-               }
-
-               private object GetAttributeDefaultValue (XmlSchemaAttribute attr)
-               {
-#if BUGGY_MS_COMPATIBLE
-                       if (attr == null)
-                               return null;
-                       else if (attr.RefName != XmlQualifiedName.Empty) {
-                               XmlSchemaAttribute referenced = schema.Attributes [attr.RefName] as XmlSchemaAttribute;
-                               if (referenced != null)
-                                       return referenced.DefaultValue;
-                               else
-                                       return null;
-                       }
-                       if (attr.DefaultValue != null)
-                               return attr.DefaultValue;
-                       return attr.FixedValue;
-#else
-                       if (attr.DefaultValue != null)
-                               return attr.DefaultValue;
-                       else if (attr.FixedValue != null)
-                               return attr.FixedValue;
-                       else if (attr.RefName == XmlQualifiedName.Empty)
-                               return null;
-                       XmlSchemaAttribute referenced = schema.Attributes [attr.RefName] as XmlSchemaAttribute;
-                       if (referenced == null) // considering missing sub components
-                               return null;
-                       if (referenced.DefaultValue != null)
-                               return referenced.DefaultValue;
-                       return referenced.FixedValue;
-#endif
-               }
-       }
-}
diff --git a/mcs/class/System.Data/System.Data/XmlSchemaWriter.cs b/mcs/class/System.Data/System.Data/XmlSchemaWriter.cs
deleted file mode 100644 (file)
index 4a0e463..0000000
+++ /dev/null
@@ -1,887 +0,0 @@
-//
-// XmlSchemaWriter.cs - DataSet.WriteXmlSchema() support
-//
-// Author:
-//
-//     Atsushi Enomoto  <atsushi@ximian.com>
-//
-// Original WriteXml/WriteXmlSchema authors are:
-//     Ville Palo, Alan Tam, Lluis Sanchez and Eran Domb.
-//
-
-//
-// Copyright (C) 2004-05 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections;
-using System.Collections.Specialized;
-using System.Globalization;
-using System.Data;
-using System.Xml;
-
-namespace System.Data
-{
-       internal class XmlSchemaWriter
-       {
-               const string xmlnsxs = System.Xml.Schema.XmlSchema.Namespace;
-
-               public static void WriteXmlSchema (DataSet dataset,
-                       XmlWriter writer)
-               {
-                       WriteXmlSchema (dataset, writer, dataset.Tables,
-                               dataset.Relations);
-               }
-
-               public static void WriteXmlSchema (DataSet dataset,
-                       XmlWriter writer, DataTableCollection tables,
-                       DataRelationCollection relations)
-               {
-                       new XmlSchemaWriter (dataset, writer,
-                               tables, relations).WriteSchema ();
-               }
-
-               internal static void WriteXmlSchema (XmlWriter writer, DataTable[] tables,
-                                                    DataRelation[] relations,
-                                                    string mainDataTable,
-                                                    string dataSetName,
-                                                    CultureInfo locale)
-               {
-                       new XmlSchemaWriter (writer, tables, relations, mainDataTable, dataSetName, locale).WriteSchema ();
-               }
-
-               public XmlSchemaWriter (DataSet dataset,
-                       XmlWriter writer, DataTableCollection tables,
-                       DataRelationCollection relations)
-               {
-                       dataSetName = dataset.DataSetName;
-                       dataSetNamespace = dataset.Namespace;
-                       dataSetLocale = dataset.LocaleSpecified ? dataset.Locale : null;
-                       dataSetProperties = dataset.ExtendedProperties;
-                       w = writer;
-                       if (tables != null) {
-                               this.tables = new DataTable[tables.Count];
-                               for(int i=0;i<tables.Count;i++) this.tables[i] = tables[i];
-                       }
-                       if (relations != null) {
-                               this.relations = new DataRelation[relations.Count];
-                               for(int i=0;i<relations.Count;i++) this.relations[i] = relations[i];
-                       }
-               }
-
-               public XmlSchemaWriter (XmlWriter writer,
-                       DataTable[] tables,
-                       DataRelation[] relations,
-                       string mainDataTable,
-                       string dataSetName,
-                       CultureInfo locale)
-               {
-                       w = writer;
-                       this.tables = tables;
-                       this.relations = relations;
-                       this.mainDataTable = mainDataTable;
-                       this.dataSetName = dataSetName;
-                       this.dataSetLocale = locale;
-                       this.dataSetProperties = new PropertyCollection();
-                       if (tables[0].DataSet != null) {
-                               dataSetNamespace = tables[0].DataSet.Namespace;
-                       } else {
-                               dataSetNamespace = tables[0].Namespace;
-                       }
-               }
-
-               XmlWriter w;
-               DataTable[] tables;
-               DataRelation[] relations;
-               string mainDataTable;
-               string dataSetName;
-               string dataSetNamespace;
-               PropertyCollection dataSetProperties;
-               CultureInfo dataSetLocale;
-
-               ArrayList globalTypeTables = new ArrayList ();
-               Hashtable additionalNamespaces = new Hashtable ();
-
-               ArrayList annotation = new ArrayList ();
-
-               public string ConstraintPrefix {
-                       get { return dataSetNamespace != String.Empty ? XmlConstants.TnsPrefix + ':' : String.Empty; }
-               }
-
-               // the whole DataSet
-
-               public void WriteSchema ()
-               {
-                       ListDictionary names = new ListDictionary ();
-                       ListDictionary includes = new ListDictionary ();
-
-                       // Add namespaces used in DataSet components (tables, columns, ...)
-                       foreach (DataTable dt in tables) {
-                               foreach (DataColumn col in dt.Columns)
-                                       CheckNamespace (col.Prefix, col.Namespace, names, includes);
-                               CheckNamespace (dt.Prefix, dt.Namespace, names, includes);
-                       }
-
-                       w.WriteStartElement ("xs", "schema", xmlnsxs);
-                       w.WriteAttributeString ("id", XmlHelper.Encode (dataSetName));
-
-                       if (dataSetNamespace != String.Empty) {
-                               w.WriteAttributeString ("targetNamespace",
-                                       dataSetNamespace);
-                               w.WriteAttributeString (
-                                       "xmlns",
-                                       XmlConstants.TnsPrefix,
-                                       XmlConstants.XmlnsNS,
-                                       dataSetNamespace);
-                       }
-                       w.WriteAttributeString ("xmlns", dataSetNamespace);
-
-                       w.WriteAttributeString ("xmlns", "xs",
-                               XmlConstants.XmlnsNS, xmlnsxs);
-                       w.WriteAttributeString ("xmlns",
-                               XmlConstants.MsdataPrefix,
-                               XmlConstants.XmlnsNS,
-                               XmlConstants.MsdataNamespace);
-
-                       if (CheckExtendedPropertyExists (tables, relations))
-                               w.WriteAttributeString ("xmlns",
-                                       XmlConstants.MspropPrefix,
-                                       XmlConstants.XmlnsNS,
-                                       XmlConstants.MspropNamespace);
-
-                       if (dataSetNamespace != String.Empty) {
-                               w.WriteAttributeString ("attributeFormDefault", "qualified");
-                               w.WriteAttributeString ("elementFormDefault", "qualified");
-                       }
-
-                       foreach (string prefix in names.Keys)
-                               w.WriteAttributeString ("xmlns", prefix,
-                                       XmlConstants.XmlnsNS,
-                                       names [prefix] as string);
-
-                       if (includes.Count > 0)
-                               w.WriteComment ("ATTENTION: This schema contains references to other imported schemas");
-                       foreach (string ns in includes.Keys) {
-                               w.WriteStartElement ("xs", "import", xmlnsxs);
-                               w.WriteAttributeString ("namespace", ns);
-                               w.WriteAttributeString ("schemaLocation", includes [ns] as string);
-                               w.WriteEndElement ();
-                       }
-                       
-                       foreach (DataTable table in tables) {
-                               bool isTopLevel = true;
-                               foreach (DataRelation rel in table.ParentRelations) {
-                                       if (rel.Nested) {
-                                               isTopLevel = false;
-                                               break;
-                                       }
-                               }
-                               // LAMESPEC: You have a nested relationship but only one table, 
-                               // write table element first
-                               if (!isTopLevel && tables.Length < 2)
-                                               WriteTableElement (table);
-                       }
-       
-                       WriteDataSetElement ();
-
-                       w.WriteEndElement (); // xs:schema
-
-                       w.Flush ();
-               }
-
-               // FIXME: actually there are some cases that this method(ology)
-               // does not apply.
-               private void WriteDataSetElement ()
-               {
-                       w.WriteStartElement ("xs", "element", xmlnsxs);
-                       w.WriteAttributeString ("name", XmlHelper.Encode (dataSetName));
-                       w.WriteAttributeString (XmlConstants.MsdataPrefix,
-                               "IsDataSet", XmlConstants.MsdataNamespace,
-                               "true");
-
-                       bool useCurrentLocale = (dataSetLocale == null);
-
-                       if (!useCurrentLocale)
-                       {
-                               w.WriteAttributeString (
-                                       XmlConstants.MsdataPrefix,
-                                       "Locale",
-                                       XmlConstants.MsdataNamespace,
-                                       dataSetLocale.Name);
-                       }
-
-                       if(mainDataTable != null && mainDataTable != "")
-                               w.WriteAttributeString (
-                                       XmlConstants.MsdataPrefix,
-                                       "MainDataTable",
-                                       XmlConstants.MsdataNamespace,
-                                       mainDataTable);
-
-                       if (useCurrentLocale) {
-                               w.WriteAttributeString (
-                                       XmlConstants.MsdataPrefix,
-                                       "UseCurrentLocale",
-                                       XmlConstants.MsdataNamespace,
-                                       "true");
-                       }
-
-                       AddExtendedPropertyAttributes (dataSetProperties);
-
-                       w.WriteStartElement ("xs", "complexType", xmlnsxs);
-                       w.WriteStartElement ("xs", "choice", xmlnsxs);
-                       w.WriteAttributeString ("minOccurs", "0");
-                       w.WriteAttributeString ("maxOccurs", "unbounded");
-
-                       foreach (DataTable table in tables) {
-                               bool isTopLevel = true;
-                               foreach (DataRelation rel in table.ParentRelations) {
-                                       if (rel.Nested) {
-                                               isTopLevel = false;
-                                               break;
-                                       }
-                               }
-
-                               // If there is a relation but only one table, could be that
-                               // we have to add a ref attribute
-                               bool addref = false;
-                               if (!isTopLevel && tables.Length < 2) {
-                                       isTopLevel = true;
-                                       addref = true;
-                               }
-                               
-                               if (isTopLevel) {
-                                       if (dataSetNamespace != table.Namespace ||
-                                           addref) {
-                                               // <xs:element ref="X:y" />
-                                               w.WriteStartElement ("xs",
-                                                       "element",
-                                                       xmlnsxs);
-                                               w.WriteStartAttribute ("ref", String.Empty);
-                                               w.WriteQualifiedName (XmlHelper.Encode (table.TableName), table.Namespace);
-                                               w.WriteEndAttribute ();
-                                               w.WriteEndElement ();
-                                       }
-                                       else
-                                               WriteTableElement (table);
-                               }
-                       }
-
-                       w.WriteEndElement (); // choice
-                       w.WriteEndElement (); // complexType
-
-                       WriteConstraints (); // DataSet constraints
-
-                       w.WriteEndElement (); // element
-
-                       if (annotation.Count > 0) {
-                               w.WriteStartElement ("xs", "annotation", xmlnsxs);
-                               w.WriteStartElement ("xs", "appinfo", xmlnsxs);
-
-                               foreach (object o in annotation) {
-                                       if (!(o is DataRelation))
-                                               continue;
-                                       WriteDataRelationAnnotation ((DataRelation)o);  
-                               }
-                               w.WriteEndElement ();
-                               w.WriteEndElement ();
-                       }
-               }
-
-               private void WriteDataRelationAnnotation (DataRelation rel) 
-               {
-                       String colnames = String.Empty;
-                       w.WriteStartElement (XmlConstants.MsdataPrefix, "Relationship",
-                                XmlConstants.MsdataNamespace);
-
-                       w.WriteAttributeString ("name", XmlHelper.Encode (rel.RelationName));
-
-                       w.WriteAttributeString (
-                                       XmlConstants.MsdataPrefix,
-                                       "parent",
-                                       XmlConstants.MsdataNamespace,
-                                       XmlHelper.Encode (rel.ParentTable.TableName));
-
-                       w.WriteAttributeString (
-                                       XmlConstants.MsdataPrefix,
-                                       "child",
-                                       XmlConstants.MsdataNamespace,
-                                       XmlHelper.Encode (rel.ChildTable.TableName));
-
-                       colnames = String.Empty;
-                       foreach (DataColumn col in rel.ParentColumns)
-                               colnames += XmlHelper.Encode (col.ColumnName) + " ";
-                       w.WriteAttributeString (
-                                       XmlConstants.MsdataPrefix,
-                                       "parentkey",
-                                       XmlConstants.MsdataNamespace,
-                                       colnames.TrimEnd ());
-
-                       colnames = String.Empty;
-                       foreach (DataColumn col in rel.ChildColumns)
-                               colnames += XmlHelper.Encode (col.ColumnName) + " ";
-                       w.WriteAttributeString (
-                                       XmlConstants.MsdataPrefix,
-                                       "childkey",
-                                       XmlConstants.MsdataNamespace,
-                                       colnames.TrimEnd ());
-
-                       w.WriteEndElement ();
-               }
-
-               private void WriteConstraints ()
-               {
-                       ArrayList names = new ArrayList ();
-
-                       // add all unique constraints.
-                       foreach (DataTable table in tables) {
-                               foreach (Constraint c in table.Constraints) {
-                                       UniqueConstraint u =
-                                               c as UniqueConstraint;
-                                       if (u != null) {
-                                               AddUniqueConstraints (u, names);
-                                               continue;
-                                       }
-
-                                       ForeignKeyConstraint fk = c as ForeignKeyConstraint;
-                                       bool haveConstraint = false;
-                                       if (relations != null) {
-                                               foreach (DataRelation r in relations)
-                                                       if (r.RelationName == fk.ConstraintName)
-                                                               haveConstraint = true;
-                                       }
-                                       if (tables.Length > 1 && fk != null && !haveConstraint) {
-                                               DataRelation rel = new DataRelation (fk.ConstraintName,
-                                                                               fk.RelatedColumns, fk.Columns);
-                                               AddForeignKeys (rel, names, true);
-                                               continue;
-                                       }
-                               }
-                       }
-
-                       // Add all foriegn key constraints.
-                       if (relations != null)
-                               foreach (DataRelation rel in relations) {
-                                       if (rel.ParentKeyConstraint == null || rel.ChildKeyConstraint == null) {
-                                               annotation.Add (rel);
-                                               continue;
-                                       }
-                                       AddForeignKeys (rel, names,false);
-                               }
-               }
-
-               // Add unique constaraints to the schema.
-               // return hashtable with the names of all XmlSchemaUnique elements we created.
-               private void AddUniqueConstraints (UniqueConstraint uniq,
-                       ArrayList names)
-               {
-                       // if column of the constraint is hidden do not write the constraint.
-                       foreach (DataColumn column in uniq.Columns)
-                               if (column.ColumnMapping == MappingType.Hidden)
-                                       return; // do nothing
-
-                       w.WriteStartElement ("xs", "unique", xmlnsxs);
-                       // if constaraint name do not exist in the hashtable we can use it.
-                       string name;
-                       if (!names.Contains (uniq.ConstraintName)) {
-                               name = XmlHelper.Encode (uniq.ConstraintName);
-                               w.WriteAttributeString ("name", name);
-                       }
-                       // otherwise generate new constraint name for the
-                       // XmlSchemaUnique element.
-                       else {
-                               name = XmlHelper.Encode (uniq.Table.TableName) + "_" + XmlHelper.Encode (uniq.ConstraintName);
-                               w.WriteAttributeString ("name", name);
-                               w.WriteAttributeString (
-                                       XmlConstants.MsdataPrefix,
-                                       XmlConstants.ConstraintName,
-                                       XmlConstants.MsdataNamespace,
-                                       XmlHelper.Encode (uniq.ConstraintName));
-                       }
-                       names.Add (name);
-
-                       if (uniq.IsPrimaryKey) {
-                               w.WriteAttributeString (
-                                       XmlConstants.MsdataPrefix,
-                                       XmlConstants.PrimaryKey,
-                                       XmlConstants.MsdataNamespace,
-                                       "true");
-                       }
-
-                       AddExtendedPropertyAttributes (uniq.ExtendedProperties);
-
-                       w.WriteStartElement ("xs", "selector",
-                               xmlnsxs);
-                       w.WriteAttributeString ("xpath", ".//" +
-                               ConstraintPrefix + XmlHelper.Encode (uniq.Table.TableName));
-                       w.WriteEndElement (); // selector
-                       foreach (DataColumn c in uniq.Columns) {
-                               w.WriteStartElement ("xs", "field",
-                                       xmlnsxs);
-                               w.WriteStartAttribute ("xpath", String.Empty);
-                               if (c.ColumnMapping == MappingType.Attribute)
-                                       w.WriteString ("@");
-                               w.WriteString (ConstraintPrefix);
-                               w.WriteString (XmlHelper.Encode (c.ColumnName));
-                               w.WriteEndAttribute (); // xpath
-                               w.WriteEndElement (); // field
-                       }
-
-                       w.WriteEndElement (); // unique
-               }
-
-               // Add the foriegn keys to the schema.
-               private void AddForeignKeys (DataRelation rel, ArrayList names, bool isConstraintOnly)
-               {
-                       // Do nothing if it contains hidden relation
-                       foreach (DataColumn col in rel.ParentColumns)
-                               if (col.ColumnMapping == MappingType.Hidden)
-                                       return;
-                       foreach (DataColumn col in rel.ChildColumns)
-                               if (col.ColumnMapping == MappingType.Hidden)
-                                       return;
-
-                       w.WriteStartElement ("xs", "keyref", xmlnsxs);
-                       w.WriteAttributeString ("name", XmlHelper.Encode (rel.RelationName));
-
-                       //ForeignKeyConstraint fkConst = rel.ChildKeyConstraint;
-                       UniqueConstraint uqConst = null; 
-
-                       if (isConstraintOnly) {
-                               foreach (Constraint c in rel.ParentTable.Constraints) {
-                                       uqConst = c as UniqueConstraint;
-                                       if (uqConst == null)
-                                               continue;
-                                       if (uqConst.Columns == rel.ParentColumns)
-                                               break;
-                               }
-                       } 
-                       else
-                               uqConst = rel.ParentKeyConstraint;
-
-                       string concatName = XmlHelper.Encode (rel.ParentTable.TableName) + "_" + XmlHelper.Encode (uqConst.ConstraintName);
-                       // first try to find the concatenated name. If we didn't find it - use constraint name.
-                       if (names.Contains (concatName)) {
-                               w.WriteStartAttribute ("refer", String.Empty);
-                               w.WriteQualifiedName (concatName, dataSetNamespace);
-                               w.WriteEndAttribute ();
-                       }
-                       else {
-                               w.WriteStartAttribute ("refer", String.Empty);
-                               w.WriteQualifiedName (XmlHelper.Encode (uqConst.ConstraintName), dataSetNamespace);
-                               w.WriteEndAttribute ();
-                       }
-
-                       if (isConstraintOnly)
-                               w.WriteAttributeString ( XmlConstants.MsdataPrefix,
-                                       XmlConstants.ConstraintOnly,
-                                       XmlConstants.MsdataNamespace,
-                                       "true");
-                       else if (rel.Nested)
-                               w.WriteAttributeString (
-                                       XmlConstants.MsdataPrefix,
-                                       XmlConstants.IsNested,
-                                       XmlConstants.MsdataNamespace,
-                                       "true");
-
-                       AddExtendedPropertyAttributes (uqConst.ExtendedProperties);
-
-                       w.WriteStartElement ("xs", "selector", xmlnsxs);
-                       w.WriteAttributeString ("xpath", ".//" + 
-                               ConstraintPrefix + XmlHelper.Encode (rel.ChildTable.TableName));
-                       w.WriteEndElement ();
-
-                       foreach (DataColumn c in rel.ChildColumns) {
-                               w.WriteStartElement ("xs", "field",
-                                       xmlnsxs);
-                               w.WriteStartAttribute ("xpath", String.Empty);
-                               if (c.ColumnMapping == MappingType.Attribute)
-                                       w.WriteString ("@");
-                               w.WriteString (ConstraintPrefix);
-                               w.WriteString (XmlHelper.Encode (c.ColumnName));
-                               w.WriteEndAttribute ();
-                               w.WriteEndElement (); // field
-                       }
-
-                       w.WriteEndElement (); // keyref
-               }
-
-               // ExtendedProperties
-
-               private bool CheckExtendedPropertyExists (
-                       DataTable[] tables,
-                       DataRelation[] relations)
-               {
-                       if (dataSetProperties.Count > 0)
-                               return true;
-                       foreach (DataTable dt in tables) {
-                               if (dt.ExtendedProperties.Count > 0)
-                                       return true;
-                               foreach (DataColumn col in dt.Columns)
-                                       if (col.ExtendedProperties.Count > 0)
-                                               return true;
-                               foreach (Constraint c in dt.Constraints)
-                                       if (c.ExtendedProperties.Count > 0)
-                                               return true;
-                       }
-                       if (relations == null)
-                               return false;
-                       foreach (DataRelation rel in relations)
-                               if (rel.ExtendedProperties.Count > 0)
-                                       return true;
-                       return false;
-               }
-
-               private void AddExtendedPropertyAttributes (PropertyCollection props)
-               {
-                       // add extended properties to xs:element
-                       foreach (DictionaryEntry de in props) {
-                               w.WriteStartAttribute (
-                                       XmlConstants.MspropPrefix,
-                                       XmlConvert.EncodeName (de.Key.ToString ()),
-                                       XmlConstants.MspropNamespace);
-                               if (de.Value != null)
-                                       w.WriteString (
-                                               DataSet.WriteObjectXml (de.Value));
-                               w.WriteEndAttribute ();
-                       }
-               }
-
-               // Table
-
-               private void WriteTableElement (DataTable table)
-               {
-                       w.WriteStartElement ("xs", "element", xmlnsxs);
-                       w.WriteAttributeString ("name", XmlHelper.Encode (table.TableName));
-
-                       AddExtendedPropertyAttributes (table.ExtendedProperties);
-
-                       WriteTableType (table);
-
-                       w.WriteEndElement ();
-               }
-
-               private void WriteTableType (DataTable table)
-               {
-                       ArrayList elements;
-                       ArrayList atts;
-                       DataColumn simple;
-
-                       DataSet.SplitColumns (table, out atts, out elements, out simple);
-
-                       w.WriteStartElement ("xs", "complexType", xmlnsxs);
-
-                       if (simple != null) {
-                               w.WriteStartElement ("xs", "simpleContent", xmlnsxs);
-                               // add column name attribute
-                               w.WriteAttributeString (
-                                       XmlConstants.MsdataPrefix,
-                                       XmlConstants.ColumnName,
-                                       XmlConstants.MsdataNamespace,
-                                       XmlHelper.Encode (simple.ColumnName));
-
-                               // add ordinal attribute
-                               w.WriteAttributeString (
-                                       XmlConstants.MsdataPrefix,
-                                       XmlConstants.Ordinal,
-                                       XmlConstants.MsdataNamespace,
-                                       XmlConvert.ToString (simple.Ordinal));
-
-                               // add extension
-                               w.WriteStartElement ("xs", "extension",
-                                       xmlnsxs);
-                               w.WriteStartAttribute ("base", String.Empty);
-                               WriteQName (MapType (simple.DataType));
-                               w.WriteEndAttribute ();
-
-                               WriteTableAttributes (atts);
-
-                               w.WriteEndElement ();
-                       } else {
-                               WriteTableAttributes (atts);
-                               bool isNested = false;
-                               foreach (DataRelation rel in table.ParentRelations) {
-                                       if (rel.Nested) {
-                                               isNested = true;
-                                               break;
-                                       }
-                               }
-                               
-                               // When we have a nested relationship and only one table,
-                               // could be that we have a reference attribute
-                               if (elements.Count > 0 || (isNested && tables.Length < 2)) {
-                                       w.WriteStartElement ("xs", "sequence",
-                                               xmlnsxs);
-
-                                       foreach (DataColumn col in elements)
-                                               WriteTableTypeParticles (col);
-
-                                       foreach (DataRelation rel in table.ChildRelations)
-                                               if (rel.Nested)
-                                                       WriteChildRelations (rel);
-                                       w.WriteEndElement ();
-                               }
-                       }
-
-                       w.WriteFullEndElement (); // complexType
-               }
-
-               private void WriteTableTypeParticles (DataColumn col)
-               {
-                       w.WriteStartElement ("xs", "element", xmlnsxs);
-                       w.WriteAttributeString ("name", XmlHelper.Encode (col.ColumnName));
-
-                       if (col.ColumnName != col.Caption && col.Caption != String.Empty)
-                               w.WriteAttributeString (
-                                       XmlConstants.MsdataPrefix,
-                                       XmlConstants.Caption, 
-                                       XmlConstants.MsdataNamespace,
-                                       col.Caption);
-
-                       if (col.AutoIncrement == true)
-                               w.WriteAttributeString (
-                                       XmlConstants.MsdataPrefix,
-                                       XmlConstants.AutoIncrement,
-                                       XmlConstants.MsdataNamespace,
-                                       "true");
-
-                       if (col.AutoIncrementSeed != 0) {
-                               w.WriteAttributeString (
-
-                                       XmlConstants.MsdataPrefix,
-                                       XmlConstants.AutoIncrementSeed,
-                                       XmlConstants.MsdataNamespace,
-                                       XmlConvert.ToString (col.AutoIncrementSeed));
-                       }
-
-                       if (col.AutoIncrementStep != 1) {
-                               w.WriteAttributeString (
-
-                                       XmlConstants.MsdataPrefix,
-                                       XmlConstants.AutoIncrementStep,
-                                       XmlConstants.MsdataNamespace,
-                                       XmlConvert.ToString (col.AutoIncrementStep));
-                       }
-
-                       if (!DataColumn.GetDefaultValueForType (col.DataType).Equals (col.DefaultValue))
-                               w.WriteAttributeString ("default",
-                                       DataSet.WriteObjectXml (col.DefaultValue));
-
-                       if (col.ReadOnly)
-                               w.WriteAttributeString (
-                                       XmlConstants.MsdataPrefix,
-                                       XmlConstants.ReadOnly,
-                                       XmlConstants.MsdataNamespace,
-                                       "true");
-
-                       XmlQualifiedName typeQName = null;
-                       if (col.MaxLength < 0) {
-                               w.WriteStartAttribute ("type", String.Empty);
-                               typeQName = MapType (col.DataType);
-                               WriteQName (typeQName);
-                               w.WriteEndAttribute ();
-                       }
-
-                       if (typeQName == XmlConstants.QnString
-                               && col.DataType != typeof (string)
-                               && col.DataType != typeof (char)) {
-                               w.WriteStartAttribute (
-                                       XmlConstants.MsdataPrefix,
-                                       XmlConstants.DataType,
-                                       XmlConstants.MsdataNamespace);
-                               string runtimeName = col.DataType.AssemblyQualifiedName;
-                               w.WriteString (runtimeName);
-                               w.WriteEndAttribute ();
-                       }
-
-                       if (col.AllowDBNull)
-                               w.WriteAttributeString ("minOccurs", "0");
-
-                       //writer.WriteAttributeString (XmlConstants.MsdataPrefix, 
-                       //                            XmlConstants.Ordinal, 
-                       //                            XmlConstants.MsdataNamespace, 
-                       //                            col.Ordinal.ToString ());
-
-                       AddExtendedPropertyAttributes (col.ExtendedProperties);
-
-                       // Write SimpleType if column have MaxLength
-                       if (col.MaxLength > -1)
-                               WriteSimpleType (col);
-
-                       w.WriteEndElement (); // sequence
-               }
-
-               private void WriteChildRelations (DataRelation rel)
-               {
-                       // If there is a parent/child relation and only one table,
-                       // it would just be a ref element.
-                       if (rel.ChildTable.Namespace != dataSetNamespace ||
-                           tables.Length < 2) {
-                               w.WriteStartElement ("xs", "element", xmlnsxs);
-                               w.WriteStartAttribute ("ref", String.Empty);
-                               w.WriteQualifiedName (
-                                       XmlHelper.Encode (rel.ChildTable.TableName),
-                                       rel.ChildTable.Namespace);
-                               w.WriteEndAttribute ();
-                       } else {
-                               w.WriteStartElement ("xs", "element", xmlnsxs);
-                               w.WriteStartAttribute ("name", String.Empty);
-                               w.WriteQualifiedName (
-                                       XmlHelper.Encode (rel.ChildTable.TableName),
-                                       rel.ChildTable.Namespace);
-                               w.WriteEndAttribute ();
-                               w.WriteAttributeString ("minOccurs", "0");
-                               w.WriteAttributeString ("maxOccurs", "unbounded");
-
-                               globalTypeTables.Add (rel.ChildTable);
-                       }
-                       
-                       // Iff there is a genuine ChildTable and not just a ref, call WriteTableType
-                       if (tables.Length > 1)
-                               WriteTableType (rel.ChildTable);
-                       w.WriteEndElement ();
-               }
-
-               private void WriteTableAttributes (ArrayList atts)
-               {
-                       //Then a list of attributes
-                       foreach (DataColumn col in atts) {
-                               w.WriteStartElement ("xs", "attribute", xmlnsxs);
-
-                               string name = XmlHelper.Encode (col.ColumnName);
-                               if (col.Namespace != String.Empty) {
-                                       w.WriteAttributeString ("form", "qualified");
-                                       string prefix = col.Prefix == String.Empty ? "app" + additionalNamespaces.Count : col.Prefix;
-                                       name = prefix + ":" + name;
-                                       // FIXME: Handle prefix mapping correctly.
-                                       additionalNamespaces [prefix] = col.Namespace;
-                               }
-                               w.WriteAttributeString ("name", name);
-
-                               AddExtendedPropertyAttributes (
-                                       col.ExtendedProperties);
-
-                               if (col.ReadOnly)
-                                       w.WriteAttributeString (
-                                               XmlConstants.MsdataPrefix,
-                                               XmlConstants.ReadOnly,
-                                               XmlConstants.MsdataNamespace,
-                                               "true");
-
-                               if (col.MaxLength < 0) {
-                                       // otherwise simpleType is written later
-                                       w.WriteStartAttribute ("type", String.Empty);
-                                       WriteQName (MapType (col.DataType));
-                                       w.WriteEndAttribute ();
-                               }
-
-                               if (!col.AllowDBNull)
-                                       w.WriteAttributeString ("use", "required");
-                               if (col.DefaultValue != DataColumn.GetDefaultValueForType (col.DataType))
-                                       w.WriteAttributeString ("default",
-                                               DataSet.WriteObjectXml (col.DefaultValue));
-
-                               if (col.MaxLength > -1)
-                                       WriteSimpleType (col);
-
-                               w.WriteEndElement (); // attribute
-                       }
-               }
-
-               private void WriteSimpleType (DataColumn col)
-               {
-                       w.WriteStartElement ("xs", "simpleType", xmlnsxs);
-                       w.WriteStartElement ("xs", "restriction", xmlnsxs);
-                       w.WriteStartAttribute ("base", String.Empty);
-                       WriteQName (MapType (col.DataType));
-                       w.WriteEndAttribute ();
-
-                       w.WriteStartElement ("xs", "maxLength", xmlnsxs);
-                       w.WriteAttributeString ("value",
-                               XmlConvert.ToString (col.MaxLength));
-                       w.WriteEndElement (); // maxLength
-                       w.WriteEndElement (); // restriction
-                       w.WriteEndElement (); // simpleType
-               }
-
-               private void WriteQName (XmlQualifiedName name)
-               {
-                       w.WriteQualifiedName (name.Name, name.Namespace);
-               }
-
-               private void CheckNamespace (string prefix, string ns, ListDictionary names, ListDictionary includes)
-               {
-                       if (ns == String.Empty)
-                               return;
-                       if (dataSetNamespace != ns) {
-                               if ((string)names [prefix] != ns) {
-                                       for (int i = 1; i < int.MaxValue; i++) {
-                                               string p = "app" + i;
-                                               if (names [p] == null) {
-                                                       names.Add (p, ns);
-                                                       HandleExternalNamespace (p, ns, includes);
-                                                       break;
-                                               }
-                                       }
-                               }
-                       }
-               }
-
-               private void HandleExternalNamespace (string prefix, string ns, ListDictionary includes)
-               {
-                       if (includes.Contains (ns))
-                               return; // nothing to do
-                       includes.Add (ns, "_" + prefix + ".xsd");
-               }
-
-               private /*static*/ XmlQualifiedName MapType (Type type)
-               {
-                       switch (Type.GetTypeCode (type)) {
-                               case TypeCode.String: return XmlConstants.QnString;
-                               case TypeCode.Int16: return XmlConstants.QnShort;
-                               case TypeCode.Int32: return XmlConstants.QnInt;
-                               case TypeCode.Int64: return XmlConstants.QnLong;
-                               case TypeCode.Boolean: return XmlConstants.QnBoolean;
-                               case TypeCode.Byte: return XmlConstants.QnUnsignedByte;
-                               //case TypeCode.Char: return XmlConstants.QnChar;
-                               case TypeCode.DateTime: return XmlConstants.QnDateTime;
-                               case TypeCode.Decimal: return XmlConstants.QnDecimal;
-                               case TypeCode.Double: return XmlConstants.QnDouble;
-                               case TypeCode.SByte: return XmlConstants.QnSbyte;
-                               case TypeCode.Single: return XmlConstants.QnFloat;
-                               case TypeCode.UInt16: return XmlConstants.QnUnsignedShort;
-                               case TypeCode.UInt32: return XmlConstants.QnUnsignedInt;
-                               case TypeCode.UInt64: return XmlConstants.QnUnsignedLong;
-                       }
-                       
-                       if (typeof (TimeSpan) == type)
-                               return XmlConstants.QnDuration;
-                       else if (typeof (System.Uri) == type)
-                               return XmlConstants.QnUri;
-                       else if (typeof (byte[]) == type)
-                               return XmlConstants.QnBase64Binary;
-                       else if (typeof (XmlQualifiedName) == type)
-                               return XmlConstants.QnXmlQualifiedName;
-                       else
-                               return XmlConstants.QnString;
-               }
-       }
-}
diff --git a/mcs/class/System.Data/System.Data/XmlTableWriter.cs b/mcs/class/System.Data/System.Data/XmlTableWriter.cs
deleted file mode 100644 (file)
index 9806e76..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-// 
-// System.Data/XmlTableWriter.cs
-//
-// Author:
-//   Patrick Earl <mono@patearl.net>
-//
-// Copyright (c) 2006, Patrick Earl
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-using System;
-using System.Collections.Generic;
-using System.Data;
-using System.Xml;
-
-internal class XmlTableWriter {
-       // This method is modelled after the DataSet's WriteXml functionality.
-       internal static void WriteTables(XmlWriter writer,
-                                XmlWriteMode mode,
-                                List<DataTable> tables,
-                                List<DataRelation> relations,
-                                string mainDataTable,
-                                string dataSetName)
-       {
-               if (mode == XmlWriteMode.DiffGram) {
-                       foreach (DataTable table in tables)
-                               table.SetRowsID();
-                       DataSet.WriteDiffGramElement(writer);
-               }
-
-               bool shouldOutputContent = (mode != XmlWriteMode.DiffGram);
-               for (int n = 0; n < tables.Count && !shouldOutputContent; n++)
-                       shouldOutputContent = tables[n].Rows.Count > 0;
-
-               if (shouldOutputContent) {
-                       // We assume that tables[0] is the main table being written.
-                       // We happen to know that the code above us does things that way.
-                       DataSet.WriteStartElement(writer, mode, tables[0].Namespace, tables[0].Prefix, XmlHelper.Encode(dataSetName));
-
-                       if (mode == XmlWriteMode.WriteSchema) {
-                               DataTable [] _tables = new DataTable[tables.Count];
-                               tables.CopyTo(_tables);
-                               DataRelation[] _relations = new DataRelation[relations.Count];
-                               relations.CopyTo(_relations);
-                               DataTable dt = _tables [0];
-                               new XmlSchemaWriter(writer,
-                                       _tables,
-                                       _relations,
-                                       mainDataTable,
-                                       dataSetName,
-                                       dt.LocaleSpecified ? dt.Locale : null
-                               ).WriteSchema();
-                       }
-
-                       WriteTableList (writer, mode, tables, DataRowVersion.Default);
-
-                       writer.WriteEndElement();
-               }
-
-               if (mode == XmlWriteMode.DiffGram) {
-                       List<DataTable> changedTables = new List<DataTable>();
-                       foreach (DataTable table in tables) {
-                               DataTable changed = table.GetChanges(DataRowState.Modified | DataRowState.Deleted);
-                               if (changed != null && changed.Rows.Count > 0) {
-                                       changedTables.Add(changed);
-                               }
-                       }
-                       if (changedTables.Count > 0) {
-                               DataSet.WriteStartElement(writer, XmlWriteMode.DiffGram, XmlConstants.DiffgrNamespace, XmlConstants.DiffgrPrefix, "before");
-                               WriteTableList (writer, mode, changedTables, DataRowVersion.Original);
-                               writer.WriteEndElement();
-                       }
-               
-                       writer.WriteEndElement(); // diffgr:diffgram
-               }
-
-               writer.Flush();
-       }
-
-       internal static void WriteTableList(XmlWriter writer, XmlWriteMode mode, List<DataTable> tables, DataRowVersion version)
-       {
-               foreach (DataTable table in tables)
-                       DataSet.WriteTable(writer, table, mode, version);
-       }
-}
diff --git a/mcs/class/System.Data/System.Data/XmlWriteMode.cs b/mcs/class/System.Data/System.Data/XmlWriteMode.cs
deleted file mode 100644 (file)
index 85add2f..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-//
-// System.Data.XmlWriteMode.cs
-//
-// Author:
-//   Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace System.Data
-{
-       /// <summary>
-       /// Use the members of this enumeration when setting the WriteMode parameter of the WriteXml method.
-       /// </summary>
-       public enum XmlWriteMode
-       {
-               WriteSchema = 0,
-               IgnoreSchema = 1,
-               DiffGram = 2
-       }
-}
\ No newline at end of file
diff --git a/mcs/class/System.Data/System.Xml/ChangeLog b/mcs/class/System.Data/System.Xml/ChangeLog
deleted file mode 100644 (file)
index 899caa8..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-2006-11-28  Nagappan A  <anagappan@novell.com>
-
-       * XmlDataDocument.cs (StringToObject): Modify
-       XmlConvert.ToDateTime to use XmlDateTimeSerializationMode, as the
-       default ToDataTime method id obsolete.
-
-2006-04-19  Senganal T <tsenganal@novell.com>
-
-       * XmlDataDocument.cs : 
-               - Use encoded names for DataSet schema.
-               - StringToElement : Return 'null' if the value is empty string
-               or null.
-               - OnDataTableRowAdded : Add the row elements to the tablenode if
-               they are not already added.
-
-2004-06-06  Atsushi Enomoto <atsushi@ximian.com>
-
-       * XmlDataDocument.cs :
-         - It was not handling SimpleContent. This fixes bug #56951.
-         - It was not converting values into DataType of the DataColumn.
-
-2004-05-17  Atsushi Enomoto <atsushi@ximian.com>
-
-       * XmlDataDocument.cs :
-         Removed MonoTODO from implemented members and private members.
-         Updated OnNodeRemoved(), OnDataRowDeleted() and OnDataTableRollback()
-         to match with current implementation.
-
-2004-05-13  Atsushi Enomoto <atsushi@ximian.com>
-
-       * XmlDataDocument.cs : Removed row-element mapping. Just use new
-         DataRow.DataElement property. Added/removed some comments.
-
-2004-05-12  Atsushi Enomoto <atsushi@ximian.com>
-
-       * XmlDataDocument.cs : Radical design change.
-         - GetElementFromRow() must return "detached" element, even if it is
-           not added to table's Rows.
-         - Introduced XmlDataElement class to map element (this class itself)
-           and DataRow _always_ . It is impossible to map *all* DataRows 
-           to/from elements only in XmlDataDocument API, since DataRow can 
-           be created separate from it (i.e. by table.NewRow()).
-         - Removed unreliable GetElementsByTagName() dependency from most
-           of the code, since users might create elements that has the same
-           name of any tables (that is possible especially unmapped elements).
-         - Adding/Removing delegates on every event action is unnecessary.
-           Use just flags.
-         - For Load(), just using base.Load() will do most of the job.
-         - Attributes and SimpleContents are not handled properly.
-
-         "Removed" and "Rollback" events are still TODO.
-
-2004-04-13  Atsushi Enomoto <atsushi@ximian.com>
-
-       * XmlDataDocument.cs:
-         Load() should not read xml multiple time nor expect BaseURI (and it
-         indicates the resource location is readable).
-         Simplified event handling logic, and fixed missing event removal.
-         Quick hack to avoid new XmlDataDocument(DataSet ds).Load ().
-         Enabled CreateNavigator() that was commented out.
-
-2004-03-18  Atsushi Enomoto <atsushi@ximian.com>
-
-       * XmlDataDocument.cs : Fixed incorrect cast in OnDataTableRowAdded().
-         This fixes bug #54505.
-
-2003-07-31  Duncan Mak  <duncan@ximian.com>
-
-       * XmlDataDocument.cs (BaseURI):
-       (InnerXml):
-       (IsReadOnly):
-       (this):
-       (LocalName):
-       (Name):
-       (OwnerDocument):
-       (WriteContentTo):
-       (WriteTo): Removed, these do not need to be redefined, as
-       they are inherited from XmlDocument already.
-
-       (CreateElement): simplifed the
-       implementation. XmlDocument.CreateElement can handle String.Empty
-       and null just fine.
-
-2003-03-12  Alan Tam <Tam@SiuLung.com>
-
-       * XmlDataDocument.cs: Still need to print tag for the DataSet if there
-       is no data at all.
-       
-2003-01-27  Ville Palo <vi64pa@koti.soon.fi>
-
-       * ChangeLog: Added this file.
-       * XmlDataDocument.cs: Some little fixes.
diff --git a/mcs/class/System.Data/System.Xml/XmlDataDocument.cs b/mcs/class/System.Data/System.Xml/XmlDataDocument.cs
deleted file mode 100644 (file)
index 3cd7367..0000000
+++ /dev/null
@@ -1,819 +0,0 @@
-//
-// mcs/class/System.Data/System.Xml/XmlDataDocument.cs
-//
-// Purpose: Provides a W3C XML DOM Document to interact with
-//          relational data in a DataSet
-//
-// class: XmlDataDocument
-// assembly: System.Data.dll
-// namespace: System.Xml
-//
-// Author:
-//     Daniel Morgan <danmorg@sc.rr.com>
-//     Ville Palo <vi64pa@koti.soon.fi>
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// (c)copyright 2002 Daniel Morgan
-// (c)copyright 2003 Ville Palo
-// (c)2004 Novell Inc.
-//
-// XmlDataDocument is included within the Mono Class Library.
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Data;
-using System.IO;
-using System.Text;
-using System.Xml.XPath;
-using System.Collections;
-using System.Globalization;
-using System.ComponentModel;
-
-namespace System.Xml 
-{
-
-       public class XmlDataDocument : XmlDocument 
-       {
-               // Should we consider overriding CloneNode() ? By default
-               // base CloneNode() will be invoked and thus no DataRow conflict
-               // would happen, that sounds the best (that means, no mapped
-               // DataRow will be provided).
-               internal class XmlDataElement : XmlElement
-               {
-                       DataRow row;
-
-                       internal XmlDataElement (DataRow row, string prefix, string localName, string ns, XmlDataDocument doc)
-                               : base (prefix, localName, ns, doc)
-                       {
-                               this.row = row;
-                               // Embed row ID only when the element is mapped to
-                               // certain DataRow.
-                               if (row != null) {
-                                       row.DataElement = this;
-                                       row.XmlRowID = doc.dataRowID;
-                                       doc.dataRowIDList.Add (row.XmlRowID);
-                                       doc.dataRowID++;
-                               }
-                       }
-
-                       internal DataRow DataRow {
-                               get { return row; }
-                       }
-               }
-
-               #region Fields
-
-               private DataSet dataSet;
-
-               private int dataRowID = 1;
-               private ArrayList dataRowIDList = new ArrayList ();
-
-               // this keeps whether table change events should be handles
-               private bool raiseDataSetEvents = true;
-               private bool raiseDocumentEvents = true;
-
-               DataColumnChangeEventHandler columnChanged;
-               DataRowChangeEventHandler rowDeleted;
-               DataRowChangeEventHandler rowChanged;
-               CollectionChangeEventHandler tablesChanged;
-               #endregion // Fields
-
-               #region Constructors
-
-               public XmlDataDocument ()
-               {
-                       InitDelegateFields ();
-
-                       dataSet = new DataSet();
-                       dataSet._xmlDataDocument = this;
-                       dataSet.Tables.CollectionChanged += tablesChanged;
-
-                       AddXmlDocumentListeners ();
-                       DataSet.EnforceConstraints = false;
-               }
-
-               public XmlDataDocument (DataSet dataset) 
-               {
-                       if (dataset == null)
-                               throw new ArgumentException ("Parameter dataset cannot be null.");
-                       if (dataset._xmlDataDocument != null)
-                               throw new ArgumentException ("DataSet cannot be associated with two or more XmlDataDocument.");
-
-                       InitDelegateFields ();
-
-                       this.dataSet = dataset;
-                       this.dataSet._xmlDataDocument = this;
-
-                       XmlElement docElem = CreateElement (dataSet.Prefix, XmlHelper.Encode (dataSet.DataSetName), dataSet.Namespace);
-                       foreach (DataTable dt in dataSet.Tables) {
-                               if (dt.ParentRelations.Count > 0)
-                                       continue; // don't add them here
-                               FillNodeRows (docElem, dt, dt.Rows);
-                       }
-
-                       // This seems required to avoid Load() error when for
-                       // example empty DataSet will be filled on Load().
-                       if (docElem.ChildNodes.Count > 0)
-                               AppendChild (docElem);
-
-                       foreach (DataTable dt in dataSet.Tables) {
-                               dt.ColumnChanged += columnChanged;
-                               dt.RowDeleted += rowDeleted;
-                               dt.RowChanged += rowChanged;
-                       }
-
-                       AddXmlDocumentListeners ();
-               }
-
-               // bool clone. If we are cloning XmlDataDocument then clone should be true.
-               // FIXME: shouldn't DataSet be mapped to at most one document??
-               private XmlDataDocument (DataSet dataset, bool clone)
-               {
-                       InitDelegateFields ();
-
-                       this.dataSet = dataset;
-                       this.dataSet._xmlDataDocument = this;
-
-                       foreach (DataTable Table in DataSet.Tables) {
-                               
-                               foreach (DataRow Row in Table.Rows) {
-                                       Row.XmlRowID = dataRowID;
-                                       dataRowIDList.Add (dataRowID);
-                                       dataRowID++;
-                               }
-                       }
-
-                       AddXmlDocumentListeners ();
-
-                       foreach (DataTable Table in dataSet.Tables) {
-                               Table.ColumnChanged += columnChanged;
-                               Table.RowDeleted += rowDeleted;
-                               Table.RowChanged += rowChanged;
-                       }
-               }
-
-               #endregion // Constructors
-
-               #region Public Properties
-
-               public DataSet DataSet {
-                       get {
-                               return dataSet;
-                       }
-               }
-
-               #endregion // Public Properties
-
-               #region Public Methods
-
-               private void FillNodeRows (XmlElement parent, DataTable dt, ICollection rows)
-               {
-                       foreach (DataRow dr in dt.Rows) {
-                               XmlDataElement el = dr.DataElement;
-                               FillNodeChildrenFromRow (dr, el);
-
-                               foreach (DataRelation rel in dt.ChildRelations)
-                                       FillNodeRows (el, rel.ChildTable, dr.GetChildRows (rel));
-                               parent.AppendChild (el);
-                       }
-               }
-
-               public override XmlNode CloneNode (bool deep) 
-               {
-                       XmlDataDocument Document;
-                       if (deep)
-                               Document = new XmlDataDocument (DataSet.Copy (), true);
-                       else
-                               Document = new XmlDataDocument (DataSet.Clone (), true);
-
-                       Document.RemoveXmlDocumentListeners ();
-
-                       Document.PreserveWhitespace = PreserveWhitespace;
-                       if (deep) {
-                               foreach(XmlNode n in ChildNodes)
-                                       Document.AppendChild (Document.ImportNode (n, deep));
-                       }
-
-                       Document.AddXmlDocumentListeners ();
-
-                       return Document;                        
-               }
-
-               #region overloaded CreateElement methods
-
-               public override XmlElement CreateElement(
-                        string prefix, string localName, string namespaceURI) 
-               {
-                       DataTable dt = DataSet.Tables [XmlHelper.Decode (localName)];
-                       DataRow row = dt != null ? dt.NewRow () : null;
-                       if (row != null)
-                               return GetElementFromRow (row);
-                       else
-                               return base.CreateElement (prefix, localName, namespaceURI);
-               }
-
-               #endregion // overloaded CreateElement Methods
-                       
-               // It is not supported in XmlDataDocument
-               public override XmlEntityReference CreateEntityReference(string name) 
-               {
-                       throw new NotSupportedException ();
-               }
-               
-               // It is not supported in XmlDataDocument
-               public override XmlElement GetElementById (string elemId) 
-               {
-                       throw new NotSupportedException ();
-               }
-
-               // get the XmlElement associated with the DataRow
-               public XmlElement GetElementFromRow (DataRow r) 
-               {
-                       return r.DataElement;
-               }
-
-               // get the DataRow associated with the XmlElement
-               public DataRow GetRowFromElement (XmlElement e)
-               {
-                       XmlDataElement el = e as XmlDataElement;
-                       if (el == null)
-                               return null;
-                       return el.DataRow;
-               }
-
-               #region overload Load methods
-
-               public override void Load(Stream inStream) {
-                       Load (new XmlTextReader (inStream));
-               }
-
-               public override void Load(string filename) {
-                       Load (new XmlTextReader (filename));
-               }
-
-               public override void Load(TextReader txtReader) {
-                       Load (new XmlTextReader (txtReader));
-               }
-
-               public override void Load (XmlReader reader) 
-               {
-                       if (DocumentElement != null)
-                               throw new InvalidOperationException ("XmlDataDocument does not support multi-time loading. New XmlDadaDocument is always required.");
-
-                       bool OldEC = DataSet.EnforceConstraints;
-                       DataSet.EnforceConstraints = false;
-                       dataSet.Tables.CollectionChanged -= tablesChanged;
-
-                       base.Load (reader);
-
-                       DataSet.EnforceConstraints = OldEC;
-                       dataSet.Tables.CollectionChanged += tablesChanged;
-               }
-               
-               #endregion // overloaded Load methods
-               #endregion // Public Methods
-
-               #region Protected Methods
-
-               [MonoTODO ("Create optimized XPathNavigator")]
-               protected override XPathNavigator CreateNavigator(XmlNode node) {
-                       return base.CreateNavigator (node);
-               }
-
-               #endregion // Protected Methods
-               
-               #region XmlDocument event handlers
-
-               private void OnNodeChanging (object sender, XmlNodeChangedEventArgs args)
-               {
-                       if (!this.raiseDocumentEvents)
-                               return;
-                       if (DataSet.EnforceConstraints) 
-                               throw new InvalidOperationException (Locale.GetText ("Please set DataSet.EnforceConstraints == false before trying to edit XmlDataDocument using XML operations."));
-               }
-
-               // Invoked when XmlNode is changed colum is changed
-               private void OnNodeChanged (object sender, XmlNodeChangedEventArgs args)
-               {
-                       if (!raiseDocumentEvents)
-                               return;
-                       bool escapedRaiseDataSetEvents = raiseDataSetEvents;
-                       raiseDataSetEvents = false;
-                       try {
-
-                               if (args.Node == null)
-                                       return;
-
-                               DataRow row = GetRowFromElement ((XmlElement)args.Node.ParentNode.ParentNode);
-
-                               if (row == null)
-                                       return;
-
-                               if (!row.Table.Columns.Contains (args.Node.ParentNode.Name))
-                                       return;
-
-                               if (row [args.Node.ParentNode.Name].ToString () != args.Node.InnerText) {
-                                       DataColumn col = row.Table.Columns [args.Node.ParentNode.Name];
-                                       row [col] = StringToObject (col.DataType, args.Node.InnerText);
-                               }
-
-                       } finally {
-                               raiseDataSetEvents = escapedRaiseDataSetEvents;
-                       }
-               }
-
-               private void OnNodeRemoving (object sender, XmlNodeChangedEventArgs args) 
-               {
-                       if (!this.raiseDocumentEvents)
-                               return;
-                       if (DataSet.EnforceConstraints) 
-                               throw new InvalidOperationException (Locale.GetText ("Please set DataSet.EnforceConstraints == false before trying to edit XmlDataDocument using XML operations."));
-                       
-               }
-               
-               // Invoked when XmlNode is removed
-               private void OnNodeRemoved (object sender, XmlNodeChangedEventArgs args)
-               {
-                       if (!raiseDocumentEvents)
-                               return;
-                       bool escapedRaiseDataSetEvents = raiseDataSetEvents;
-                       raiseDataSetEvents = false;
-
-                       try {
-                               if (args.OldParent == null)
-                                       return;
-
-                               XmlElement oldParentElem = args.OldParent as XmlElement;
-                               if (oldParentElem == null)
-                                       return;
-                               
-                               // detach child row (if exists)
-                               XmlElement childElem = args.Node as XmlElement;
-                               if (childElem != null) {
-                                       DataRow childRow = GetRowFromElement (childElem);
-                                       if (childRow != null)
-                                               childRow.Table.Rows.Remove (childRow);
-                               }
-
-                               DataRow row = GetRowFromElement (oldParentElem);
-                               
-                               if (row == null)
-                                       return ;
-
-                               row [args.Node.Name] = null;
-
-                       } finally {
-                               raiseDataSetEvents = escapedRaiseDataSetEvents;
-                       }
-               }
-
-               private void OnNodeInserting (object sender, XmlNodeChangedEventArgs args) 
-               {
-                       if (!this.raiseDocumentEvents)
-                               return;
-                       if (DataSet.EnforceConstraints) 
-                               throw new InvalidOperationException (Locale.GetText ("Please set DataSet.EnforceConstraints == false before trying to edit XmlDataDocument using XML operations."));
-               }
-               
-               private void OnNodeInserted (object sender, XmlNodeChangedEventArgs args)
-               {
-                       if (!raiseDocumentEvents)
-                               return;
-                       bool escapedRaiseDataSetEvents = raiseDataSetEvents;
-                       raiseDataSetEvents = false;
-
-                       // If the parent node is mapped to a DataTable, then
-                       // add a DataRow and map the parent element to it.
-                       //
-                       // AND If the child node is mapped to a DataTable, then
-                       // 1. if it is mapped to a DataTable and relation, add
-                       // a new DataRow and map the child element to it.
-                       // 2. if it is mapped to a DataColumn, set the column
-                       // value of the parent DataRow as the child
-
-                       try {
-                               if (! (args.NewParent is XmlElement)) {
-                                       // i.e. adding document element
-                                       foreach (XmlNode table in args.Node.ChildNodes)
-                                               CheckDescendantRelationship (table);
-                                       return;
-                               }
-
-                               DataRow row = GetRowFromElement (args.NewParent as XmlElement);
-                               if (row == null && args.Node is XmlCharacterData)
-                                       // check if grandparent is a new row and this node is one of its column values.
-                                       row = GetRowFromElement (args.NewParent.ParentNode as XmlElement);
-                               if (row == null) {
-                                       // That happens only when adding table to existing DocumentElement (aka DataSet element)
-                                       if (args.NewParent == DocumentElement)
-                                               CheckDescendantRelationship (args.Node);
-                                       return;
-                               }
-
-                               XmlAttribute attr = args.Node as XmlAttribute;
-                               if (attr != null) { // fill attribute value
-                                       DataColumn col = row.Table.Columns [XmlHelper.Decode (attr.LocalName)];
-                                       if (col != null)
-                                               row [col] = StringToObject (col.DataType, args.Node.Value);
-                               } else {
-                                       DataRow childRow = GetRowFromElement (args.Node as XmlElement);
-                                       if (childRow != null) {
-                                               // child might be a table row.
-                                               // I might be impossible to set parent
-                                               // since either of them might be detached
-                                               if (childRow.RowState != DataRowState.Detached && row.RowState != DataRowState.Detached) {
-                                                       FillRelationship (row, childRow, args.NewParent, args.Node);
-                                               }
-                                       } else if (args.Node.NodeType == XmlNodeType.Element) {
-                                               // child element might be a column
-                                               DataColumn col = row.Table.Columns [XmlHelper.Decode (args.Node.LocalName)];
-                                               if (col != null)
-                                                       row [col] = StringToObject (col.DataType, args.Node.InnerText);
-                                       } else if (args.Node is XmlCharacterData) {
-                                               if (args.Node.NodeType != XmlNodeType.Comment) {
-                                                       for (int i = 0; i < row.Table.Columns.Count; i++) {
-                                                               DataColumn col = row.Table.Columns [i];
-                                                               if (col.ColumnMapping == MappingType.SimpleContent || col.ColumnName == XmlHelper.Decode (args.NewParent.LocalName))
-                                                                       row [col] = StringToObject (col.DataType, args.Node.Value);
-                                                       }
-                                               }
-                                       }
-                               }
-                       } finally {
-                               raiseDataSetEvents = escapedRaiseDataSetEvents;
-                       }
-               }
-
-               private void CheckDescendantRelationship (XmlNode n)
-               {
-                       XmlElement el = n as XmlElement;
-                       DataRow row = GetRowFromElement (el);
-                       if (row == null)
-                               return;
-                       row.Table.Rows.Add (row); // attach
-                       CheckDescendantRelationship (n, row);
-               }
-
-               private void CheckDescendantRelationship (XmlNode p, DataRow row)
-               {
-                       foreach (XmlNode n in p.ChildNodes) {
-                               XmlElement el = n as XmlElement;
-                               if (el == null)
-                                       continue;
-                               DataRow childRow = GetRowFromElement (el);
-                               if (childRow == null)
-                                       continue;
-                               childRow.Table.Rows.Add (childRow);
-                               FillRelationship (row, childRow, p, el);
-                       }
-               }
-
-               private void FillRelationship (DataRow row, DataRow childRow, XmlNode parentNode, XmlNode childNode)
-               {
-                       for (int i = 0; i < childRow.Table.ParentRelations.Count; i++) {
-                               DataRelation rel = childRow.Table.ParentRelations [i];
-                               if (rel.ParentTable == row.Table) {
-                                       childRow.SetParentRow (row);
-                                       break;
-                               }
-                       }
-                       CheckDescendantRelationship (childNode, childRow);
-               }
-               #endregion // DataSet event handlers
-
-               #region DataSet event handlers
-
-               // If DataTable is added or removed from DataSet
-               private void OnDataTableChanged (object sender, CollectionChangeEventArgs eventArgs)
-               {
-                       if (!raiseDataSetEvents)
-                               return;
-                       bool escapedRaiseDocumentEvents = raiseDocumentEvents;
-                       raiseDocumentEvents = false;
-
-                       try {
-                               DataTable Table = (DataTable)eventArgs.Element;
-                               switch (eventArgs.Action) {
-                               case CollectionChangeAction.Add:
-                                       Table.ColumnChanged += columnChanged;
-                                       Table.RowDeleted += rowDeleted;
-                                       Table.RowChanged += rowChanged;
-                                       break;
-                               case CollectionChangeAction.Remove:
-                                       Table.ColumnChanged -= columnChanged;
-                                       Table.RowDeleted -= rowDeleted;
-                                       Table.RowChanged -= rowChanged;
-                                       break;
-                               }
-                       } finally {
-                               raiseDocumentEvents = escapedRaiseDocumentEvents;
-                       }
-               }
-
-               // If column has changed 
-               private void OnDataTableColumnChanged (object sender, 
-                                                            DataColumnChangeEventArgs eventArgs)
-               {
-                       if (!raiseDataSetEvents)
-                               return;
-                       bool escapedRaiseDocumentEvents = raiseDocumentEvents;
-                       raiseDocumentEvents = false;
-
-                       try {
-                               DataRow row = eventArgs.Row;
-                               XmlElement el = GetElementFromRow (row);
-                               if (el == null)
-                                       return;
-                               DataColumn col = eventArgs.Column;
-                               string value = row.IsNull (col) ? String.Empty : row [col].ToString ();
-                               switch (col.ColumnMapping) {
-                               case MappingType.Attribute:
-                                       el.SetAttribute (XmlHelper.Encode (col.ColumnName), col.Namespace, value);
-                                       break;
-                               case MappingType.SimpleContent:
-                                       el.InnerText = value;
-                                       break;
-                               case MappingType.Element:
-                                       bool exists = false;
-                                       for (int i = 0; i < el.ChildNodes.Count; i++) {
-                                               XmlElement c = el.ChildNodes [i] as XmlElement;
-                                               if (c != null && c.LocalName == XmlHelper.Encode (col.ColumnName) && c.NamespaceURI == col.Namespace) {
-                                                       exists = true;
-                                                       c.InnerText = value;
-                                                       break;
-                                               }
-                                       }
-                                       if (!exists) {
-                                               XmlElement cel = CreateElement (col.Prefix, XmlHelper.Encode (col.ColumnName), col.Namespace); 
-                                               cel.InnerText = value;
-                                               el.AppendChild (cel);
-                                       }
-                                       break;
-                               // FIXME: how to handle hidden?
-                               }
-                       } finally {
-                               raiseDocumentEvents = escapedRaiseDocumentEvents;
-                       }
-               }
-       
-               private void OnDataTableRowDeleted (object sender,
-                                                         DataRowChangeEventArgs eventArgs)
-               {
-                       if (!raiseDataSetEvents)
-                               return;
-                       bool escapedRaiseDocumentEvents = raiseDocumentEvents;
-                       raiseDocumentEvents = false;
-
-                       try {
-                               // This code is obsolete XmlDataDocument one
-
-                               XmlElement el = GetElementFromRow (eventArgs.Row);
-                               if (el == null)
-                                       return;
-
-                               el.ParentNode.RemoveChild (el);
-                       } finally {
-                               raiseDocumentEvents = escapedRaiseDocumentEvents;
-                       }
-               }
-               
-               [MonoTODO ("Need to handle hidden columns? - see comments on each private method")]
-               private void OnDataTableRowChanged (object sender, DataRowChangeEventArgs eventArgs)
-               {
-                       if (!raiseDataSetEvents)
-                               return;
-                       bool escapedRaiseDocumentEvents = raiseDocumentEvents;
-                       raiseDocumentEvents = false;
-                       try {
-
-                               switch (eventArgs.Action) {
-
-                               case DataRowAction.Delete:
-                                       OnDataTableRowDeleted (sender, eventArgs);
-                                       break;
-
-                               case DataRowAction.Add:
-                                       OnDataTableRowAdded (eventArgs);
-                                       break;
-
-                               case DataRowAction.Rollback:
-                                       OnDataTableRowRollback (eventArgs);
-                                       break;
-                               default:
-                                       break;
-                               } 
-                       } finally {
-                               raiseDocumentEvents = escapedRaiseDocumentEvents;
-                       }
-               }
-
-               // Added - see FillNodeChildrenFromRow comment
-               private void OnDataTableRowAdded (DataRowChangeEventArgs args)
-               {
-                       if (!raiseDataSetEvents)
-                               return;
-
-                       bool escapedRaiseDocumentEvents = raiseDocumentEvents;
-                       raiseDocumentEvents = false;
-
-                       try {
-                               // Create row element. Row's name same as TableName                                     
-                               DataRow row = args.Row;
-
-                               // create document element if it does not exist
-                               if (DocumentElement == null)
-                                       this.AppendChild (CreateElement (XmlHelper.Encode (DataSet.DataSetName)));
-
-                               DataTable table= args.Row.Table;
-                               XmlElement element = GetElementFromRow (row);
-                               if (element == null)
-                                       element = CreateElement (table.Prefix, XmlHelper.Encode (table.TableName), table.Namespace);
-
-                               if (element.ChildNodes.Count == 0)
-                                       FillNodeChildrenFromRow (row, element);
-
-                               if (element.ParentNode == null) {
-                                       // parent is not always DocumentElement.
-                                       XmlElement parent = null;
-
-                                       if (table.ParentRelations.Count > 0) {
-                                               for (int i = 0; i < table.ParentRelations.Count; i++) {
-                                                       DataRelation rel = table.ParentRelations [i];
-                                                       DataRow parentRow = row.GetParentRow (rel);
-                                                       if (parentRow == null)
-                                                               continue;
-                                                       parent = GetElementFromRow (parentRow);
-                                               }
-                                       }
-
-                                       // The row might be orphan. In such case, the 
-                                       // element is appended to DocumentElement.
-                                       if (parent == null)
-                                               parent = DocumentElement;
-                                       parent.AppendChild (element);
-                               }
-                       } finally {                     
-                               raiseDocumentEvents = escapedRaiseDocumentEvents;
-                       }
-               }
-
-               private void FillNodeChildrenFromRow (DataRow row, XmlElement element)
-               {
-                       DataTable table = row.Table;
-                       // fill columns for the row
-                       for (int i = 0; i < table.Columns.Count; i++) {
-                               DataColumn col = table.Columns [i];
-                               string value = row.IsNull (col) ? String.Empty : row [col].ToString ();
-                               switch (col.ColumnMapping) {
-                               case MappingType.Element:
-                                       XmlElement el = CreateElement (col.Prefix, XmlHelper.Encode (col.ColumnName), col.Namespace);
-                                       el.InnerText = value;
-                                       element.AppendChild (el);
-                                       break;
-                               case MappingType.Attribute:
-                                       XmlAttribute attr = CreateAttribute (col.Prefix, XmlHelper.Encode (col.ColumnName), col.Namespace);
-                                       attr.Value = value;
-                                       element.SetAttributeNode (attr);
-                                       break;
-                               case MappingType.SimpleContent:
-                                       XmlText text = CreateTextNode (value);
-                                       element.AppendChild (text);
-                                       break;
-                               // FIXME: how to handle hidden?
-                               }
-                       }
-               }
-
-               // Rollback
-               [MonoTODO ("It does not look complete.")]
-               private void OnDataTableRowRollback (DataRowChangeEventArgs args)
-               {
-                       if (!raiseDataSetEvents)
-                               return;
-                       bool escapedRaiseDocumentEvents = raiseDocumentEvents;
-                       raiseDocumentEvents = false;
-
-                       try {
-                               DataRow r = args.Row;
-                               XmlElement el = GetElementFromRow (r);
-                               if (el == null)
-                                       return;
-                               DataTable tab = r.Table;
-                               ArrayList al = new ArrayList ();
-                               foreach (XmlAttribute attr in el.Attributes) {
-                                       DataColumn col = tab.Columns [XmlHelper.Decode (attr.LocalName)];
-                                       if (col != null) {
-                                               if (r.IsNull (col))
-                                                       // should be removed
-                                                       al.Add (attr);
-                                               else
-                                                       attr.Value = r [col].ToString ();
-                                       }
-                               }
-                               foreach (XmlAttribute attr in al)
-                                       el.RemoveAttributeNode (attr);
-                               al.Clear ();
-                               foreach (XmlNode child in el.ChildNodes) {
-                                       if (child.NodeType == XmlNodeType.Element) {
-                                               DataColumn col = tab.Columns [XmlHelper.Decode (child.LocalName)];
-                                               if (col != null) {
-                                                       if (r.IsNull (col))
-                                                               al.Add (child);
-                                                       else
-                                                               child.InnerText = r [col].ToString ();
-                                               }
-                                       }
-                               }
-                               foreach (XmlNode n in al)
-                                       el.RemoveChild (n);
-                       } finally {
-                               raiseDocumentEvents = escapedRaiseDocumentEvents;
-                       }
-               }
-
-               #endregion // DataSet event handlers
-
-               #region Private methods
-               private void InitDelegateFields ()
-               {
-                       columnChanged = new DataColumnChangeEventHandler (OnDataTableColumnChanged);
-                       rowDeleted = new DataRowChangeEventHandler (OnDataTableRowDeleted);
-                       rowChanged = new DataRowChangeEventHandler (OnDataTableRowChanged);
-                       tablesChanged = new CollectionChangeEventHandler (OnDataTableChanged);
-               }
-               
-               private void RemoveXmlDocumentListeners ()
-               {
-                       this.NodeInserting -= new XmlNodeChangedEventHandler (OnNodeInserting);
-                       this.NodeInserted -= new XmlNodeChangedEventHandler (OnNodeInserted);
-                       this.NodeChanging -= new XmlNodeChangedEventHandler (OnNodeChanging);
-                       this.NodeChanged -= new XmlNodeChangedEventHandler (OnNodeChanged);
-                       this.NodeRemoving -= new XmlNodeChangedEventHandler (OnNodeRemoving);
-                       this.NodeRemoved -= new XmlNodeChangedEventHandler (OnNodeRemoved);
-               }
-
-               private void AddXmlDocumentListeners ()
-               {
-                       this.NodeInserting += new XmlNodeChangedEventHandler (OnNodeInserting);
-                       this.NodeInserted += new XmlNodeChangedEventHandler (OnNodeInserted);
-                       this.NodeChanging += new XmlNodeChangedEventHandler (OnNodeChanging);
-                       this.NodeChanged += new XmlNodeChangedEventHandler (OnNodeChanged);
-                       this.NodeRemoving += new XmlNodeChangedEventHandler (OnNodeRemoving);
-                       this.NodeRemoved += new XmlNodeChangedEventHandler (OnNodeRemoved);
-               }
-
-               internal static object StringToObject (Type type, string value)
-               {
-                       if (value == null || value == String.Empty)
-                               return DBNull.Value;
-
-                       switch (Type.GetTypeCode (type)) {
-                               case TypeCode.Boolean: return XmlConvert.ToBoolean (value);
-                               case TypeCode.Byte: return XmlConvert.ToByte (value);
-                               case TypeCode.Char: return (char)XmlConvert.ToInt32 (value);
-                               case TypeCode.DateTime: return XmlConvert.ToDateTime (value, XmlDateTimeSerializationMode.Unspecified);
-                               case TypeCode.Decimal: return XmlConvert.ToDecimal (value);
-                               case TypeCode.Double: return XmlConvert.ToDouble (value);
-                               case TypeCode.Int16: return XmlConvert.ToInt16 (value);
-                               case TypeCode.Int32: return XmlConvert.ToInt32 (value);
-                               case TypeCode.Int64: return XmlConvert.ToInt64 (value);
-                               case TypeCode.SByte: return XmlConvert.ToSByte (value);
-                               case TypeCode.Single: return XmlConvert.ToSingle (value);
-                               case TypeCode.UInt16: return XmlConvert.ToUInt16 (value);
-                               case TypeCode.UInt32: return XmlConvert.ToUInt32 (value);
-                               case TypeCode.UInt64: return XmlConvert.ToUInt64 (value);
-                       }
-
-                       if (type == typeof (TimeSpan)) return XmlConvert.ToTimeSpan (value);
-                       if (type == typeof (Guid)) return XmlConvert.ToGuid (value);
-                       if (type == typeof (byte[])) return Convert.FromBase64String (value);
-
-                       return Convert.ChangeType (value, type);
-               }
-               #endregion // Private methods
-       }
-}
-
index 217a30dce28d876cfcf56466daee4d61c5486fc8..84d958a752fcd55813680e894224727d155c1dc1 100644 (file)
@@ -120,18 +120,24 @@ namespace Monotests_Mono.Data.SqlExpressions
        [TestFixture]
        public class DataColumnCharTest
        {
-               private static DataTable _dt = new DataTable();
+               DataTable _dt;
 
-               [Test]
-               public void Test1 ()
+               [SetUp]
+               public void Setup ()
                {
+                       _dt = new DataTable();
+
                        _dt.Columns.Add(new DataColumn("a", typeof(char)));
 
                        AddData('1');
                        AddData('2');
                        AddData('3');
                        AddData('A');
+               }
 
+               [Test]
+               public void Test1 ()
+               {
                        Assert.AreEqual (true, FindRow("'A'"), "Test1-1 failed");
                        Assert.AreEqual (true, FindRow("65"), "Test1-2 failed");
                        Assert.AreEqual (true, FindRow("'1'"), "Test1-3 failed");
@@ -143,13 +149,14 @@ namespace Monotests_Mono.Data.SqlExpressions
                {
                        FindRow("'65'");
                }
+
                [Test]
                public void Test3 ()
                {
                        Assert.AreEqual (false, FindRow ("1"), "Test3-1 failed");
                }
 
-               private static bool FindRow(string f)
+               private bool FindRow(string f)
                {
                        string filter = string.Format("a = {0}", f);
 
@@ -161,7 +168,7 @@ namespace Monotests_Mono.Data.SqlExpressions
                                return true;
                }
 
-               private static void AddData(char a)
+               private void AddData(char a)
                {
                        DataRow row = _dt.NewRow();
                        row["a"] = a;
index 3fbebc38fe2161a31094cda68499bd2854ee450c..560620c3c2a145b950445cc2976533cf251b9134 100644 (file)
@@ -58,6 +58,7 @@ namespace MonoTests.System.Data
                public void Setup () {
                        currentCultureBackup = Thread.CurrentThread.CurrentCulture;
                        Thread.CurrentThread.CurrentCulture = new CultureInfo ("fi-FI");
+                       MyDataSet.count = 0;
                }
 
                //[SetUp]
@@ -2565,7 +2566,7 @@ namespace MonoTests.System.Data
 
         public  class MyDataSet:DataSet {
 
-            public static int count = 0;
+            public static int count;
                                                                                                     
              public MyDataSet() {
 
index 0f2d40ad39a66bceda31268280f56e33d6bd6227..7ce2ef3e2d9c963096878051b4bfa5ca1f951c36 100644 (file)
@@ -54,6 +54,12 @@ namespace MonoTests.System.Data
        [TestFixture]
        public class DataTableTest :  DataSetAssertion
        {
+               [SetUp]
+               public void Setup ()
+               {
+                       MyDataTable.count = 0;
+               }
+
                string EOL = Environment.NewLine;
 
                [Test]
@@ -816,6 +822,7 @@ namespace MonoTests.System.Data
                }
                
                [Test]
+               [SetCulture("en-US")]
                public void PropertyExceptions ()
                {
                        DataSet set = new DataSet ();
@@ -3242,7 +3249,7 @@ namespace MonoTests.System.Data
                        substring = TextString.Substring (0, TextString.IndexOf (EOL));
                        TextString = TextString.Substring (TextString.IndexOf (EOL) + EOL.Length);
                        // Looks like whoever added this test depended on English culture, which is wrong.
-                       Assert.AreEqual ("  <xs:element msdata:IsDataSet=\"true\" msdata:MainDataTable=\"Region\" msdata:UseCurrentLocale=\"true\" name=\"Root\">", substring, "test#03");
+                       Assert.AreEqual ("  <xs:element msdata:IsDataSet=\"true\" msdata:Locale=\"en-US\" msdata:MainDataTable=\"Region\" name=\"Root\">", substring, "test#03");
 
                        substring = TextString.Substring (0, TextString.IndexOf (EOL));
                        TextString = TextString.Substring (TextString.IndexOf (EOL) + EOL.Length);
@@ -4173,7 +4180,7 @@ namespace MonoTests.System.Data
 
        public  class MyDataTable : DataTable
        {
-               public static int count = 0;
+               public static int count;
 
                public MyDataTable()
                {
@@ -4205,6 +4212,7 @@ namespace MonoTests.System.Data
 #endif
 
                [Test]
+               [SetCulture ("en-US")]
                public void Bug55978 ()
                {
                        DataTable dt = new DataTable ();
index 1e79f7e3ff12d56af5f1172e5b737c9d3c9f8697..9ca044096f6ff78a10f7567a79b8e568b233044d 100644 (file)
@@ -10,6 +10,7 @@ ReferenceSources/ResCategoryAttribute.cs
 ReferenceSources/ResDescriptionAttribute.cs
 ReferenceSources/ThisAssembly.cs
 ReferenceSources/Win32NativeMethods.cs
+ReferenceSources/SqlInternalConnectionTds.cs
 
 ReferenceSources/mobile_DbConnectionPoolCounters.cs
 
index 5504113ff952753b181b376a18235cee2f87cb35..b1b921bbb8c9c185280ba0f5baa737c7f6852478 100644 (file)
 ../../../external/referencesource/System.Data/System/Data/Merger.cs
 ../../../external/referencesource/System.Data/System/Data/MissingMappingAction.cs
 ../../../external/referencesource/System.Data/System/Data/MissingSchemaAction.cs
+../../../external/referencesource/System.Data/System/Data/OleDb/OleDbType.cs
 ../../../external/referencesource/System.Data/System/Data/OleDb/PropertyAttributes.cs
 ../../../external/referencesource/System.Data/System/Data/OperationAbortedException.cs
 ../../../external/referencesource/System.Data/System/Data/ParameterDirection.cs
 ../../../external/referencesource/System.Data/System/NewXml/XmlDataDocument.cs
 ../../../external/referencesource/System.Data/System/NewXml/XmlDataImplementation.cs
 ../../../external/referencesource/System.Data/System/NewXml/XPathNodePointer.cs
-../../../external/referencesource/System.Data/System/Data/OleDb/OleDbType.cs
+
+../../../external/referencesource/System.Data/System/Data/Sql/SqlDataSourceEnumerator.cs
 
 ../../../external/referencesource/System.Data/System/Data/SqlClient/ApplicationIntent.cs
+../../../external/referencesource/System.Data/System/Data/SqlClient/LocalDBAPI.cs
+../../../external/referencesource/System.Data/System/Data/SqlClient/SqlClientPermission.cs
+../../../external/referencesource/System.Data/System/Data/SqlClient/SqlConnectionString.cs
+../../../external/referencesource/System.Data/System/Data/SqlClient/SqlConnectionStringBuilder.cs
+../../../external/referencesource/System.Data/System/Data/SqlClient/SqlError.cs
+../../../external/referencesource/System.Data/System/Data/SqlClient/SqlErrorCollection.cs
+../../../external/referencesource/System.Data/System/Data/SqlClient/SqlInfoMessageEvent.cs
+../../../external/referencesource/System.Data/System/Data/SqlClient/SqlUtil.cs
+../../../external/referencesource/System.Data/System/Data/SqlClient/TdsEnums.cs
+../../../external/referencesource/System.Data/System/Data/SqlClient/TdsParserStaticMethods.cs
+
 ../../../external/referencesource/System.Data/System/Data/SQLTypes/INullable.cs
 ../../../external/referencesource/System.Data/System/Data/SQLTypes/SQLBinary.cs
 ../../../external/referencesource/System.Data/System/Data/SQLTypes/SQLBoolean.cs
index 04f7f47cb21bb958ea4b2fb7e16b86c9316d7703..59c3b8483883ba8d0b3b56d345afee2a861a696a 100644 (file)
@@ -10,8 +10,8 @@ ReferenceSources/ResCategoryAttribute.cs
 ReferenceSources/ResDescriptionAttribute.cs
 ReferenceSources/ThisAssembly.cs
 ReferenceSources/Win32NativeMethods.cs
+ReferenceSources/SqlInternalConnectionTds.cs
 
-System.Data.Sql/SqlDataSourceEnumerator.cs
 System.Data.Sql/SqlNotificationRequest.cs
 Microsoft.SqlServer.Server/Format.cs
 Microsoft.SqlServer.Server/DataAccessKind.cs
@@ -35,21 +35,15 @@ System.Data.SqlClient/SqlNotificationSource.cs
 System.Data.SqlClient/SqlAsyncState.cs
 System.Data.SqlClient/SqlAsyncResult.cs
 System.Data.SqlClient/SqlClientMetaDataCollectionNames.cs
-System.Data.SqlClient/SqlClientPermission.cs
-System.Data.SqlClient/SqlClientPermissionAttribute.cs
 System.Data.SqlClient/SqlCommand.cs
 System.Data.SqlClient/SqlCommandBuilder.cs
 System.Data.SqlClient/SqlConnection.cs
-System.Data.SqlClient/SqlConnectionStringBuilder.cs
 System.Data.SqlClient/SqlCredential.cs
 System.Data.SqlClient/SqlDataAdapter.cs
 System.Data.SqlClient/SqlDataReader.cs
 System.Data.SqlClient/SqlDataSourceConverter.cs
 System.Data.SqlClient/SqlDependency.cs
-System.Data.SqlClient/SqlError.cs
-System.Data.SqlClient/SqlErrorCollection.cs
 System.Data.SqlClient/SqlException.cs
-System.Data.SqlClient/SqlInfoMessageEventArgs.cs
 System.Data.SqlClient/SqlInfoMessageEventHandler.cs
 System.Data.SqlClient/SqlInitialCatalogConverter.cs
 System.Data.SqlClient/NetworkLibraryConverter.cs
index f787d709695ef041902b0d05143303afae5bc968..04985c2d9bf173f0c6e559d84f547384601c6ee4 100644 (file)
 ../../../external/referencesource/System.Data/System/NewXml/XmlDataImplementation.cs
 ../../../external/referencesource/System.Data/System/NewXml/XPathNodePointer.cs
 
+../../../external/referencesource/System.Data/System/Data/Sql/SqlDataSourceEnumerator.cs
+
 ../../../external/referencesource/System.Data/System/Data/SqlClient/ApplicationIntent.cs
+../../../external/referencesource/System.Data/System/Data/SqlClient/LocalDBAPI.cs
+../../../external/referencesource/System.Data/System/Data/SqlClient/SqlClientPermission.cs
+../../../external/referencesource/System.Data/System/Data/SqlClient/SqlConnectionString.cs
+../../../external/referencesource/System.Data/System/Data/SqlClient/SqlConnectionStringBuilder.cs
+../../../external/referencesource/System.Data/System/Data/SqlClient/SqlError.cs
+../../../external/referencesource/System.Data/System/Data/SqlClient/SqlErrorCollection.cs
+../../../external/referencesource/System.Data/System/Data/SqlClient/SqlInfoMessageEvent.cs
+../../../external/referencesource/System.Data/System/Data/SqlClient/SqlUtil.cs
+../../../external/referencesource/System.Data/System/Data/SqlClient/TdsEnums.cs
+../../../external/referencesource/System.Data/System/Data/SqlClient/TdsParserStaticMethods.cs
+
 ../../../external/referencesource/System.Data/System/Data/SQLTypes/INullable.cs
 ../../../external/referencesource/System.Data/System/Data/SQLTypes/SQLBinary.cs
 ../../../external/referencesource/System.Data/System/Data/SQLTypes/SQLBoolean.cs
diff --git a/mcs/class/System.Runtime.Serialization.Json/Assembly/AssemblyInfo.cs b/mcs/class/System.Runtime.Serialization.Json/Assembly/AssemblyInfo.cs
deleted file mode 100644 (file)
index 9ef66ef..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-//
-// AssemblyInfo.cs
-//
-// Author:
-//   Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//
-// (C) 2003 Ximian, Inc.  http://www.ximian.com
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Reflection;
-using System.Resources;
-using System.Security;
-using System.Diagnostics;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about the System.Runtime.Serialization.Json assembly
-// v2.1 Assembly
-
-[assembly: AssemblyTitle ("System.Runtime.Serialization.Json.dll")]
-[assembly: AssemblyDescription ("System.Runtime.Serialization.Json.dll")]
-[assembly: AssemblyDefaultAlias ("System.Runtime.Serialization.Json.dll")]
-
-[assembly: AssemblyCompany (Consts.MonoCompany)]
-[assembly: AssemblyProduct (Consts.MonoProduct)]
-[assembly: AssemblyCopyright (Consts.MonoCopyright)]
-[assembly: AssemblyVersion (Consts.FxVersion)]
-[assembly: SatelliteContractVersion (Consts.FxVersion)]
-[assembly: AssemblyInformationalVersion (Consts.FxFileVersion)]
-[assembly: AssemblyFileVersion (Consts.FxFileVersion)]
-
-[assembly: NeutralResourcesLanguage ("en-US")]
-[assembly: CLSCompliant (true)]
-[assembly: AssemblyDelaySign (true)]
-#if NET_2_1
-[assembly: AssemblyKeyFile ("../silverlight.pub")]
-#else
-[assembly: AssemblyKeyFile ("../ecma.pub")]
-#endif
-
-[assembly: ComVisible (false)]
-[assembly: AllowPartiallyTrustedCallers]
-
-[assembly: CompilationRelaxations (CompilationRelaxations.NoStringInterning)]
diff --git a/mcs/class/System.Runtime.Serialization.Json/Makefile b/mcs/class/System.Runtime.Serialization.Json/Makefile
deleted file mode 100644 (file)
index cf3d387..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-thisdir = class/System.Runtime.Serialization.Json
-SUBDIRS = 
-include ../../build/rules.make
-
-LIBRARY = System.Runtime.Serialization.Json.dll
-LIB_REFS = System System.Xml System.Runtime.Serialization System.Core
-LIB_MCS_FLAGS =
-
-TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
-
-EXTRA_DISTFILES = $(RESOURCE_FILES)
-
-VALID_PROFILE := $(filter 2.1, $(FRAMEWORK_VERSION))
-ifndef VALID_PROFILE
-LIBRARY_NAME = dummy-System.Runtime.Serialization.Json.dll
-NO_INSTALL = yes
-NO_SIGN_ASSEMBLY = yes
-endif
-
-include ../../build/library.make
diff --git a/mcs/class/System.Runtime.Serialization.Json/System.Runtime.Serialization.Json.dll.sources b/mcs/class/System.Runtime.Serialization.Json/System.Runtime.Serialization.Json.dll.sources
deleted file mode 100644 (file)
index 74425b6..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-../../build/common/Consts.cs
-../../build/common/Locale.cs
-../../build/common/MonoTODOAttribute.cs
-Assembly/AssemblyInfo.cs
-../System.ServiceModel.Web/System.Runtime.Serialization.Json/IXmlJsonReaderInitializer.cs
-../System.ServiceModel.Web/System.Runtime.Serialization.Json/IXmlJsonWriterInitializer.cs
-../System.ServiceModel.Web/System.Runtime.Serialization.Json/JsonReader.cs
-../System.ServiceModel.Web/System.Runtime.Serialization.Json/JsonReaderWriterFactory.cs
-../System.ServiceModel.Web/System.Runtime.Serialization.Json/JsonWriter.cs
diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization.Configuration/ChangeLog b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization.Configuration/ChangeLog
deleted file mode 100644 (file)
index 5d445cd..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-2010-03-08  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * TypeElementCollection.cs : more corcompare fixes.
-
-2010-03-04  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * TypeElement.cs, DeclaredTypeElement.cs,
-         ParameterElementCollection.cs, DataContractSerializerSection.cs,
-         ParameterElement.cs :
-         Looks like MSDN pages are quite incorrect. updated to match what
-         status page tells.
-
-2010-03-03  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataContractSerializerSection.cs : new.
-       * XmlFormatterSection.cs : remove.
-       * DeclaredTypeElementCollection.cs
-         TypeElement.cs
-         DeclaredTypeElement.cs
-         SerializationSectionGroup.cs
-         ParameterElementCollection.cs
-         TypeElementCollection.cs
-         ParameterElement.cs : implement.
-
-2005-10-03  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DeclaredTypeElementCollection.cs, TypeElement.cs,
-         DeclaredTypeElement.cs, SerializationSectionGroup.cs,
-         ParameterElementCollection.cs, TypeElementCollection.cs,
-         XmlFormatterSection.cs, ParameterElement.cs : new files.
-
diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization.Configuration/DataContractSerializerSection.cs b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization.Configuration/DataContractSerializerSection.cs
deleted file mode 100644 (file)
index 617894f..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-//
-// DataContractSerializerSection.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2010 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.Configuration;
-
-namespace System.Runtime.Serialization.Configuration
-{
-       public sealed class DataContractSerializerSection : ConfigurationSection
-       {
-               // Static Fields
-               static ConfigurationPropertyCollection properties;
-               static ConfigurationProperty declared_types;
-
-               static DataContractSerializerSection ()
-               {
-                       properties = new ConfigurationPropertyCollection ();
-                       declared_types = new ConfigurationProperty ("declaredTypes",
-                               typeof (DeclaredTypeElementCollection), null, null, null,
-                               ConfigurationPropertyOptions.None);
-
-                       properties.Add (declared_types);
-               }
-
-               public DataContractSerializerSection ()
-               {
-               }
-
-               [ConfigurationPropertyAttribute ("declaredTypes", DefaultValue = null)]
-               public DeclaredTypeElementCollection DeclaredTypes {
-                       get { return (DeclaredTypeElementCollection) base [declared_types]; }
-               }
-
-               protected override ConfigurationPropertyCollection Properties {
-                       get { return properties; }
-               }
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization.Configuration/DeclaredTypeElement.cs b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization.Configuration/DeclaredTypeElement.cs
deleted file mode 100644 (file)
index d4b9054..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-//
-// DeclaredTypeElement.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005,2010 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.Configuration;
-
-namespace System.Runtime.Serialization.Configuration
-{
-       [MonoTODO]
-       public sealed class DeclaredTypeElement : ConfigurationElement
-       {
-               // Static Fields
-               static ConfigurationPropertyCollection properties;
-               static ConfigurationProperty known_types;
-               static ConfigurationProperty type;
-
-               static DeclaredTypeElement ()
-               {
-                       properties = new ConfigurationPropertyCollection ();
-                       known_types = new ConfigurationProperty ("",
-                               typeof (TypeElementCollection), null, null, null,
-                               ConfigurationPropertyOptions.IsDefaultCollection);
-                       type = new ConfigurationProperty ("type",
-                               typeof (string), "", null, null,
-                               ConfigurationPropertyOptions.None);
-
-                       properties.Add (known_types);
-                       properties.Add (type);
-               }
-
-               public DeclaredTypeElement ()
-               {
-               }
-
-               public DeclaredTypeElement (string typeName)
-               {
-                       Type = typeName;
-               }
-
-               [ConfigurationProperty ("", DefaultValue = null, Options = ConfigurationPropertyOptions.IsDefaultCollection)]
-               public TypeElementCollection KnownTypes {
-                       get { return (TypeElementCollection) base [known_types]; }
-               }
-
-               [ConfigurationProperty ("type", DefaultValue = "", Options = ConfigurationPropertyOptions.IsKey)]
-               public string Type {
-                       get { return (string) base [type]; }
-                       set { base [type] = value; }
-               }
-
-               protected override ConfigurationPropertyCollection Properties {
-                       get { return properties; }
-               }
-
-               protected override void PostDeserialize ()
-               {
-                       // what to do here?
-                       base.PostDeserialize ();
-               }
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization.Configuration/DeclaredTypeElementCollection.cs b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization.Configuration/DeclaredTypeElementCollection.cs
deleted file mode 100644 (file)
index d902478..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-//
-// DeclaredTypeElementCollection.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.Configuration;
-
-namespace System.Runtime.Serialization.Configuration
-{
-       [ConfigurationCollection (typeof (DeclaredTypeElement))]
-       public sealed class DeclaredTypeElementCollection : ConfigurationElementCollection
-       {
-               public DeclaredTypeElementCollection ()
-               {
-               }
-
-               public DeclaredTypeElement this [int index] {
-                       get { return (DeclaredTypeElement) BaseGet (index); }
-                       set {
-                               RemoveAt (index);
-                               Add (value);
-                       }
-               }
-
-               public new DeclaredTypeElement this [string typeName] {
-                       get { return (DeclaredTypeElement) BaseGet (typeName); }
-                       set {
-                               Remove (typeName);
-                               Add (value);
-                       }
-               }
-
-               public void Add (DeclaredTypeElement element)
-               {
-                       BaseAdd (element);
-               }
-
-               public void Clear ()
-               {
-                       BaseClear ();
-               }
-
-               public bool Contains (string typeName)
-               {
-                       return BaseGet (typeName) != null;
-               }
-
-               public int IndexOf (DeclaredTypeElement element)
-               {
-                       return BaseIndexOf (element);
-               }
-
-               public void Remove (DeclaredTypeElement element)
-               {
-                       Remove ((string) GetElementKey (element));
-               }
-
-               public void Remove (string typeName)
-               {
-                       BaseRemove (typeName);
-               }
-
-               public void RemoveAt (int index)
-               {
-                       BaseRemoveAt (index);
-               }
-
-               protected override ConfigurationElement CreateNewElement ()
-               {
-                       return new DeclaredTypeElement ();
-               }
-
-               protected override Object GetElementKey (
-                       ConfigurationElement element)
-               {
-                       return ((DeclaredTypeElement) element).Type;
-               }
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization.Configuration/ParameterElement.cs b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization.Configuration/ParameterElement.cs
deleted file mode 100644 (file)
index fcfaf5f..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-//
-// ParameterElement.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005,2010 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.Configuration;
-using System.Xml;
-
-namespace System.Runtime.Serialization.Configuration
-{
-       public sealed class ParameterElement : ConfigurationElement
-       {
-               // Static Fields
-               static ConfigurationPropertyCollection properties;
-               static ConfigurationProperty index;
-               static ConfigurationProperty parameters;
-               static ConfigurationProperty type;
-
-               static ParameterElement ()
-               {
-                       properties = new ConfigurationPropertyCollection ();
-                       index = new ConfigurationProperty ("index",
-                               typeof (int), "", null, null,
-                               ConfigurationPropertyOptions.None);
-                       parameters = new ConfigurationProperty ("",
-                               typeof (ParameterElementCollection), null, null, null,
-                               ConfigurationPropertyOptions.IsDefaultCollection);
-                       type = new ConfigurationProperty ("type",
-                               typeof (string), "", null, null,
-                               ConfigurationPropertyOptions.None);
-
-                       properties.Add (index);
-                       properties.Add (parameters);
-                       properties.Add (type);
-               }
-
-               public ParameterElement ()
-               {
-               }
-
-               public ParameterElement (int index)
-               {
-                       Index = index;
-               }
-
-               public ParameterElement (string typeName)
-               {
-                       Type = typeName;
-               }
-
-               [IntegerValidator (MinValue = 0)]
-               [ConfigurationProperty ("index", DefaultValue = 0)]
-               public int Index {
-                       get { return (int) base [index]; }
-                       set { base [index] = value; }
-               }
-
-               [ConfigurationProperty ("", DefaultValue = null, Options = ConfigurationPropertyOptions.IsDefaultCollection)]
-               public ParameterElementCollection Parameters {
-                       get { return (ParameterElementCollection) base [parameters]; }
-               }
-
-               [StringValidator (MinLength = 0)]
-               [ConfigurationProperty ("type", DefaultValue = "")]
-               public string Type {
-                       get { return (string) base [type]; }
-                       set { base [type] = value; }
-               }
-
-               protected override ConfigurationPropertyCollection Properties {
-                       get { return properties; }
-               }
-
-               protected override void PreSerialize (XmlWriter writer)
-               {
-                       // what to do here?
-                       base.PreSerialize (writer);
-               }
-
-               protected override void PostDeserialize ()
-               {
-                       // what to do here?
-                       base.PostDeserialize ();
-               }
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization.Configuration/ParameterElementCollection.cs b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization.Configuration/ParameterElementCollection.cs
deleted file mode 100644 (file)
index ef44ceb..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-//
-// ParameterElementCollection.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005,2010 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.Configuration;
-
-namespace System.Runtime.Serialization.Configuration
-{
-       [ConfigurationCollection (typeof (ParameterElement), AddItemName = "parameter", CollectionType = ConfigurationElementCollectionType.BasicMap)]
-       public sealed class ParameterElementCollection : ConfigurationElementCollection
-       {
-               public ParameterElementCollection ()
-               {
-               }
-
-               public override ConfigurationElementCollectionType CollectionType {
-                       get { return ConfigurationElementCollectionType.BasicMap; }
-               }
-
-               // FIXME: not very sure, just had a look at http://msdn.microsoft.com/en-us/library/ms731806.aspx
-               protected override string ElementName {
-                       get { return String.Empty; }
-               }
-
-               public ParameterElement this [int index] {
-                       get { return (ParameterElement) BaseGet (index); }
-                       set {
-                               BaseRemoveAt (index);
-                               Add (value);
-                       }
-               }
-
-               public void Add (ParameterElement element)
-               {
-                       BaseAdd (element);
-               }
-
-               public void Clear ()
-               {
-                       BaseClear ();
-               }
-
-               public bool Contains (string typeName)
-               {
-                       return BaseGet (typeName) != null;
-               }
-
-               public int IndexOf (ParameterElement element)
-               {
-                       return BaseIndexOf (element);
-               }
-
-               public void Remove (ParameterElement element)
-               {
-                       BaseRemove ((string) GetElementKey (element));
-               }
-
-               public void RemoveAt (int index)
-               {
-                       BaseRemoveAt (index);
-               }
-
-               protected override ConfigurationElement CreateNewElement ()
-               {
-                       return new ParameterElement ();
-               }
-
-               protected override object GetElementKey (
-                       ConfigurationElement element)
-               {
-                       return ((ParameterElement) element).Type;
-               }
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization.Configuration/SerializationSectionGroup.cs b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization.Configuration/SerializationSectionGroup.cs
deleted file mode 100644 (file)
index b2101cf..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-//
-// SerializationSectionGroup.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005,2010 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.Configuration;
-
-using ConfigurationType = System.Configuration.Configuration;
-
-namespace System.Runtime.Serialization.Configuration
-{
-       public sealed class SerializationSectionGroup : ConfigurationSectionGroup
-       {
-               public static SerializationSectionGroup GetSectionGroup (ConfigurationType config)
-               {
-                       var ret = (SerializationSectionGroup) config.GetSectionGroup ("system.runtime.serialization");
-                       if (ret == null)
-                               throw new SystemException ("Internal configuration error: section 'system.runtime.serialization' was not found.");
-                       return ret;
-               }
-
-               public SerializationSectionGroup ()
-               {
-               }
-
-               public DataContractSerializerSection DataContractSerializer {
-                       get { return (DataContractSerializerSection) Sections ["dataContractSerializer"]; }
-               }
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization.Configuration/TypeElement.cs b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization.Configuration/TypeElement.cs
deleted file mode 100644 (file)
index 4057b04..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-//
-// TypeElement.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005,2010 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.Configuration;
-
-namespace System.Runtime.Serialization.Configuration
-{
-       public sealed class TypeElement : ConfigurationElement
-       {
-               // Static Fields
-               static ConfigurationPropertyCollection properties;
-               static ConfigurationProperty index;
-               static ConfigurationProperty parameters;
-               static ConfigurationProperty type;
-
-               static TypeElement ()
-               {
-                       properties = new ConfigurationPropertyCollection ();
-                       index = new ConfigurationProperty ("index",
-                               typeof (int), "", null, null,
-                               ConfigurationPropertyOptions.None);
-                       parameters = new ConfigurationProperty ("",
-                               typeof (ParameterElementCollection), null, null, null,
-                               ConfigurationPropertyOptions.IsDefaultCollection);
-                       type = new ConfigurationProperty ("type",
-                               typeof (string), "", null, null,
-                               ConfigurationPropertyOptions.None);
-
-                       properties.Add (index);
-                       properties.Add (parameters);
-                       properties.Add (type);
-               }
-
-               public TypeElement ()
-               {
-               }
-               
-               public TypeElement (string typeName)
-               {
-               }
-
-               [ConfigurationProperty ("index", DefaultValue = 0)]
-               [IntegerValidator (MinValue = 0)]
-               public int Index {
-                       get { return (int) base [index]; }
-                       set { base [index] = value; }
-               }
-
-               [ConfigurationProperty ("", DefaultValue = null, Options = ConfigurationPropertyOptions.IsDefaultCollection)]
-               public ParameterElementCollection Parameters {
-                       get { return (ParameterElementCollection) base [parameters]; }
-               }
-
-               [ConfigurationProperty ("type", DefaultValue = "")]
-               [StringValidator (MinLength = 0)]
-               public string Type {
-                       get { return (string) base [type]; }
-                       set { base [type] = value; }
-               }
-
-               protected override ConfigurationPropertyCollection Properties {
-                       get { return properties; }
-               }
-
-               protected override void Reset (ConfigurationElement parentElement)
-               {
-                       base.Reset (parentElement);
-               }
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization.Configuration/TypeElementCollection.cs b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization.Configuration/TypeElementCollection.cs
deleted file mode 100644 (file)
index 3055c6e..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-//
-// TypeElementCollection.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.Configuration;
-
-namespace System.Runtime.Serialization.Configuration
-{
-       [ConfigurationCollection (typeof (TypeElement), CollectionType = ConfigurationElementCollectionType.BasicMap)]
-       public sealed class TypeElementCollection : ConfigurationElementCollection
-       {
-               public TypeElementCollection ()
-               {
-               }
-
-               public override ConfigurationElementCollectionType CollectionType {
-                       get { return ConfigurationElementCollectionType.BasicMap; }
-               }
-
-               // It is undocumented.
-               protected override string ElementName {
-                       get { return "knownType"; }
-               }
-
-               public TypeElement this [int index] {
-                       get { return (TypeElement) BaseGet (index); }
-                       set {
-                               BaseRemoveAt (index);
-                               Add (value);
-                       }
-               }
-
-               public void Add (TypeElement element)
-               {
-                       BaseAdd (element);
-               }
-
-               public void Clear ()
-               {
-                       BaseClear ();
-               }
-
-               public int IndexOf (TypeElement element)
-               {
-                       return BaseIndexOf (element);
-               }
-
-               public void Remove (TypeElement element)
-               {
-                       BaseRemove ((string) GetElementKey (element));
-               }
-
-               public void RemoveAt (int index)
-               {
-                       BaseRemoveAt (index);
-               }
-
-               protected override ConfigurationElement CreateNewElement ()
-               {
-                       return new TypeElement ();
-               }
-
-               protected override Object GetElementKey (
-                       ConfigurationElement element)
-               {
-                       return ((TypeElement) element).Type;
-               }
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/ChangeLog b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/ChangeLog
deleted file mode 100755 (executable)
index 5efe584..0000000
+++ /dev/null
@@ -1,856 +0,0 @@
-2010-07-06  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * SerializationMap.cs : add OnDeserializing/OnDeserialized support.
-
-2010-06-23  Sebastien Pouliot  <sebastien@ximian.com>
-
-       * XmlFormatterDeserializer.cs: Fix some issues in Moonlight when 
-       some referenced assemblies cannot be found or loaded
-
-2010-06-03  Sebastien Pouliot  <sebastien@ximian.com>
-
-       * SerializationMap.cs: NET_2_1 needs cast too
-
-2010-06-02  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * SerializationMap.cs : fix PeerNodeAddress serialization regression.
-
-2010-06-01  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * SerializationMap.cs : for IXmlSerializable it uses CreateInstance()
-         instead of GetUninitializedObject(). Fixed bug #601785.
-
-2010-05-31  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * SerializationMap.cs, XmlFormatterSerializer.cs,
-         DataContractSerializer.cs :
-         support DataContractSerializer.PreserveObjectReferences. z:Ref
-         attributes are used not only for objects with IsReference=true.
-         Fixed bug #610036.
-
-2010-05-31  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * SerializationMap.cs, KnownTypeCollection.cs : contract namespace
-         should be still considered even if contract (local) name is null.
-         Fix crash for generic derived type of dictionary. Fixed the
-         primary (crasher) part of bug #610036.
-
-2010-05-19  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlFormatterDeserializer.cs : Array of something with non-default
-         namespace should be deserialized as well. Required for fixing
-         PeerResolvers ResolveResponseInfo serialization test case.
-
-2010-05-19  Andreia Gaita  <avidigal@novell.com>
-
-       * SerializationMap.cs: when deserializing, it is possible that the
-       DataMemberInfo objects being matched against the xml don't have
-       a set namespace because they were created from
-       DefaultTypeMap.GetDataMembers(), so only use the namespace for
-       comparison if it's not null (fixes part of #599667)
-
-2010-04-28  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * KnownTypeCollection.cs : support DataContractNamespaceAttribute.
-         Fixed bug #599889.
-
-2010-04-05  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataContractExporter-new.cs : do not expect contract attribute on
-         dictionary map. Non-contract type also uses this.
-
-2010-04-05  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * SerializationMap.XsdExporter.cs, DataContractExporter-new.cs :
-         handle schema export for SharedTypeMap.
-
-2010-04-05  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * KnownTypeCollection.cs, SerializationMap.cs : split SharedTypeMap
-         .ctor() and initialization. Fixed infinite loop for some
-         [Serializable] types (such as Assembly).
-
-2010-04-02  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataContractSerializer : implement IsStartObject().
-
-2010-03-12  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * KnownTypeCollection.cs, SerializationMap.cs :
-         some refactoring to implement MessageDescription.XmlName.
-
-2010-03-04  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * SerializationMap.cs : return array instance if the runtime type is
-         an array (it used to return ArrayList without conveting to array).
-
-2010-03-01  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * SerializationMap.XsdExporter.cs, XsdDataContractExporter-new.cs:
-         refresh implementation to reflect the latest WCF impl.
-       * SerializationMap.cs : make types partial.
-
-2010-02-19  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XsdDataContractImporter.cs : fix extension type name (and comment).
-
-2010-02-19  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XsdDataContractImporter.cs : added dictionary support.
-
-2010-02-18  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XsdDataContractImporter-new.cs, XsdDataContractImporter.cs :
-         replaced implementation.
-       * ImportOptions.cs : add correct MonoTODOs.
-
-2010-02-18  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XsdDataContractImporter-new.cs : output [KnownType] to expose
-         base/derived type relationship.
-
-2010-02-18  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XsdDataContractImporter-new.cs : fix GenerateInternal.
-
-2010-02-17  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XsdDataContractImporter-new.cs : refresh implementation that is
-         not based on xml serialization. Not enabled yet.
-       * KnownTypeCollection.cs : add cosmetic comment.
-
-2010-02-09  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XsdDataContractImporter.cs : add appropriate code namespaces
-         imported from xsd namespace.
-
-2010-02-08  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XsdDataContractImporter.cs : do not add primitive ArrayOfxxx types.
-
-2010-02-08  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XsdDataContractImporter.cs : some generated attributes are put
-         on enums too.
-
-2010-01-25  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * SerializationMap.cs : allow readonly field as data member.
-         Fixed bug #560155.
-
-2010-01-08  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * SerializationMap.cs, KnownTypeCollection.cs : differentiate
-         [DataContract(Namespace=null)] and [DataContract(Namespace="")].
-         Fixed bug #568763.
-
-2009-12-01  Sebastien Pouliot  <sebastien@ximian.com>
-
-       * DataContractSerializer.cs: Add two missing methods for FX3.0 
-       and SL2/SL3.
-
-2009-10-22  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * SerializationMap.cs : partly revert previous sorting fix in
-         Sep.28th. Do not sort and mix members in base and derived types.
-         Fixed bug #546238.
-
-2009-10-21  Jb Evain  <jbevain@novell.com>
-
-       * SerializationMap.cs, KnownTypeCollection.cs: avoid using LINQ
-       on arrays as MonoTouch has issues with them.
-
-2009-09-28  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * SerializationMap.cs :
-         There were some places that ignored possible whitespace nodes.
-         Fixed sorting of ordered members so that it does not give
-         incomplete sorting among base/derived types. (should fix #539563.)
-         Give xml error details in some places.
-
-2009-09-28  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * KnownTypeCollection.cs : (the previous one didn't fix #539563.)
-         Consider attempts to register the same collection type as it did
-         before.
-
-2009-09-28  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * SerializationMap.cs, KnownTypeCollection.cs : nested use of type
-         in its members resulted in infinite loop. This hopefully fixes
-         bug #539563.
-
-2009-09-07  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * IgnoreDataMemberAttribute.cs : add missing type.
-       * SerializationMap.cs : support above.
-
-2009-07-23  Sebastien Pouliot  <sebastien@ximian.com>
-
-       * SerializationMap.cs : Ensure Dictionary is still deserialized
-       correctly (wrt previous change). Fix moonlight isolated storage
-       settings.
-
-2009-07-22  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * SerializationMap.cs : for empty element, do not try to consume
-         children. Fixed bug #524086.
-         For enum, it is always error when the enum is not flags, and
-         is always default value for flags.
-
-2009-07-22  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlFormatterDeserializer.cs : when reading empty primitive value,
-         make sure to consume the reader. Fixed bug #524083.
-
-2009-07-22  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * SerializationMap.cs : call MoveToContent() before examining
-         the reader node type.
-
-2009-07-22  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * KnownTypeCollection.cs : Find KnownTypeAttributes in base types
-         too. Patch by Rolf Bjarne Kvinge. Fixed bug #524088.
-
-2009-07-21  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataContractSerializer.cs : it does not write dictionary string
-         when it was not created with it.
-
-2009-07-07  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlFormatterDeserializer.cs, SerializationMap.cs : IXmlSerializable
-         were not deserialized correctly as it has mismatch on wrapper
-         element. This fixes PeerNodeAddress.EndpointAddress deserialization.
-
-2009-06-26  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlFormatterDeserializer.cs : verifyObjectName rather blocked
-         correct names provided as the root names.
-
-2009-06-01  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlFormatterSerializer.cs, KnownTypeCollection.cs : collection
-         types does not emit xsi:type when the actual type is different
-         from the nominal serilaization type. To achieve this, introduced
-         the idea of the actual serialization type.
-
-2009-05-28  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * SerializationMap.cs : for default / shared type map, members are
-         serialized in alphabetical order.
-
-2009-05-28  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * SerializationMap.cs : generic interface search has to be more
-         complicated. Give kind error message on setting deserialized value.
-
-2009-05-28  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * SerializationMap.cs: collection interface cannot be instantiated,
-         so create List<T> (generic) or ArrayList (non-generic) instead.
-
-2009-05-25  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * SerializationMap.cs, XmlFormatterSerializer.cs :
-         collection types should not output xsi:type e.g. IList<T> should
-         not exposed xsi:type as xsi:type=List`1.
-
-2009-05-18  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * SerializationMap.cs, XmlFormatterDeserializer.cs,
-         KnownTypeCollection.cs : Support for array of some primitive types
-         in the deserializer was missing, which resulted in peer resolver
-         RegisterInfo deserialization failure.
-
-2009-05-18  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlFormatterDeserializer.cs : remove type lookup optimization
-         (since .NET 3.5 introduced system types with DC) and fix
-         serialization of system types (ISerializable types were not
-         resolved in previous code).
-
-2009-05-18  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * SerializationMap.cs : it was only about 2.1. Fix build.
-
-2009-05-18  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * SerializationMap.cs : It is not possible to get schema without
-         IXmlSerializable instance.
-
-2009-05-15  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataContractSerializer.cs : write dictionary string directly for
-         root name/ns (root only, so far).
-
-2009-05-14  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * SerializationMap.cs: interface collection failed to serialize as
-         it was calling inappropriate GetInterfaceMap().
-
-2009-04-01  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlFormatterDeserializer.cs : more hack to handle empty
-         element nicely.
-
-2009-03-24  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * SerializationMap.cs, XmlFormatterDeserializer.cs:
-         empty collection deserialization resulted in extra
-         consumption of the next xml node.
-
-2009-03-19  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * KnownTypeCollection.cs, XmlFormatterDeserializer.cs :
-         to infer type from xml qname, consider DataContractAttribute
-         names.
-
-2009-03-12  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * SerializationMap.cs : make generic type parsing sloppy.
-         because we don't know some cryptic hash algorithm:
-         http://jeffbarnes.net/portal/blogs/jeff_barnes/archive/2007/05/10/wcf-serialization-and-generics.aspx
-
-2009-03-12  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * SerializationMap.cs, KnownTypeCollection.cs :
-         support CollectionDataContract-based dictionary too.
-
-2009-03-12  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * SerializationMap.cs, KnownTypeCollection.cs :
-         added support for dictionary serialization (not for
-         CollectionDataContract-attributed dictionary yet).
-
-2009-03-12  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * SerializationMap.cs : cosmetic !NET_2_1 fix (no effect).
-       * KnownTypeCollection.cs : use ICollection<> and IList instead of
-         IEnumerable. This causes confusion for dictionary.
-
-2009-03-11  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlFormatterSerializer.cs, XmlObjectSerializer.cs,
-         XmlFormatterDeserializer.cs, KnownTypeCollection.cs :
-         add more xsi:type to cover collection items.
-
-2009-03-11  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * KnownTypeCollection.cs : fix generic argument names in xml.
-         They should use xmlized names instead of raw type name.
-       * XmlFormatterDeserializer.cs : remove extra Console.WriteLine.
-
-2009-03-11  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * SerializationMap.cs : eliminate whitespace misuses.
-
-2009-03-11  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * SerializationMap.cs : actually it could just be ICollection<T>.
-
-2009-03-11  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * SerializationMap.cs : implemented generic IList deserialization.
-
-2009-03-10  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * KnownTypeCollection.cs : fix for generic serialization.
-
-2009-02-27  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * SerializationMap.cs : look for unordered members first, in
-         different iteration. Got SL OpenStreetMap working.
-
-2009-02-13  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * SerializationMap.cs : remove use of non-2.1 CreateInstance().
-       * XmlFormatterDeserializer.cs : allow empty element.
-
-2009-02-13  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * SerializationMap.cs, DataContractSerializer.cs,
-         KnownTypeCollection.cs : now .NET 3.5/SP1 supports non-contract
-         type serialization.
-
-2009-02-13  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * SerializationMap.cs, KnownTypeCollection.cs : couple of refactoring
-         to simplify code base and handle CollectionDataContract namespace.
-
-2009-02-13  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * SerializationMap.cs : oops, remove debug lines.
-
-2009-02-13  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataContractSerializer.cs : remove extra writexmlns.
-       * SerializationMap.cs : allow DataMember of collection contract type
-         as read-only.
-       * KnownTypeCollection.cs : it was not iterating interfaces to find
-         IEnumerable<T> correctly.
-
-2009-02-03  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * SerializationMap.cs : a bit more detailed error message.
-
-2009-01-23  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * KnownTypeCollection.cs : similar fix to the previous one,
-         on uint16.
-
-2009-01-22  Alan McGovern  <amcgovern@novell.com>
-
-       * KnownTypeCollection.cs : The byte overload doesn't exist in
-       Silverlight, so cast the byte to an int instead.
-
-2008-11-23  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataContractAttribute.cs : remove MonoTODO.
-
-2008-11-23  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * SerializationMap.cs, XmlFormatterSerializer.cs,
-         XmlFormatterDeserializer.cs, DataContractAttribute.cs,
-         CollectionDataContractAttribute.cs, KnownTypeCollection.cs :
-         support IsReference (new in 3.5 SP1).
-
-2008-11-23  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataContractSerializer.cs : remove extra type validity check.
-
-2008-11-23  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlFormatterSerializer.cs : one object could not be serialized
-         twice in non-circular situation.
-
-2008-09-09  Atsushi Enomoto  <atsushi@ximian.com>
-                       Jb Evain  <jbevain@novell.com>
-
-       * IDataContractSurrogater.cs, SerializationMap.cs:
-       add support to build on the net_2_1 profile.
-
-2008-06-19  Noam Lampert <noaml@mainsoft.com>
-       
-       * KnownTypeCollection.cs: Support anyUri type
-
-2008-06-05  Noam Lampert <noaml@mainsoft.com>
-       
-       * KnownTypeCollection.cs: Support XmlRoot attribute
-
-2008-06-01  Noam Lampert <noaml@mainsoft.com>
-       
-       * KnownTypeCollection.cs: Implement byte[] serialization.
-
-2008-05-19  Noam Lampert <noaml@mainsoft.com>
-       
-       * KnownTypeCollection.cs: Implement char serialization.
-          
-2008-05-19  Noam Lampert <noaml@mainsoft.com>
-       
-       * KnownTypeCollection.cs, XmlFormatterDeserializer.cs: Imporve support for 
-          Nullable types in contracts.
-          
-2008-04-29  Eyal Alaluf <eyala@mainsoft.com>
-
-       * KnownTypeCollection.cs: Fixed a typo in long conversion.
-
-2008-04-17  Eyal Alaluf <eyala@mainsoft.com>
-
-       * SerializationMap.cs: Implement partially collections deserialization.
-         Supports arrays and types derived from IList. Needs support for calling
-         'Add' method and for dictionaries.
-       * SerializationMap.cs XmlFormatterSerializer.cs DataContractSerializer.cs:
-         Serialize namespaces for base members according to base class namespace.
-
-2008-04-14  Eyal Alaluf <eyala@mainsoft.com>
-
-       * SerializationMap.cs: Use FormatterServices.GetUninitializedObject instead
-         of Activator.CreateInstance.
-
-2008-04-10  Eyal Alaluf <eyala@mainsoft.com>
-
-       * DataContractSerializer.cs: Write and register the current type namespace
-         within the writer.
-       * XmlObjectSerializer.cs: ReadObject verifies by default.
-       * XmlFormatterSerializer.cs: Write and register XML namespaces.
-       * XmlFormatterDeserializer.cs: Refactored so Deserialize instance method can
-         be used from SerializationMap deserialization logic recursively.
-       * SerializationMap.cs: Reimplemented main deserialization logic. Now it
-         handles better missing entries, consumes the XmlReader until the end
-         element and handles XML namespaces correctly.
-         Enabled checks for required fields.
-
-2008-02-27  Eyal Alaluf <eyala@mainsoft.com>
-
-       * SerializationMap.cs: Fix namespace logic at least in simple case where
-         there are several unknown elements before the current element.
-       * ContractNamespaceAttribute.cs: The ClrNamespace is not set by the ctor.
-       * XmlObjectSerializer.cs: Dispose the XmlWriter created in WriteObject
-         to a stream.
-       * DataMemberAttribute.cs: Added the EmitDefaultValue property.
-       * XsdDataContractImporter.cs: Handle null arguments in Import methods.
-       * KnownTypeCollection.cs: Use XmlConvert.ToDateTime with roundtrip style.
-
-2007-12-05  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlObjectSerializer.cs : some methods became virtual (in Redbits).
-       * DataContractSerializer.cs : added some overriden methods in Redbits.
-         knownTypes can be null in .ctor().
-
-2007-08-17  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * SerializationMap.cs : for void it cannot be instantiated. Return
-         null instead.
-
-2007-08-17  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlFormatterDeserializer.cs DataContractSerializer.cs :
-         uhoh, the semantic of bool parameter in ReadObject() has
-         changed in the RTM. Implemented it as verifyObjectName.
-
-2007-03-27  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * SerializationMap.cs
-         XmlFormatterSerializer.cs
-         DataContractSerializer.cs :
-         now it needs some mess to handle serialization namespaces.
-         Collection items are serialized in its own xml namespace. Others,
-         (including the collection member itself) is serialized in its
-         parent xml namespace. Collection items are serialized with its
-         wrapping element.
-       * XsdDataContractImporter.cs : use constant.
-
-2007-03-26  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * KnownTypeCollection.cs : added support for Guid serialization.
-
-2006-10-20  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * KnownTypeCollection.cs : (RemoveItem) don't remove items while 
-         iterating.
-
-2006-09-06  Ankit Jain  <jankit@novell.com>
-
-       * SerializationMap.cs (SerializationMap.GetSequence): Set minOccurs = 0
-
-2006-09-05  Ankit Jain  <jankit@novell.com>
-
-       * XsdDataContractExporter.cs (XsdDataContractExporter.MSTypesSchema):
-       Load resource mstypes.schema
-       (XsdDataContractExporter.Schemas): Add MSTypesSchema by default.
-
-2006-09-05  Ankit Jain  <jankit@novell.com>
-
-       * SerializationMap.cs (SerializationMap.AddImport): New.
-       (SerializationMap.GetSequence): Use AddImport.
-
-2006-09-04  Ankit Jain  <jankit@novell.com>
-
-       * SerializationMap.cs (SerializationMap.GetSchemaSet): Remove.
-       (SerializationMap.GetSchemaType):
-       (SerializationMap.GetSequence):
-       (SerializationMap.GetSchema): Change XmlSchemas param to XmlSchemaSet.
-       Call XmlSchemaSet.Reprocess whenever an existing schema is modified.
-       * XsdDataContractExporter.cs (XsdDataContractExporter.Export): Update to
-       changes in SerializationMap.
-       (XsdDataContractExporter.CanExport): Implement.
-       (XsdDataContractExporter.GetSchemaType): Implement.
-       (XsdDataContractExporter.GetSchemaTypeName): Implement.
-       (XsdDataContractExporter.KnownTypes): New.
-       (XsdDataContractExporter.GeneratedTypes): New.
-
-2006-09-01  Ankit Jain  <jankit@novell.com>
-
-       * SerializationMap.cs (SerializationMap.GetSchemaSet): New.
-       (SerializationMap.IsPrimitive): New.
-       (SerializationMap.GetSchemaType): New.
-       (SerializationMap.GetSequence): New.
-       (SerializationMap.GetMembers): New.
-       (SerializationMap.GetSchemaElement): New.
-       (SerializationMap.GetSchema): New.
-       (SerializationMap.GetQualifiedName): New.
-       New methods for exporting schema for the type.
-
-       (SharedContractMap.ctor): Move code for building Members list to ..
-       (SharedContractMap.GetMembers): .. here.
-
-       (CollectionTypeMap.Serialize): Mark 'override'.
-       (CollectionTypeMap.GetMembers): 'override' and throw
-       NotImplementedException.
-       (CollectionTypeMap.GetSchemaType): Implement.
-
-       (SharedTypeMap..ctor): Move code to ..
-       (SharedTypeMap.GetMembers): .. here.
-       (EnumMap.GetSchemaType): Implement.
-
-       * XsdDataContractExporter.cs (XsdDataContractExporter.Export):
-       Implement.
-       * KnownTypeCollection.cs (KnownTypeCollection.GetCollectionQName): Use
-       GetQName instead of GetXmlName. Set Namespace for collections of
-       primitive types to MSArraysNamespace
-
-2006-08-31  Ankit Jain  <jankit@novell.com>
-
-       * SerializationMap.cs (EnumMap): New. For de/serializing enums.
-       (EnumMemberInfo): New.
-       (SerializationMap.DeserializeContent): Made protected virtual from private.
-       * DataContractSerializer.cs (WriteStartObject):
-       Ensure that "i:type" is not emitted for enums.
-       * KnownTypeCollection.cs (GetPrimitiveTypeName): Don't treat enum as a
-       primitive type.
-       (GetQName): Likewise. Use GetEnumQName for enums.
-       (GetEnumQName): New.
-       (IsPrimitiveNotEnum): New.
-       (TryRegister): Add support for enums.
-       (RegisterEnum): New.
-
-2006-08-14  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlFormatterSerializer.cs : (contd from my previous change)
-         ... and don't complain at WriteObject(). It is somehow required
-         in S.SM.D.WSTrustContract (soon to be committed).
-
-2006-07-27  Ankit Jain  <jankit@novell.com>
-
-       * XsdDataContractImporter.cs (Compile): Remove, thanks to eno
-       XmlSchemaSet.Compile () works now.
-       Update to directly use XmlSchemaSet.Compile ()
-
-2006-07-27  Ankit Jain  <jankit@novell.com>
-
-       * XsdDataContractImporter.cs (ImportInternal): New.
-       Update various overloads of Import to use this.
-       (ImportFromTypeMapping): New. Emits code for a DataContract from a
-       XmlTypeMapping. Code is duplicate of
-       ServiceContractGenerator.ExportDataContract .
-       (GetNamespace): New. Duplicate like above.
-       (Compile): New. Temporary hack, will XmlSchemaSet.Compile is not
-       working.
-
-2006-07-18  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlFormatterSerializer.cs, KnownTypeCollection.cs :
-         don't raise an error at DataContractSerializer..ctor(). Raise
-         InvalidDataContractException on WriteObject().
-
-2006-07-12  Ankit Jain  <jankit@novell.com>
-
-       * SerializationMap.cs (XmlSerializableMap): New. Map for classes which
-       implement IXmlSerializable interface.
-       * KnownTypeCollection.cs (KnownTypeCollection.GetQName): Add support for
-       types which implement IXmlSerializable interface. Change the order in
-       which DataContractAttribute/IXmlSerializable/SerializableAttribute get
-       selected.
-       (KnownTypeCollection.TryRegister): Change the order like above.
-       (KnownTypeCollection.RegisterIXmlSerializable): New.
-
-2006-07-04  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XsdDataContractExporter.cs, XmlObjectSerializer.cs,
-         InvalidDataContractException.cs : some June CTP updates.
-
-2006-07-04  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * IDataContractSurrogate.cs, ExportOptions.cs,
-         DataContractSerializer.cs, KnownTypeCollection.cs :
-         June CTP updates.
-
-2006-05-09  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataContractSerializer.cs : null knownTypes argument is allowed.
-       * KnownTypeCollection.cs : Type.Namespace could be null.
-
-2006-05-09  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * KnownTypeCollection.cs : for nested classes, treat localName of
-         the QName as "Parent.Child", not "Child".
-         Don't encode name here (to pass ".").
-
-2006-05-09  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataContractSerializer.cs :
-         Added maxObjectsInGraph range check.
-         interface type has BaseType as null, so end base type check when
-         it is null (I don't think this check is required btw).
-
-2006-04-05  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataContractSerializer.cs : xmlns:xsi is not written when the
-         target type is string.
-
-2006-03-22  Ankit Jain  <jankit@novell.com>
-
-       * SerializationMap.cs (CheckDataContractEqual): Remove.
-       (Deserialize): Allows expected type to be a derived one from actual
-       type.
-       (DeserializeInternal): Handle DataMember of type 'object'.
-       * XmlFormatterSerializer.cs (SerializeNonPrimitive): Serialize types not
-       already known.
-       * DataContractSerializer.cs (.ctor): Use KnownTypeCollection.GetQName
-       instead of doing it manually.
-       (PopulateTypes): Change return type from KnownTypeCollection to void.
-       Scan the base types to ensure that all have DataContract or Serializable
-       attributes.
-       Add all (including inherited) KnownTypeAttribute values to the
-       collection.
-
-2006-03-18  Ankit Jain  <jankit@novell.com>
-
-       * SerializationMap.cs (SerializationMap.GetEmptyInstance): Rename to ..
-       (SerializationMap.GetInstance): .. this. Gets the instance or null if nil=true.
-       (SerializationMap.DeserializeInternal): New. Renamed from .. 
-       (SerializationMap.Deserialize): .. this. Check DataContract equivalence, and use new
-       DeserializeInternal for rest of the work.
-       (DeserializeContent): Cleanup and handle various "null" cases.
-       * XmlFormatterSerializer.cs (Write_i_type): New. Write i:type=".."
-       (SerializeNonPrimitive): Update to use Write_i_type.
-       * DataContractSerializer.cs (WriteStartObject): Add rootType to known_types.
-
-2006-03-16  Ankit Jain  <jankit@novell.com>
-
-       * SerializationMap.cs (SerializationMap.Deserialize): Use NameTable.Get
-       before reader.LookupNamespace.
-       (DataMemberInfo.Compare): Use String.CompareOrdinal instead of
-       String.Compare.
-
-2006-03-16  Ankit Jain  <jankit@novell.com>
-
-       * SerializationMap.cs (SerializationMap.GetEmptyInstance): New.
-       (SerializationMap.Deserialize): Refactor, handle primitive types and nils.
-       (SerializationMap.DeserializeContent): Handle nils and nested DataContracts.
-       (SharedContractMap.ctor): Include inherited properties and fields, in
-       the correct order.
-
-2006-03-15  Ankit Jain  <jankit@novell.com>
-
-       * KnownTypeCollection.cs (IsPrimitiveType): New.
-       * SerializationMap.cs (Deserialize): Handle primitive types.
-
-2006-03-15  Ankit Jain  <jankit@novell.com>
-
-       * DataContractSerializer.cs (WriteObjectContent): Handle null.
-       (WriteStartObject): Rewritten.
-       * KnownTypeCollection.cs (GetQName): New. Return QName for a given type.        
-       (GetContractQName):
-       (GetSerializableQName):
-       (GetCollectionQName): New.
-       (RegisterContract):
-       (RegisterSerializable):
-       (RegisterCollection): Update to use new Get* methods.
-       * SerializationMap.cs (CheckDataContractEqual): New.
-       (Deserialize): Split into this and ..
-       (DeserializeContent): .. this.
-       * XmlDictionaryWriter.cs (CreateTextWriter): Use UTF8Encoding.
-
-2006-03-09  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataContractSerializer.cs : xmlns output should be done at
-         WriteStartObject().
-
-2006-03-08  Ankit Jain  <jankit@novell.com>
-
-       * DataContractSerializer.cs (.ctor): Use name & namespace specified (if any) 
-       with the DataContractAttribute for non-primitive types.
-       (DataContractSerializer.WriteStartObject): DataContractAttribute.Name
-       cannot be "".
-
-2006-03-03  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataContractSerializer.cs : Handle primitive type name rather than
-         raw type name in constructors that don't receive root QName.
-         In case the actual graph is not of root type, write xsi:type.
-
-2006-03-02  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * KnownTypeCollection.cs : default namespace contains common MS base
-         URI fragment.
-       * XmlObjectSerializer.cs : added internal common utility field.
-       * DataContractSerializer.cs : Fixed constructors to fill fields and
-         make it work.
-       * NetDataContractSerializer.cs : just leave it unimplemented until
-         we find how it works. It looks different from what
-         DataContractSerializer does.
-
-2006-01-17  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlFormatter.cs : extra namespaces are not written in Dec.CTP.
-
-2005-11-28  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * KnownTypeCollection.cs : override.
-
-2005-11-02  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * SerializationMap.cs, XmlFormatterSerializer.cs, XmlFormatter.cs
-         XmlFormatterDeserializer.cs, KnownTypeCollection.cs :
-         several changes. Partial support for collection serialization.
-         SerializationMap now contains its own Deserialize()/Serialize()
-         methods.
-
-2005-10-20  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlFormatterDeserializer.cs : new file.
-       * SerializationMap.cs, XmlFormatter.cs, KnownTypeCollection.cs :
-         several changes for pretty primitive Deserialize() implementation.
-
-2005-10-07  Atsushi Enomoto  <atsushi@ximian.com>
-
-       Added hacky serialization feature. Actually it should be rewritten to
-       be based on IDataContractSurrogate.
-       * SerializationMap.cs, XmlFormatterSerializer.cs :
-         new files for Serialize() implementation.
-       * KnownTypeCollection.cs : use serialization maps to check contracts.
-       * XmlFormatter.cs : implemented hacky Serialize().
-       * DataMemberAttribute.cs : default Order is -1.
-       * DataContractAttribute.cs : added tiny comment.
-
-2005-10-03  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlFormatter.cs : Added implementation switch between
-         BinaryFormatter and internal DataContractFormatter.
-       * XmlSerializableServices.cs : WriteNodes() impl.
-
-2005-10-03  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlSerializableServices.cs : ReadNodes() impl.
-
-2005-09-28  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * KnownTypeAttribute.cs : fixed attribute usage.
-
-2005-09-22  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * IDataContractSurrogate.cs, ContractNamespaceAttribute.cs,
-         XsdDataContractExporter.cs, KnownTypeAttribute.cs,
-         SerializationMode.cs, XmlFormatter.cs, DataMemberAttribute.cs,
-         ImportOptions.cs, UnknownSerializationData.cs,
-         SerializationFactoryMethodAttribute.cs, XmlSerializableServices.cs,
-         DataContractAttribute.cs, ExportOptions.cs,
-         InvalidDataContractException.cs, IUnknownSerializationData.cs,
-         CollectionDataContractAttribute.cs, XsdDataContractImporter.cs,
-         KnownTypeCollection.cs :
-         #if NET_2_0. coding style was updated.
-
-2005-09-22  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * CollectionDataContractAttribute.cs
-         ContractNamespaceAttribute.cs
-         DataContractAttribute.cs
-         DataMemberAttribute.cs
-         ExportOptions.cs
-         IDataContractSurrogate.cs
-         InvalidDataContractException.cs
-         IUnknownSerializationData.cs
-         ImportOptions.cs
-         KnownTypeAttribute.cs
-         KnownTypeCollection.cs
-         SerializationFactoryMethodAttribute.cs
-         SerializationMode.cs
-         UnknownSerializationData.cs
-         XmlFormatter.cs
-         XmlSerializableServices.cs
-         XsdDataContractExporter.cs
-         XsdDataContractImporter.cs : new files.
-
diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/DataContractResolver.cs b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/DataContractResolver.cs
deleted file mode 100644 (file)
index 5a6dc28..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-//
-// DataContractResolver.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2010 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Xml;
-
-namespace System.Runtime.Serialization
-{
-       // See http://msdn.microsoft.com/en-us/library/ee358759.aspx
-       public
-       abstract class DataContractResolver
-       {
-               public abstract Type ResolveName (string typeName, string typeNamespace, Type declaredType, DataContractResolver knownTypeResolver);
-
-               public abstract bool TryResolveType (Type type, Type declaredType, DataContractResolver knownTypeResolver, out XmlDictionaryString typeName, out XmlDictionaryString typeNamespace);
-       }
-
-       internal class DefaultDataContractResolver : DataContractResolver
-       {
-               public DefaultDataContractResolver (DataContractSerializer serializer)
-               {
-                       this.serializer = serializer;
-               }
-
-               DataContractSerializer serializer;
-               XmlDictionary dictionary;
-
-               public override Type ResolveName (string typeName, string typeNamespace, Type declaredType, DataContractResolver knownTypeResolver)
-               {
-                       var map = serializer.InternalKnownTypes.FindUserMap (new XmlQualifiedName (typeName, typeNamespace));
-                       if (map == null)
-                               serializer.InternalKnownTypes.Add (declaredType);
-                       if (map != null)
-                               return map.RuntimeType;
-                       return null;
-               }
-
-               public override bool TryResolveType (Type type, Type declaredType, DataContractResolver knownTypeResolver, out XmlDictionaryString typeName, out XmlDictionaryString typeNamespace)
-               {
-                       var map = serializer.InternalKnownTypes.FindUserMap (type);
-                       if (map == null) {
-                               typeName = null;
-                               typeNamespace = null;
-                               return false;
-                       } else {
-                               dictionary = dictionary ?? new XmlDictionary ();
-                               typeName = dictionary.Add (map.XmlName.Name);
-                               typeNamespace = dictionary.Add (map.XmlName.Namespace);
-                               return true;
-                       }
-               }
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/DataContractSerializer.cs b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/DataContractSerializer.cs
deleted file mode 100755 (executable)
index 8a33e29..0000000
+++ /dev/null
@@ -1,565 +0,0 @@
-//
-// DataContractSerializer.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005-2007 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.IO;
-using System.Reflection;
-using System.Runtime.Serialization.Formatters.Binary;
-using System.Xml;
-using System.Xml.Schema;
-using System.Xml.Serialization;
-
-using QName = System.Xml.XmlQualifiedName;
-
-namespace System.Runtime.Serialization
-{
-       public sealed class DataContractSerializer : XmlObjectSerializer
-       {
-               const string xmlns = "http://www.w3.org/2000/xmlns/";
-
-               Type type;
-               bool ignore_ext, preserve_refs;
-
-               // This is only for compatible mode.
-               StreamingContext context;
-               ReadOnlyCollection<Type> returned_known_types;
-               KnownTypeCollection known_types;
-               List<Type> specified_known_types;
-               IDataContractSurrogate surrogate;
-               DataContractResolver resolver, default_resolver;
-
-               int max_items = 0x10000; // FIXME: could be from config.
-
-               bool names_filled;
-               XmlDictionaryString root_name, root_ns;
-
-               public DataContractSerializer (Type type)
-                       : this (type, Type.EmptyTypes)
-               {
-                       // nothing to do here.
-               }
-
-               public DataContractSerializer (Type type,
-                       IEnumerable<Type> knownTypes)
-               {
-                       if (type == null)
-                               throw new ArgumentNullException ("type");
-                       this.type = type;
-                       PopulateTypes (knownTypes);
-                       known_types.Add (type);
-                       QName qname = known_types.GetQName (type);
-
-                       FillDictionaryString (qname.Name, qname.Namespace);
-
-               }
-
-               public DataContractSerializer (Type type, string rootName,
-                       string rootNamespace)
-                       : this (type, rootName, rootNamespace, Type.EmptyTypes)
-               {
-                       // nothing to do here.
-               }
-
-               public DataContractSerializer (Type type,
-                       XmlDictionaryString rootName,
-                       XmlDictionaryString rootNamespace)
-                       : this (type, rootName, rootNamespace, Type.EmptyTypes)
-               {
-                       // nothing to do here.
-               }
-
-               public DataContractSerializer (Type type, string rootName,
-                       string rootNamespace, IEnumerable<Type> knownTypes)
-               {
-                       if (type == null)
-                               throw new ArgumentNullException ("type");
-                       if (rootName == null)
-                               throw new ArgumentNullException ("rootName");
-                       if (rootNamespace == null)
-                               throw new ArgumentNullException ("rootNamespace");
-                       this.type = type;
-                       PopulateTypes (knownTypes);
-                       FillDictionaryString (rootName, rootNamespace);
-               }
-
-               public DataContractSerializer (Type type,
-                       XmlDictionaryString rootName,
-                       XmlDictionaryString rootNamespace,
-                       IEnumerable<Type> knownTypes)
-               {
-                       if (type == null)
-                               throw new ArgumentNullException ("type");
-                       if (rootName == null)
-                               throw new ArgumentNullException ("rootName");
-                       if (rootNamespace == null)
-                               throw new ArgumentNullException ("rootNamespace");
-                       this.type = type;
-                       PopulateTypes (knownTypes);
-                       root_name = rootName;
-                       root_ns = rootNamespace;
-               }
-
-               public DataContractSerializer (Type type,
-                       IEnumerable<Type> knownTypes,
-                       int maxObjectsInGraph,
-                       bool ignoreExtensionDataObject,
-                       bool preserveObjectReferences,
-                       IDataContractSurrogate dataContractSurrogate)
-                       : this (type, knownTypes)
-               {
-                       Initialize (maxObjectsInGraph,
-                               ignoreExtensionDataObject,
-                               preserveObjectReferences,
-                               dataContractSurrogate);
-               }
-
-               public DataContractSerializer (Type type,
-                       string rootName,
-                       string rootNamespace,
-                       IEnumerable<Type> knownTypes,
-                       int maxObjectsInGraph,
-                       bool ignoreExtensionDataObject,
-                       bool preserveObjectReferences,
-                       IDataContractSurrogate dataContractSurrogate)
-                       : this (type, rootName, rootNamespace, knownTypes)
-               {
-                       Initialize (maxObjectsInGraph,
-                               ignoreExtensionDataObject,
-                               preserveObjectReferences,
-                               dataContractSurrogate);
-               }
-
-               public DataContractSerializer (Type type,
-                       XmlDictionaryString rootName,
-                       XmlDictionaryString rootNamespace,
-                       IEnumerable<Type> knownTypes,
-                       int maxObjectsInGraph,
-                       bool ignoreExtensionDataObject,
-                       bool preserveObjectReferences,
-                       IDataContractSurrogate dataContractSurrogate)
-                       : this (type, rootName, rootNamespace, knownTypes)
-               {
-                       Initialize (maxObjectsInGraph,
-                               ignoreExtensionDataObject,
-                               preserveObjectReferences,
-                               dataContractSurrogate);
-               }
-
-               public DataContractSerializer (Type type,
-                       IEnumerable<Type> knownTypes,
-                       int maxObjectsInGraph,
-                       bool ignoreExtensionDataObject,
-                       bool preserveObjectReferences,
-                       IDataContractSurrogate dataContractSurrogate,
-                       DataContractResolver dataContractResolver)
-                       : this (type, knownTypes, maxObjectsInGraph, ignoreExtensionDataObject, preserveObjectReferences, dataContractSurrogate)
-               {
-                       DataContractResolver = dataContractResolver;
-               }
-
-               public DataContractSerializer (Type type,
-                       string rootName,
-                       string rootNamespace,
-                       IEnumerable<Type> knownTypes,
-                       int maxObjectsInGraph,
-                       bool ignoreExtensionDataObject,
-                       bool preserveObjectReferences,
-                       IDataContractSurrogate dataContractSurrogate,
-                       DataContractResolver dataContractResolver)
-                       : this (type, rootName, rootNamespace, knownTypes, maxObjectsInGraph, ignoreExtensionDataObject, preserveObjectReferences, dataContractSurrogate)
-               {
-                       DataContractResolver = dataContractResolver;
-               }
-
-               public DataContractSerializer (Type type,
-                       XmlDictionaryString rootName,
-                       XmlDictionaryString rootNamespace,
-                       IEnumerable<Type> knownTypes,
-                       int maxObjectsInGraph,
-                       bool ignoreExtensionDataObject,
-                       bool preserveObjectReferences,
-                       IDataContractSurrogate dataContractSurrogate,
-                       DataContractResolver dataContractResolver)
-                       : this (type, rootName, rootNamespace, knownTypes, maxObjectsInGraph, ignoreExtensionDataObject, preserveObjectReferences, dataContractSurrogate)
-               {
-                       DataContractResolver = dataContractResolver;
-               }
-
-               public DataContractSerializer (Type type, DataContractSerializerSettings settings)
-                       : this (type, settings.RootName, settings.RootNamespace, settings.KnownTypes,
-                               settings.MaxItemsInObjectGraph, settings.IgnoreExtensionDataObject,
-                               settings.PreserveObjectReferences, settings.DataContractSurrogate,
-                               settings.DataContractResolver)
-               {
-               }
-
-               void PopulateTypes (IEnumerable<Type> knownTypes)
-               {
-                       if (known_types == null)
-                               known_types = new KnownTypeCollection ();
-
-                       if (specified_known_types == null)
-                               specified_known_types = new List<Type> ();
-
-                       if (knownTypes != null) {
-                               foreach (Type t in knownTypes) {
-                                       known_types.Add (t);
-                                       specified_known_types.Add (t);
-                               }
-                       }
-
-                       RegisterTypeAsKnown (type);
-               }
-
-               void RegisterTypeAsKnown (Type type)
-               {
-                       if (known_types.Contains (type))
-                               return;
-
-                       Type elementType = type;
-                       if (type.HasElementType) {
-                               known_types.Add (type);
-                               elementType = type.GetElementType ();
-                       }
-
-                       known_types.Add (elementType);
-
-                       /* Get all KnownTypeAttribute-s, including inherited ones */
-                       object [] attrs = elementType.GetCustomAttributes (typeof (KnownTypeAttribute), true);
-                       for (int i = 0; i < attrs.Length; i ++) {
-                               KnownTypeAttribute kt = (KnownTypeAttribute) attrs [i];
-                               foreach (var t in kt.GetTypes (elementType))
-                                       RegisterTypeAsKnown (t);
-                       }
-               }
-
-               void FillDictionaryString (string name, string ns)
-               {
-                       XmlDictionary d = new XmlDictionary ();
-                       root_name = d.Add (name);
-                       root_ns = d.Add (ns);
-                       names_filled = true;
-               }
-
-               void Initialize (
-                       int maxObjectsInGraph,
-                       bool ignoreExtensionDataObject,
-                       bool preserveObjectReferences,
-                       IDataContractSurrogate dataContractSurrogate)
-               {
-                       if (maxObjectsInGraph < 0)
-                               throw new ArgumentOutOfRangeException ("maxObjectsInGraph must not be negative.");
-                       max_items = maxObjectsInGraph;
-                       ignore_ext = ignoreExtensionDataObject;
-                       preserve_refs = preserveObjectReferences;
-                       surrogate = dataContractSurrogate;
-               }
-
-               public
-               DataContractResolver DataContractResolver {
-                       get { return resolver; }
-                       private set {
-                               resolver = value;
-                               default_resolver = default_resolver ?? new DefaultDataContractResolver (this);
-                       }
-               }
-
-               public bool IgnoreExtensionDataObject {
-                       get { return ignore_ext; }
-               }
-
-               public ReadOnlyCollection<Type> KnownTypes {
-                       get {
-                               if (returned_known_types == null)
-                                       returned_known_types = new ReadOnlyCollection<Type> (specified_known_types);
-                               return returned_known_types;
-                       }
-               }
-
-               internal KnownTypeCollection InternalKnownTypes {
-                       get { return known_types; }
-               }
-
-               public IDataContractSurrogate DataContractSurrogate {
-                       get { return surrogate; }
-               }
-
-               public int MaxItemsInObjectGraph {
-                       get { return max_items; }
-               }
-
-               public bool PreserveObjectReferences {
-                       get { return preserve_refs; }
-               }
-
-               public override bool IsStartObject (XmlDictionaryReader reader)
-               {
-                       if (reader == null)
-                               throw new ArgumentNullException ("reader");
-                       reader.MoveToContent ();
-                       return reader.IsStartElement (root_name, root_ns);
-               }
-
-               // SP1
-               public override bool IsStartObject (XmlReader reader)
-               {
-                       return IsStartObject (XmlDictionaryReader.CreateDictionaryReader (reader));
-               }
-
-               // SP1
-               public override object ReadObject (XmlReader reader)
-               {
-                       return ReadObject (XmlDictionaryReader.CreateDictionaryReader (reader));
-               }
-
-               public override object ReadObject (XmlReader reader, bool verifyObjectName)
-               {
-                       return ReadObject (XmlDictionaryReader.CreateDictionaryReader (reader), verifyObjectName);
-               }
-
-               public override object ReadObject (XmlDictionaryReader reader, bool verifyObjectName)
-               {
-                       int startTypeCount = known_types.Count;
-                       known_types.Add (type);
-
-                       bool isEmpty = reader.IsEmptyElement;
-
-                       object ret = XmlFormatterDeserializer.Deserialize (reader, type,
-                               known_types, surrogate, DataContractResolver, default_resolver, root_name.Value, root_ns.Value, verifyObjectName);
-
-                       // remove temporarily-added known types for
-                       // rootType and object graph type.
-                       while (known_types.Count > startTypeCount)
-                               known_types.RemoveAt (startTypeCount);
-
-                       return ret;
-               }
-
-               public object ReadObject (XmlDictionaryReader reader, bool verifyObjectName, DataContractResolver resolver)
-               {
-                       var bak = DataContractResolver;
-                       try {
-                               DataContractResolver = resolver;
-                               return ReadObject (reader, verifyObjectName);
-                       } finally {
-                               DataContractResolver = bak;
-                       }
-               }
-
-               // SP1
-               public override void WriteObject (XmlWriter writer, object graph)
-               {
-                       XmlDictionaryWriter w = XmlDictionaryWriter.CreateDictionaryWriter (writer);
-                       WriteObject (w, graph);
-               }
-
-               public void WriteObject (XmlDictionaryWriter writer, object graph, DataContractResolver resolver)
-               {
-                       var bak = DataContractResolver;
-                       try {
-                               DataContractResolver = resolver;
-                               WriteObject (writer, graph);
-                       } finally {
-                               DataContractResolver = bak;
-                       }
-               }
-
-               [MonoTODO ("use DataContractSurrogate")]
-               /*
-                       when writeContentOnly is true, then the input XmlWriter
-                       must be at element state. This is to write possible
-                       xsi:nil.
-
-                       rootType determines the top-level element QName (thus
-                       it is ignored when writeContentOnly is true).
-
-                       preserveObjectReferences indicates that whether the
-                       output should contain ms:Id or not.
-                       (http://schemas.microsoft.com/2003/10/Serialization/)
-               */
-               public override void WriteObjectContent (XmlDictionaryWriter writer, object graph)
-               {
-                       if (graph == null)
-                               return;
-
-                       int startTypeCount = known_types.Count;
-
-                       XmlFormatterSerializer.Serialize (writer, graph,
-                               type, known_types,
-                               ignore_ext, max_items, root_ns.Value, preserve_refs, DataContractResolver, default_resolver);
-
-                       // remove temporarily-added known types for
-                       // rootType and object graph type.
-                       while (known_types.Count > startTypeCount)
-                               known_types.RemoveAt (startTypeCount);
-               }
-
-               public override void WriteObjectContent (XmlWriter writer, object graph)
-               {
-                       XmlDictionaryWriter w = XmlDictionaryWriter.CreateDictionaryWriter (writer);
-                       WriteObjectContent (w, graph);
-               }
-
-               // SP1
-               public override void WriteStartObject (
-                       XmlWriter writer, object graph)
-               {
-                       WriteStartObject (XmlDictionaryWriter.CreateDictionaryWriter (writer), graph);
-               }
-
-               public override void WriteStartObject (
-                       XmlDictionaryWriter writer, object graph)
-               {
-                       Type rootType = type;
-
-                       if (IsAny())
-                               return;
-
-                       if (root_name.Value == "")
-                               throw new InvalidDataContractException ("Type '" + type.ToString () +
-                                       "' cannot have a DataContract attribute Name set to null or empty string.");
-
-                       if (graph == null) {
-                               if (names_filled)
-                                       writer.WriteStartElement (root_name.Value, root_ns.Value);
-                               else
-                                       writer.WriteStartElement (root_name, root_ns);
-                               writer.WriteAttributeString ("i", "nil", XmlSchema.InstanceNamespace, "true");
-                               return;
-                       }
-
-                       QName rootQName = null;
-                       XmlDictionaryString name, ns;
-                       var graphType = graph.GetType ();
-                       if (DataContractResolver != null && DataContractResolver.TryResolveType (graphType, type, default_resolver, out name, out ns))
-                               rootQName = new QName (name.Value, ns.Value);
-
-                       // It is error unless 1) TypeResolver resolved the type name, 2) the object is the exact type, 3) the object is known or 4) the type is primitive.
-
-                       QName collectionQName;
-                       if (KnownTypeCollection.IsInterchangeableCollectionType (type, graphType, out collectionQName)) {
-                               graphType = type;
-                               rootQName = collectionQName;
-                       } else if (graphType != type && rootQName == null && IsUnknownType (type, graphType))
-                               throw new SerializationException (String.Format ("Type '{0}' is unexpected. The type should either be registered as a known type, or DataContractResolver should be used.", graphType));
-
-                       QName instName = rootQName;
-                       rootQName = rootQName ?? known_types.GetQName (rootType);
-                       QName graph_qname = known_types.GetQName (graphType);
-
-                       known_types.Add (graphType);
-
-                       if (names_filled)
-                               writer.WriteStartElement (root_name.Value, root_ns.Value);
-                       else
-                               writer.WriteStartElement (root_name, root_ns);
-
-                       if (rootQName != graph_qname || rootQName.Namespace != KnownTypeCollection.MSSimpleNamespace && !rootType.IsEnum)
-                               //FIXME: Hack, when should the "i:type" be written?
-                               //Not used in case of enums
-                               writer.WriteXmlnsAttribute ("i", XmlSchema.InstanceNamespace);
-
-                       if (root_ns.Value != rootQName.Namespace)
-                               if (rootQName.Namespace != KnownTypeCollection.MSSimpleNamespace)
-                                       writer.WriteXmlnsAttribute (null, rootQName.Namespace);
-
-                       if (rootQName == graph_qname)
-                               return;
-
-                       /* Different names */
-                       known_types.Add (rootType);
-
-                       instName = instName ?? KnownTypeCollection.GetPredefinedTypeName (graphType);
-                       if (instName == QName.Empty)
-                               /* Not a primitive type */
-                               instName = graph_qname;
-                       else
-                               /* FIXME: Hack, .. see test WriteObject7 () */
-                               instName = new QName (instName.Name, XmlSchema.Namespace);
-
-/* // disabled as it now generates extraneous i:type output.
-                       // output xsi:type as rootType is not equivalent to the graph's type.
-                       writer.WriteStartAttribute ("i", "type", XmlSchema.InstanceNamespace);
-                       writer.WriteQualifiedName (instName.Name, instName.Namespace);
-                       writer.WriteEndAttribute ();
-*/
-               }
-
-               bool IsUnknownType (Type contractType, Type type)
-               {
-                       if (type.IsArray) {
-                               if (KnownTypeCollection.GetAttribute<CollectionDataContractAttribute> (contractType) != null ||
-                                   KnownTypeCollection.GetAttribute<DataContractAttribute> (contractType) != null)
-                                       return true;
-                       }
-                       return IsUnknownType (type);
-               }
-
-               bool IsUnknownType (Type type)
-               {
-                       if (known_types.Contains (type) ||
-                           KnownTypeCollection.GetPrimitiveTypeName (type) != QName.Empty)
-                               return false;
-                       if (type.IsArray)
-                               return IsUnknownType (type.GetElementType ());
-                       return true;
-               }
-
-               public override void WriteEndObject (XmlDictionaryWriter writer)
-               {
-                       if (IsAny())
-                               return;
-
-                       writer.WriteEndElement ();
-               }
-
-               // SP1
-               public override void WriteEndObject (XmlWriter writer)
-               {
-                       WriteEndObject (XmlDictionaryWriter.CreateDictionaryWriter (writer));
-               }
-
-               [MonoTODO]
-               public bool SerializeReadOnlyTypes {
-                       get { throw new NotImplementedException (); }
-               }
-
-               private bool IsAny ()
-               {
-                       var xpa = type.GetCustomAttribute<XmlSchemaProviderAttribute> (true);
-
-                       if (xpa != null)
-                               return xpa.IsAny;
-
-                       return false;
-               }
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/DataContractSerializerSettings.cs b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/DataContractSerializerSettings.cs
deleted file mode 100644 (file)
index 18a78e1..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-//
-// DataContractJsonSerializerSettings.cs
-//
-// Author:
-//       Martin Baulig <martin.baulig@xamarin.com>
-//
-// Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-using System.Xml;
-using System.Collections.Generic;
-
-namespace System.Runtime.Serialization {
-       public class DataContractSerializerSettings {
-               public DataContractResolver DataContractResolver { get; set; }
-               public IDataContractSurrogate DataContractSurrogate { get; set; }
-               public bool IgnoreExtensionDataObject { get; set; }
-               public IEnumerable<Type> KnownTypes { get; set; }
-               public int MaxItemsInObjectGraph { get; set; }
-               public bool PreserveObjectReferences { get; set; }
-               public XmlDictionaryString RootName { get; set; }
-               public XmlDictionaryString RootNamespace { get; set; }
-               public bool SerializeReadOnlyTypes { get; set; }
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/DataMemberAttribute.cs b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/DataMemberAttribute.cs
deleted file mode 100644 (file)
index be38301..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-//
-// DataMemberAttribute.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-
-namespace System.Runtime.Serialization
-{
-       [AttributeUsage (AttributeTargets.Property | AttributeTargets.Field,
-               Inherited = false, AllowMultiple = false)]
-       public sealed class DataMemberAttribute : Attribute
-       {
-               bool is_required;
-               bool emit_default = true;
-               string name;
-               int order = -1;
-
-               public DataMemberAttribute ()
-               {
-               }
-
-               public bool EmitDefaultValue {
-                       get { return emit_default; }
-                       set { emit_default = value; }
-               }
-
-               public bool IsRequired {
-                       get { return is_required; }
-                       set { is_required = value; }
-               }
-
-               public string Name {
-                       get { return name; }
-                       set { name = value; }
-               }
-
-               public int Order {
-                       get { return order; }
-                       set { order = value; }
-               }
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/DateTimeFormat.cs b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/DateTimeFormat.cs
deleted file mode 100644 (file)
index a6dc358..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-// Authors:
-//      Martin Baulig (martin.baulig@xamarin.com)
-//
-// Copyright 2012 Xamarin Inc. (http://www.xamarin.com)
-//
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.Globalization;
-
-namespace System.Runtime.Serialization {
-       [MonoTODO]
-       public class DateTimeFormat {
-               public DateTimeFormat (string formatString)
-               {
-                       throw new InvalidOperationException ();
-               }
-               
-               public DateTimeFormat (string formatString, IFormatProvider formatProvider)
-               {
-                       throw new InvalidOperationException ();
-               }
-               
-               public DateTimeStyles DateTimeStyles {
-                       get { throw new InvalidOperationException (); }
-                       set { throw new InvalidOperationException (); }
-               }
-
-               public IFormatProvider FormatProvider {
-                       get { throw new InvalidOperationException (); }
-               }
-
-               public string FormatString {
-                       get { throw new InvalidOperationException (); }
-               }
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/EmitTypeInformation.cs b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/EmitTypeInformation.cs
deleted file mode 100644 (file)
index 289dd5e..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-//
-// IgnoreList.cs
-//
-// Author:
-//       Martin Baulig <martin.baulig@xamarin.com>
-//
-// Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-namespace System.Runtime.Serialization {
-       public enum EmitTypeInformation {
-               AsNeeded,
-               Always,
-               Never
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/EnumMemberAttribute.cs b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/EnumMemberAttribute.cs
deleted file mode 100644 (file)
index 491eefb..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-//
-// EnumMemberAttribute.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-
-namespace System.Runtime.Serialization
-{
-       [AttributeUsage (AttributeTargets.Field,
-               Inherited = false, AllowMultiple = false)]
-       public sealed class EnumMemberAttribute : Attribute
-       {
-               string value;
-
-               public EnumMemberAttribute ()
-               {
-               }
-
-               public string Value {
-                       get { return value; }
-                       set { this.value = value; }
-               }
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/ExportOptions.cs b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/ExportOptions.cs
deleted file mode 100644 (file)
index 1067da2..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-//
-// ExportOptions.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System.Collections.ObjectModel;
-
-namespace System.Runtime.Serialization
-{
-       public class ExportOptions
-       {
-               IDataContractSurrogate surrogate;
-               const KnownTypeCollection known_types = null;
-
-               public ExportOptions ()
-               {
-               }
-
-               public IDataContractSurrogate DataContractSurrogate {
-                       get { return surrogate; }
-                       set { surrogate = value; }
-               }
-
-               [MonoTODO]
-               public Collection<Type> KnownTypes {
-                       get { return known_types; }
-               }
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/ExtensionDataObject.cs b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/ExtensionDataObject.cs
deleted file mode 100644 (file)
index faf07ef..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-//
-// ExtensionDataObject.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.Collections.ObjectModel;
-
-namespace System.Runtime.Serialization
-{
-       public sealed class ExtensionDataObject
-       {
-               object target;
-
-               internal ExtensionDataObject (object target)
-               {
-                       this.target = target;
-               }
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/IDataContractSurrogate.cs b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/IDataContractSurrogate.cs
deleted file mode 100644 (file)
index 94ae63d..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-//
-// IDataContractSurrogate.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.CodeDom;
-using System.Collections.ObjectModel;
-using System.Reflection;
-
-namespace System.Runtime.Serialization
-{
-       public interface IDataContractSurrogate
-       {
-               object GetCustomDataToExport (MemberInfo memberInfo,
-                       Type dataContractType);
-               object GetCustomDataToExport (Type clrType,
-                       Type dataContractType);
-
-               Type GetDataContractType (Type type);
-
-               object GetDeserializedObject (object obj, Type targetType);
-
-               void GetKnownCustomDataTypes (Collection<Type> customDataTypes);
-
-               object GetObjectToSerialize (object obj, Type targetType);
-#if !NET_2_1
-               Type GetReferencedTypeOnImport (string typeName,
-                       string typeNamespace, object customData);
-
-               CodeTypeDeclaration ProcessImportedType (
-                       CodeTypeDeclaration typeDeclaration,
-                       CodeCompileUnit compileUnit);
-#endif
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/IExtensibleDataObject.cs b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/IExtensibleDataObject.cs
deleted file mode 100644 (file)
index bc1b0f5..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-//
-// IExtensibleDataObject.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-namespace System.Runtime.Serialization
-{
-       public interface IExtensibleDataObject
-       {
-               ExtensionDataObject ExtensionData { get; set; }
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/IgnoreDataMemberAttribute.cs b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/IgnoreDataMemberAttribute.cs
deleted file mode 100644 (file)
index 9302632..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-//
-// IgnoreDataMemberAttribute.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2009 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-
-namespace System.Runtime.Serialization
-{
-       [AttributeUsage (AttributeTargets.Property | AttributeTargets.Field,
-               Inherited = false, AllowMultiple = false)]
-       public sealed class IgnoreDataMemberAttribute : Attribute
-       {
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/ImportOptions.cs b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/ImportOptions.cs
deleted file mode 100644 (file)
index 6ddc6e3..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-//
-// ImportOptions.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.CodeDom.Compiler;
-using System.Collections.Generic;
-
-namespace System.Runtime.Serialization
-{
-       public class ImportOptions
-       {
-               IDataContractSurrogate surrogate;
-               ICollection<Type> referenced_collection_types =
-                       new List<Type> ();
-               ICollection<Type> referenced_types = new List<Type> ();
-               bool enable_data_binding;
-               bool generate_internal;
-               bool generate_serializable;
-               bool import_xml_type;
-               IDictionary<string, string> namespaces =
-                       new Dictionary<string, string> ();
-               CodeDomProvider code_provider;
-
-               public ImportOptions ()
-               {
-               }
-
-               public CodeDomProvider CodeProvider {
-                       get { return code_provider; }
-                       set { code_provider = value; }
-               }
-
-               [MonoTODO]
-               public IDataContractSurrogate DataContractSurrogate {
-                       get { return surrogate; }
-                       set { surrogate = value; }
-               }
-
-               [MonoTODO]
-               public bool EnableDataBinding {
-                       get { return enable_data_binding; }
-                       set { enable_data_binding = value; }
-               }
-
-               public bool GenerateInternal {
-                       get { return generate_internal; }
-                       set { generate_internal = value; }
-               }
-
-               public bool GenerateSerializable {
-                       get { return generate_serializable; }
-                       set { generate_serializable = value; }
-               }
-
-               [MonoTODO]
-               public bool ImportXmlType {
-                       get { return import_xml_type; }
-                       set { import_xml_type = value; }
-               }
-
-               public IDictionary<string, string> Namespaces {
-                       get { return namespaces; }
-               }
-
-               [MonoTODO]
-               public ICollection<Type> ReferencedCollectionTypes {
-                       get { return referenced_collection_types; }
-               }
-
-               [MonoTODO]
-               public ICollection<Type> ReferencedTypes {
-                       get { return referenced_types; }
-               }
-       }
-}
-
diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/InvalidDataContractException.cs b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/InvalidDataContractException.cs
deleted file mode 100644 (file)
index bbd9e11..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-//
-// InvalidDataContractException.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.Xml;
-
-namespace System.Runtime.Serialization
-{
-       [Serializable]
-       public class InvalidDataContractException : Exception
-       {
-               public InvalidDataContractException ()
-                       : base ()
-               {
-               }
-
-               public InvalidDataContractException (string message)
-                       : base (message)
-               {
-               }
-
-               protected InvalidDataContractException (SerializationInfo info,
-                       StreamingContext context)
-                       : base (info, context)
-               {
-               }
-
-               public InvalidDataContractException (string message, Exception innerException)
-                       : base (message, innerException)
-               {
-               }
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/KnownTypeAttribute.cs b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/KnownTypeAttribute.cs
deleted file mode 100644 (file)
index 4ab8d1f..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-//
-// KnownTypeAttribute.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.Collections.Generic;
-using System.Reflection;
-
-namespace System.Runtime.Serialization
-{
-       [AttributeUsage (AttributeTargets.Class | AttributeTargets.Struct,
-               Inherited = true, AllowMultiple = true)]
-       public sealed class KnownTypeAttribute : Attribute
-       {
-               string method_name;
-               Type type;
-
-               public KnownTypeAttribute (string methodName)
-               {
-                       if (methodName == null)
-                               throw new ArgumentNullException ("methodName");
-                       method_name = methodName;
-               }
-
-               public KnownTypeAttribute (Type type)
-               {
-                       if (type == null)
-                               throw new ArgumentNullException ("type");
-                       this.type = type;
-               }
-
-               public string MethodName {
-                       get { return method_name; }
-               }
-
-               public Type Type {
-                       get { return type; }
-               }
-
-               MethodInfo method_cache;
-
-               internal IEnumerable<Type> GetTypes (Type type)
-               {
-                       if (method_cache != null)
-                               return (IEnumerable<Type>) method_cache.Invoke (null, new object [0]);
-
-                       if (Type != null)
-                               return new Type [] {Type};
-                       else {
-                               var mi = type.GetMethod (MethodName, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static, null, Type.EmptyTypes, null);
-                               if (mi == null)
-                                       throw new InvalidDataContractException (String.Format ("KnownTypeAttribute on {0} specifies '{1}' method, but that does not exist. The methos must be static.", type, MethodName));
-                               if (!typeof (IEnumerable<Type>).IsAssignableFrom (mi.ReturnType))
-                                       throw new InvalidDataContractException (String.Format ("KnownTypeAttribute on {0} specifies '{1}' method, but it returns {2} which cannot be assignable from IEnumerable<Type>.", type, MethodName, mi.ReturnType));
-                               method_cache = mi;
-                               return GetTypes (type);
-                       }
-               }
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/KnownTypeCollection.cs b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/KnownTypeCollection.cs
deleted file mode 100755 (executable)
index 702e7f3..0000000
+++ /dev/null
@@ -1,1067 +0,0 @@
-//
-// KnownTypeCollection.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.Linq;
-using System.Reflection;
-using System.Xml;
-using System.Xml.Schema;
-
-using QName = System.Xml.XmlQualifiedName;
-using System.Xml.Serialization;
-
-namespace System.Runtime.Serialization
-{
-/*
-       XmlFormatter implementation design inference:
-
-       type definitions:
-       - No XML Schema types are directly used. There are some maps from
-         xs:blahType to ms:blahType where the namespaceURI for prefix "ms" is
-         "http://schemas.microsoft.com/2003/10/Serialization/" .
-
-       serializable types:
-       - An object being serialized 1) must be of type System.Object, or
-         2) must be null, or 3) must have either a [DataContract] attribute
-         or a [Serializable] attribute to be serializable.
-       - When the object is either of type System.Object or null, then the
-         XML type is "anyType".
-       - When the object is [Serializable], then the runtime-serialization
-         compatible object graph is written.
-       - Otherwise the serialization is based on contract attributes.
-         ([Serializable] takes precedence).
-
-       type derivation:
-       - For type A to be serializable, the base type B of A must be
-         serializable.
-       - If a type which is [Serializable] and whose base type has a
-         [DataContract], then for base type members [DataContract] is taken.
-       - It is vice versa i.e. if the base type is [Serializable] and the
-         derived type has a [DataContract], then [Serializable] takes place
-         for base members.
-
-       known type collection:
-       - It internally manages mapping store keyed by contract QNames.
-         KnownTypeCollection.Add() checks if the same QName contract already
-         exists (and raises InvalidOperationException if required).
-
-*/
-
-       internal static class TypeExtensions
-       {
-               public static IEnumerable<Type> GetInterfacesOrSelfInterface (this Type type)
-               {
-                       if (type.IsInterface)
-                               yield return type;
-                       foreach (var t in type.GetInterfaces ())
-                               yield return t;
-               }
-
-               public static bool ImplementsInterface (this Type type, Type iface)
-               {
-                       foreach (var t in type.GetInterfacesOrSelfInterface ()) {
-                               if (t == iface)
-                                       return true;
-                       }
-
-                       var baseType = type.BaseType;
-                       if (baseType != null)
-                               return baseType.ImplementsInterface (iface);
-                       
-                       return false;
-               }
-       }
-
-       internal sealed class KnownTypeCollection : Collection<Type>
-       {
-               internal const string MSSimpleNamespace =
-                       "http://schemas.microsoft.com/2003/10/Serialization/";
-               internal const string MSArraysNamespace =
-                       "http://schemas.microsoft.com/2003/10/Serialization/Arrays";
-               internal const string DefaultClrNamespaceBase =
-                       "http://schemas.datacontract.org/2004/07/";
-               internal const string DefaultClrNamespaceSystem =
-                       "http://schemas.datacontract.org/2004/07/System";
-
-
-               static QName any_type, bool_type,
-                       byte_type, date_type, decimal_type, double_type,
-                       float_type, string_type,
-                       short_type, int_type, long_type,
-                       ubyte_type, ushort_type, uint_type, ulong_type,
-                       // non-TypeCode
-                       any_uri_type, base64_type, duration_type, qname_type,
-                       // custom in ms nsURI schema
-                       char_type, guid_type,
-                       // not in ms nsURI schema
-                       dbnull_type, date_time_offset_type;
-
-               // XmlSchemaType.GetBuiltInPrimitiveType() does not exist in moonlight, so I had to explicitly add them. And now that we have it, it does not make much sense to use #if MOONLIGHT ... #endif for XmlSchemaType anymore :-(
-               static Dictionary<string,Type> xs_predefined_types = new Dictionary<string,Type> ();
-
-               static KnownTypeCollection ()
-               {
-                       string s = MSSimpleNamespace;
-                       any_type = new QName ("anyType", s);
-                       any_uri_type = new QName ("anyURI", s);
-                       bool_type = new QName ("boolean", s);
-                       base64_type = new QName ("base64Binary", s);
-                       date_type = new QName ("dateTime", s);
-                       duration_type = new QName ("duration", s);
-                       qname_type = new QName ("QName", s);
-                       decimal_type = new QName ("decimal", s);
-                       double_type = new QName ("double", s);
-                       float_type = new QName ("float", s);
-                       byte_type = new QName ("byte", s);
-                       short_type = new QName ("short", s);
-                       int_type = new QName ("int", s);
-                       long_type = new QName ("long", s);
-                       ubyte_type = new QName ("unsignedByte", s);
-                       ushort_type = new QName ("unsignedShort", s);
-                       uint_type = new QName ("unsignedInt", s);
-                       ulong_type = new QName ("unsignedLong", s);
-                       string_type = new QName ("string", s);
-                       guid_type = new QName ("guid", s);
-                       char_type = new QName ("char", s);
-
-                       dbnull_type = new QName ("DBNull", DefaultClrNamespaceBase + "System");
-                       date_time_offset_type = new QName ("DateTimeOffset", DefaultClrNamespaceBase + "System");
-
-                       xs_predefined_types.Add ("string", typeof (string));
-                       xs_predefined_types.Add ("boolean", typeof (bool));
-                       xs_predefined_types.Add ("float", typeof (float));
-                       xs_predefined_types.Add ("double", typeof (double));
-                       xs_predefined_types.Add ("decimal", typeof (decimal));
-                       xs_predefined_types.Add ("duration", typeof (TimeSpan));
-                       xs_predefined_types.Add ("dateTime", typeof (DateTime));
-                       xs_predefined_types.Add ("date", typeof (DateTime));
-                       xs_predefined_types.Add ("time", typeof (DateTime));
-                       xs_predefined_types.Add ("gYearMonth", typeof (DateTime));
-                       xs_predefined_types.Add ("gYear", typeof (DateTime));
-                       xs_predefined_types.Add ("gMonthDay", typeof (DateTime));
-                       xs_predefined_types.Add ("gDay", typeof (DateTime));
-                       xs_predefined_types.Add ("gMonth", typeof (DateTime));
-                       xs_predefined_types.Add ("hexBinary", typeof (byte []));
-                       xs_predefined_types.Add ("base64Binary", typeof (byte []));
-                       xs_predefined_types.Add ("anyURI", typeof (Uri));
-                       xs_predefined_types.Add ("QName", typeof (QName));
-                       xs_predefined_types.Add ("NOTATION", typeof (string));
-
-                       xs_predefined_types.Add ("normalizedString", typeof (string));
-                       xs_predefined_types.Add ("token", typeof (string));
-                       xs_predefined_types.Add ("language", typeof (string));
-                       xs_predefined_types.Add ("IDREFS", typeof (string []));
-                       xs_predefined_types.Add ("ENTITIES", typeof (string []));
-                       xs_predefined_types.Add ("NMTOKEN", typeof (string));
-                       xs_predefined_types.Add ("NMTOKENS", typeof (string []));
-                       xs_predefined_types.Add ("Name", typeof (string));
-                       xs_predefined_types.Add ("NCName", typeof (string));
-                       xs_predefined_types.Add ("ID", typeof (string));
-                       xs_predefined_types.Add ("IDREF", typeof (string));
-                       xs_predefined_types.Add ("ENTITY", typeof (string));
-
-                       xs_predefined_types.Add ("integer", typeof (decimal));
-                       xs_predefined_types.Add ("nonPositiveInteger", typeof (int));
-                       xs_predefined_types.Add ("negativeInteger", typeof (int));
-                       xs_predefined_types.Add ("long", typeof (long));
-                       xs_predefined_types.Add ("int", typeof (int));
-                       xs_predefined_types.Add ("short", typeof (short));
-                       xs_predefined_types.Add ("byte", typeof (sbyte));
-                       xs_predefined_types.Add ("nonNegativeInteger", typeof (decimal));
-                       xs_predefined_types.Add ("unsignedLong", typeof (ulong));
-                       xs_predefined_types.Add ("unsignedInt", typeof (uint));
-                       xs_predefined_types.Add ("unsignedShort", typeof (ushort));
-                       xs_predefined_types.Add ("unsignedByte", typeof (byte));
-                       xs_predefined_types.Add ("positiveInteger", typeof (decimal));
-
-                       xs_predefined_types.Add ("anyType", typeof (object));
-               }
-
-               // FIXME: find out how QName and guid are processed
-
-               internal QName GetXmlName (Type type)
-               {
-                       SerializationMap map = FindUserMap (type);
-                       if (map != null)
-                               return map.XmlName;
-                       return GetPredefinedTypeName (type);
-               }
-
-               internal static QName GetPredefinedTypeName (Type type)
-               {
-                       QName name = GetPrimitiveTypeName (type);
-                       if (name != QName.Empty)
-                               return name;
-                       if (type == typeof (DBNull))
-                               return dbnull_type;
-                       return QName.Empty;
-               }
-
-               internal static QName GetPrimitiveTypeName (Type type)
-               {
-                       if (type.IsGenericType && type.GetGenericTypeDefinition () == typeof (Nullable<>))
-                               return GetPrimitiveTypeName (type.GetGenericArguments () [0]);
-
-                       if (type.IsEnum)
-                               return QName.Empty;
-
-                       switch (Type.GetTypeCode (type)) {
-                       case TypeCode.Object: // other than System.Object
-                       case TypeCode.DBNull: // it is natively mapped, but not in ms serialization namespace.
-                       case TypeCode.Empty:
-                       default:
-                               if (type == typeof (object))
-                                       return any_type;
-                               if (type == typeof (Guid))
-                                       return guid_type;
-                               if (type == typeof (TimeSpan))
-                                       return duration_type;
-                               if (type == typeof (byte []))
-                                       return base64_type;
-                               if (type == typeof (Uri))
-                                       return any_uri_type;
-                               if (type == typeof (DateTimeOffset))
-                                       return date_time_offset_type;
-                               return QName.Empty;
-                       case TypeCode.Boolean:
-                               return bool_type;
-                       case TypeCode.Byte:
-                               return ubyte_type;
-                       case TypeCode.Char:
-                               return char_type;
-                       case TypeCode.DateTime:
-                               return date_type;
-                       case TypeCode.Decimal:
-                               return decimal_type;
-                       case TypeCode.Double:
-                               return double_type;
-                       case TypeCode.Int16:
-                               return short_type;
-                       case TypeCode.Int32:
-                               return int_type;
-                       case TypeCode.Int64:
-                               return long_type;
-                       case TypeCode.SByte:
-                               return byte_type;
-                       case TypeCode.Single:
-                               return float_type;
-                       case TypeCode.String:
-                               return string_type;
-                       case TypeCode.UInt16:
-                               return ushort_type;
-                       case TypeCode.UInt32:
-                               return uint_type;
-                       case TypeCode.UInt64:
-                               return ulong_type;
-                       }
-               }
-
-               internal static string PredefinedTypeObjectToString (object obj)
-               {
-                       Type type = obj.GetType ();
-                       switch (Type.GetTypeCode (type)) {
-                       case TypeCode.Object: // other than System.Object
-                       case TypeCode.Empty:
-                       default:
-                               if (type == typeof (object))
-                                       return String.Empty;
-                               if (type == typeof (Guid))
-                                       return XmlConvert.ToString ((Guid) obj);
-                               if (type == typeof (TimeSpan))
-                                       return XmlConvert.ToString ((TimeSpan) obj);
-                               if (type == typeof (byte []))
-                                       return Convert.ToBase64String ((byte []) obj);
-                               if (type == typeof (Uri))
-                                       return ((Uri) obj).ToString ();
-                               throw new Exception ("Internal error: missing predefined type serialization for type " + type.FullName);
-                       case TypeCode.DBNull: // predefined, but not primitive
-                               return String.Empty;
-                       case TypeCode.Boolean:
-                               return XmlConvert.ToString ((bool) obj);
-                       case TypeCode.Byte:
-                               return XmlConvert.ToString ((int)((byte) obj));
-                       case TypeCode.Char:
-                               return XmlConvert.ToString ((uint) (char) obj);
-                       case TypeCode.DateTime:
-                               return XmlConvert.ToString ((DateTime) obj, XmlDateTimeSerializationMode.RoundtripKind);
-                       case TypeCode.Decimal:
-                               return XmlConvert.ToString ((decimal) obj);
-                       case TypeCode.Double:
-                               return XmlConvert.ToString ((double) obj);
-                       case TypeCode.Int16:
-                               return XmlConvert.ToString ((short) obj);
-                       case TypeCode.Int32:
-                               return XmlConvert.ToString ((int) obj);
-                       case TypeCode.Int64:
-                               return XmlConvert.ToString ((long) obj);
-                       case TypeCode.SByte:
-                               return XmlConvert.ToString ((sbyte) obj);
-                       case TypeCode.Single:
-                               return XmlConvert.ToString ((float) obj);
-                       case TypeCode.String:
-                               return (string) obj;
-                       case TypeCode.UInt16:
-                               return XmlConvert.ToString ((int) (ushort) obj);
-                       case TypeCode.UInt32:
-                               return XmlConvert.ToString ((uint) obj);
-                       case TypeCode.UInt64:
-                               return XmlConvert.ToString ((ulong) obj);
-                       }
-               }
-
-               internal static Type GetPrimitiveTypeFromName (QName name)
-               {
-                       switch (name.Namespace) {
-                       case DefaultClrNamespaceSystem:
-                               switch (name.Name) {
-                               case "DBNull":
-                                       return typeof (DBNull);
-                               case "DateTimeOffset":
-                                       return typeof (DateTimeOffset);
-                               }
-                               break;
-                       case XmlSchema.Namespace:
-                               return xs_predefined_types.FirstOrDefault (p => p.Key == name.Name).Value;
-                       case MSSimpleNamespace:
-                               switch (name.Name) {
-                               case "anyURI":
-                                       return typeof (Uri);
-                               case "boolean":
-                                       return typeof (bool);
-                               case "base64Binary":
-                                       return typeof (byte []);
-                               case "dateTime":
-                                       return typeof (DateTime);
-                               case "duration":
-                                       return typeof (TimeSpan);
-                               case "QName":
-                                       return typeof (QName);
-                               case "decimal":
-                                       return typeof (decimal);
-                               case "double":
-                                       return typeof (double);
-                               case "float":
-                                       return typeof (float);
-                               case "byte":
-                                       return typeof (sbyte);
-                               case "short":
-                                       return typeof (short);
-                               case "int":
-                                       return typeof (int);
-                               case "long":
-                                       return typeof (long);
-                               case "unsignedByte":
-                                       return typeof (byte);
-                               case "unsignedShort":
-                                       return typeof (ushort);
-                               case "unsignedInt":
-                                       return typeof (uint);
-                               case "unsignedLong":
-                                       return typeof (ulong);
-                               case "string":
-                                       return typeof (string);
-                               case "anyType":
-                                       return typeof (object);
-                               case "guid":
-                                       return typeof (Guid);
-                               case "char":
-                                       return typeof (char);
-                               }
-                               break;
-                       }
-                       return null;
-               }
-
-
-               internal static object PredefinedTypeStringToObject (string s,
-                       string name, XmlReader reader)
-               {
-                       switch (name) {
-                       case "anyURI":
-                               return new Uri(s,UriKind.RelativeOrAbsolute);
-                       case "boolean":
-                               return XmlConvert.ToBoolean (s);
-                       case "base64Binary":
-                               return Convert.FromBase64String (s);
-                       case "dateTime":
-                               return XmlConvert.ToDateTime (s, XmlDateTimeSerializationMode.RoundtripKind);
-                       case "duration":
-                               return XmlConvert.ToTimeSpan (s);
-                       case "QName":
-                               int idx = s.IndexOf (':');
-                               string l = idx < 0 ? s : s.Substring (idx + 1);
-                               return idx < 0 ? new QName (l) :
-                                       new QName (l, reader.LookupNamespace (
-                                               s.Substring (0, idx)));
-                       case "decimal":
-                               return XmlConvert.ToDecimal (s);
-                       case "double":
-                               return XmlConvert.ToDouble (s);
-                       case "float":
-                               return XmlConvert.ToSingle (s);
-                       case "byte":
-                               return XmlConvert.ToSByte (s);
-                       case "short":
-                               return XmlConvert.ToInt16 (s);
-                       case "int":
-                               return XmlConvert.ToInt32 (s);
-                       case "long":
-                               return XmlConvert.ToInt64 (s);
-                       case "unsignedByte":
-                               return XmlConvert.ToByte (s);
-                       case "unsignedShort":
-                               return XmlConvert.ToUInt16 (s);
-                       case "unsignedInt":
-                               return XmlConvert.ToUInt32 (s);
-                       case "unsignedLong":
-                               return XmlConvert.ToUInt64 (s);
-                       case "string":
-                               return s;
-                       case "guid":
-                               return XmlConvert.ToGuid (s);
-                       case "anyType":
-                               return s;
-                       case "char":
-                               return (char) XmlConvert.ToUInt32 (s);
-                       default:
-                               throw new Exception ("Unanticipated primitive type: " + name);
-                       }
-               }
-
-               List<SerializationMap> contracts = new List<SerializationMap> ();
-
-               public KnownTypeCollection ()
-               {
-               }
-
-               protected override void ClearItems ()
-               {
-                       base.Clear ();
-               }
-
-               protected override void InsertItem (int index, Type type)
-               {
-                       if (ShouldNotRegister (type))
-                               return;
-                       if (!Contains (type)) {
-                               TryRegister (type);
-                               base.InsertItem (index, type);
-                       }
-               }
-
-               // FIXME: it could remove other types' dependencies.
-               protected override void RemoveItem (int index)
-               {
-                       lock (this)
-                               DoRemoveItem (index);
-               }
-
-               void DoRemoveItem (int index)
-               {
-                       Type t = base [index];
-                       List<SerializationMap> l = new List<SerializationMap> ();
-                       foreach (SerializationMap m in contracts) {
-                               if (m.RuntimeType == t)
-                                       l.Add (m);
-                       }
-                       foreach (SerializationMap m in l) {
-                               contracts.Remove (m);
-                               base.RemoveItem (index);
-                       }
-               }
-
-               protected override void SetItem (int index, Type type)
-               {
-                       if (ShouldNotRegister (type))
-                               return;
-
-                       // Since this collection is not assured to be ordered, it ignores the whole Set operation if the type already exists.
-                       if (Contains (type))
-                               return;
-
-                       if (index != Count)
-                               RemoveItem (index);
-                       if (TryRegister (type))
-                               base.InsertItem (index - 1, type);
-               }
-
-               internal SerializationMap FindUserMap (Type type)
-               {
-                       lock (this) {
-                               for (int i = 0; i < contracts.Count; i++)
-                                       if (type == contracts [i].RuntimeType)
-                                               return contracts [i];
-                               return null;
-                       }
-               }
-
-               internal SerializationMap FindUserMap (QName qname)
-               {
-                       lock (this)
-                               return contracts.FirstOrDefault (c => c.XmlName == qname);
-               }
-
-               internal SerializationMap FindUserMap (QName qname, Type type)
-               {
-                       lock (this)
-                               return contracts.FirstOrDefault (c => c.XmlName == qname && c.RuntimeType == type);
-               }
-
-               internal Type GetSerializedType (Type type)
-               {
-                       if (IsPrimitiveNotEnum (type))
-                               return type;
-                       Type element = GetCollectionElementType (type);
-                       if (element == null)
-                               return type;
-                       QName name = GetQName (type);
-                       var map = FindUserMap (name, type);
-                       if (map != null)
-                               return map.RuntimeType;
-                       return type;
-               }
-
-               internal QName GetQName (Type type)
-               {
-                       SerializationMap map = FindUserMap (type);
-                       if (map != null)
-                               // already mapped.
-                               return map.XmlName;
-                       return GetStaticQName (type);
-               }
-
-               public static QName GetStaticQName (Type type)
-               {
-                       if (IsPrimitiveNotEnum (type))
-                               return GetPrimitiveTypeName (type);
-
-                       if (type.IsEnum)
-                               return GetEnumQName (type);
-
-                       QName qname = GetContractQName (type);
-                       if (qname != null)
-                               return qname;
-
-                       if (type.GetInterface ("System.Xml.Serialization.IXmlSerializable") != null)
-                               //FIXME: Reusing GetSerializableQName here, since we just
-                               //need name of the type..
-                               return GetSerializableQName (type);
-
-                       qname = GetCollectionContractQName (type);
-                       if (qname != null)
-                               return qname;
-
-                       Type element = GetCollectionElementType (type);
-                       if (element != null) {
-                               if (type.IsInterface || IsCustomCollectionType (type, element))
-                                       return GetCollectionQName (element);
-                       }
-
-                       if (GetAttribute<SerializableAttribute> (type) != null)
-                               return GetSerializableQName (type);
-
-                       // default type map - still uses GetContractQName().
-                       return GetContractQName (type, null, null);
-               }
-
-               internal static QName GetContractQName (Type type)
-               {
-                       var a = GetAttribute<DataContractAttribute> (type);
-                       return a == null ? null : GetContractQName (type, a.Name, a.Namespace);
-               }
-
-               static QName GetCollectionContractQName (Type type)
-               {
-                       var a = GetAttribute<CollectionDataContractAttribute> (type);
-                       return a == null ? null : GetContractQName (type, a.Name, a.Namespace);
-               }
-
-               static QName GetContractQName (Type type, string name, string ns)
-               {
-                       if (name == null)
-                               name = GetDefaultName (type);
-                       else if (type.IsGenericType) {
-                               var args = type.GetGenericArguments ();
-                               for (int i = 0; i < args.Length; i++)
-                                       name = name.Replace ("{" + i + "}", GetStaticQName (args [i]).Name);
-                       }
-
-                       if (ns == null)
-                               ns = GetDefaultNamespace (type);
-                       return new QName (name, ns);
-               }
-
-               static QName GetEnumQName (Type type)
-               {
-                       string name = null, ns = null;
-
-                       if (!type.IsEnum)
-                               return null;
-
-                       var dca = GetAttribute<DataContractAttribute> (type);
-
-                       if (dca != null) {
-                               ns = dca.Namespace;
-                               name = dca.Name;
-                       }
-
-                       if (ns == null)
-                               ns = GetDefaultNamespace (type);
-
-                       if (name == null)
-                               name = type.Namespace == null ? type.Name : type.FullName.Substring (type.Namespace.Length + 1).Replace ('+', '.');
-
-                       return new QName (name, ns);
-               }
-
-               internal static string GetDefaultName (Type type)
-               {
-                       // FIXME: there could be decent ways to get
-                       // the same result...
-                       string name = type.Namespace == null || type.Namespace.Length == 0 ? type.Name : type.FullName.Substring (type.Namespace.Length + 1).Replace ('+', '.');
-                       if (type.IsGenericType) {
-                               name = name.Substring (0, name.IndexOf ('`')) + "Of";
-                               foreach (var t in type.GetGenericArguments ())
-                                       name += t.Name; // FIXME: check namespaces too
-                       }
-                       return name;
-               }
-
-               internal static string GetDefaultNamespace (Type type)
-               {
-                       foreach (ContractNamespaceAttribute a in type.Assembly.GetCustomAttributes (typeof (ContractNamespaceAttribute), true))
-                               if (a.ClrNamespace == type.Namespace)
-                                       return a.ContractNamespace;
-                       return DefaultClrNamespaceBase + type.Namespace;
-               }
-
-               static QName GetCollectionQName (Type element)
-               {
-                       QName eqname = GetStaticQName (element);
-
-                       string ns = eqname.Namespace;
-                       if (eqname.Namespace == MSSimpleNamespace)
-                               //Arrays of Primitive types
-                               ns = MSArraysNamespace;
-
-                       return new QName (
-                               "ArrayOf" + XmlConvert.EncodeLocalName (eqname.Name),
-                               ns);
-               }
-
-               static QName GetSerializableQName (Type type)
-               {
-                       // First, check XmlSchemaProviderAttribute and try GetSchema() to see if it returns a schema in the expected format.
-                       var xpa = type.GetCustomAttribute<XmlSchemaProviderAttribute> (true);
-                       if (xpa != null) {
-                               if (xpa.IsAny)
-                                       return XmlQualifiedName.Empty;
-                               var mi = type.GetMethod (xpa.MethodName, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static);
-                               if (mi != null) {
-                                       try {
-                                               var xss = new XmlSchemaSet ();
-                                               return (XmlQualifiedName) mi.Invoke (null, new object [] {xss});
-                                       } catch {
-                                               // ignore.
-                                       }
-                               }
-                       }
-
-                       string xmlName = type.Name;
-                       if (type.IsGenericType) {
-                               xmlName = xmlName.Substring (0, xmlName.IndexOf ('`')) + "Of";
-                               foreach (var t in type.GetGenericArguments ())
-                                       xmlName += GetStaticQName (t).Name; // FIXME: check namespaces too
-                       }
-                       string xmlNamespace = GetDefaultNamespace (type);
-                       var x = GetAttribute<XmlRootAttribute> (type);
-                       if (x != null) {
-                               xmlName = x.ElementName;
-                               xmlNamespace = x.Namespace;
-                       }
-                       return new QName (XmlConvert.EncodeLocalName (xmlName), xmlNamespace);
-               }
-
-               static bool IsPrimitiveNotEnum (Type type)
-               {
-                       if (type.IsEnum)
-                               return false;
-                       if (Type.GetTypeCode (type) != TypeCode.Object) // explicitly primitive
-                               return true;
-                       if (type == typeof (Guid) || type == typeof (object) || type == typeof(TimeSpan) || type == typeof(byte[]) || type == typeof(Uri) || type == typeof(DateTimeOffset)) // special primitives
-                               return true;
-                       // DOM nodes
-                       if (type == typeof (XmlElement) || type == typeof (XmlNode []))
-                               return true;
-                       // nullable
-                       if (type.IsGenericType && type.GetGenericTypeDefinition () == typeof (Nullable<>))
-                               return IsPrimitiveNotEnum (type.GetGenericArguments () [0]);
-                       return false;
-               }
-
-               bool ShouldNotRegister (Type type)
-               {
-                       return IsPrimitiveNotEnum (type);
-               }
-
-               internal bool TryRegister (Type type)
-               {
-                       lock (this) {
-                               return DoTryRegister (type);
-                       }
-               }
-
-               bool DoTryRegister (Type type)
-               {
-                       // exclude predefined maps
-                       if (ShouldNotRegister (type))
-                               return false;
-
-                       if (FindUserMap (type) != null)
-                               return false;
-
-                       if (RegisterEnum (type) != null)
-                               return true;
-
-                       if (RegisterDictionary (type) != null)
-                               return true;
-
-                       if (RegisterCollectionContract (type) != null)
-                               return true;
-
-                       if (RegisterContract (type) != null)
-                               return true;
-
-                       if (RegisterIXmlSerializable (type) != null)
-                               return true;
-
-                       if (RegisterCollection (type) != null)
-                               return true;
-
-                       if (GetAttribute<SerializableAttribute> (type) != null) {
-                               RegisterSerializable (type);
-                               return true;
-                       }
-
-                       RegisterDefaultTypeMap (type);
-                       return true;
-               }
-
-               static Type GetCollectionElementType (Type type)
-               {
-                       if (type.IsArray)
-                               return type.GetElementType ();
-                       var ifaces = type.GetInterfacesOrSelfInterface ();
-                       foreach (Type i in ifaces)
-                               if (i.IsGenericType && i.GetGenericTypeDefinition ().Equals (typeof (IEnumerable<>)))
-                                       return i.GetGenericArguments () [0];
-                       foreach (Type i in ifaces)
-                               if (i == typeof (IEnumerable))
-                                       return typeof (object);
-                       return null;
-               }
-
-               internal static T GetAttribute<T> (ICustomAttributeProvider ap) where T : Attribute
-               {
-                       object [] atts = ap.GetCustomAttributes (typeof (T), false);
-                       return atts.Length == 0 ? null : (T) atts [0];
-               }
-
-               private CollectionContractTypeMap RegisterCollectionContract (Type type)
-               {
-                       var cdca = GetAttribute<CollectionDataContractAttribute> (type);
-                       if (cdca == null)
-                               return null;
-
-                       Type element = GetCollectionElementType (type);
-                       if (element == null)
-                               throw new InvalidDataContractException (String.Format ("Type '{0}' is marked as collection contract, but it is not a collection", type));
-                       if (type.GetMethod ("Add", new Type[] { element }) == null)
-                               throw new InvalidDataContractException (String.Format ("Type '{0}' is marked as collection contract, but missing a public \"Add\" method", type));
-
-                       TryRegister (element); // must be registered before the name conflict check.
-
-                       QName qname = GetCollectionContractQName (type);
-                       CheckStandardQName (qname);
-                       var map = FindUserMap (qname, type);
-                       if (map != null) {
-                               var cmap = map as CollectionContractTypeMap;
-                               if (cmap == null) // The runtime type may still differ (between array and other IList; see bug #670560)
-                                       throw new InvalidOperationException (String.Format ("Failed to add type {0} to known type collection. There already is a registered type for XML name {1}", type, qname));
-                       }
-
-                       var ret = new CollectionContractTypeMap (type, cdca, element, qname, this);
-                       contracts.Add (ret);
-                       return ret;
-               }
-
-               private CollectionTypeMap RegisterCollection (Type type)
-               {
-                       Type element = GetCollectionElementType (type);
-                       if (element == null)
-                               return null;
-
-                       TryRegister (element);
-
-                       /*
-                        * To qualify as a custom collection type, a type must have
-                        * a public parameterless constructor and an "Add" method
-                        * with the correct parameter type in addition to implementing
-                        * one of the collection interfaces.
-                        * 
-                        */
-
-                       if (!type.IsArray && type.IsClass && !IsCustomCollectionType (type, element))
-                               return null;
-
-                       QName qname = GetCollectionQName (element);
-
-                       var map = FindUserMap (qname, element);
-                       if (map != null) {
-                               var cmap = map as CollectionTypeMap;
-                               if (cmap == null) // The runtime type may still differ (between array and other IList; see bug #670560)
-                                       throw new InvalidOperationException (String.Format ("Failed to add type {0} to known type collection. There already is a registered type for XML name {1}", type, qname));
-                               return cmap;
-                       }
-
-                       CollectionTypeMap ret =
-                               new CollectionTypeMap (type, element, qname, this);
-                       contracts.Add (ret);
-                       return ret;
-               }
-
-               static bool IsCustomCollectionType (Type type, Type elementType)
-               {
-                       if (!type.IsClass)
-                               return false;
-                       if (type.GetConstructor (new Type [0]) == null)
-                               return false;
-                       if (type.GetMethod ("Add", new Type[] { elementType }) == null)
-                               return false;
-
-                       return true;
-               }
-
-               internal static bool IsInterchangeableCollectionType (Type contractType, Type graphType,
-                                                                     out QName collectionQName)
-               {
-                       collectionQName = null;
-                       if (GetAttribute<CollectionDataContractAttribute> (contractType) != null)
-                               return false;
-
-                       var type = contractType;
-                       if (type.IsGenericType)
-                               type = type.GetGenericTypeDefinition ();
-
-                       var elementType = GetCollectionElementType (contractType);
-                       if (elementType == null)
-                               return false;
-                       
-                       if (contractType.IsArray) {
-                               if (!graphType.IsArray || !elementType.Equals (graphType.GetElementType ()))
-                                       throw new InvalidCastException (String.Format ("Type '{0}' cannot be converted into '{1}'.", graphType.GetElementType (), elementType));
-                       } else if (!contractType.IsInterface) {
-                               if (GetAttribute<SerializableAttribute> (contractType) == null)
-                                       return false;
-
-                               var graphElementType = GetCollectionElementType (graphType);
-                               if (elementType != graphElementType)
-                                       return false;
-
-                               if (!IsCustomCollectionType (contractType, elementType))
-                                       return false;
-                       } else if (type.Equals (typeof (IEnumerable)) || type.Equals (typeof (IList)) ||
-                                  type.Equals (typeof (ICollection))) {
-                               if (!graphType.ImplementsInterface (contractType))
-                                       return false;
-                       } else if (type.Equals (typeof (IEnumerable<>)) || type.Equals (typeof (IList<>)) ||
-                                  type.Equals (typeof (ICollection<>))) {
-                               var graphElementType = GetCollectionElementType (graphType);
-                               if (graphElementType != elementType)
-                                       throw new InvalidCastException (String.Format (
-                                               "Cannot convert type '{0}' into '{1}'.", graphType, contractType));
-
-                               if (!graphType.ImplementsInterface (contractType))
-                                       return false;
-                       } else {
-                               return false;
-                       }
-
-                       collectionQName = GetCollectionQName (elementType);
-                       return true;
-               }
-
-               static bool ImplementsInterface (Type type, Type iface)
-               {
-                       foreach (var i in type.GetInterfacesOrSelfInterface ())
-                               if (iface == i)
-                                       return true;
-                                       
-                       return false;
-               }
-
-
-               static bool TypeImplementsIEnumerable (Type type)
-               {
-                       foreach (var iface in type.GetInterfacesOrSelfInterface ())
-                               if (iface == typeof (IEnumerable) || (iface.IsGenericType && iface.GetGenericTypeDefinition () == typeof (IEnumerable<>)))
-                                       return true;
-                       
-                       return false;
-               }
-
-               static bool TypeImplementsIDictionary (Type type)
-               {
-                       foreach (var iface in type.GetInterfacesOrSelfInterface ())
-                               if (iface == typeof (IDictionary) || (iface.IsGenericType && iface.GetGenericTypeDefinition () == typeof (IDictionary<,>)))
-                                       return true;
-
-                       return false;
-               }
-
-               // it also supports contract-based dictionary.
-               private DictionaryTypeMap RegisterDictionary (Type type)
-               {
-                       if (!TypeImplementsIDictionary (type))
-                               return null;
-
-                       var cdca = GetAttribute<CollectionDataContractAttribute> (type);
-
-                       DictionaryTypeMap ret =
-                               new DictionaryTypeMap (type, cdca, this);
-
-                       TryRegister (ret.KeyType);
-                       TryRegister (ret.ValueType);
-
-                       var map = FindUserMap (ret.XmlName, type);
-                       if (map != null) {
-                               var dmap = map as DictionaryTypeMap;
-                               if (dmap == null) // The runtime type may still differ (between array and other IList; see bug #670560)
-                                       throw new InvalidOperationException (String.Format ("Failed to add type {0} to known type collection. There already is a registered type for XML name {1}", type, ret.XmlName));
-                       }
-                       contracts.Add (ret);
-
-                       return ret;
-               }
-
-               private SerializationMap RegisterSerializable (Type type)
-               {
-                       QName qname = GetSerializableQName (type);
-
-                       if (FindUserMap (qname, type) != null)
-                               throw new InvalidOperationException (String.Format ("There is already a registered type for XML name {0}", qname));
-
-                       SharedTypeMap ret = new SharedTypeMap (type, qname, this);
-                       contracts.Add (ret);
-                       ret.Initialize ();
-                       return ret;
-               }
-
-               private SerializationMap RegisterIXmlSerializable (Type type)
-               {
-                       if (type.GetInterface ("System.Xml.Serialization.IXmlSerializable") == null)
-                               return null;
-
-                       QName qname = GetSerializableQName (type);
-
-                       if (!QName.Empty.Equals (qname) && FindUserMap (qname, type) != null)
-                               throw new InvalidOperationException (String.Format ("There is already a registered type for XML name {0}", qname));
-
-                       XmlSerializableMap ret = new XmlSerializableMap (type, qname, this);
-                       contracts.Add (ret);
-
-                       return ret;
-               }
-
-               void CheckStandardQName (QName qname)
-               {
-                       switch (qname.Namespace) {
-                       case XmlSchema.Namespace:
-                       case XmlSchema.InstanceNamespace:
-                       case MSSimpleNamespace:
-                       case MSArraysNamespace:
-                               throw new InvalidOperationException (String.Format ("Namespace {0} is reserved and cannot be used for user serialization", qname.Namespace));
-                       }
-
-               }
-
-               private SharedContractMap RegisterContract (Type type)
-               {
-                       QName qname = GetContractQName (type);
-                       if (qname == null)
-                               return null;
-                       CheckStandardQName (qname);
-                       if (FindUserMap (qname, type) != null)
-                               throw new InvalidOperationException (String.Format ("There is already a registered type for XML name {0}", qname));
-
-                       SharedContractMap ret = new SharedContractMap (type, qname, this);
-                       contracts.Add (ret);
-                       ret.Initialize ();
-
-                       if (type.BaseType != typeof (object)) {
-                               TryRegister (type.BaseType);
-                               if (!FindUserMap (type.BaseType).IsContractAllowedType)
-                                       throw new InvalidDataContractException (String.Format ("To be serializable by data contract, type '{0}' cannot inherit from non-contract and non-Serializable type '{1}'", type, type.BaseType));
-                       }
-
-                       object [] attrs = type.GetCustomAttributes (typeof (KnownTypeAttribute), true);
-                       for (int i = 0; i < attrs.Length; i++) {
-                               KnownTypeAttribute kt = (KnownTypeAttribute) attrs [i];
-                               foreach (var t in kt.GetTypes (type))
-                                       TryRegister (t);
-                       }
-
-                       return ret;
-               }
-
-               DefaultTypeMap RegisterDefaultTypeMap (Type type)
-               {
-                       DefaultTypeMap ret = new DefaultTypeMap (type, this);
-                       contracts.Add (ret);
-                       ret.Initialize ();
-                       return ret;
-               }
-
-               private EnumMap RegisterEnum (Type type)
-               {
-                       QName qname = GetEnumQName (type);
-                       if (qname == null)
-                               return null;
-
-                       if (FindUserMap (qname, type) != null)
-                               throw new InvalidOperationException (String.Format ("There is already a registered type for XML name {0}", qname));
-
-                       EnumMap ret =
-                               new EnumMap (type, qname, this);
-                       contracts.Add (ret);
-                       return ret;
-               }
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/NetDataContractSerializer.cs b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/NetDataContractSerializer.cs
deleted file mode 100644 (file)
index 68f6bea..0000000
+++ /dev/null
@@ -1,272 +0,0 @@
-//
-// NetDataContractSerializer.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.Collections;
-using System.IO;
-using System.Reflection;
-using System.Runtime.Serialization.Formatters;
-using System.Runtime.Serialization.Formatters.Binary;
-using System.Xml;
-using System.Xml.Schema;
-
-using QName = System.Xml.XmlQualifiedName;
-
-namespace System.Runtime.Serialization
-{
-       public sealed class NetDataContractSerializer
-               : XmlObjectSerializer, IFormatter
-       {
-               const string xmlns = "http://www.w3.org/2000/xmlns/";
-               const string default_ns = "http://schemas.datacontract.org/2004/07/";
-
-               // This is only for compatible mode.
-               StreamingContext context;
-//             KnownTypeCollection known_types;
-//             IDataContractSurrogate surrogate;
-
-               SerializationBinder binder;
-               ISurrogateSelector selector;
-
-               int max_items = 0x10000; // FIXME: could be from config.
-               bool ignore_extensions;
-               FormatterAssemblyStyle ass_style;
-
-               XmlDictionaryString root_name, root_ns;
-
-               public NetDataContractSerializer ()
-               {
-               }
-
-               public NetDataContractSerializer (StreamingContext context)
-               {
-                       this.context = context;
-               }
-
-               public NetDataContractSerializer (string rootName,
-                       string rootNamespace)
-               {
-                       FillDictionaryString (rootName, rootNamespace);
-               }
-
-               public NetDataContractSerializer (XmlDictionaryString rootName,
-                       XmlDictionaryString rootNamespace)
-               {
-                       if (rootName == null)
-                               throw new ArgumentNullException ("rootName");
-                       if (rootNamespace == null)
-                               throw new ArgumentNullException ("rootNamespace");
-                       root_name = rootName;
-                       root_ns = rootNamespace;
-               }
-
-               public NetDataContractSerializer (StreamingContext context, 
-                       int maxItemsInObjectGraph,
-                       bool ignoreExtensibleDataObject,
-                       FormatterAssemblyStyle assemblyFormat,
-                       ISurrogateSelector surrogateSelector)
-               {
-                       this.context = context;
-                       max_items = maxItemsInObjectGraph;
-                       ignore_extensions = ignoreExtensibleDataObject;
-                       ass_style = assemblyFormat;
-                       selector = surrogateSelector;
-               }
-
-               public NetDataContractSerializer (
-                       string rootName, string rootNamespace,
-                       StreamingContext context, 
-                       int maxItemsInObjectGraph,
-                       bool ignoreExtensibleDataObject,
-                       FormatterAssemblyStyle assemblyFormat,
-                       ISurrogateSelector surrogateSelector)
-                       : this (context, maxItemsInObjectGraph,
-                               ignoreExtensibleDataObject, assemblyFormat,
-                               surrogateSelector)
-               {
-                       FillDictionaryString (rootName, rootNamespace);
-               }
-
-               public NetDataContractSerializer (
-                       XmlDictionaryString rootName,
-                       XmlDictionaryString rootNamespace,
-                       StreamingContext context,
-                       int maxItemsInObjectGraph,
-                       bool ignoreExtensibleDataObject,
-                       FormatterAssemblyStyle assemblyFormat,
-                       ISurrogateSelector surrogateSelector)
-                       : this (context, maxItemsInObjectGraph,
-                               ignoreExtensibleDataObject, assemblyFormat,
-                               surrogateSelector)
-               {
-                       if (rootName == null)
-                               throw new ArgumentNullException ("rootName");
-                       if (rootNamespace == null)
-                               throw new ArgumentNullException ("rootNamespace");
-                       root_name = rootName;
-                       root_ns = rootNamespace;
-               }
-
-               void FillDictionaryString (string rootName, string rootNamespace)
-               {
-                       if (rootName == null)
-                               throw new ArgumentNullException ("rootName");
-                       if (rootNamespace == null)
-                               throw new ArgumentNullException ("rootNamespace");
-                       XmlDictionary d = new XmlDictionary ();
-                       root_name = d.Add (rootName);
-                       root_ns = d.Add (rootNamespace);
-               }
-
-               public FormatterAssemblyStyle AssemblyFormat {
-                       get { return ass_style; }
-                       set { ass_style = value; }
-               }
-
-               public SerializationBinder Binder {
-                       get { return binder; }
-                       set { binder = value; }
-               }
-
-               public bool IgnoreExtensionDataObject {
-                       get { return ignore_extensions; }
-               }
-
-               public ISurrogateSelector SurrogateSelector {
-                       get { return selector; }
-                       set { selector = value; }
-               }
-
-               public StreamingContext Context {
-                       get { return context; }
-                       set { context = value; }
-               }
-
-               public int MaxItemsInObjectGraph {
-                       get { return max_items; }
-               }
-
-               public object Deserialize (Stream stream)
-               {
-                       return ReadObject (stream);
-               }
-
-               [MonoTODO]
-               public override bool IsStartObject (XmlDictionaryReader reader)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public override object ReadObject (XmlDictionaryReader reader, bool readContentOnly)
-               {
-                       /*
-                       int startTypeCount = known_types.Count;
-
-                       object ret = XmlFormatterDeserializer.Deserialize (
-                               // FIXME: remove this second param.
-                               reader, null, known_types, surrogate, readContentOnly);
-
-                       if (!readContentOnly && reader.NodeType == XmlNodeType.EndElement)
-                               reader.Read ();
-
-                       // remove temporarily-added known types for
-                       // rootType and object graph type.
-                       while (known_types.Count > startTypeCount)
-                               known_types.RemoveAt (startTypeCount);
-
-                       return ret;
-                       */
-                       throw new NotImplementedException ();
-               }
-
-               public void Serialize (Stream stream, Object graph)
-               {
-                       using (XmlWriter w = XmlWriter.Create (stream)) {
-                               WriteObject (w, graph);
-                       }
-               }
-
-               [MonoTODO ("support arrays; support Serializable; support SharedType; use DataContractSurrogate")]
-               /*
-                       when writeContentOnly is true, then the input XmlWriter
-                       must be at element state. This is to write possible
-                       xsi:nil.
-
-                       rootType determines the top-level element QName (thus
-                       it is ignored when writeContentOnly is true).
-
-                       preserveObjectReferences indicates that whether the
-                       output should contain ms:Id or not.
-                       (http://schemas.microsoft.com/2003/10/Serialization/)
-               */
-               public override void WriteObjectContent (
-                       XmlDictionaryWriter writer, object graph)
-               {
-                       /*
-                       int startTypeCount = known_types.Count;
-
-                       string ns = default_ns;
-
-                       //writer.WriteAttributeString ("xmlns", "i", xmlns, XmlSchema.InstanceNamespace);
-                       //writer.WriteAttributeString ("xmlns", "x", xmlns, XmlSchema.Namespace);
-                       if (ns != null)
-                               writer.WriteAttributeString ("xmlns", xmlns, ns);
-
-                       XmlFormatterSerializer.Serialize (writer, graph,
-                               known_types,
-                               ignore_extensions, max_items);
-
-                       // remove temporarily-added known types for
-                       // rootType and object graph type.
-                       while (known_types.Count > startTypeCount)
-                               known_types.RemoveAt (startTypeCount);
-                       */
-                       throw new NotImplementedException ();
-               }
-
-               public override void WriteStartObject (
-                       XmlDictionaryWriter writer, object graph)
-               {
-                       /*
-                       Type rootType = graph.GetType ();
-                       known_types.Add (rootType);
-                       SerializationMap map =
-                               known_types.FindUserMap (rootType);
-                       QName name = map != null ? map.XmlName :
-                               KnownTypeCollection.GetPredefinedTypeName (rootType);
-                       writer.WriteStartElement (
-                               name.Name, name.Namespace);
-                       */
-                       throw new NotImplementedException ();
-               }
-
-               public override void WriteEndObject (XmlDictionaryWriter writer)
-               {
-                       writer.WriteEndElement ();
-               }
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/SerializationMap.XsdExporter.cs b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/SerializationMap.XsdExporter.cs
deleted file mode 100644 (file)
index 47fc17c..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-//
-// SerializationMap.XsdExporter.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2010 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.CodeDom;
-using System.CodeDom.Compiler;
-using System.Collections;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Reflection;
-using System.Xml;
-using System.Xml.Schema;
-using System.Xml.Serialization;
-
-using QName = System.Xml.XmlQualifiedName;
-
-namespace System.Runtime.Serialization
-{
-       internal abstract partial class SerializationMap
-       {
-               public abstract void ExportSchemaType (XsdDataContractExporter exporter);
-       }
-       
-       internal partial class XmlSerializableMap
-       {
-               public override void ExportSchemaType (XsdDataContractExporter exporter)
-               {
-                       // .NET also expects a default constructor.
-                       var ixs = (IXmlSerializable) Activator.CreateInstance (RuntimeType, true);
-                       var xs = ixs.GetSchema ();
-                       if (xs != null)
-                               exporter.Schemas.Add (xs);
-               }
-       }
-       
-       internal partial class SharedContractMap
-       {
-               public override void ExportSchemaType (XsdDataContractExporter exporter)
-               {
-                       exporter.ExportStandardComplexType (RuntimeType.GetCustomAttribute<DataContractAttribute> (false), this, Members);
-               }
-       }
-       
-       internal partial class DefaultTypeMap
-       {
-               public override void ExportSchemaType (XsdDataContractExporter exporter)
-               {
-                       exporter.ExportStandardComplexType (null, this, Members);
-               }
-       }
-       
-       internal partial class CollectionContractTypeMap
-       {
-               public override void ExportSchemaType (XsdDataContractExporter exporter)
-               {
-                       exporter.ExportListContractType (a, this);
-               }
-       }
-       
-       internal partial class CollectionTypeMap
-       {
-               public override void ExportSchemaType (XsdDataContractExporter exporter)
-               {
-                       exporter.ExportListContractType (null, this);
-               }
-       }
-       
-       internal partial class DictionaryTypeMap
-       {
-               public override void ExportSchemaType (XsdDataContractExporter exporter)
-               {
-                       exporter.ExportDictionaryContractType (a, this, GetGenericDictionaryInterface (RuntimeType));
-               }
-       }
-       
-       internal partial class SharedTypeMap
-       {
-               public override void ExportSchemaType (XsdDataContractExporter exporter)
-               {
-                       exporter.ExportStandardComplexType (null, this, Members);
-               }
-       }
-       
-       internal partial class EnumMap
-       {
-               public override void ExportSchemaType (XsdDataContractExporter exporter)
-               {
-                       exporter.ExportEnumContractType (RuntimeType.GetCustomAttribute<DataContractAttribute> (false), this);
-               }
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/SerializationMap.cs b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/SerializationMap.cs
deleted file mode 100644 (file)
index 48b121e..0000000
+++ /dev/null
@@ -1,1122 +0,0 @@
-//
-// SerializationMap.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//     Ankit Jain <JAnkit@novell.com>
-//     Duncan Mak (duncan@ximian.com)
-//     Eyal Alaluf (eyala@mainsoft.com)
-//
-// Copyright (C) 2005 Novell, Inc.  http://www.novell.com
-// Copyright (C) 2006 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.Linq;
-using System.Reflection;
-using System.Xml;
-using System.Xml.Schema;
-using System.Xml.Serialization;
-
-using QName = System.Xml.XmlQualifiedName;
-
-namespace System.Runtime.Serialization
-{
-/*
-       XmlFormatter implementation design inference:
-
-       type definitions:
-       - No XML Schema types are directly used. There are some maps from
-         xs:blahType to ms:blahType where the namespaceURI for prefix "ms" is
-         "http://schemas.microsoft.com/2003/10/Serialization/" .
-
-       serializable types:
-       - An object being serialized 1) must be of type System.Object, or
-         2) must be null, or 3) must have either a [DataContract] attribute
-         or a [Serializable] attribute to be serializable.
-       - When the object is either of type System.Object or null, then the
-         XML type is "anyType".
-       - When the object is [Serializable], then the runtime-serialization
-         compatible object graph is written.
-       - Otherwise the serialization is based on contract attributes.
-         ([Serializable] takes precedence).
-
-       type derivation:
-       - For type A to be serializable, the base type B of A must be
-         serializable.
-       - If a type which is [Serializable] and whose base type has a
-         [DataContract], then for base type members [DataContract] is taken.
-       - It is vice versa i.e. if the base type is [Serializable] and the
-         derived type has a [DataContract], then [Serializable] takes place
-         for base members.
-
-       known type collection:
-       - It internally manages mapping store keyed by contract QNames.
-         KnownTypeCollection.Add() checks if the same QName contract already
-         exists (and raises InvalidOperationException if required).
-
-*/
-       internal abstract partial class SerializationMap
-       {
-               public const BindingFlags AllInstanceFlags =
-                       BindingFlags.Public | BindingFlags.NonPublic |
-                       BindingFlags.Instance;
-
-               public readonly KnownTypeCollection KnownTypes;
-               public readonly Type RuntimeType;
-               public bool IsReference; // new in 3.5 SP1
-               public List<DataMemberInfo> Members;
-#if !NET_2_1
-               XmlSchemaSet schema_set;
-#endif
-               //FIXME FIXME
-               Dictionary<Type, QName> qname_table = new Dictionary<Type, QName> ();
-
-               protected SerializationMap (
-                       Type type, QName qname, KnownTypeCollection knownTypes)
-               {
-                       KnownTypes = knownTypes;
-                       RuntimeType = type;
-                       if (qname.Namespace == null)
-                               qname = new QName (qname.Name,
-                                       KnownTypeCollection.DefaultClrNamespaceBase + type.Namespace);
-
-                       XmlName = qname;
-                       Members = new List<DataMemberInfo> ();
-
-                       foreach (var mi in type.GetMethods (AllInstanceFlags)) {
-                               if (mi.GetCustomAttributes (typeof (OnDeserializingAttribute), false).Length > 0)
-                                       OnDeserializing = mi;
-                               else if (mi.GetCustomAttributes (typeof (OnDeserializedAttribute), false).Length > 0)
-                                       OnDeserialized = mi;
-                       }
-               }
-
-               public MethodInfo OnDeserializing { get; set; }
-               public MethodInfo OnDeserialized { get; set; }
-
-               public virtual bool OutputXsiType {
-                       get { return true; }
-               }
-
-               public QName XmlName { get; set; }
-
-               public abstract bool IsContractAllowedType { get; }
-
-               protected void HandleId (XmlReader reader, XmlFormatterDeserializer deserializer, object instance)
-               {
-                       HandleId (reader.GetAttribute ("Id", KnownTypeCollection.MSSimpleNamespace), deserializer, instance);
-               }
-               
-               protected void HandleId (string id, XmlFormatterDeserializer deserializer, object instance)
-               {
-                       if (id != null)
-                               deserializer.References.Add (id, instance);
-               }
-
-               public CollectionDataContractAttribute GetCollectionDataContractAttribute (Type type)
-               {
-                       object [] atts = type.GetCustomAttributes (
-                               typeof (CollectionDataContractAttribute), false);
-                       return atts.Length == 0 ? null : (CollectionDataContractAttribute) atts [0];
-               }
-
-               public DataMemberAttribute GetDataMemberAttribute (
-                       MemberInfo mi)
-               {
-                       object [] atts = mi.GetCustomAttributes (
-                               typeof (DataMemberAttribute), false);
-                       if (atts.Length == 0)
-                               return null;
-                       return (DataMemberAttribute) atts [0];
-               }
-
-               bool IsPrimitive (Type type)
-               {
-                       return (Type.GetTypeCode (type) != TypeCode.Object || type == typeof (object));
-               }
-
-               //Returns list of data members for this type ONLY
-               public virtual List<DataMemberInfo> GetMembers ()
-               {
-                       throw new NotImplementedException (String.Format ("Implement me for {0}", this));
-               }
-
-#if !NET_2_1
-               protected XmlSchemaElement GetSchemaElement (QName qname, XmlSchemaType schemaType)
-               {
-                       XmlSchemaElement schemaElement = new XmlSchemaElement ();
-                       schemaElement.Name = qname.Name;
-                       schemaElement.SchemaTypeName = qname;
-
-                       if (schemaType is XmlSchemaComplexType)
-                               schemaElement.IsNillable = true;
-
-                       return schemaElement;
-               }
-
-               protected XmlSchema GetSchema (XmlSchemaSet schemas, string ns)
-               {
-                       ICollection colln = schemas.Schemas (ns);
-                       if (colln.Count > 0) {
-                               if (colln.Count > 1)
-                                       throw new Exception (String.Format (
-                                               "More than 1 schema for namespace '{0}' found.", ns));
-                               foreach (object o in colln)
-                                       //return colln [0]
-                                       return (o as XmlSchema);
-                       }
-
-                       XmlSchema schema = new XmlSchema ();
-                       schema.TargetNamespace = ns;
-                       schema.ElementFormDefault = XmlSchemaForm.Qualified;
-                       schemas.Add (schema);
-
-                       return schema;
-               }
-
-               protected XmlQualifiedName GetQualifiedName (Type type)
-               {
-                       if (qname_table.ContainsKey (type))
-                               return qname_table [type];
-
-                       QName qname = KnownTypes.GetQName (type);
-                       if (qname.Namespace == KnownTypeCollection.MSSimpleNamespace)
-                               qname = new QName (qname.Name, XmlSchema.Namespace);
-
-                       qname_table [type] = qname;
-                       return qname;
-               }
-#endif
-
-               public virtual void Serialize (object graph,
-                       XmlFormatterSerializer serializer)
-               {
-                       string label;
-                       if (serializer.TrySerializeAsReference (IsReference, graph, out label))
-                               return;
-                       else if (serializer.SerializingObjects.Contains (graph))
-                               throw new SerializationException (String.Format ("Circular reference of an object in the object graph was found: '{0}' of type {1}", graph, graph.GetType ()));
-                       serializer.SerializingObjects.Add (graph);
-
-                       if (label != null)
-                               serializer.Writer.WriteAttributeString ("z", "Id", KnownTypeCollection.MSSimpleNamespace, label);
-
-                       SerializeNonReference (graph, serializer);
-
-                       serializer.SerializingObjects.Remove (graph);
-               }
-
-               public virtual void SerializeNonReference (object graph,
-                       XmlFormatterSerializer serializer)
-               {
-                       foreach (DataMemberInfo dmi in Members) {
-                               FieldInfo fi = dmi.Member as FieldInfo;
-                               PropertyInfo pi = fi == null ?
-                                       (PropertyInfo) dmi.Member : null;
-                               Type type = fi != null ?
-                                       fi.FieldType : pi.PropertyType;
-                               object value = fi != null ?
-                                       fi.GetValue (graph) :
-                                       pi.GetValue (graph, null);
-
-                               serializer.WriteStartElement (dmi.XmlName, dmi.XmlRootNamespace, dmi.XmlNamespace);
-                               serializer.Serialize (type, value);
-                               serializer.WriteEndElement ();
-                       }
-               }
-
-               public virtual object DeserializeObject (XmlReader reader, XmlFormatterDeserializer deserializer)
-               {
-                       bool isEmpty = reader.IsEmptyElement;
-                       string id = reader.GetAttribute ("Id", KnownTypeCollection.MSSimpleNamespace);
-                       reader.ReadStartElement ();
-                       reader.MoveToContent ();
-
-                       object res;
-
-                       if (isEmpty)
-                               res = DeserializeEmptyContent (reader, deserializer, id);
-                       else
-                               res = DeserializeContent (reader, deserializer, id);
-
-                       reader.MoveToContent ();
-                       if (!isEmpty && reader.NodeType == XmlNodeType.EndElement)
-                               reader.ReadEndElement ();
-                       else if (!isEmpty && !reader.EOF && reader.NodeType != XmlNodeType.EndElement) {
-                               var li = reader as IXmlLineInfo;
-                               throw new SerializationException (String.Format ("Deserializing type '{3}'. Expecting state 'EndElement'. Encountered state '{0}' with name '{1}' with namespace '{2}'.{4}",
-                                       reader.NodeType,
-                                       reader.Name,
-                                       reader.NamespaceURI,
-                                       RuntimeType.FullName,
-                                       li != null && li.HasLineInfo () ? String.Format (" {0}({1},{2})", reader.BaseURI, li.LineNumber, li.LinePosition) : String.Empty));
-                       }
-                       return res;
-               }
-
-               // This is sort of hack. The argument reader already moved ahead of
-               // the actual empty element.It's just for historical consistency.
-               public virtual object DeserializeEmptyContent (XmlReader reader,
-                       XmlFormatterDeserializer deserializer, string id)
-               {
-                       return DeserializeContent (reader, deserializer, id, true);
-               }
-
-               public virtual object DeserializeContent (XmlReader reader,
-                       XmlFormatterDeserializer deserializer, string id)
-               {
-                       return DeserializeContent (reader, deserializer, id, false);
-               }
-
-               object DeserializeContent (XmlReader reader, XmlFormatterDeserializer deserializer, string id, bool empty)
-               {
-                       object instance = FormatterServices.GetUninitializedObject (RuntimeType);
-                       HandleId (id, deserializer, instance);
-
-                       if (OnDeserializing != null)
-                               OnDeserializing.Invoke (instance, new object [] {new StreamingContext (StreamingContextStates.All)});
-
-                       int depth = reader.NodeType == XmlNodeType.None ? reader.Depth : reader.Depth - 1;
-                       bool [] filled = new bool [Members.Count];
-                       bool [] nsmatched = new bool [Members.Count];
-                       int memberInd = -1, ordered = -1;
-                       while (!empty && reader.NodeType == XmlNodeType.Element && reader.Depth > depth) {
-                               DataMemberInfo dmi = null;
-                               int i = 0;
-                               bool nsmatchedOne = false;
-                               for (; i < Members.Count; i++) { // unordered
-                                       if (Members [i].Order >= 0)
-                                               break;
-                                       if (reader.LocalName == Members [i].XmlName) {
-                                               memberInd = i;
-                                               dmi = Members [i];
-                                               nsmatchedOne = (dmi.XmlRootNamespace == null || reader.NamespaceURI == dmi.XmlRootNamespace);
-                                               if (nsmatchedOne)
-                                                       break;
-                                       }
-                               }
-                               for (i = Math.Max (i, ordered); i < Members.Count; i++) { // ordered
-                                       if (dmi != null)
-                                               break;
-                                       if (reader.LocalName == Members [i].XmlName) {
-                                               ordered = i;
-                                               memberInd = i;
-                                               dmi = Members [i];
-                                               nsmatchedOne = (dmi.XmlRootNamespace == null || reader.NamespaceURI == dmi.XmlRootNamespace);
-                                               if (nsmatchedOne)
-                                                       break;
-                                       }
-                               }
-                               
-                               if (dmi == null) {
-                                       reader.Skip ();
-                                       reader.MoveToContent ();
-                                       continue;
-                               }
-                               if (filled [memberInd] && nsmatched [memberInd]) {
-                                       // The strictly-corresponding member (i.e. that matches namespace URI too, not only local name) already exists, so skip this element.
-                                       reader.Skip ();
-                                       reader.MoveToContent ();
-                                       continue;
-                               }
-                               nsmatched [memberInd] = nsmatchedOne;
-                               SetValue (dmi, instance, deserializer.Deserialize (dmi.MemberType, reader));
-                               filled [memberInd] = true;
-                               reader.MoveToContent ();
-                       }
-                       for (int i = 0; i < Members.Count; i++)
-                               if (!filled [i] && Members [i].IsRequired)
-                                       throw MissingRequiredMember (Members [i], reader);
-
-                       if (OnDeserialized != null)
-                               OnDeserialized.Invoke (instance, new object [] {new StreamingContext (StreamingContextStates.All)});
-
-                       return instance;
-               }
-
-               // For now it could be private.
-               protected Exception MissingRequiredMember (DataMemberInfo dmi, XmlReader reader)
-               {
-                       var li = reader as IXmlLineInfo;
-                       return new ArgumentException (String.Format ("Data contract member {0} for the type {1} is required, but missing in the input XML.{2}",
-                               new QName (dmi.XmlName, dmi.XmlNamespace),
-                               RuntimeType,
-                               li != null && li.HasLineInfo () ? String.Format (" {0}({1},{2})", reader.BaseURI, li.LineNumber, li.LinePosition) : null));
-               }
-
-               // For now it could be private.
-               protected void SetValue (DataMemberInfo dmi, object obj, object value)
-               {
-                       try {
-                               if (dmi.Member is PropertyInfo)
-                                       ((PropertyInfo) dmi.Member).SetValue (obj, value, null);
-                               else
-                                       ((FieldInfo) dmi.Member).SetValue (obj, value);
-                       } catch (Exception ex) {
-                               throw new InvalidOperationException (String.Format ("Failed to set value of type {0} for property {1}", value != null ? value.GetType () : null, dmi.Member), ex);
-                       }
-               }
-
-               protected DataMemberInfo CreateDataMemberInfo (DataMemberAttribute dma, MemberInfo mi, Type memberType, string ownerNamespace)
-               {
-                       KnownTypes.Add (memberType);
-                       QName qname = KnownTypes.GetQName (memberType);
-                       
-                       if (KnownTypeCollection.GetPrimitiveTypeFromName (qname) != null)
-                               return new DataMemberInfo (mi, dma, ownerNamespace, null);
-                       else
-                               return new DataMemberInfo (mi, dma, ownerNamespace, qname.Namespace);
-               }
-       }
-
-       internal partial class XmlSerializableMap : SerializationMap
-       {
-               public override bool IsContractAllowedType { get { return true; } }
-
-               public XmlSerializableMap (Type type, QName qname, KnownTypeCollection knownTypes)
-                       : base (type, qname, knownTypes)
-               {
-               }
-
-               public override void Serialize (object graph, XmlFormatterSerializer serializer)
-               {
-                       IXmlSerializable ixs = graph as IXmlSerializable;
-                       if (ixs == null)
-                               //FIXME: Throw what exception here?
-                               throw new SerializationException ();
-
-                       ixs.WriteXml (serializer.Writer);
-               }
-
-               public override object DeserializeObject (XmlReader reader, XmlFormatterDeserializer deserializer)
-               {
-#if NET_2_1
-                       IXmlSerializable ixs = (IXmlSerializable) Activator.CreateInstance (RuntimeType);
-#else
-                       IXmlSerializable ixs = (IXmlSerializable) Activator.CreateInstance (RuntimeType, true);
-#endif
-
-                       HandleId (reader, deserializer, ixs);
-
-                       ixs.ReadXml (reader);
-                       return ixs;
-               }
-       }
-
-       internal partial class SharedContractMap : SerializationMap
-       {
-               public SharedContractMap (
-                       Type type, QName qname, KnownTypeCollection knownTypes)
-                       : base (type, qname, knownTypes)
-               {
-               }
-
-               public override bool IsContractAllowedType { get { return true; } }
-
-               internal void Initialize ()
-               {
-                       Type type = RuntimeType;
-                       List <DataMemberInfo> members;
-                       object [] atts = type.GetCustomAttributes (
-                               typeof (DataContractAttribute), false);
-                       IsReference = atts.Length > 0 ? (((DataContractAttribute) atts [0]).IsReference) : false;
-
-                       while (type != null) {
-                               members = GetMembers (type);
-                               members.Sort (DataMemberInfo.DataMemberInfoComparer.Instance);
-                               Members.InsertRange (0, members);
-                               members.Clear ();
-
-                               type = type.BaseType;
-                       }
-               }
-
-               List<DataMemberInfo> GetMembers (Type type)
-               {
-                       List<DataMemberInfo> data_members = new List<DataMemberInfo> ();
-                       BindingFlags flags = AllInstanceFlags | BindingFlags.DeclaredOnly;
-
-                       foreach (PropertyInfo pi in type.GetProperties (flags)) {
-                               DataMemberAttribute dma =
-                                       GetDataMemberAttribute (pi);
-                               if (dma == null)
-                                       continue;
-                               KnownTypes.Add (pi.PropertyType);
-                               var map = KnownTypes.FindUserMap (pi.PropertyType);
-                               if (!pi.CanRead || (!pi.CanWrite && !(map is ICollectionTypeMap)))
-                                       throw new InvalidDataContractException (String.Format (
-                                                       "DataMember property '{0}' on type '{1}' must have both getter and setter.", pi, pi.DeclaringType));
-                               data_members.Add (CreateDataMemberInfo (dma, pi, pi.PropertyType, KnownTypeCollection.GetStaticQName (pi.DeclaringType).Namespace));
-                       }
-
-                       foreach (FieldInfo fi in type.GetFields (flags)) {
-                               DataMemberAttribute dma =
-                                       GetDataMemberAttribute (fi);
-                               if (dma == null)
-                                       continue;
-                               data_members.Add (CreateDataMemberInfo (dma, fi, fi.FieldType, KnownTypeCollection.GetStaticQName (fi.DeclaringType).Namespace));
-                       }
-
-                       return data_members;
-               }
-
-               public override List<DataMemberInfo> GetMembers ()
-               {
-                       return Members;
-               }
-       }
-
-       internal partial class DefaultTypeMap : SerializationMap
-       {
-               public DefaultTypeMap (Type type, KnownTypeCollection knownTypes)
-                       : base (type, KnownTypeCollection.GetStaticQName (type), knownTypes)
-               {
-               }
-
-               public override bool IsContractAllowedType { get { return false; } }
-
-               internal void Initialize ()
-               {
-                       Members.AddRange (GetDefaultMembers ());
-               }
-
-               List<DataMemberInfo> GetDefaultMembers ()
-               {
-                       var l = new List<DataMemberInfo> ();
-                       foreach (var mi in RuntimeType.GetMembers ()) {
-                               Type mt = null;
-                               FieldInfo fi = mi as FieldInfo;
-                               mt = fi == null ? null : fi.FieldType;
-                               PropertyInfo pi = mi as PropertyInfo;
-                               if (pi != null && pi.CanRead && pi.CanWrite && pi.GetIndexParameters ().Length == 0)
-                                       mt = pi.PropertyType;
-                               if (mt == null)
-                                       continue;
-                               if (mi.GetCustomAttributes (typeof (IgnoreDataMemberAttribute), false).Length != 0)
-                                       continue;
-                               string ns = KnownTypeCollection.GetStaticQName (mi.DeclaringType).Namespace;
-                               l.Add (CreateDataMemberInfo (new DataMemberAttribute (), mi, mt, ns));
-                       }
-                       l.Sort (DataMemberInfo.DataMemberInfoComparer.Instance);
-                       return l;
-               }
-       }
-
-       // FIXME: it still needs to consider KeyName/ValueName
-       // (especially Dictionary collection is not likely considered yet.)
-       internal partial class CollectionContractTypeMap : CollectionTypeMap
-       {
-               CollectionDataContractAttribute a;
-
-               public CollectionContractTypeMap (
-                       Type type, CollectionDataContractAttribute a, Type elementType,
-                       QName qname, KnownTypeCollection knownTypes)
-                       : base (type, elementType, qname, knownTypes)
-               {
-                       this.a = a;
-                       IsReference = a.IsReference;
-                       if (!String.IsNullOrEmpty (a.ItemName))
-                               element_qname = new XmlQualifiedName (a.ItemName, a.Namespace ?? CurrentNamespace);
-               }
-
-               internal override string CurrentNamespace {
-                       get { return XmlName.Namespace; }
-               }
-
-               public override bool IsContractAllowedType { get { return true; } }
-       }
-
-       internal interface ICollectionTypeMap
-       {
-       }
-
-       internal partial class CollectionTypeMap : SerializationMap, ICollectionTypeMap
-       {
-               Type element_type;
-               internal QName element_qname;
-               MethodInfo add_method;
-
-               public CollectionTypeMap (
-                       Type type, Type elementType,
-                       QName qname, KnownTypeCollection knownTypes)
-                       : base (type, qname, knownTypes)
-               {
-                       element_type = elementType;
-                       element_qname = KnownTypes.GetQName (element_type);
-                       var icoll = GetGenericCollectionInterface (RuntimeType);
-                       if (icoll != null) {
-                               if (RuntimeType.IsInterface) {
-                                       add_method = RuntimeType.GetMethod ("Add", icoll.GetGenericArguments ());
-                               } else {
-                                       var imap = RuntimeType.GetInterfaceMap (icoll);
-                                       for (int i = 0; i < imap.InterfaceMethods.Length; i++)
-                                               if (imap.InterfaceMethods [i].Name == "Add") {
-                                                       add_method = imap.TargetMethods [i];
-                                                       break;
-                                               }
-                                       if (add_method == null)
-                                               add_method = type.GetMethod ("Add", icoll.GetGenericArguments ());
-                               }
-                       }
-               }
-
-               static Type GetGenericCollectionInterface (Type type)
-               {
-                       foreach (var iface in type.GetInterfacesOrSelfInterface ())
-                               if (iface.IsGenericType && iface.GetGenericTypeDefinition () == typeof (IEnumerable<>))
-                                       return iface;
-
-                       return null;
-               }
-
-               public override bool IsContractAllowedType { get { return false; } }
-
-               public override bool OutputXsiType {
-                       get { return false; }
-               }
-
-               internal virtual string CurrentNamespace {
-                       get {
-                               string ns = element_qname.Namespace;
-                               if (ns == KnownTypeCollection.MSSimpleNamespace)
-                                       ns = KnownTypeCollection.MSArraysNamespace;
-                               return ns;
-                       }
-               }
-
-               public override void SerializeNonReference (object graph,
-                       XmlFormatterSerializer serializer)
-               {
-                       // output item xmlns in advance so that it does not result in excessive xmlns overwrites.
-                       if (XmlName.Namespace != element_qname.Namespace && element_qname.Namespace != KnownTypeCollection.MSSimpleNamespace)
-                               serializer.Writer.WriteXmlnsAttribute (null, element_qname.Namespace);
-
-                       foreach (object o in (IEnumerable) graph) {
-                               serializer.WriteStartElement (element_qname.Name, XmlName.Namespace, CurrentNamespace);
-                               serializer.Serialize (element_type, o);
-                               serializer.WriteEndElement ();
-                       }
-               }
-
-               object CreateInstance ()
-               {
-                       if (RuntimeType.IsArray)
-                               return new ArrayList ();
-                       if (RuntimeType.IsInterface) {
-                               var icoll = GetGenericCollectionInterface (RuntimeType);
-                               if (icoll != null)
-                                       return Activator.CreateInstance (typeof (List<>).MakeGenericType (RuntimeType.GetGenericArguments () [0])); // List<T>
-                               else // non-generic
-                                       return new ArrayList ();
-                       }
-#if NET_2_1 // FIXME: is it fine?
-                       return Activator.CreateInstance (RuntimeType);
-#else
-                       return Activator.CreateInstance (RuntimeType, true);
-#endif
-               }
-
-               public override object DeserializeEmptyContent (XmlReader reader, XmlFormatterDeserializer deserializer, string id)
-               {
-                       var instance = CreateInstance ();
-                       HandleId (id, deserializer, instance);
-                       if (OnDeserializing != null)
-                               OnDeserializing.Invoke (instance, new object [] {new StreamingContext (StreamingContextStates.All)});
-                       try {
-                               if (RuntimeType.IsArray)
-                                       return ((ArrayList)instance).ToArray (element_type);
-                               else
-                                       return instance;
-                       } finally {
-                               if (OnDeserialized != null)
-                                       OnDeserialized.Invoke (instance, new object [] {new StreamingContext (StreamingContextStates.All)});
-                       }
-               }
-
-               public override object DeserializeContent (XmlReader reader, XmlFormatterDeserializer deserializer, string id)
-               {
-                       object instance = CreateInstance ();
-                       HandleId (id, deserializer, instance);
-                       if (OnDeserializing != null)
-                               OnDeserializing.Invoke (instance, new object [] {new StreamingContext (StreamingContextStates.All)});
-                       int depth = reader.NodeType == XmlNodeType.None ? reader.Depth : reader.Depth - 1;
-                       while (reader.NodeType == XmlNodeType.Element && reader.Depth > depth) {
-                               object elem = deserializer.Deserialize (element_type, reader);
-                               if (instance is IList)
-                                       ((IList)instance).Add (elem);
-                               else if (add_method != null)
-                                       add_method.Invoke (instance, new object [] {elem});
-                               else
-                                       throw new NotImplementedException (String.Format ("Type {0} is not supported", RuntimeType));
-                               reader.MoveToContent ();
-                       }
-                       try {
-                               if (RuntimeType.IsArray)
-                                       return ((ArrayList)instance).ToArray (element_type);
-                               return instance;
-                       } finally {
-                               if (OnDeserialized != null)
-                                       OnDeserialized.Invoke (instance, new object [] {new StreamingContext (StreamingContextStates.All)});
-                       }
-               }
-
-               public override List<DataMemberInfo> GetMembers ()
-               {
-                       //Shouldn't come here at all!
-                       throw new NotImplementedException ();
-               }
-       }
-
-       internal partial class DictionaryTypeMap : SerializationMap, ICollectionTypeMap
-       {
-               Type key_type, value_type;
-               QName item_qname, key_qname, value_qname;
-               MethodInfo add_method;
-               CollectionDataContractAttribute a;
-
-               public DictionaryTypeMap (
-                       Type type, CollectionDataContractAttribute a, KnownTypeCollection knownTypes)
-                       : base (type, QName.Empty, knownTypes)
-               {
-                       this.a = a;
-
-                       key_type = typeof (object);
-                       value_type = typeof (object);
-
-                       var idic = GetGenericDictionaryInterface (RuntimeType);
-                       if (idic != null) {
-                               var imap = RuntimeType.GetInterfaceMap (idic);
-                               for (int i = 0; i < imap.InterfaceMethods.Length; i++)
-                                       if (imap.InterfaceMethods [i].Name == "Add") {
-                                               add_method = imap.TargetMethods [i];
-                                               break;
-                                       }
-                               var argtypes = idic.GetGenericArguments();
-                               key_type = argtypes [0];
-                               value_type = argtypes [1];
-                               if (add_method == null)
-                                       add_method = type.GetMethod ("Add", argtypes);
-                       }
-
-                       XmlName = GetDictionaryQName ();
-                       item_qname = GetItemQName ();
-                       key_qname = GetKeyQName ();
-                       value_qname = GetValueQName ();
-               }
-
-               static Type GetGenericDictionaryInterface (Type type)
-               {
-                       foreach (var iface in type.GetInterfacesOrSelfInterface ())
-                               if (iface.IsGenericType && iface.GetGenericTypeDefinition () == typeof (IDictionary<,>))
-                                       return iface;
-
-                       return null;
-               }
-
-               string ContractNamespace {
-                       get { return a != null && !String.IsNullOrEmpty (a.Namespace) ? a.Namespace : KnownTypeCollection.MSArraysNamespace; }
-               }
-
-               public override bool IsContractAllowedType { get { return a != null; } }
-
-               public Type KeyType { get { return key_type; } }
-               public Type ValueType { get { return value_type; } }
-
-               internal virtual QName GetDictionaryQName ()
-               {
-                       string name = a != null ? a.Name : null;
-                       string ns = a != null ? a.Namespace : null;
-                       if (RuntimeType.IsGenericType && RuntimeType.GetGenericTypeDefinition () != typeof (Dictionary<,>))
-                               name = name ?? KnownTypeCollection.GetDefaultName (RuntimeType);
-                       else
-                               name = "ArrayOf" + GetItemQName ().Name;
-                       ns = ns ?? KnownTypeCollection.MSArraysNamespace;
-
-                       return new QName (name, ns);
-               }
-
-               internal virtual QName GetItemQName ()
-               {
-                       string name = a != null ? a.ItemName : null;
-                       string ns = a != null ? a.Namespace : null;
-
-                       name = name ?? "KeyValueOf" + KnownTypes.GetQName (key_type).Name + KnownTypes.GetQName (value_type).Name;
-                       ns = ns ?? (a != null ? ContractNamespace : KnownTypeCollection.MSArraysNamespace);
-
-                       return new QName (name, ns);
-               }
-
-               internal virtual QName GetKeyQName ()
-               {
-                       string name = a != null ? a.KeyName : null;
-                       string ns = a != null ? a.Namespace : null;
-
-                       name = name ?? "Key";
-                       ns = ns ?? (a != null ? ContractNamespace : KnownTypeCollection.MSArraysNamespace);
-                       return new QName (name, ns);
-               }
-
-               internal virtual QName GetValueQName ()
-               {
-                       string name = a != null ? a.ValueName : null;
-                       string ns = a != null ? a.Namespace : null;
-
-                       name = name ?? "Value";
-                       ns = ns ?? (a != null ? ContractNamespace : KnownTypeCollection.MSArraysNamespace);
-                       return new QName (name, ns);
-               }
-
-               internal virtual string CurrentNamespace {
-                       get {
-                               string ns = item_qname.Namespace;
-                               if (ns == KnownTypeCollection.MSSimpleNamespace)
-                                       ns = KnownTypeCollection.MSArraysNamespace;
-                               return ns;
-                       }
-               }
-
-               Type pair_type;
-               PropertyInfo pair_key_property, pair_value_property;
-
-               public override void SerializeNonReference (object graph,
-                       XmlFormatterSerializer serializer)
-               {
-                       if (add_method != null) { // generic
-                               if (pair_type == null) {
-                                       pair_type = typeof (KeyValuePair<,>).MakeGenericType (add_method.DeclaringType.GetGenericArguments ());
-                                       pair_key_property = pair_type.GetProperty ("Key");
-                                       pair_value_property = pair_type.GetProperty ("Value");
-                               }
-                               foreach (object p in (IEnumerable) graph) {
-                                       serializer.WriteStartElement (item_qname.Name, item_qname.Namespace, CurrentNamespace);
-                                       serializer.WriteStartElement (key_qname.Name, key_qname.Namespace, CurrentNamespace);
-                                       serializer.Serialize (pair_key_property.PropertyType, pair_key_property.GetValue (p, null));
-                                       serializer.WriteEndElement ();
-                                       serializer.WriteStartElement (value_qname.Name, value_qname.Namespace, CurrentNamespace);
-                                       serializer.Serialize (pair_value_property.PropertyType, pair_value_property.GetValue (p, null));
-                                       serializer.WriteEndElement ();
-                                       serializer.WriteEndElement ();
-                               }
-                       } else { // non-generic
-                               foreach (DictionaryEntry p in (IEnumerable) graph) {
-                                       serializer.WriteStartElement (item_qname.Name, item_qname.Namespace, CurrentNamespace);
-                                       serializer.WriteStartElement (key_qname.Name, key_qname.Namespace, CurrentNamespace);
-                                       serializer.Serialize (key_type, p.Key);
-                                       serializer.WriteEndElement ();
-                                       serializer.WriteStartElement (value_qname.Name, value_qname.Namespace, CurrentNamespace);
-                                       serializer.Serialize (value_type, p.Value);
-                                       serializer.WriteEndElement ();
-                                       serializer.WriteEndElement ();
-                               }
-                       }
-               }
-
-               object CreateInstance ()
-               {
-                       if (RuntimeType.IsInterface) {
-                               if (RuntimeType.IsGenericType && Array.IndexOf (RuntimeType.GetGenericTypeDefinition ().GetInterfaces (), typeof (IDictionary<,>)) >= 0) {
-                                       var gargs = RuntimeType.GetGenericArguments ();
-                                       return Activator.CreateInstance (typeof (Dictionary<,>).MakeGenericType (gargs [0], gargs [1])); // Dictionary<T>
-                               }
-                               else // non-generic
-                                       return new Hashtable ();
-                       }
-#if NET_2_1 // FIXME: is it fine?
-                       return Activator.CreateInstance (RuntimeType);
-#else
-                       return Activator.CreateInstance (RuntimeType, true);
-#endif
-               }
-
-               public override object DeserializeEmptyContent (XmlReader reader, XmlFormatterDeserializer deserializer, string id)
-               {
-                       object instance = CreateInstance ();
-                       HandleId (id, deserializer, instance);
-                       return instance;
-               }
-
-               public override object DeserializeContent (XmlReader reader, XmlFormatterDeserializer deserializer, string id)
-               {
-                       object instance = CreateInstance ();
-                       HandleId (id, deserializer, instance);
-                       int depth = reader.NodeType == XmlNodeType.None ? reader.Depth : reader.Depth - 1;
-                       while (reader.NodeType == XmlNodeType.Element && reader.Depth > depth) {
-                               if (reader.IsEmptyElement)
-                                       throw new XmlException (String.Format ("Unexpected empty element for dictionary entry: name {0}", reader.Name));
-                               // FIXME: sloppy parsing
-                               reader.ReadStartElement ();// item_qname.Name, item_qname.Namespace);
-                               reader.MoveToContent ();
-                               object key = deserializer.Deserialize (key_type, reader);
-                               reader.MoveToContent ();
-                               object val = deserializer.Deserialize (value_type, reader);
-                               reader.MoveToContent ();
-                               reader.ReadEndElement (); // of pair
-                               reader.MoveToContent ();
-
-                               if (instance is IDictionary)
-                                       ((IDictionary)instance).Add (key, val);
-                               else if (add_method != null)
-                                       add_method.Invoke (instance, new object [] {key, val});
-                               else
-                                       throw new NotImplementedException (String.Format ("Type {0} is not supported", RuntimeType));
-                       }
-                       return instance;
-               }
-
-               public override List<DataMemberInfo> GetMembers ()
-               {
-                       //Shouldn't come here at all!
-                       throw new NotImplementedException ();
-               }
-       }
-
-       internal partial class SharedTypeMap : SerializationMap
-       {
-               public SharedTypeMap (
-                       Type type, QName qname, KnownTypeCollection knownTypes)
-                       : base (type, qname, knownTypes)
-               {
-               }
-
-               public override bool IsContractAllowedType { get { return true; } }
-
-               public void Initialize ()
-               {
-                       Members = GetMembers (RuntimeType, XmlName, false);
-               }
-
-               List<DataMemberInfo> GetMembers (Type type, QName qname, bool declared_only)
-               {
-                       List<DataMemberInfo> data_members = new List<DataMemberInfo> ();
-                       BindingFlags flags = AllInstanceFlags | BindingFlags.DeclaredOnly;
-                       
-                       for (Type t = type; t != null; t = t.BaseType) {
-                               foreach (FieldInfo fi in t.GetFields (flags)) {
-                                       if (fi.GetCustomAttributes (
-                                               typeof (NonSerializedAttribute),
-                                               false).Length > 0)
-                                               continue;
-
-                                       if (fi.IsInitOnly)
-                                               throw new InvalidDataContractException (String.Format ("DataMember field {0} must not be read-only.", fi));
-                                       DataMemberAttribute dma = new DataMemberAttribute ();
-                                       data_members.Add (CreateDataMemberInfo (dma, fi, fi.FieldType, KnownTypeCollection.GetStaticQName (fi.DeclaringType).Namespace));
-                               }
-                       }
-
-                       data_members.Sort (DataMemberInfo.DataMemberInfoComparer.Instance); // alphabetic order.
-
-                       return data_members;
-               }
-
-               // Does this make sense? I doubt.
-               public override List<DataMemberInfo> GetMembers ()
-               {
-                       return Members;
-                       //return GetMembers (RuntimeType, XmlName, true);
-               }
-       }
-
-       internal partial class EnumMap : SerializationMap
-       {
-               List<EnumMemberInfo> enum_members;
-               bool flag_attr;
-
-               public EnumMap (
-                       Type type, QName qname, KnownTypeCollection knownTypes)
-                       : base (type, qname, knownTypes)
-               {
-                       bool has_dc = false;
-                       object [] atts = RuntimeType.GetCustomAttributes (
-                               typeof (DataContractAttribute), false);
-                       if (atts.Length != 0)
-                               has_dc = true;
-                       flag_attr = type.GetCustomAttributes (typeof (FlagsAttribute), false).Length > 0;
-
-                       enum_members = new List<EnumMemberInfo> ();
-                       BindingFlags flags = BindingFlags.Public | BindingFlags.DeclaredOnly | BindingFlags.Static;
-                       
-                       foreach (FieldInfo fi in RuntimeType.GetFields (flags)) {
-                               string name = fi.Name;
-                               if (has_dc) {
-                                       EnumMemberAttribute ema =
-                                               GetEnumMemberAttribute (fi);
-                                       if (ema == null)
-                                               continue;
-
-                                       if (ema.Value != null)
-                                               name = ema.Value;
-                               }
-
-                               enum_members.Add (new EnumMemberInfo (name, fi.GetValue (null)));
-                       }
-               }
-
-               public override bool IsContractAllowedType { get { return false; } }
-
-               private EnumMemberAttribute GetEnumMemberAttribute (
-                       MemberInfo mi)
-               {
-                       object [] atts = mi.GetCustomAttributes (
-                               typeof (EnumMemberAttribute), false);
-                       if (atts.Length == 0)
-                               return null;
-                       return (EnumMemberAttribute) atts [0];
-               }
-
-               public override void Serialize (object graph,
-                       XmlFormatterSerializer serializer)
-               {
-                       if (flag_attr) {
-                               long val = Convert.ToInt64 (graph);
-                               string s = null;
-                               foreach (EnumMemberInfo emi in enum_members) {
-                                       long f = Convert.ToInt64 (emi.Value);
-                                       if (f == val) {
-                                               s = emi.XmlName;
-                                               break;
-                                       }
-                                       if ((f & val) == f)
-                                               s += (s != null ? " " : String.Empty) + emi.XmlName;
-                               }
-                               if (s != null)
-                                       serializer.Writer.WriteString (s);
-                               return;
-                       } else {
-                               foreach (EnumMemberInfo emi in enum_members) {
-                                       if (Enum.Equals (emi.Value, graph)) {
-                                               serializer.Writer.WriteString (emi.XmlName);
-                                               return;
-                                       }
-                               }
-                       }
-
-                       throw new SerializationException (String.Format (
-                               "Enum value '{0}' is invalid for type '{1}' and cannot be serialized.", graph, RuntimeType));
-               }
-
-               public override object DeserializeEmptyContent (XmlReader reader, XmlFormatterDeserializer deserializer, string id)
-               {
-                       if (!flag_attr)
-                               throw new SerializationException (String.Format ("Enum value '' is invalid for type '{0}' and cannot be deserialized.", RuntimeType));
-                       var instance = Enum.ToObject (RuntimeType, 0);
-                       HandleId (id, deserializer, instance);
-                       return instance;
-               }
-
-               public override object DeserializeContent (XmlReader reader, XmlFormatterDeserializer deserializer, string id)
-               {
-                       string value = reader.NodeType != XmlNodeType.Text ? String.Empty : reader.ReadContentAsString ();
-                       HandleId (id, deserializer, value);
-
-                       if (value != String.Empty) {
-                               if (flag_attr && value.IndexOf (' ') != -1) {
-                                       long flags = 0L;
-                                       foreach (string flag in value.Split (' ')) {
-                                               foreach (EnumMemberInfo emi in enum_members) {
-                                                       if (emi.XmlName == flag) {
-                                                               flags |= Convert.ToInt64 (emi.Value);
-                                                               break;
-                                                       }
-                                               }
-                                       }
-                                       return Enum.ToObject (RuntimeType, flags);
-                               }
-                               else {
-                                       foreach (EnumMemberInfo emi in enum_members)
-                                               if (emi.XmlName == value)
-                                                       return emi.Value;
-                               }
-                       }
-
-                       if (!flag_attr)
-                               throw new SerializationException (String.Format ("Enum value '{0}' is invalid for type '{1}' and cannot be deserialized.", value, RuntimeType));
-                       return Enum.ToObject (RuntimeType, 0);
-               }
-       }
-
-       internal struct EnumMemberInfo
-       {
-               public readonly string XmlName;
-               public readonly object Value;
-
-               public EnumMemberInfo (string name, object value)
-               {
-                       XmlName = name;
-                       Value = value;
-               }
-       }
-
-       internal class DataMemberInfo //: KeyValuePair<int, MemberInfo>
-       {
-               public readonly int Order;
-               public readonly bool IsRequired;
-               public readonly string XmlName;
-               public readonly MemberInfo Member;
-               public readonly string XmlNamespace;
-               public readonly string XmlRootNamespace;
-               public readonly Type MemberType;
-
-               public DataMemberInfo (MemberInfo member, DataMemberAttribute dma, string rootNamespce, string ns)
-               {
-                       if (dma == null)
-                               throw new ArgumentNullException ("dma");
-                       Order = dma.Order;
-                       Member = member;
-                       IsRequired = dma.IsRequired;
-                       XmlName = XmlConvert.EncodeLocalName (dma.Name != null ? dma.Name : member.Name);
-                       XmlNamespace = ns;
-                       XmlRootNamespace = rootNamespce;
-                       if (Member is FieldInfo)
-                               MemberType = ((FieldInfo) Member).FieldType;
-                       else
-                               MemberType = ((PropertyInfo) Member).PropertyType;
-               }
-
-               public class DataMemberInfoComparer : IComparer<DataMemberInfo>
-                       , IComparer // see bug #76361
-               {
-                       public static readonly DataMemberInfoComparer Instance
-                               = new DataMemberInfoComparer ();
-
-                       private DataMemberInfoComparer () {}
-
-                       public int Compare (object o1, object o2)
-                       {
-                               return Compare ((DataMemberInfo) o1,
-                                       (DataMemberInfo) o2);
-                       }
-
-                       public int Compare (DataMemberInfo d1, DataMemberInfo d2)
-                       {
-                               if (d1.Order == d2.Order)
-                                       return String.CompareOrdinal (d1.XmlName, d2.XmlName);
-
-                               return d1.Order - d2.Order;
-                       }
-               }
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/XmlFormatterDeserializer.cs b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/XmlFormatterDeserializer.cs
deleted file mode 100644 (file)
index a0a9632..0000000
+++ /dev/null
@@ -1,304 +0,0 @@
-//
-// XmlFormatterDeserializer.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Reflection;
-using System.Runtime.Serialization.Formatters.Binary;
-using System.Xml;
-using System.Xml.Schema;
-
-using QName = System.Xml.XmlQualifiedName;
-
-namespace System.Runtime.Serialization
-{
-       internal class XmlFormatterDeserializer
-       {
-               KnownTypeCollection types;
-               IDataContractSurrogate surrogate;
-               DataContractResolver resolver, default_resolver; // new in 4.0.
-               // 3.5 SP1 supports deserialization by reference (id->obj).
-               // Though unlike XmlSerializer, it does not support forward-
-               // reference resolution i.e. a referenced object must appear
-               // before any references to it.
-               Dictionary<string,object> references = new Dictionary<string,object> ();
-               Dictionary<QName,Type> resolved_qnames = new Dictionary<QName,Type> ();
-
-               public static object Deserialize (XmlReader reader, Type declaredType,
-                       KnownTypeCollection knownTypes, IDataContractSurrogate surrogate, DataContractResolver resolver, DataContractResolver defaultResolver,
-                       string name, string ns, bool verifyObjectName)
-               {
-                       reader.MoveToContent ();
-                       if (verifyObjectName)
-                               if (reader.NodeType != XmlNodeType.Element ||
-                                   reader.LocalName != name ||
-                                   reader.NamespaceURI != ns)
-                                       throw new SerializationException (String.Format ("Expected element '{0}' in namespace '{1}', but found {2} node '{3}' in namespace '{4}'", name, ns, reader.NodeType, reader.LocalName, reader.NamespaceURI));
-//                             Verify (knownTypes, declaredType, name, ns, reader);
-                       return new XmlFormatterDeserializer (knownTypes, surrogate, resolver, defaultResolver).Deserialize (declaredType, reader);
-               }
-
-               // Verify the top element name and namespace.
-               private static void Verify (KnownTypeCollection knownTypes, Type type, string name, string Namespace, XmlReader reader)
-               {
-                       QName graph_qname = new QName (reader.LocalName, reader.NamespaceURI);
-                       if (graph_qname.Name == name && graph_qname.Namespace == Namespace)
-                               return;
-
-                       // <BClass .. i:type="EClass" >..</BClass>
-                       // Expecting type EClass : allowed
-                       // See test Serialize1b, and Serialize1c (for
-                       // negative cases)
-
-                       // Run through inheritance heirarchy .. 
-                       for (Type baseType = type; baseType != null; baseType = baseType.BaseType)
-                               if (knownTypes.GetQName (baseType) == graph_qname)
-                                       return;
-
-                       QName typeQName = knownTypes.GetQName (type);
-                       throw new SerializationException (String.Format (
-                               "Expecting element '{0}' from namespace '{1}'. Encountered 'Element' with name '{2}', namespace '{3}'",
-                               typeQName.Name, typeQName.Namespace, graph_qname.Name, graph_qname.Namespace));
-               }
-
-               private XmlFormatterDeserializer (
-                       KnownTypeCollection knownTypes,
-                       IDataContractSurrogate surrogate,
-                       DataContractResolver resolver,
-                       DataContractResolver defaultResolver)
-               {
-                       this.types = knownTypes;
-                       this.surrogate = surrogate;
-                       this.resolver = resolver;
-                       this.default_resolver = defaultResolver;
-               }
-
-               public Dictionary<string,object> References {
-                       get { return references; }
-               }
-
-               XmlDocument document;
-               
-               XmlDocument XmlDocument {
-                       get { return (document = document ?? new XmlDocument ()); }
-               }
-
-               // This method handles z:Ref, xsi:nil and primitive types, and then delegates to DeserializeByMap() for anything else.
-
-               public object Deserialize (Type type, XmlReader reader)
-               {
-                       if (type == typeof (XmlElement))
-                               return XmlDocument.ReadNode (reader);
-                       else if (type == typeof (XmlNode [])) {
-                               reader.ReadStartElement ();
-                               var l = new List<XmlNode> ();
-                               for(; !reader.EOF && reader.NodeType != XmlNodeType.EndElement; reader.MoveToContent ())
-                                       l.Add (XmlDocument.ReadNode (reader));
-                               reader.ReadEndElement ();
-                               return l.ToArray ();
-                       }
-                       QName graph_qname = null;
-                       
-                       if (type.IsGenericType && type.GetGenericTypeDefinition () == typeof (Nullable<>)) {
-                               Type internal_type = type.GetGenericArguments () [0];
-                               
-                               if (types.FindUserMap(internal_type) != null) {
-                                       graph_qname = types.GetQName (internal_type);
-                               }
-                       }
-                       
-                       if (graph_qname == null)
-                               graph_qname = types.GetQName (type);
-                               
-                       string itype = reader.GetAttribute ("type", XmlSchema.InstanceNamespace);
-                       if (itype != null) {
-                               string [] parts = itype.Split (':');
-                               if (parts.Length > 1)
-                                       graph_qname = new QName (parts [1], reader.LookupNamespace (reader.NameTable.Get (parts [0])));
-                               else
-                                       graph_qname = new QName (itype, reader.LookupNamespace (String.Empty));
-                       }
-
-                       string label = reader.GetAttribute ("Ref", KnownTypeCollection.MSSimpleNamespace);
-                       if (label != null) {
-                               object o;
-                               if (!references.TryGetValue (label, out o))
-                                       throw new SerializationException (String.Format ("Deserialized object with reference Id '{0}' was not found", label));
-                               reader.Skip ();
-                               return o;
-                       }
-
-                       bool isNil = reader.GetAttribute ("nil", XmlSchema.InstanceNamespace) == "true";
-
-                       if (isNil) {
-                               reader.Skip ();
-                               if (!type.IsValueType || type == typeof (void))
-                                       return null;
-                               else if (type.IsGenericType && type.GetGenericTypeDefinition () == typeof (Nullable<>))
-                                       return null;
-                               else 
-                                       throw new SerializationException (String.Format ("Value type {0} cannot be null.", type));
-                       }
-
-                       if (resolver != null) {
-                               Type t;
-                               if (resolved_qnames.TryGetValue (graph_qname, out t))
-                                       type = t;
-                               else { // i.e. resolve name only once.
-                                       type = resolver.ResolveName (graph_qname.Name, graph_qname.Namespace, type, default_resolver) ?? type;
-                                       resolved_qnames.Add (graph_qname, type);
-                                       types.Add (type);
-                               }
-                       }
-
-                       if (KnownTypeCollection.GetPrimitiveTypeFromName (graph_qname) != null) {
-                               string id = reader.GetAttribute ("Id", KnownTypeCollection.MSSimpleNamespace);
-
-                               object ret = DeserializePrimitive (type, reader, graph_qname);
-
-                               if (id != null) {
-                                       if (references.ContainsKey (id))
-                                               throw new InvalidOperationException (String.Format ("Object with Id '{0}' already exists as '{1}'", id, references [id]));
-                                       references.Add (id, ret);
-                               }
-                               return ret;
-                       }
-
-                       return DeserializeByMap (graph_qname, type, reader);
-               }
-
-               object DeserializePrimitive (Type type, XmlReader reader, QName qname)
-               {
-                       bool isDateTimeOffset = false;
-                       // Handle DateTimeOffset type and DateTimeOffset?.
-                       if (type == typeof (DateTimeOffset))
-                               isDateTimeOffset = true;
-                       else if(type.IsGenericType && type.GetGenericTypeDefinition () == typeof (Nullable<>)) 
-                               isDateTimeOffset = type.GetGenericArguments () [0] == typeof (DateTimeOffset);  
-                       // It is the only exceptional type that does not serialize to string but serializes into complex element.
-                       if (isDateTimeOffset) {
-                               if (reader.IsEmptyElement) {
-                                       reader.Read ();
-                                       return default (DateTimeOffset);
-                               }
-                               reader.ReadStartElement ();
-                               reader.MoveToContent ();
-                               var date = reader.ReadElementContentAsDateTime ("DateTime", KnownTypeCollection.DefaultClrNamespaceSystem);
-                               var off = TimeSpan.FromMinutes (reader.ReadElementContentAsInt ("OffsetMinutes", KnownTypeCollection.DefaultClrNamespaceSystem));
-                               reader.MoveToContent ();
-                               reader.ReadEndElement ();
-                               return new DateTimeOffset (DateTime.SpecifyKind (date.ToUniversalTime () + off, DateTimeKind.Unspecified), off);
-                       }
-
-                       string value;
-                       if (reader.IsEmptyElement) {
-                               reader.Read (); // advance
-                               if (type.IsValueType)
-                                       return Activator.CreateInstance (type);
-                               else
-                                       // FIXME: Workaround for creating empty objects of the correct type.
-                                       value = String.Empty;
-                       }
-                       else
-                               value = reader.ReadElementContentAsString ();
-                       return KnownTypeCollection.PredefinedTypeStringToObject (value, qname.Name, reader);
-               }
-
-               object DeserializeByMap (QName name, Type type, XmlReader reader)
-               {
-                       SerializationMap map = null;
-                       // List<T> and T[] have the same QName, use type to find map work better.
-                       if(name.Name.StartsWith ("ArrayOf", StringComparison.Ordinal) || resolved_qnames.ContainsKey (name))
-                               map = types.FindUserMap (type);
-                       else
-                               map = types.FindUserMap (name); // use type when the name is "resolved" one. Otherwise use name (there are cases that type cannot be resolved by type).
-                       if (map == null && (name.Name.StartsWith ("ArrayOf", StringComparison.Ordinal) ||
-                           name.Namespace == KnownTypeCollection.MSArraysNamespace ||
-                           name.Namespace.StartsWith (KnownTypeCollection.DefaultClrNamespaceBase, StringComparison.Ordinal))) {
-                               var it = GetTypeFromNamePair (name.Name, name.Namespace);
-                               types.Add (it);
-                               map = types.FindUserMap (name);
-                       }
-                       if (map == null)
-                               throw new SerializationException (String.Format ("Unknown type {0} is used for DataContract with reference of name {1}. Any derived types of a data contract or a data member should be added to KnownTypes.", type, name));
-
-                       return map.DeserializeObject (reader, this);
-               }
-
-               Type GetTypeFromNamePair (string name, string ns)
-               {
-                       Type p = KnownTypeCollection.GetPrimitiveTypeFromName (new QName (name, ns));
-                       if (p != null)
-                               return p;
-                       bool makeArray = false;
-                       if (name.StartsWith ("ArrayOf", StringComparison.Ordinal)) {
-                               name = name.Substring (7); // strip "ArrayOf"
-                               if (ns == KnownTypeCollection.MSArraysNamespace)
-                                       return GetTypeFromNamePair (name, KnownTypeCollection.MSSimpleNamespace).MakeArrayType ();
-                               makeArray = true;
-                       }
-
-                       string dnsb = KnownTypeCollection.DefaultClrNamespaceBase;
-                       string clrns = ns.StartsWith (dnsb, StringComparison.Ordinal) ?  ns.Substring (dnsb.Length) : ns;
-
-                       foreach (var ass in AppDomain.CurrentDomain.GetAssemblies ()) {
-                               Type [] types;
-
-                               types = ass.GetTypes ();
-                               if (types == null)
-                                       continue;
-
-                               foreach (var t in types) {
-                                       // there can be null entries or exception throw to access the attribute - 
-                                       // at least when some referenced assemblies could not be loaded (affects moonlight)
-                                       if (t == null)
-                                               continue;
-
-                                       try {
-                                               var dca = t.GetCustomAttribute<DataContractAttribute> (true);
-                                               if (dca != null && dca.Name == name && dca.Namespace == ns)
-                                                       return makeArray ? t.MakeArrayType () : t;
-                                       }
-                                       catch (TypeLoadException tle) {
-                                               Console.Error.WriteLine (tle);
-                                               continue;
-                                       }
-                                       catch (FileNotFoundException fnfe) {
-                                               Console.Error.WriteLine (fnfe);
-                                               continue;
-                                       }
-
-                                       if (clrns != null && t.Name == name && t.Namespace == clrns)
-                                               return makeArray ? t.MakeArrayType () : t;
-                               }
-                       }
-                       throw new XmlException (String.Format ("Type not found; name: {0}, namespace: {1}", name, ns));
-               }
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/XmlFormatterSerializer.cs b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/XmlFormatterSerializer.cs
deleted file mode 100644 (file)
index 4dae584..0000000
+++ /dev/null
@@ -1,213 +0,0 @@
-//
-// XmlFormatterSerializer.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Reflection;
-using System.Runtime.Serialization.Formatters.Binary;
-using System.Xml;
-using System.Xml.Schema;
-
-using QName = System.Xml.XmlQualifiedName;
-
-namespace System.Runtime.Serialization
-{
-       internal class XmlFormatterSerializer
-       {
-               XmlDictionaryWriter writer;
-               object graph;
-               KnownTypeCollection types;
-               
-               bool save_id;
-               bool ignore_unknown;
-               IDataContractSurrogate surrogate;
-               DataContractResolver resolver, default_resolver; // new in 4.0
-               int max_items;
-
-               List<object> objects = new List<object> ();
-               Dictionary<object,string> references = new Dictionary<object,string> (); // preserve possibly referenced objects to ids. (new in 3.5 SP1)
-
-               public static void Serialize (XmlDictionaryWriter writer, object graph, Type declaredType, KnownTypeCollection types,
-                       bool ignoreUnknown, int maxItems, string root_ns, bool preserveObjectReferences, DataContractResolver resolver, DataContractResolver defaultResolver)
-               {
-                       new XmlFormatterSerializer (writer, types, ignoreUnknown, maxItems, root_ns, preserveObjectReferences, resolver, defaultResolver)
-                               .Serialize (/*graph != null ? graph.GetType () : */declaredType, graph); // FIXME: I believe it should always use declaredType, but such a change brings some test breakages.
-               }
-
-               public XmlFormatterSerializer (XmlDictionaryWriter writer, KnownTypeCollection types, bool ignoreUnknown,
-                                              int maxItems, string root_ns, bool preserveObjectReferences,
-                                              DataContractResolver resolver, DataContractResolver defaultResolver)
-               {
-                       this.writer = writer;
-                       this.types = types;
-                       ignore_unknown = ignoreUnknown;
-                       max_items = maxItems;
-                       PreserveObjectReferences = preserveObjectReferences;
-                       this.resolver = resolver;
-                       this.default_resolver = defaultResolver;
-               }
-
-               public bool PreserveObjectReferences { get; private set; }
-
-               public List<object> SerializingObjects {
-                       get { return objects; }
-               }
-
-               public XmlDictionaryWriter Writer {
-                       get { return writer; }
-               }
-
-               public void Serialize (Type type, object graph)
-               {
-                       if (graph == null)
-                               writer.WriteAttributeString ("i", "nil", XmlSchema.InstanceNamespace, "true");
-                       else if (type == typeof (XmlElement))
-                               ((XmlElement) graph).WriteTo (Writer);
-                       else if (type == typeof (XmlNode [])) {
-                               foreach (var xn in (XmlNode []) graph)
-                                       xn.WriteTo (Writer);
-                       }
-                       else {
-                               QName resolvedQName = null;
-                               if (resolver != null) {
-                                       XmlDictionaryString rname, rns;
-                                       if (resolver.TryResolveType (graph != null ? graph.GetType () : typeof (object), type, default_resolver, out rname, out rns))
-                                               resolvedQName = new QName (rname.Value, rns.Value);
-                               }
-
-                               Type actualType = graph.GetType ();
-
-                               SerializationMap map;
-                               map = types.FindUserMap (actualType);
-                               // For some collection types, the actual type does not matter. So get nominal serialization type instead.
-                               // (The code below also covers the lines above, but I don't remove above lines to avoid extra search cost.)
-                               if (map == null) {
-                                       // FIXME: not sure if type.IsInterface is the correct condition to determine whether items are serialized with i:type or not. (e.g. bug #675144 server response).
-                                       actualType = types.GetSerializedType (type.IsInterface ? type : actualType);
-                                       map = types.FindUserMap (actualType);
-                               }
-                               // If it is still unknown, then register it.
-                               if (map == null) {
-                                       types.Add (actualType);
-                                       map = types.FindUserMap (actualType);
-                               }
-                               
-                               bool explicityType = false;
-                               if(type != actualType)
-                               {
-                                       // Check if underlying type of Nullable, mismatch the current type.
-                                       if(type.IsGenericType && type.GetGenericTypeDefinition () == typeof (Nullable<>))
-                                               explicityType = (type.GetGenericArguments () [0] != actualType);
-                                       else
-                                               explicityType = true;
-                               }
-
-                               if (explicityType && (map == null || map.OutputXsiType)) {
-                                       QName qname = resolvedQName ?? types.GetXmlName (actualType);
-                                       string name = qname.Name;
-                                       string ns = qname.Namespace;
-                                       if (qname == QName.Empty) {
-                                               name = XmlConvert.EncodeLocalName (actualType.Name);
-                                               ns = KnownTypeCollection.DefaultClrNamespaceBase + actualType.Namespace;
-                                       } else if (XmlSchemaType.GetBuiltInSimpleType (new QName (qname.Name, XmlSchema.Namespace)) != null)
-                                               ns = XmlSchema.Namespace;
-                                       if (writer.LookupPrefix (ns) == null) // it goes first (extraneous, but it makes att order compatible)
-                                               writer.WriteXmlnsAttribute (null, ns);
-                                       writer.WriteStartAttribute ("i", "type", XmlSchema.InstanceNamespace);
-                                       writer.WriteQualifiedName (name, ns);
-                                       writer.WriteEndAttribute ();
-                               }
-                               QName predef = KnownTypeCollection.GetPredefinedTypeName (actualType);
-                               if (predef != QName.Empty)
-                                       SerializePrimitive (type, graph, predef);
-                               else
-                                       map.Serialize (graph, this);
-                       }
-               }
-
-               public void SerializePrimitive (Type type, object graph, QName qname)
-               {
-                       string label;
-                       if (TrySerializeAsReference (false, graph, out label))
-                               return;
-                       if (label != null)
-                               Writer.WriteAttributeString ("z", "Id", KnownTypeCollection.MSSimpleNamespace, label);
-
-                       bool isDateTimeOffset = false;
-                       // Handle DateTimeOffset type and DateTimeOffset?
-                       if (type == typeof (DateTimeOffset))
-                               isDateTimeOffset = true;
-                       else if(type.IsGenericType && type.GetGenericTypeDefinition () == typeof (Nullable<>)) 
-                               isDateTimeOffset = type.GetGenericArguments () [0] == typeof (DateTimeOffset);  
-                       // It is the only exceptional type that does not serialize to string but serializes into complex element.
-                       if (isDateTimeOffset) {
-                               var v = (DateTimeOffset) graph;
-                               writer.WriteStartElement ("DateTime", KnownTypeCollection.DefaultClrNamespaceSystem);
-                               SerializePrimitive (typeof (DateTime), DateTime.SpecifyKind (v.DateTime.Subtract (v.Offset), DateTimeKind.Utc), KnownTypeCollection.GetPredefinedTypeName (typeof (DateTime)));
-                               writer.WriteEndElement ();
-                               writer.WriteStartElement ("OffsetMinutes", KnownTypeCollection.DefaultClrNamespaceSystem);
-                               SerializePrimitive (typeof (int), v.Offset.TotalMinutes, KnownTypeCollection.GetPredefinedTypeName (typeof (int)));
-                               writer.WriteEndElement ();
-                       }
-                       else
-                               writer.WriteString (KnownTypeCollection.PredefinedTypeObjectToString (graph));
-               }
-
-               public void WriteStartElement (string memberName, string memberNamespace, string contentNamespace)
-               {
-                       writer.WriteStartElement (memberName, memberNamespace);
-                       if (!string.IsNullOrEmpty (contentNamespace) && contentNamespace != memberNamespace)
-                               writer.WriteXmlnsAttribute (null, contentNamespace);
-               }
-
-               public void WriteEndElement ()
-               {
-                       writer.WriteEndElement ();
-               }
-
-               // returned bool: whether z:Ref is written or not.
-               // out label: object label either in use or newly allocated.
-               public bool TrySerializeAsReference (bool isMapReference, object graph, out string label)
-               {
-                       label = null;
-                       if (!isMapReference && (!PreserveObjectReferences || graph == null || graph.GetType ().IsValueType))
-                               return false;
-
-                       if (references.TryGetValue (graph, out label)) {
-                               Writer.WriteAttributeString ("z", "Ref", KnownTypeCollection.MSSimpleNamespace, label);
-                               label = null; // do not write label
-                               return true;
-                       }
-
-                       label = "i" + (references.Count + 1);
-                       references.Add (graph, label);
-
-                       return false;
-               }
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/XmlObjectSerializer.cs b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/XmlObjectSerializer.cs
deleted file mode 100644 (file)
index 2abb766..0000000
+++ /dev/null
@@ -1,139 +0,0 @@
-//
-// XmlObjectSerializer.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.Collections;
-using System.IO;
-using System.Text;
-using System.Reflection;
-using System.Runtime.Serialization.Formatters.Binary;
-using System.Xml;
-using System.Xml.Schema;
-
-using QName = System.Xml.XmlQualifiedName;
-
-namespace System.Runtime.Serialization
-{
-       public abstract class XmlObjectSerializer
-       {
-               // This is only for compatible mode.
-               IDataContractSurrogate surrogate;
-
-               SerializationBinder binder;
-               ISurrogateSelector selector;
-
-               int max_items = 0x10000; // FIXME: could be from config.
-
-               protected XmlObjectSerializer ()
-               {
-               }
-
-               public virtual bool IsStartObject (XmlReader reader)
-               {
-                       return IsStartObject (XmlDictionaryReader.CreateDictionaryReader (reader));
-               }
-
-               public abstract bool IsStartObject (XmlDictionaryReader reader);
-
-               public virtual object ReadObject (Stream stream)
-               {
-                       var settings = new XmlReaderSettings ();
-                       settings.CheckCharacters = false;
-                       return ReadObject (XmlReader.Create (stream, settings));
-               }
-
-               public virtual object ReadObject (XmlReader reader)
-               {
-                       return ReadObject (XmlDictionaryReader.CreateDictionaryReader (reader));
-               }
-
-               public virtual object ReadObject (XmlDictionaryReader reader)
-               {
-                       return ReadObject (reader, true);
-               }
-
-               public virtual object ReadObject (XmlReader reader, bool readContentOnly)
-               {
-                       return ReadObject (
-                               XmlDictionaryReader.CreateDictionaryReader (reader),
-                               readContentOnly);
-               }
-
-               [MonoTODO]
-               public abstract object ReadObject (XmlDictionaryReader reader, bool readContentOnly);
-
-               public virtual void WriteObject (Stream stream, object graph)
-               {
-                       var settings = new XmlWriterSettings ();
-                       settings.Encoding = Encoding.UTF8;
-                       settings.CloseOutput = false;
-                       settings.OmitXmlDeclaration = true;
-                       settings.CheckCharacters = false;
-                       using (XmlWriter xw = XmlDictionaryWriter.CreateDictionaryWriter (XmlWriter.Create (stream, settings))) {
-                               WriteObject (xw, graph);
-                       }
-               }
-
-               public virtual void WriteObject (XmlWriter writer, object graph)
-               {
-                       WriteObject (XmlDictionaryWriter.CreateDictionaryWriter (writer), graph);
-               }
-
-               public virtual void WriteStartObject (XmlWriter writer, object graph)
-               {
-                       WriteStartObject (XmlDictionaryWriter.CreateDictionaryWriter (writer), graph);
-               }
-
-               public virtual void WriteObject (XmlDictionaryWriter writer, object graph)
-               {
-                       WriteStartObject (writer, graph);
-                       WriteObjectContent (writer, graph);
-                       WriteEndObject (writer);
-               }
-
-               public abstract void WriteStartObject (
-                       XmlDictionaryWriter writer, object graph);
-
-               public virtual void WriteObjectContent (XmlWriter writer, object graph)
-               {
-                       WriteObjectContent (
-                               XmlDictionaryWriter.CreateDictionaryWriter (writer),
-                               graph);
-               }
-
-               public abstract void WriteObjectContent (
-                       XmlDictionaryWriter writer, object graph);
-
-               public virtual void WriteEndObject (XmlWriter writer)
-               {
-                       WriteEndObject (XmlDictionaryWriter.CreateDictionaryWriter (writer));
-               }
-
-               public abstract void WriteEndObject (
-                       XmlDictionaryWriter writer);
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/XmlSerializableServices.cs b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/XmlSerializableServices.cs
deleted file mode 100644 (file)
index a2cf7e6..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-//
-// XmlSerializableServices.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Xml;
-using System.Xml.Schema;
-
-using QName = System.Xml.XmlQualifiedName;
-
-namespace System.Runtime.Serialization
-{
-       public static class XmlSerializableServices
-       {
-               static Dictionary<QName, XmlSchemaSet> defaultSchemas
-                       = new Dictionary<QName, XmlSchemaSet> ();
-
-               [MonoTODO]
-               public static void AddDefaultSchema (
-                       XmlSchemaSet schemas,
-                       QName typeQName)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public static XmlNode [] ReadNodes (XmlReader xmlReader)
-               {
-                       if (xmlReader.NodeType != XmlNodeType.Element || xmlReader.IsEmptyElement)
-                               return new XmlNode [0];
-
-                       int depth = xmlReader.Depth;
-                       xmlReader.Read ();
-                       if (xmlReader.NodeType == XmlNodeType.EndElement)
-                               return new XmlNode [0];
-
-                       List<XmlNode> al = new List<XmlNode> ();
-                       XmlDocument doc = new XmlDocument ();
-                       while (xmlReader.Depth > depth & !xmlReader.EOF)
-                               al.Add (doc.ReadNode (xmlReader));
-                       return al.ToArray ();
-               }
-
-               public static void WriteNodes (XmlWriter xmlWriter,
-                       XmlNode [] nodes)
-               {
-                       foreach (XmlNode n in nodes)
-                               n.WriteTo (xmlWriter);
-               }
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/XsdDataContractExporter.cs b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/XsdDataContractExporter.cs
deleted file mode 100644 (file)
index b3959eb..0000000
+++ /dev/null
@@ -1,497 +0,0 @@
-//
-// XsdDataContractExporter.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2010 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.CodeDom;
-using System.CodeDom.Compiler;
-using System.Collections;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Reflection;
-using System.Xml;
-using System.Xml.Schema;
-using System.Xml.Serialization;
-
-using QName = System.Xml.XmlQualifiedName;
-
-//
-// .NET exports almost empty schema for "http://www.w3.org/2001/XMLSchema" that
-// contains only "schema" element which consists of a complexType with empty
-// definition (i.e. <complexType/> ).
-//
-
-namespace System.Runtime.Serialization
-{
-       public class XsdDataContractExporter
-       {
-               class TypeImportInfo
-               {
-                       public Type ClrType { get; set; }
-                       public QName RootElementName { get; set; }
-                       public XmlSchemaType SchemaType { get; set; }
-                       public QName  SchemaTypeName { get; set; }
-               }
-
-               static readonly List<TypeImportInfo> predefined_types;
-
-               static XsdDataContractExporter ()
-               {
-                       var l = new List<TypeImportInfo> ();
-                       predefined_types = l;
-                       if (!MSTypesSchema.IsCompiled)
-                               MSTypesSchema.Compile (null);
-                       foreach (XmlSchemaElement el in MSTypesSchema.Elements.Values) {
-                               var typeName = el.ElementSchemaType.QualifiedName;
-                               var info = new TypeImportInfo () {
-                                       RootElementName = el.QualifiedName,
-                                       SchemaType = typeName.Namespace == XmlSchema.Namespace ? null : el.ElementSchemaType,
-                                       SchemaTypeName = typeName,
-                                       ClrType = GetPredefinedTypeFromQName (typeName) };
-                               l.Add (info);
-                       }
-               }
-
-               // Note that this does not handle DBNull and DateTimeOffset
-               // (they are not included in the predefined schema)
-               static Type GetPredefinedTypeFromQName (QName qname)
-               {
-                       switch (qname.Namespace) {
-                       case XmlSchema.Namespace:
-                       case KnownTypeCollection.MSSimpleNamespace:
-                               return KnownTypeCollection.GetPrimitiveTypeFromName (qname);
-                       }
-                       throw new Exception ("Should not happen");
-               }
-
-               static XmlSchema mstypes_schema;
-               static XmlSchema MSTypesSchema {
-                       get {
-                               if (mstypes_schema == null) {
-                                       Assembly a = Assembly.GetCallingAssembly ();
-                                       Stream s = a.GetManifestResourceStream ("mstypes.schema");
-                                       mstypes_schema= XmlSchema.Read (s, null);
-                               }
-                               return mstypes_schema;
-                       }
-               }
-
-               KnownTypeCollection known_types = new KnownTypeCollection ();
-               List<TypeImportInfo> imported_types = new List<TypeImportInfo> ();
-
-               public XsdDataContractExporter ()
-                       : this (new XmlSchemaSet ())
-               {
-               }
-               
-               public XsdDataContractExporter (XmlSchemaSet schemas)
-               {
-                       if (schemas == null)
-                               throw new ArgumentNullException ("schemas");
-#if false // by default this is the only added schema. But it is pointless...
-                       var xs = new XmlSchema () { TargetNamespace = XmlSchema.Namespace };
-                       xs.Items.Add (new XmlSchemaElement () { Name = "schema", SchemaType = new XmlSchemaComplexType () });
-                       schemas.Add (xs);
-#else // FIXME: it is added only when the included items are in use.
-                       schemas.Add (MSTypesSchema);
-#endif
-                       Schemas = schemas;
-               }
-               
-               public ExportOptions Options { get; set; }
-               public XmlSchemaSet Schemas { get; private set; }
-
-               // CanExport implementation
-
-               public bool CanExport (ICollection<Assembly> assemblies)
-               {
-                       if (assemblies == null)
-                               throw new ArgumentNullException ("assemblies");
-                       foreach (var ass in assemblies)
-                               if (!CanExport (ass.GetTypes ()))
-                                       return false;
-                       return true;
-               }
-               
-               public bool CanExport (ICollection<Type> types)
-               {
-                       if (types == null)
-                               throw new ArgumentNullException ("types");
-                       foreach (var type in types)
-                               if (!CanExport (type))
-                                       return false;
-                       return true;
-               }
-               
-               public bool CanExport (Type type)
-               {
-                       if (type == null)
-                               throw new ArgumentNullException ("type");
-
-                       if (predefined_types.FirstOrDefault (i => i.ClrType == type) != null)
-                               return true;
-
-                       known_types.Add (type);
-                       return known_types.FindUserMap (type) != null;
-               }
-
-               // Export implementation
-
-               public void Export (ICollection<Assembly> assemblies)
-               {
-                       if (assemblies == null)
-                               throw new ArgumentNullException ("assemblies");
-                       foreach (var ass in assemblies)
-                               Export (ass.GetTypes ());
-               }
-               
-               public void Export (ICollection<Type> types)
-               {
-                       if (types == null)
-                               throw new ArgumentNullException ("types");
-                       foreach (var type in types)
-                               Export (type);
-               }
-               
-               public void Export (Type type)
-               {
-                       if (ExportCore (type, true)) {
-                               // This reprocess is required to clean up compilation state.
-                               foreach (XmlSchema xs in Schemas.Schemas ())
-                                       Schemas.Reprocess (xs);
-                               Schemas.Compile ();
-                       }
-               }
-
-               // returns true if it requires recompilcation
-               bool ExportCore (Type type, bool rejectNonContract)
-               {
-                       if (type == null)
-                               throw new ArgumentNullException ("type");
-
-                       if (predefined_types.FirstOrDefault (i => i.ClrType == type) != null) {
-                               if (Schemas.Contains (MSTypesSchema.TargetNamespace))
-                                       return false; // exists
-                               Schemas.Add (MSTypesSchema);
-                               return false;
-                       }
-                       if (imported_types.FirstOrDefault (i => i.ClrType == type) != null)
-                               return false;
-
-                       known_types.Add (type);
-                       var map = known_types.FindUserMap (type);
-                       if (map == null)
-                               return false;
-                       map.ExportSchemaType (this);
-                       return true;
-               }
-               
-               internal void ExportDictionaryContractType (CollectionDataContractAttribute attr, SerializationMap map, Type dicType)
-               {
-                       var type = map.RuntimeType;
-                       var qname = map.XmlName;
-
-                       var typeArgs = dicType.IsGenericType ? dicType.GetGenericArguments () : null;
-                       var keyType = typeArgs != null ? typeArgs [0] : typeof (object);
-                       var valueType = typeArgs != null ? typeArgs [1] : typeof (object);
-                       ExportCore (keyType, false);
-                       ExportCore (valueType, false);
-
-                       string keyName = "Key", valueName = "Value";
-                       if (attr != null) {
-                               keyName = attr.KeyName ?? keyName;
-                               valueName = attr.ValueName ?? valueName;
-                       }
-                       string itemName = attr != null && attr.ItemName != null ? attr.ItemName : "KeyValueOf" + keyName + valueName;
-
-                       var ct = CreateComplexType (qname, type);
-                       var appInfo = new XmlSchemaAppInfo ();
-                       var node = new XmlDocument ().CreateElement ("IsDictionary", KnownTypeCollection.MSSimpleNamespace);
-                       node.InnerText = "true";
-                       appInfo.Markup = new XmlNode [] { node };
-                       ct.Annotation = new XmlSchemaAnnotation ();
-                       ct.Annotation.Items.Add (appInfo);
-
-                       var seq = new XmlSchemaSequence ();
-                       ct.Particle = seq;
-                       var el = new XmlSchemaElement () { Name = itemName, MinOccurs = 0, MaxOccursString = "unbounded" };
-                       seq.Items.Add (el);
-
-                       var dictType = new XmlSchemaComplexType ();
-                       el.SchemaType = dictType;
-                       var dictSeq = new XmlSchemaSequence ();
-                       dictType.Particle = dictSeq;
-                       dictSeq.Items.Add (new XmlSchemaElement () { Name = keyName, SchemaTypeName = GetSchemaTypeName (keyType), IsNillable = true });
-                       dictSeq.Items.Add (new XmlSchemaElement () { Name = valueName, SchemaTypeName = GetSchemaTypeName (valueType), IsNillable = true });
-               }
-               
-               internal void ExportListContractType (CollectionDataContractAttribute attr, CollectionTypeMap map)
-               {
-                       Type type = map.RuntimeType;
-                       var qname = map.XmlName;
-
-                       var typeArgs = type.IsGenericType ? type.GetGenericArguments () : null;
-                       if (typeArgs != null && typeArgs.Length != 1)
-                               throw new InvalidDataContractException ("CollectionDataContractAttribute is applied to non-collection type.");
-
-                       var itemType = typeArgs != null ? typeArgs [0] : type.IsArray ? type.GetElementType () : typeof (object);
-                       bool nullable = !itemType.IsValueType;
-                       if (itemType.IsGenericType && itemType.GetGenericTypeDefinition () == typeof (Nullable<>)) {
-                               itemType = itemType.GetGenericArguments () [0];
-                               nullable = true;
-                       }
-                       ExportCore (itemType, false);
-
-                       var itemQName = GetSchemaTypeName (itemType);
-                       var itemName = attr != null && attr.ItemName != null ? attr.ItemName : itemQName.Name;
-
-                       var ct = CreateComplexType (qname, type);
-                       var seq = new XmlSchemaSequence ();
-                       ct.Particle = seq;
-                       var el = new XmlSchemaElement () { Name = itemName, MinOccurs = 0, MaxOccursString = "unbounded", SchemaTypeName = itemQName, IsNillable = nullable };
-                       seq.Items.Add (el);
-
-                       /*
-                       var arrayType = new XmlSchemaComplexType ();
-                       el.SchemaType = arrayType;
-                       var arraySeq = new XmlSchemaSequence ();
-                       arrayType.Particle = arraySeq;
-                       arraySeq.Items.Add (new XmlSchemaElement () { Name = itemName, SchemaTypeName = itemQName, IsNillable = true });
-                       */
-               }
-
-               internal void ExportEnumContractType (DataContractAttribute attr, SerializationMap map)
-               {
-                       Type type = map.RuntimeType;
-                       var qname = map.XmlName;
-                       var st = CreateSimpleType (qname, type);
-                       if (type.GetCustomAttribute<FlagsAttribute> (false) != null) {
-                               var list = new XmlSchemaSimpleTypeList ();
-                               var sct = new XmlSchemaSimpleType ();
-                               sct.Content = CreateEnumMembers (type, attr != null);
-                               list.ItemType = sct;
-                               st.Content = list;
-                       }
-                       else
-                               st.Content = CreateEnumMembers (type, attr != null);
-               }
-
-               XmlSchemaSimpleTypeRestriction CreateEnumMembers (Type type, bool expectAttribute)
-               {
-                       var r = new XmlSchemaSimpleTypeRestriction () { BaseTypeName = GetSchemaTypeName (typeof (string)) };
-                       foreach (var mi in type.GetFields (BindingFlags.Public | BindingFlags.Static)) {
-                               var ema = expectAttribute ? mi.GetCustomAttribute<EnumMemberAttribute> (false) : null;
-                               if (expectAttribute && ema == null)
-                                       continue;
-                               var xe = new XmlSchemaEnumerationFacet () { Value = ema != null && ema.Value != null ? ema.Value : mi.Name };
-                               r.Facets.Add (xe);
-                       }
-                       return r;
-               }
-
-               internal void ExportStandardComplexType (DataContractAttribute attr, SerializationMap map, List<DataMemberInfo> members)
-               {
-                       Type type = map.RuntimeType;
-                       var qname = map.XmlName;
-                       var ct = CreateComplexType (qname, type);
-
-                       if (type.BaseType != null && type.BaseType != typeof (object)) {
-                               ExportCore (type.BaseType, false);
-                               var xcc = new XmlSchemaComplexContent ();
-                               ct.ContentModel = xcc;
-                               var xcce = new XmlSchemaComplexContentExtension ();
-                               xcc.Content = xcce;
-                               xcce.BaseTypeName = GetSchemaTypeName (type.BaseType);
-                               xcce.Particle = CreateMembersSequence (type, members, attr != null);
-                       }
-                       else
-                               ct.Particle = CreateMembersSequence (type, members, attr != null);
-               }
-
-               XmlSchemaSimpleType CreateSimpleType (QName qname, Type type)
-               {
-                       var xs = GetSchema (qname.Namespace);
-
-                       var el = new XmlSchemaElement () { Name = qname.Name, IsNillable = true };
-                       el.SchemaTypeName = qname;
-                       xs.Items.Add (el);
-                       var st = new XmlSchemaSimpleType () { Name = qname.Name };
-                       xs.Items.Add (st);
-                       imported_types.Add (new TypeImportInfo () { RootElementName = qname, SchemaType = st, SchemaTypeName = qname,  ClrType = type });
-
-                       return st;
-               }
-
-               XmlSchemaComplexType CreateComplexType (QName qname, Type type)
-               {
-                       var xs = GetSchema (qname.Namespace);
-
-                       var el = new XmlSchemaElement () { Name = qname.Name, IsNillable = true };
-                       el.SchemaTypeName = qname;
-                       xs.Items.Add (el);
-                       var ct = new XmlSchemaComplexType () { Name = qname.Name };
-                       xs.Items.Add (ct);
-                       imported_types.Add (new TypeImportInfo () { RootElementName = qname, SchemaType = ct, SchemaTypeName = qname,  ClrType = type });
-
-                       return ct;
-               }
-
-               static int CompareMembers (MemberInfo m1, MemberInfo m2)
-               {
-                       var a1 = m1.GetCustomAttribute<DataMemberAttribute> (false);
-                       var a2 = m2.GetCustomAttribute<DataMemberAttribute> (false);
-                       return a1.Order == a2.Order ? String.CompareOrdinal (a1.Name ?? m1.Name, a2.Name ?? m2.Name) : a1.Order - a2.Order;
-               }
-
-               // FIXME: use members parameter to determine which members are to be exported.
-               XmlSchemaSequence CreateMembersSequence (Type type, List<DataMemberInfo> dataMembers, bool expectContract)
-               {
-                       var seq = new XmlSchemaSequence ();
-                       var members = new List<MemberInfo> ();
-                       var flags = BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly;
-                       if (expectContract)
-                               flags |= BindingFlags.NonPublic;
-
-                       foreach (var mi in type.GetFields (flags))
-                               if (!expectContract || mi.GetCustomAttribute<DataMemberAttribute> (false) != null)
-                                       members.Add (mi);
-                       foreach (var mi in type.GetProperties (flags))
-                               if ((!expectContract || mi.GetCustomAttribute<DataMemberAttribute> (false) != null) && mi.GetIndexParameters ().Length == 0)
-                                       members.Add (mi);
-
-                       if (expectContract)
-                               members.Sort (CompareMembers);
-
-                       foreach (var mi in members) {
-                               var dma = mi.GetCustomAttribute<DataMemberAttribute> (false);
-                               var fi = mi as FieldInfo;
-                               var pi = mi as PropertyInfo;
-                               var mt = fi != null ? fi.FieldType : pi.PropertyType;
-                               bool nullable = !mt.IsValueType;
-                               if (mt.IsGenericType && mt.GetGenericTypeDefinition () == typeof (Nullable<>)) {
-                                       mt = mt.GetGenericArguments () [0];
-                                       nullable = true;
-                               }
-                               ExportCore (mt, false);
-
-                               var name = dma != null && dma.Name != null ? dma.Name : mi.Name;
-                               var xe = new XmlSchemaElement () { Name = name, IsNillable = nullable };
-                               xe.SchemaTypeName = GetSchemaTypeName (mt);
-                               seq.Items.Add (xe);
-                       }
-                       return seq;
-               }
-
-               XmlSchema GetSchema (string ns)
-               {
-                       foreach (XmlSchema xs in Schemas.Schemas (ns))
-                               return xs;
-                       var nxs = new XmlSchema () { ElementFormDefault = XmlSchemaForm.Qualified };
-                       if (!String.IsNullOrEmpty (ns))
-                               nxs.TargetNamespace = ns;
-                       Schemas.Add (nxs);
-                       return nxs;
-               }
-
-               string GetXmlTypeName (Type type)
-               {
-                       var qname = KnownTypeCollection.GetPrimitiveTypeName (type);
-                       if (!qname.Equals (QName.Empty))
-                               return qname.Name;
-                       var ret = type.Name;
-                       int idx = ret.IndexOf ('`');
-                       return idx < 0 ? ret : ret.Substring (0, idx);
-               }
-
-               string GetXmlNamespace (Type type)
-               {
-                       foreach (ContractNamespaceAttribute a in type.Assembly.GetCustomAttributes (typeof (ContractNamespaceAttribute), false))
-                               if (a.ClrNamespace == type.Namespace)
-                                       return a.ContractNamespace;
-                       return KnownTypeCollection.DefaultClrNamespaceBase + type.Namespace;
-               }
-
-               // get mapping info (either exported or predefined).
-
-               public QName GetRootElementName (Type type)
-               {
-                       var info = predefined_types.FirstOrDefault (i => i.ClrType == type);
-                       if (info != null)
-                               return info.RootElementName;
-                       info = imported_types.FirstOrDefault (i => i.ClrType == type);
-                       if (info != null && info.RootElementName != null)
-                               return info.RootElementName;
-
-                       return GetSchemaTypeName (type);
-               }
-               
-               public XmlSchemaType GetSchemaType (Type type)
-               {
-                       var info = predefined_types.FirstOrDefault (i => i.ClrType == type);
-                       if (info != null)
-                               return info.SchemaType;
-                       info = imported_types.FirstOrDefault (i => i.ClrType == type);
-                       if (info != null)
-                               return info.SchemaType;
-
-                       return null;
-               }
-               
-               public QName GetSchemaTypeName (Type type)
-               {
-                       var info = predefined_types.FirstOrDefault (i => i.ClrType == type);
-                       if (info != null)
-                               return info.SchemaTypeName;
-                       info = imported_types.FirstOrDefault (i => i.ClrType == type);
-                       if (info != null && info.SchemaTypeName != null)
-                               return info.SchemaTypeName;
-
-                       known_types.Add (type);
-                       var map = known_types.FindUserMap (type);
-                       if (map != null)
-                               return map.XmlName;
-
-                       // The following lines would be mostly redundant (legacy code now that it widely uses SerializationMap.XmlName for consistency...)
-
-                       var cdca = type.GetCustomAttribute<CollectionDataContractAttribute> (false);
-                       if (cdca != null)
-                               return new QName (cdca.Name ?? GetXmlTypeName (type), cdca.Namespace ?? GetXmlNamespace (type));
-                       var dca = type.GetCustomAttribute<DataContractAttribute> (false);
-                       if (dca != null)
-                               return new QName (dca.Name ?? GetXmlTypeName (type), dca.Namespace ?? GetXmlNamespace (type));
-
-                       if (type.IsArray) {
-                               var item = GetSchemaTypeName (type.GetElementType ());
-                               if (item.Namespace == XmlSchema.Namespace)
-                                       return new QName ("ArrayOf" + item.Name, KnownTypeCollection.MSArraysNamespace);
-                               return new QName ("ArrayOf" + item.Name, item.Namespace);
-                       }
-
-                       return new QName (type.Name, KnownTypeCollection.DefaultClrNamespaceBase + type.Namespace);
-               }
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/XsdDataContractImporter.cs b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/XsdDataContractImporter.cs
deleted file mode 100644 (file)
index 28bc270..0000000
+++ /dev/null
@@ -1,1085 +0,0 @@
-//
-// XsdDataContractImporter.cs
-//
-// Authors:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//      Martin Baulig <martin.baulig@xamarin.com>
-//
-// Copyright (C) 2010 Novell, Inc.  http://www.novell.com
-//               2012 Xamarin, Inc.
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.CodeDom;
-using System.CodeDom.Compiler;
-using System.Collections;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Reflection;
-using System.Xml;
-using System.Xml.Schema;
-using System.Xml.Serialization;
-
-using QName = System.Xml.XmlQualifiedName;
-
-namespace System.Runtime.Serialization
-{
-       [MonoTODO ("support arrays")]
-       public class XsdDataContractImporter
-       {
-               static readonly XmlQualifiedName qname_anytype = new XmlQualifiedName ("anyType", XmlSchema.Namespace);
-
-               public XsdDataContractImporter ()
-                       : this (null)
-               {
-               }
-
-               public XsdDataContractImporter (CodeCompileUnit codeCompileUnit)
-               {
-                       // null argument is ok.
-                       CodeCompileUnit = codeCompileUnit ?? new CodeCompileUnit ();
-
-                       // Options is null by default
-               }
-
-               public CodeCompileUnit CodeCompileUnit { get; private set; }
-
-               CodeDomProvider code_provider = CodeDomProvider.CreateProvider ("csharp");
-               Dictionary<CodeNamespace,CodeIdentifiers> identifiers_table = new Dictionary<CodeNamespace,CodeIdentifiers> ();
-               ImportOptions import_options;
-
-               public ImportOptions Options {
-                       get { return import_options; }
-                       set {
-                               import_options = value;
-                               code_provider = value.CodeProvider ?? code_provider;
-                       }
-               }
-
-               void GenerateXmlType (XmlQualifiedName qname)
-               {
-                       var cns = GetCodeNamespace (qname.Namespace);
-                       var td = new CodeTypeDeclaration () {
-                               Name = GetUniqueName (CodeIdentifier.MakeValid (qname.Name), cns),
-                               TypeAttributes = GenerateInternal ? TypeAttributes.NotPublic : TypeAttributes.Public,
-                               IsPartial = true };
-                       cns.Types.Add (td);
-                       td.BaseTypes.Add (new CodeTypeReference (typeof (IXmlSerializable)));
-
-                       var thisNodes = new CodePropertyReferenceExpression (new CodeThisReferenceExpression (), "Nodes"); // property this.Nodes
-                       var xmlSerializableServices = new CodeTypeReferenceExpression (typeof (XmlSerializableServices)); // static XmlSerializableServices.
-                       var qnameType = new CodeTypeReference (typeof (XmlQualifiedName));
-
-                       // XmlQualifiedName qname = new XmlQualifiedName ({qname.Name}, {qname.Namespace});
-                       td.Members.Add (new CodeMemberField () { Name = "qname", Type = qnameType, InitExpression = new CodeObjectCreateExpression (qnameType, new CodePrimitiveExpression (qname.Name), new CodePrimitiveExpression (qname.Namespace)) });
-
-                       // public XmlNode[] Nodes { get; set; }
-                       td.Members.Add (new CodeMemberProperty () { Name = "Nodes", Type = new CodeTypeReference (typeof (XmlNode [])), Attributes = (GenerateInternal ? MemberAttributes.Assembly : MemberAttributes.Public) | MemberAttributes.Final, HasGet = true, HasSet = true });
-
-                       // public void ReadXml(XmlReader reader) {
-                       var read = new CodeMemberMethod () { Name = "ReadXml", Attributes = (GenerateInternal ? MemberAttributes.Assembly : MemberAttributes.Public) | MemberAttributes.Final };
-                       read.Parameters.Add (new CodeParameterDeclarationExpression (new CodeTypeReference (typeof (XmlReader)), "reader"));
-                       //   this.Nodes = XmlSerializableServices.ReadXml(reader);
-                       read.Statements.Add (
-                               new CodeAssignStatement (thisNodes,
-                                       new CodeMethodInvokeExpression (
-                                               new CodeMethodReferenceExpression (xmlSerializableServices, "ReadXml"),
-                                               new CodeArgumentReferenceExpression ("reader"))));
-                       // }
-                       td.Members.Add (read);
-
-                       // public void WriteXml(XmlWriter writer) {
-                       var write = new CodeMemberMethod () { Name = "WriteXml",Attributes = (GenerateInternal ? MemberAttributes.Assembly : MemberAttributes.Public) | MemberAttributes.Final };
-                       write.Parameters.Add (new CodeParameterDeclarationExpression (new CodeTypeReference (typeof (XmlWriter)), "writer"));
-                       //   XmlSerializableServices.WriteXml(writer, this.Nodes);
-                       write.Statements.Add (
-                               new CodeMethodInvokeExpression (
-                                       new CodeMethodReferenceExpression (xmlSerializableServices, "WriteXml"),
-                                       new CodeArgumentReferenceExpression ("writer"),
-                                       thisNodes));
-                       // }
-                       td.Members.Add (write);
-
-                       // public XmlSchema GetSchema () { return null; }
-                       var getSchema = new CodeMemberMethod () { Name = "GetSchema", Attributes = (GenerateInternal ? MemberAttributes.Assembly : MemberAttributes.Public) | MemberAttributes.Final, ReturnType = new CodeTypeReference (typeof (XmlSchema)) };
-                       getSchema.Statements.Add (new CodeMethodReturnStatement (new CodePrimitiveExpression (null)));
-                       td.Members.Add (getSchema);
-
-                       // public static XmlQualifiedName ExportSchema (XmlSchemaSet schemas) {
-                       var export = new CodeMemberMethod () { Name = "ExportSchema", Attributes = (GenerateInternal ? MemberAttributes.Assembly : MemberAttributes.Public) | MemberAttributes.Final | MemberAttributes.Static, ReturnType = qnameType };
-                       export.Parameters.Add (new CodeParameterDeclarationExpression (new CodeTypeReference (typeof (XmlSchemaSet)), "schemas"));
-                       //   XmlSerializableServices.AddDefaultSchema (schemas);
-                       export.Statements.Add (new CodeMethodInvokeExpression (xmlSerializableServices, "AddDefaultSchema", new CodeArgumentReferenceExpression ("schemas")));
-                       //   return qname;
-                       export.Statements.Add (new CodeMethodReturnStatement (new CodeFieldReferenceExpression (new CodeThisReferenceExpression (), "qname")));
-                       // }
-                       td.Members.Add (export);
-               }
-
-               // CanImport
-
-               public bool CanImport (XmlSchemaSet schemas)
-               {
-                       if (schemas == null)
-                               throw new ArgumentNullException ("schemas");
-
-                       PrepareSchemas (schemas);
-
-                       foreach (XmlSchemaElement xe in schemas.GlobalElements.Values)
-                               if (!CanImport (schemas, xe))
-                                       return false;
-                       return true;
-               }
-
-               public bool CanImport (XmlSchemaSet schemas, ICollection<XmlQualifiedName> typeNames)
-               {
-                       if (schemas == null)
-                               throw new ArgumentNullException ("schemas");
-                       if (typeNames == null)
-                               throw new ArgumentNullException ("typeNames");
-
-                       PrepareSchemas (schemas);
-
-                       foreach (var name in typeNames)
-                               if (!CanImport (schemas, name))
-                                       return false;
-                       return true;
-               }
-
-               public bool CanImport (XmlSchemaSet schemas, XmlQualifiedName typeName)
-               {
-                       if (schemas == null)
-                               throw new ArgumentNullException ("schemas");
-                       if (typeName == null)
-                               throw new ArgumentNullException ("typeName");
-
-                       PrepareSchemas (schemas);
-
-                       if (IsPredefinedType (typeName))
-                               return true; // while it just ignores...
-
-                       if (!schemas.GlobalTypes.Contains (typeName))
-                               return false;
-
-                       return CanImport (schemas, schemas.GlobalTypes [typeName] as XmlSchemaType);
-               }
-
-               public bool CanImport (XmlSchemaSet schemas, XmlSchemaElement element)
-               {
-                       if (schemas == null)
-                               throw new ArgumentNullException ("schemas");
-                       if (element == null)
-                               throw new ArgumentNullException ("element");
-
-                       PrepareSchemas (schemas);
-
-                       if (element.ElementSchemaType != null)
-                               return CanImport (schemas, element.ElementSchemaType as XmlSchemaType);
-                       else if (element.SchemaTypeName != null && !element.SchemaTypeName.Equals (QName.Empty))
-                               return CanImport (schemas, element.SchemaTypeName);
-                       else
-                               // anyType
-                               return true;
-               }
-
-
-#if true // new
-               bool CanImport (XmlSchemaSet schemas, XmlSchemaType type)
-               {
-                       if (IsPredefinedType (type.QualifiedName))
-                               return true;
-
-                       var st = type as XmlSchemaSimpleType;
-                       if (st != null) {
-                               return CanImportSimpleType (schemas, st);
-                       } else {
-                               var ct = (XmlSchemaComplexType) type;
-                               var sc = ct.ContentModel as XmlSchemaSimpleContent;
-                               if (sc != null) {
-                                       if (sc.Content is XmlSchemaSimpleContentExtension)
-                                               return false;
-                               }
-                               if (!CanImportComplexType (schemas, ct))
-                                       return false;
-                               return true;
-                       }
-               }
-
-               bool CanImportSimpleType (XmlSchemaSet schemas, XmlSchemaSimpleType type)
-               {
-                       var scl = type.Content as XmlSchemaSimpleTypeList;
-                       if (scl != null) {
-                               if (scl.ItemType == null)
-                                       return false;
-                               var itemType = scl.ItemType as XmlSchemaSimpleType;
-                               var ir = itemType.Content as XmlSchemaSimpleTypeRestriction;
-                               if (ir == null)
-                                       return false;
-                               return true; // as enum
-                       }
-                       var scr = type.Content as XmlSchemaSimpleTypeRestriction;
-                       if (scr != null)
-                               return true; // as enum
-
-                       return false;
-               }
-
-               bool CanImportComplexType (XmlSchemaSet schemas, XmlSchemaComplexType type)
-               {
-                       foreach (XmlSchemaAttribute att in type.AttributeUses.Values)
-                               if (att.Use != XmlSchemaUse.Optional || att.QualifiedName.Namespace != KnownTypeCollection.MSSimpleNamespace)
-                                       return false;
-
-                       CodeTypeReference baseClrType = null;
-                       var particle = type.Particle;
-                       if (type.ContentModel != null) {
-                               var xsscr = type.ContentModel.Content as XmlSchemaSimpleContentRestriction;
-                               if (xsscr != null) {
-                                       if (xsscr.BaseType != null) {
-                                               if (!CanImport (schemas, xsscr.BaseType))
-                                                       return false;
-                                       } else {
-                                               if (!CanImport (schemas, xsscr.BaseTypeName))
-                                                       return false;
-                                       }
-                                       // The above will result in an error, but make sure to show we don't support it.
-                                       return false;
-                               }
-                               var xscce = type.ContentModel.Content as XmlSchemaComplexContentExtension;
-                               if (xscce != null) {
-                                       if (!CanImport (schemas, xscce.BaseTypeName))
-                                               return false;
-                                       baseClrType = GetCodeTypeReferenceInternal (xscce.BaseTypeName, false);
-
-                                       var baseInfo = GetTypeInfo (xscce.BaseTypeName, false);
-                                       particle = xscce.Particle;
-                               }
-                               var xsccr = type.ContentModel.Content as XmlSchemaComplexContentRestriction;
-                               if (xsccr != null)
-                                       return false;
-                       }
-
-                       var seq = particle as XmlSchemaSequence;
-                       if (seq == null && particle != null)
-                               return false;
-
-                       if (seq != null) {
-
-                       if (seq.Items.Count == 1 && seq.Items [0] is XmlSchemaAny && type.Parent is XmlSchemaElement) {
-
-                               // looks like it is not rejected (which contradicts the error message on .NET). See XsdDataContractImporterTest.ImportTestX32(). Also ImporTestX13() for Parent check.
-
-                       } else {
-
-                       foreach (var child in seq.Items)
-                               if (!(child is XmlSchemaElement))
-                                       return false;
-
-                       bool isDictionary = false;
-                       if (type.Annotation != null) {
-                               foreach (var ann in type.Annotation.Items) {
-                                       var ai = ann as XmlSchemaAppInfo;
-                                       if (ai != null && ai.Markup != null &&
-                                           ai.Markup.Length > 0 &&
-                                           ai.Markup [0].NodeType == XmlNodeType.Element &&
-                                           ai.Markup [0].LocalName == "IsDictionary" &&
-                                           ai.Markup [0].NamespaceURI == KnownTypeCollection.MSSimpleNamespace)
-                                               isDictionary = true;
-                               }
-                       }
-
-                       if (seq.Items.Count == 1) {
-                               var pt = (XmlSchemaParticle) seq.Items [0];
-                               var xe = pt as XmlSchemaElement;
-                               if (pt.MaxOccursString == "unbounded") {
-                                       // import as a collection contract.
-                                       if (pt is XmlSchemaAny) {
-                                       } else if (isDictionary) {
-                                               var kvt = xe.ElementSchemaType as XmlSchemaComplexType;
-                                               var seq2 = kvt != null ? kvt.Particle as XmlSchemaSequence : null;
-                                               var k = seq2 != null && seq2.Items.Count == 2 ? seq2.Items [0] as XmlSchemaElement : null;
-                                               var v = seq2 != null && seq2.Items.Count == 2 ? seq2.Items [1] as XmlSchemaElement : null;
-                                               if (k == null || v == null)
-                                                       return false;
-                                               if (!CanImport (schemas, k.ElementSchemaType))
-                                                       return false;
-                                               if (!CanImport (schemas, v.ElementSchemaType))
-                                                       return false;
-                                               
-                                               return true;
-                                       } else if (type.QualifiedName.Namespace == KnownTypeCollection.MSArraysNamespace &&
-                                                  IsPredefinedType (xe.ElementSchemaType.QualifiedName)) {
-                                               // then this CodeTypeDeclaration is to be removed, and CodeTypeReference to this type should be an array instead.
-                                               return true;
-                                       }
-                                       else
-                                               if (!CanImport (schemas, xe.ElementSchemaType))
-                                                       return false;
-                                       return true;
-                               }
-                       }
-                       if (isDictionary)
-                               return false;
-
-                       // import as a (normal) contract.
-                       var elems = new List<XmlSchemaElement> ();
-                       foreach (XmlSchemaElement xe in seq.Items) {
-                               if (xe.MaxOccurs != 1)
-                                       return false;
-
-                               if (elems.Any (e => e.QualifiedName.Name == xe.QualifiedName.Name))
-                                       return false;
-
-                               elems.Add (xe);
-                       }
-                       foreach (var xe in elems) {
-                               // import property type in prior.
-                               if (!CanImport (schemas, xe.ElementSchemaType.QualifiedName))
-                                       return false;
-                       }
-
-                       } // if (seq contains only an xs:any)
-                       } // if (seq != 0)
-
-                       return true;
-               }
-#else
-               bool CanImport (XmlSchemaSet schemas, XmlSchemaComplexType type)
-               {
-                       if (type == null || type.QualifiedName.Namespace == XmlSchema.Namespace) // xs:anyType -> not supported.
-                               return false;
-
-                       if (type.ContentModel is XmlSchemaSimpleContent) // simple content derivation is not supported.
-                               return false;
-                       if (type.ContentModel != null && type.ContentModel.Content != null) {
-                               var xscce = type.ContentModel.Content as XmlSchemaComplexContentExtension;
-                               if (xscce == null) // complex DBR is not supported.
-                                       return false;
-                               // check base type
-                               if (xscce.BaseTypeName != qname_anytype && !CanImport (schemas, xscce.BaseTypeName))
-                                       return false;
-                       }
-
-                       return true;
-               }
-#endif
-
-               // Import
-
-               void PrepareSchemas (XmlSchemaSet schemas)
-               {
-                       if (!schemas.Contains (KnownTypeCollection.MSSimpleNamespace))
-                               schemas.Add (XmlSchema.Read (GetType ().Assembly.GetManifestResourceStream ("mstypes.schema"), null));
-
-                       if (!schemas.IsCompiled)
-                               schemas.Compile ();
-               }
-
-               public void Import (XmlSchemaSet schemas)
-               {
-                       if (schemas == null)
-                               throw new ArgumentNullException ("schemas");
-
-                       PrepareSchemas (schemas);
-
-                       foreach (XmlSchemaElement xe in schemas.GlobalElements.Values)
-                               Import (schemas, xe);
-               }
-
-               public void Import (XmlSchemaSet schemas, ICollection<XmlQualifiedName> typeNames)
-               {
-                       if (schemas == null)
-                               throw new ArgumentNullException ("schemas");
-                       if (typeNames == null)
-                               throw new ArgumentNullException ("typeNames");
-                       foreach (var name in typeNames)
-                               Import (schemas, name);
-               }
-
-               // This checks type existence and raises an error if it is missing.
-               public void Import (XmlSchemaSet schemas, XmlQualifiedName typeName)
-               {
-                       if (schemas == null)
-                               throw new ArgumentNullException ("schemas");
-                       if (typeName == null)
-                               throw new ArgumentNullException ("typeName");
-
-                       PrepareSchemas (schemas);
-
-                       if (IsPredefinedType (typeName))
-                               return;
-
-                       if (!schemas.GlobalTypes.Contains (typeName))
-                               throw new InvalidDataContractException (String.Format ("Type {0} is not found in the schemas", typeName));
-
-                       Import (schemas, schemas.GlobalTypes [typeName] as XmlSchemaType, typeName);
-               }
-
-               public XmlQualifiedName Import (XmlSchemaSet schemas, XmlSchemaElement element)
-               {
-                       if (schemas == null)
-                               throw new ArgumentNullException ("schemas");
-                       if (element == null)
-                               throw new ArgumentNullException ("element");
-
-                       var elname = element.QualifiedName;
-
-                       if (IsPredefinedType (element.SchemaTypeName))
-                               return elname;
-
-                       switch (elname.Namespace) {
-                       case KnownTypeCollection.MSSimpleNamespace:
-                               switch (elname.Name) {
-                               case "char":
-                               case "duration":
-                               case "guid":
-                                       return elname;
-                               }
-                               break;
-                       }
-
-                       if (!CanImport (schemas, element) && Options != null && Options.ImportXmlType) {
-                               var qn = element.QualifiedName;
-                               GenerateXmlType (qn);
-                               return qn;
-                       }
-
-                       if (element.ElementSchemaType != null) {
-                               if (IsCollectionType (element.ElementSchemaType))
-                                       elname = element.ElementSchemaType.QualifiedName;
-                       }
-
-                       // FIXME: use element to fill nillable and arrays.
-                       var qname =
-                               elname != null && !elname.Equals (QName.Empty) ? elname :
-                               element.ElementSchemaType != null ? element.ElementSchemaType.QualifiedName :
-                               qname_anytype;
-
-                       if (element.ElementSchemaType != null)
-                               Import (schemas, element.ElementSchemaType, qname);
-                       else if (element.SchemaTypeName != null && !element.SchemaTypeName.Equals (QName.Empty))
-                               Import (schemas, schemas.GlobalTypes [element.SchemaTypeName] as XmlSchemaType, qname);
-                       // otherwise it is typeless == anyType.
-                       else
-                               Import (schemas, XmlSchemaType.GetBuiltInComplexType (qname_anytype), qname);
-
-                       return qname;
-               }
-
-               void Import (XmlSchemaSet schemas, XmlSchemaType type)
-               {
-                       if (!CanImport (schemas, type) && Options != null && Options.ImportXmlType) {
-                               GenerateXmlType (type.QualifiedName);
-                               return;
-                       }
-                       Import (schemas, type, type.QualifiedName);
-               }
-
-               void Import (XmlSchemaSet schemas, XmlSchemaType type, XmlQualifiedName qname)
-               {
-                       var existing = imported_types.FirstOrDefault (it => it.XsdType == type);
-                       if (existing != null)
-                               return;// existing.XsdTypeName;
-
-                       if (IsPredefinedType (type.QualifiedName))
-                               return;
-
-                       DoImport (schemas, type, qname);
-               }
-
-               string GetUniqueName (string name, CodeNamespace cns)
-               {
-                       CodeIdentifiers i;
-                       if (!identifiers_table.TryGetValue (cns, out i)) {
-                               i = new CodeIdentifiers ();
-                               identifiers_table.Add (cns, i);
-                       }
-                       return i.AddUnique (name, null);
-               }
-
-               void DoImport (XmlSchemaSet schemas, XmlSchemaType type, XmlQualifiedName qname)
-               {
-                       CodeNamespace cns = null;
-                       CodeTypeReference clrRef;
-                       cns = GetCodeNamespace (qname.Namespace);
-                       clrRef = new CodeTypeReference (cns.Name.Length > 0 ? cns.Name + "." + qname.Name : qname.Name);
-
-                       var td = new CodeTypeDeclaration () {
-                               Name = GetUniqueName (CodeIdentifier.MakeValid (qname.Name), cns),
-                               TypeAttributes = GenerateInternal ? TypeAttributes.NotPublic : TypeAttributes.Public,
-                               IsPartial = true };
-                       cns.Types.Add (td);
-
-                       var info = new TypeImportInfo () { ClrType = clrRef, XsdType = type,  XsdTypeName = qname };
-                       imported_types.Add (info);
-
-                       var st = type as XmlSchemaSimpleType;
-                       if (st != null) {
-                               ImportSimpleType (td, schemas, st, qname);
-                       } else {
-                               var ct = (XmlSchemaComplexType) type;
-                               var sc = ct.ContentModel as XmlSchemaSimpleContent;
-                               if (sc != null) {
-                                       if (sc.Content is XmlSchemaSimpleContentExtension)
-                                               throw new InvalidDataContractException (String.Format ("complex type '{0}' with simple content extension is not supported", type.QualifiedName));
-                               }
-                               if (!ImportComplexType (td, schemas, ct, qname)) {
-                                       cns.Types.Remove (td);
-                                       if (cns.Types.Count == 0)
-                                               CodeCompileUnit.Namespaces.Remove (cns);
-                               }
-
-                               foreach (var impinfo in imported_types)
-                                       for (; impinfo.KnownTypeOutputIndex < impinfo.KnownClrTypes.Count; impinfo.KnownTypeOutputIndex++)
-                                               td.CustomAttributes.Add (new CodeAttributeDeclaration (
-                                                       new CodeTypeReference (typeof (KnownTypeAttribute)),
-                                                       new CodeAttributeArgument (new CodeTypeOfExpression (impinfo.KnownClrTypes [impinfo.KnownTypeOutputIndex]))));
-                       }
-               }
-
-               static readonly string ass_name = typeof (DataContractAttribute).Assembly.GetName ().Name;
-               static readonly string ass_version = typeof (DataContractAttribute).Assembly.GetName ().Version.ToString ();
-               static readonly CodeTypeReference typeref_data_contract = new CodeTypeReference (typeof (DataContractAttribute));
-               static readonly CodeTypeReference typeref_coll_contract = new CodeTypeReference (typeof (CollectionDataContractAttribute));
-
-               void AddTypeAttributes (CodeTypeDeclaration td, XmlSchemaType type, params XmlSchemaElement [] collectionArgs)
-               {
-                       var name = type.QualifiedName;
-                       // [GeneratedCode (assembly_name, assembly_version)]
-                       td.CustomAttributes.Add (new CodeAttributeDeclaration (
-                               new CodeTypeReference (typeof (GeneratedCodeAttribute)),
-                               new CodeAttributeArgument (new CodePrimitiveExpression (ass_name)),
-                               new CodeAttributeArgument (new CodePrimitiveExpression (ass_version))));
-
-                       var ct = type as XmlSchemaComplexType;
-
-                       // [DataContract(Name="foobar",Namespace="urn:foobar")] (optionally IsReference=true),
-                       // or [CollectionDataContract(ditto, ItemType/KeyType/ValueType)]
-                       var dca = new CodeAttributeDeclaration (
-                               collectionArgs != null && collectionArgs.Length > 0 ? typeref_coll_contract : typeref_data_contract,
-                               new CodeAttributeArgument ("Name", new CodePrimitiveExpression (name.Name)),
-                               new CodeAttributeArgument ("Namespace", new CodePrimitiveExpression (name.Namespace)));
-                       if (collectionArgs != null) {
-                               if (collectionArgs.Length > 0)
-                                       dca.Arguments.Add (new CodeAttributeArgument ("ItemName", new CodePrimitiveExpression (CodeIdentifier.MakeValid (collectionArgs [0].QualifiedName.Name))));
-                               if (collectionArgs.Length > 2) {
-                                       dca.Arguments.Add (new CodeAttributeArgument ("KeyName", new CodePrimitiveExpression (CodeIdentifier.MakeValid (collectionArgs [1].QualifiedName.Name))));
-                                       dca.Arguments.Add (new CodeAttributeArgument ("ValueName", new CodePrimitiveExpression (CodeIdentifier.MakeValid (collectionArgs [2].QualifiedName.Name))));
-                               }
-                       }
-                       if (ct != null && ct.AttributeUses [new XmlQualifiedName ("Ref", KnownTypeCollection.MSSimpleNamespace)] != null)
-                               dca.Arguments.Add (new CodeAttributeArgument ("IsReference", new CodePrimitiveExpression (true)));
-                       td.CustomAttributes.Add (dca);
-
-                       // optional [Serializable]
-                       if (Options != null && Options.GenerateSerializable)
-                               td.CustomAttributes.Add (new CodeAttributeDeclaration ("System.SerializableAttribute"));
-               }
-
-               static readonly CodeTypeReference typeref_ext_iface = new CodeTypeReference ("System.Runtime.Serialization.IExtensibleDataObject");
-               static readonly CodeTypeReference typeref_ext_class = new CodeTypeReference ("System.Runtime.Serialization.ExtensionDataObject");
-
-               void AddExtensionData (CodeTypeDeclaration td)
-               {
-                       td.BaseTypes.Add (typeref_ext_iface);
-
-                       var field = new CodeMemberField (typeref_ext_class, "extensionDataField");
-                       td.Members.Add (field);
-
-                       var prop = new CodeMemberProperty () { Type = field.Type, Name = "ExtensionData", Attributes = (GenerateInternal ? MemberAttributes.Assembly : MemberAttributes.Public) | MemberAttributes.Final };
-                       prop.GetStatements.Add (new CodeMethodReturnStatement (
-                               new CodeFieldReferenceExpression (
-                               new CodeThisReferenceExpression (),
-                               "extensionDataField")));
-                       prop.SetStatements.Add (new CodeAssignStatement (
-                               new CodeFieldReferenceExpression (
-                               new CodeThisReferenceExpression (),
-                               "extensionDataField"),
-                               new CodePropertySetValueReferenceExpression ()));
-
-                       td.Members.Add (prop);
-               }
-
-               void ImportSimpleType (CodeTypeDeclaration td, XmlSchemaSet schemas, XmlSchemaSimpleType type, XmlQualifiedName qname)
-               {
-                       var scl = type.Content as XmlSchemaSimpleTypeList;
-                       if (scl != null) {
-                               if (scl.ItemType == null)
-                                       throw new InvalidDataContractException (String.Format ("simple type list is allowed only with an anonymous simple type with enumeration restriction content as its item type definition (type is {0})", type.QualifiedName));
-                               var itemType = scl.ItemType as XmlSchemaSimpleType;
-                               var ir = itemType.Content as XmlSchemaSimpleTypeRestriction;
-                               if (ir == null)
-                                       throw new InvalidDataContractException (String.Format ("simple type list is allowed only with an anonymous simple type with enumeration restriction content as its item type definition (type is {0})", type.QualifiedName));
-                               ImportEnum (td, schemas, ir, type, qname, true);
-                               return;
-                       }
-                       var scr = type.Content as XmlSchemaSimpleTypeRestriction;
-                       if (scr != null) {
-                               ImportEnum (td, schemas, scr, type, qname, false);
-                               return;
-                       }
-
-                       throw new InvalidDataContractException (String.Format ("simple type is supported only if it has enumeration or list of an anonymous simple type with enumeration restriction content as its item type definition (type is {0})", qname));
-               }
-
-               static readonly CodeTypeReference enum_member_att_ref = new CodeTypeReference (typeof (EnumMemberAttribute));
-
-               void ImportEnum (CodeTypeDeclaration td, XmlSchemaSet schemas, XmlSchemaSimpleTypeRestriction r, XmlSchemaType type, XmlQualifiedName qname, bool isFlag)
-               {
-                       if (isFlag && !r.BaseTypeName.Equals (new XmlQualifiedName ("string", XmlSchema.Namespace)))
-                               throw new InvalidDataContractException (String.Format ("For flags enumeration '{0}', the base type for the simple type restriction must be XML schema string", qname));
-
-                       td.IsEnum = true;
-                       AddTypeAttributes (td, type);
-                       if (isFlag)
-                               td.CustomAttributes.Add (new CodeAttributeDeclaration (new CodeTypeReference (typeof (FlagsAttribute))));
-
-                       foreach (var facet in r.Facets) {
-                               var e = facet as XmlSchemaEnumerationFacet;
-                               if (e == null)
-                                       throw new InvalidDataContractException (String.Format ("Invalid simple type restriction (type {0}). Only enumeration is allowed.", qname));
-                               var em = new CodeMemberField () { Name = CodeIdentifier.MakeValid (e.Value) };
-                               var ea = new CodeAttributeDeclaration (enum_member_att_ref);
-                               if (e.Value != em.Name)
-                                       ea.Arguments.Add (new CodeAttributeArgument ("Value", new CodePrimitiveExpression (e.Value)));
-                               em.CustomAttributes.Add (ea);
-                               td.Members.Add (em);
-                       }
-               }
-
-               // Returns false if it should remove the imported type.
-               bool IsCollectionType (XmlSchemaType type)
-               {
-                       var complex = type as XmlSchemaComplexType;
-                       if (complex == null)
-                               return false;
-
-                       var seq = complex.Particle as XmlSchemaSequence;
-                       if (seq == null)
-                               return false;
-
-                       if (seq.Items.Count == 1 && seq.Items [0] is XmlSchemaAny && complex.Parent is XmlSchemaElement)
-                               return false;
-
-                       if (type.Annotation != null) {
-                               foreach (var ann in type.Annotation.Items) {
-                                       var ai = ann as XmlSchemaAppInfo;
-                                       if (ai != null && ai.Markup != null &&
-                                           ai.Markup.Length > 0 &&
-                                           ai.Markup [0].NodeType == XmlNodeType.Element &&
-                                           ai.Markup [0].LocalName == "IsDictionary" &&
-                                           ai.Markup [0].NamespaceURI == KnownTypeCollection.MSSimpleNamespace)
-                                               return true;
-                               }
-                       }
-                                       
-                       if (seq.Items.Count != 1)
-                               return false;
-
-                       var pt = (XmlSchemaParticle) seq.Items [0];
-                       var xe = pt as XmlSchemaElement;
-                       if (pt.MaxOccursString != "unbounded")
-                               return false;
-
-                       return !(pt is XmlSchemaAny);
-               }
-
-               // Returns false if it should remove the imported type.
-               bool ImportComplexType (CodeTypeDeclaration td, XmlSchemaSet schemas, XmlSchemaComplexType type, XmlQualifiedName qname)
-               {
-                       foreach (XmlSchemaAttribute att in type.AttributeUses.Values)
-                               if (att.Use != XmlSchemaUse.Optional || att.QualifiedName.Namespace != KnownTypeCollection.MSSimpleNamespace)
-                                       throw new InvalidDataContractException (String.Format ("attribute in DataContract complex type '{0}' is limited to those in {1} namespace, and optional.", qname, KnownTypeCollection.MSSimpleNamespace));
-
-                       CodeTypeReference baseClrType = null;
-                       var particle = type.Particle;
-                       if (type.ContentModel != null) {
-                               var xsscr = type.ContentModel.Content as XmlSchemaSimpleContentRestriction;
-                               if (xsscr != null) {
-                                       if (xsscr.BaseType != null)
-                                               Import (schemas, xsscr.BaseType);
-                                       else
-                                               Import (schemas, xsscr.BaseTypeName);
-                                       // The above will result in an error, but make sure to show we don't support it.
-                                       throw new InvalidDataContractException (String.Format ("complex type simple content restriction is not supported in DataContract (type '{0}')", qname));
-                               }
-                               var xscce = type.ContentModel.Content as XmlSchemaComplexContentExtension;
-                               if (xscce != null) {
-                                       Import (schemas, xscce.BaseTypeName);
-                                       baseClrType = GetCodeTypeReferenceInternal (xscce.BaseTypeName, false);
-                                       if (baseClrType != null)
-                                               td.BaseTypes.Add (baseClrType);
-
-                                       var baseInfo = GetTypeInfo (xscce.BaseTypeName, false);
-                                       if (baseInfo != null)
-                                               baseInfo.KnownClrTypes.Add (imported_types.First (it => it.XsdType == type).ClrType);
-                                       particle = xscce.Particle;
-                               }
-                               var xsccr = type.ContentModel.Content as XmlSchemaComplexContentRestriction;
-                               if (xsccr != null)
-                                       throw new InvalidDataContractException (String.Format ("complex content type (for type '{0}') has a restriction content model, which is not supported in DataContract.", qname));
-                       }
-
-                       var seq = particle as XmlSchemaSequence;
-                       if (seq == null && particle != null)
-                               throw new InvalidDataContractException (String.Format ("Not supported particle {1}. In DataContract, only sequence particle is allowed as the top-level content of a complex type (type '{0}')", qname, particle));
-
-                       if (seq != null) {
-
-                       if (seq.Items.Count == 1 && seq.Items [0] is XmlSchemaAny && type.Parent is XmlSchemaElement) {
-
-                               // looks like it is not rejected (which contradicts the error message on .NET). See XsdDataContractImporterTest.ImportTestX32(). Also ImporTestX13() for Parent check.
-
-                       } else {
-
-                       foreach (var child in seq.Items)
-                               if (!(child is XmlSchemaElement))
-                                       throw new InvalidDataContractException (String.Format ("Only local element is allowed as the content of the sequence of the top-level content of a complex type '{0}'. Other particles (sequence, choice, all, any, group ref) are not supported.", qname));
-
-                       bool isDictionary = false;
-                       if (type.Annotation != null) {
-                               foreach (var ann in type.Annotation.Items) {
-                                       var ai = ann as XmlSchemaAppInfo;
-                                       if (ai != null && ai.Markup != null &&
-                                           ai.Markup.Length > 0 &&
-                                           ai.Markup [0].NodeType == XmlNodeType.Element &&
-                                           ai.Markup [0].LocalName == "IsDictionary" &&
-                                           ai.Markup [0].NamespaceURI == KnownTypeCollection.MSSimpleNamespace)
-                                               isDictionary = true;
-                               }
-                       }
-
-                       /*
-                        * Collection Type Support:
-                        * 
-                        * We need to distinguish between normal array/dictionary collections and
-                        * custom collection types which use [CollectionDataContract].
-                        * 
-                        * The name of a normal collection type starts with "ArrayOf" and uses the
-                        * element type's namespace.  We use the collection type directly and don't
-                        * generate a proxy class for these.
-                        * 
-                        * The collection type (and the base class or a custom collection's proxy type)
-                        * is dermined by 'ImportOptions.ReferencedCollectionTypes'.  The default is to
-                        * use an array for list collections and Dictionary<,> for dictionaries.
-                        * 
-                        * Note that my implementation currently only checks for generic type definitions
-                        * in the 'ImportOptions.ReferencedCollectionTypes' - it looks for something that
-                        * implements IEnumerable<T> or IDictionary<K,V>.  This is not complete, but it's
-                        * all that's necessary to support different collection types in a GUI.
-                        * 
-                        * Simply use
-                        *     var options = new ImportOptions ();
-                        *     options.ReferencedCollectionTypes.Add (typeof (LinkedList<>));
-                        *     options.ReferencedCollectionTypes.Add (typeof (SortedList<,>));
-                        * to configure these; see XsdDataContractImportTest2.cs for some examples.
-                        * 
-                        */
-
-                       if (seq.Items.Count == 1) {
-                               var pt = (XmlSchemaParticle) seq.Items [0];
-                               var xe = pt as XmlSchemaElement;
-                               if (pt.MaxOccursString == "unbounded") {
-                                       // import as a collection contract.
-                                       if (pt is XmlSchemaAny) {
-                                       } else if (isDictionary) {
-                                               var kvt = xe.ElementSchemaType as XmlSchemaComplexType;
-                                               var seq2 = kvt != null ? kvt.Particle as XmlSchemaSequence : null;
-                                               var k = seq2 != null && seq2.Items.Count == 2 ? seq2.Items [0] as XmlSchemaElement : null;
-                                               var v = seq2 != null && seq2.Items.Count == 2 ? seq2.Items [1] as XmlSchemaElement : null;
-                                               if (k == null || v == null)
-                                                       throw new InvalidDataContractException (String.Format ("Invalid Dictionary contract type '{0}'. A Dictionary schema type must have a sequence particle which contains exactly two schema elements for key and value.", type.QualifiedName));
-                                               return ImportCollectionType (td, schemas, type, k, v);
-                                       }
-                                       return ImportCollectionType (td, schemas, type, xe);
-                               }
-                       }
-                       if (isDictionary)
-                               throw new InvalidDataContractException (String.Format ("complex type '{0}' is an invalid Dictionary type definition. A Dictionary must have a sequence particle with exactly two child elements", qname));
-
-                       // import as a (normal) contract.
-                       var elems = new List<XmlSchemaElement> ();
-                       foreach (XmlSchemaElement xe in seq.Items) {
-                               if (xe.MaxOccurs != 1)
-                                       throw new InvalidDataContractException (String.Format ("schema complex type '{0}' has a content sequence containing an element '{1}' with 'maxOccurs' value as more than 1, which is not supported in DataContract.", qname, xe.QualifiedName));
-
-                               if (elems.Any (e => e.QualifiedName.Name == xe.QualifiedName.Name))
-                                       throw new InvalidDataContractException (String.Format ("In schema type '{0}', there already is an element whose name is {1}, where duplicate of element names are not supported.", qname, xe.QualifiedName.Name));
-
-                               elems.Add (xe);
-                       }
-                       foreach (var xe in elems) {
-                               // import property type in prior.
-                               Import (schemas, xe.ElementSchemaType.QualifiedName);
-                               AddProperty (td, xe);
-                       }
-
-                       } // if (seq contains only an xs:any)
-                       } // if (seq != 0)
-
-                       AddTypeAttributes (td, type);
-                       AddExtensionData (td);
-
-                       return true;
-               }
-
-               bool ImportCollectionType (CodeTypeDeclaration td, XmlSchemaSet schemas,
-                                          XmlSchemaComplexType type,
-                                          XmlSchemaElement key, XmlSchemaElement value)
-               {
-                       Import (schemas, key.ElementSchemaType);
-                       Import (schemas, value.ElementSchemaType);
-                       var keyType = GetCodeTypeReference (key.ElementSchemaType.QualifiedName);
-                       var valueType = GetCodeTypeReference (value.ElementSchemaType.QualifiedName);
-
-                       var collectionType = GetDictionaryCollectionType ();
-                       var baseTypeName = collectionType != null ?
-                               collectionType.FullName : "System.Collections.Generic.Dictionary";
-
-                       if (type.QualifiedName.Name.StartsWith ("ArrayOf")) {
-                               // Standard collection, use the collection type instead of
-                               // creating a proxy class.
-                               var cti = imported_types.First (i => i.XsdType == type);
-                               cti.ClrType = new CodeTypeReference (baseTypeName, keyType, valueType);
-                               return false;
-                       }
-
-                       td.BaseTypes.Add (new CodeTypeReference (baseTypeName, keyType, valueType));
-                       AddTypeAttributes (td, type, key);
-                       AddTypeAttributes (td, type, value);
-                       return true;
-               }
-
-               bool ImportCollectionType (CodeTypeDeclaration td, XmlSchemaSet schemas,
-                                          XmlSchemaComplexType type, XmlSchemaElement xe)
-               {
-                       Import (schemas, xe.ElementSchemaType);
-                       var element = GetCodeTypeReference (xe.ElementSchemaType.QualifiedName);
-
-                       var collectionType = GetListCollectionType ();
-
-                       if (type.QualifiedName.Name.StartsWith ("ArrayOf")) {
-                               // Standard collection, use the collection type instead of
-                               // creating a proxy class.
-                               var cti = imported_types.First (i => i.XsdType == type);
-                               if (collectionType != null)
-                                       cti.ClrType = new CodeTypeReference (collectionType.FullName, element);
-                               else
-                                       cti.ClrType = new CodeTypeReference (element, 1);
-                               return false;
-                       }
-
-                       var baseTypeName = collectionType != null ?
-                               collectionType.FullName : "System.Collections.Generic.List";
-
-                       td.BaseTypes.Add (new CodeTypeReference (baseTypeName, element));
-                       AddTypeAttributes (td, type, xe);
-                       return true;
-               }
-
-               bool ImplementsInterface (Type type, Type iface)
-               {
-                       foreach (var i in type.GetInterfaces ()) {
-                               if (i.Equals (iface))
-                                       return true;
-                               if (i.IsGenericType && i.GetGenericTypeDefinition ().Equals (iface))
-                                       return true;
-                       }
-
-                       return false;
-               }
-
-               Type GetListCollectionType ()
-               {
-                       if (import_options == null)
-                               return null;
-                       var listTypes = import_options.ReferencedCollectionTypes.Where (
-                               t => t.IsGenericTypeDefinition && t.GetGenericArguments ().Length == 1 &&
-                               ImplementsInterface (t, typeof (IEnumerable<>)));
-                       return listTypes.FirstOrDefault ();
-               }
-
-               Type GetDictionaryCollectionType ()
-               {
-                       if (import_options == null)
-                               return null;
-                       var dictTypes = import_options.ReferencedCollectionTypes.Where (
-                               t => t.IsGenericTypeDefinition && t.GetGenericArguments ().Length == 2 &&
-                               ImplementsInterface (t, typeof (IDictionary<,>)));
-                       return dictTypes.FirstOrDefault ();
-               }
-
-               static readonly CodeExpression this_expr = new CodeThisReferenceExpression ();
-               static readonly CodeExpression arg_value_expr = new CodePropertySetValueReferenceExpression ();
-
-               bool GenerateInternal {
-                       get { return Options != null && Options.GenerateInternal; }
-               }
-
-               void AddProperty (CodeTypeDeclaration td, XmlSchemaElement xe)
-               {
-                       var att = GenerateInternal ? MemberAttributes.Assembly : MemberAttributes.Public;
-                       var fi = new CodeMemberField () { Name = CodeIdentifier.MakeValid (xe.QualifiedName.Name + "Field"), Type = GetCodeTypeReference (xe.ElementSchemaType.QualifiedName, xe) };
-                       td.Members.Add (fi);
-                       var pi = new CodeMemberProperty () { Name = xe.QualifiedName.Name, Attributes = att, HasGet = true, HasSet = true, Type = fi.Type };
-                       // [DataMember(Name=foobar, IsRequired=!nillable)]
-                       var dma = new CodeAttributeDeclaration (
-                               new CodeTypeReference (typeof (DataMemberAttribute)));
-                       if (fi.Name != xe.QualifiedName.Name)
-                               new CodeAttributeArgument ("Name", new CodePrimitiveExpression (xe.QualifiedName.Name));
-                       if (!xe.IsNillable)
-                               new CodeAttributeArgument ("IsRequired", new CodePrimitiveExpression (true));
-                       pi.CustomAttributes.Add (dma);
-
-                       pi.GetStatements.Add (new CodeMethodReturnStatement () { Expression = new CodeFieldReferenceExpression (this_expr, fi.Name) });
-                       pi.SetStatements.Add (new CodeAssignStatement (new CodeFieldReferenceExpression (this_expr, fi.Name), arg_value_expr));
-
-
-                       td.Members.Add (pi);
-               }
-
-               bool IsPredefinedType (XmlQualifiedName qname)
-               {
-                       if (qname == null)
-                               return false;
-                       switch (qname.Namespace) {
-                       case KnownTypeCollection.MSSimpleNamespace:
-                               return KnownTypeCollection.GetPrimitiveTypeFromName (qname) != null;
-                       case XmlSchema.Namespace:
-                               return XmlSchemaType.GetBuiltInSimpleType (qname) != null || XmlSchemaType.GetBuiltInComplexType (qname) != null;
-                       }
-                       return false;
-               }
-
-               CodeNamespace GetCodeNamespace (string xmlns)
-               {
-                       string ns = null;
-                       if (Options == null || !Options.Namespaces.TryGetValue (xmlns, out ns))
-                               ns = GetCodeNamespaceFromXmlns (xmlns);
-
-                       foreach (CodeNamespace cns in CodeCompileUnit.Namespaces)
-                               if (cns.Name == ns)
-                                       return cns;
-                       var newCns = new CodeNamespace () { Name = ns };
-                       CodeCompileUnit.Namespaces.Add (newCns);
-                       return newCns;
-               }
-
-               const string default_ns_prefix = "http://schemas.datacontract.org/2004/07/";
-
-               string GetCodeNamespaceFromXmlns (string xns)
-               {
-                       if (xns.StartsWith (default_ns_prefix, StringComparison.Ordinal))
-                               xns = xns.Substring (default_ns_prefix.Length);
-                       else {
-                               Uri u;
-                               string tmp;
-                               if (Uri.TryCreate (xns, UriKind.Absolute, out u) && (tmp = MakeStringNamespaceComponentsValid (u.GetComponents (UriComponents.Host | UriComponents.Path, UriFormat.Unescaped))).Length > 0)
-                                       xns = tmp;
-                       }
-                       return MakeStringNamespaceComponentsValid (xns);
-               }
-
-               static readonly char [] split_tokens = new char [] {'/', '.'};
-
-               string MakeStringNamespaceComponentsValid (string ns)
-               {
-                       var arr = ns.Split (split_tokens, StringSplitOptions.RemoveEmptyEntries);
-                       for (int i = 0; i < arr.Length; i++)
-                               arr [i] = CodeIdentifier.MakeValid (arr [i]);
-                       return String.Join (".", arr);
-               }
-
-               // Post-compilation information retrieval
-
-               TypeImportInfo GetTypeInfo (XmlQualifiedName typeName, bool throwError)
-               {
-                       var info = imported_types.FirstOrDefault (
-                               i => i.XsdTypeName.Equals (typeName) || i.XsdType.QualifiedName.Equals (typeName));
-                       if (info == null) {
-                               if (throwError)
-                                       throw new InvalidOperationException (String.Format ("schema type '{0}' has not been imported yet. Import it first.", typeName));
-                               return null;
-                       }
-                       return info;
-               }
-
-               public CodeTypeReference GetCodeTypeReference (XmlQualifiedName typeName)
-               {
-                       return GetCodeTypeReferenceInternal (typeName, true);
-               }
-
-               CodeTypeReference GetCodeTypeReferenceInternal (XmlQualifiedName typeName, bool throwError)
-               {
-                       if (typeName == null)
-                               throw new ArgumentNullException ("typeName");
-
-                       switch (typeName.Namespace) {
-                       case XmlSchema.Namespace:
-                       case KnownTypeCollection.MSSimpleNamespace:
-                               var pt = KnownTypeCollection.GetPrimitiveTypeFromName (typeName);
-                               if (pt == null)
-                                       throw new ArgumentException (String.Format ("Invalid type name in a predefined namespace: {0}", typeName));
-                               return new CodeTypeReference (pt);
-                       }
-
-                       var info = GetTypeInfo (typeName, throwError);
-                       return info != null ? info.ClrType : null;
-               }
-
-               [MonoTODO ("use element argument and fill Nullable etc.")]
-               public CodeTypeReference GetCodeTypeReference (XmlQualifiedName typeName, XmlSchemaElement element)
-               {
-                       if (typeName == null)
-                               throw new ArgumentNullException ("typeName");
-                       if (element == null)
-                               throw new ArgumentNullException ("element");
-
-                       return GetCodeTypeReference (typeName);
-               }
-
-               public ICollection<CodeTypeReference> GetKnownTypeReferences (XmlQualifiedName typeName)
-               {
-                       if (typeName == null)
-                               throw new ArgumentNullException ("typeName");
-
-                       return GetTypeInfo (typeName, true).KnownClrTypes;
-               }
-
-               List<TypeImportInfo> imported_types = new List<TypeImportInfo> ();
-
-               class TypeImportInfo
-               {
-                       public TypeImportInfo ()
-                       {
-                               KnownClrTypes = new List<CodeTypeReference> ();
-                       }
-
-                       public CodeTypeReference ClrType { get; set; }
-                       public XmlQualifiedName XsdTypeName { get; set; }
-                       public XmlSchemaType XsdType { get; set; }
-                       public List<CodeTypeReference> KnownClrTypes { get; private set; }
-                       public int KnownTypeOutputIndex { get; set; } // updated while importing.
-               }
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Xml/ChangeLog b/mcs/class/System.Runtime.Serialization/System.Xml/ChangeLog
deleted file mode 100755 (executable)
index 25af315..0000000
+++ /dev/null
@@ -1,632 +0,0 @@
-2010-06-02 Atsushi Enomoto  <atsushi@ximian.com>
-
-        * XmlBinaryDictionaryReader.cs : reset name in Reset().
-          Fixed bug #599479.
-
-2010-02-10  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlDictionaryWriter.cs : try to lookup dictionary string in
-         WriteNode(). This is part of #577139 fix (probably).
-
-2010-02-10  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryWriter.cs : for text '0' and '1', write 0x80 and
-         0x82 instead of 0x99 [0x30|0x31]. This cosmetic fix gives identical
-         writer output for #577139 (and yet it still doesn't work).
-
-2009-12-22  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryReader.cs : slightly more descriptive errmsg.
-
-2009-12-01  Sebastien Pouliot  <sebastien@ximian.com>
-
-       * XmlDictionaryReader.cs: Fix ReadValueAsBase64 return value and
-       remove NET_2_1 (gui-compare shows this in our 3.0 SP1 profile)
-
-2009-09-21  Sebastien Pouliot  <sebastien@ximian.com>
-
-       * XmlDictionaryWriter.cs: Remove usage of XmlMtomDictionaryWriter
-       for NET_2_1
-
-2009-07-22  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlDictionaryReader.cs : ReadValueAsBase64(byte[],int,int) is only
-         in SL2.
-
-2009-07-14  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryReader.cs : read false (0x84) and true (0x86).
-
-2009-07-07  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlSimpleDictionaryWriter.cs : fix bogus import of
-         XmlWriter.WriteNode() to handle more than two elements.
-
-2009-06-05  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryReader.cs : fix GetAttribute() that returns
-         attributes from cache that are *not* in current element.
-
-2009-06-05  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryReader.cs : there was wrong reusage of nodes
-         when the node was at the top of the stack. It was added twice and
-         call to reset resulted in end element with empty names.
-
-2009-05-29  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryWriter.cs : allow mapping an identical prefix
-         to different xmlns in different element level.
-
-2009-05-29  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryWriter.cs : allow writing xml/xmlns attributes
-         without specifying their corresponding namespaces.
-
-2009-05-23  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryReader.cs : fix regression on stream consumption
-         excess.
-
-2009-05-22  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryReader.cs : ReadContentString() returned
-         doubled string result.
-
-2009-05-19  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryReader.cs : fix utf16 array on getting its
-         length. Report correct length (since BinaryReader is directly used
-         it makes no sense to incompletely keep track of position in Source).
-
-2009-05-19  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryReader.cs : support reader quotas.
-
-2009-05-07  Sebastien Pouliot  <sebastien@ximian.com>
-
-       * UniqueId.cs: Fix attributes for v3.5 (and later 2.0 SP) and remove
-       them (in particular [SecurityTreatAsSafe]) from the NET_2_1 build.
-
-2009-04-27  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryReader.cs : several fixes;
-         - Name property was always empty.
-         - Value property was always empty for attributes.
-         - TextIndex node type was not supported.
-         - node reset at Read() was incomplete.
-         - attribute Prefix for single character had wrong value.
-         - namespace nodes did not appear as attribute nodes.
-         - attribute value node must be always single. Another text node
-           means a text child of the element, not the following attr value.
-         tests will go in sys.servicemodel.
-
-2009-04-15  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlMtomDictionaryReader.cs : new.
-       * XmlDictionaryReader.cs : implemented CreateMtomReader().
-
-2009-04-02  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlMtomDictionaryWriter.cs : new.
-       * XmlDictionaryWriter.cs : implement CreateMtomWriter().
-
-2009-04-01  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlDictionaryReader.cs : add ReadStartElement() overload.
-
-2009-04-01  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * UniqueId.cs : add missing security attributes.
-       * XmlDictionaryReader.cs : cleanup extra TODOs.
-       * XmlBinaryDictionaryReader.cs : iplement IsArray.
-
-2009-03-31  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryReader.cs, XmlDictionaryWriter.cs :
-         a couple of fixes to reflect correct values for node properties
-         on each read step.
-
-2009-03-31  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryReader.cs, XmlBinaryFormat.cs :
-         support array operation (0x03) on reader too.
-
-2009-03-31  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryReader.cs : removed lots of unused part.
-
-2009-03-31  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryWriterAutoGen.cs : generated code.
-       * XmlBinaryFormat.cs, XmlBinaryDictionaryWriter.cs :
-         support array operation (0x03) and a bunch of WriteArray() methods.
-
-2009-03-31  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryReader.cs, XmlBinaryDictionaryWriter.cs
-         XmlBinaryFormat.cs : implemented element with short prefix.
-
-2009-03-27  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryFormat.cs, XmlBinaryDictionaryWriter.cs :
-         resolved all namespace and QName issues.
-
-2009-03-27  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryWriter.cs : further namespace refactory.
-         namespaces are managed by its own (to work fine for both string
-         and dictionary string).
-
-2009-03-27  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryFormat.cs, XmlBinaryDictionaryReader.cs,
-         XmlBinaryDictionaryWriter.cs : improved shorthanded prefix
-         support. Not only autocreated prefixes but also explicitly-
-         specified 'a' .. 'z' prefixes are mapped as shorthand.
-         Some significant (and ongoing) namespace support changes.
-
-2009-03-26  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryFormat.cs, XmlBinaryDictionaryWriter.cs :
-         added some incomplete code for QName support.
-
-2009-03-26  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryReader.cs, XmlBinaryFormat.cs :
-         handle utf16 typed nodes. (not sure if it is used in writer.)
-
-2009-03-26  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryWriter.cs : oops, fix build.
-
-2009-03-26  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryWriter.cs, XmlBinaryDictionaryReader.cs,
-         XmlBinaryFormat.cs, : reverted Uuid change (UniqueId is different).
-         Updated TODO status. Removed extra BinaryReader type.
-
-2009-03-26  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryReader.cs, XmlBinaryDictionaryWriter.cs,
-         XmlBinaryFormat.cs : fixed couple of issues regarding text and
-         base64 fixed-length buffers (their sizes are not variant).
-         Some ongoing changes on reading dummy-prefixed attributes.
-
-2009-03-25  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryReader.cs, XmlBinaryFormat.cs,
-         XmlBinaryDictionaryWriter.cs : couple of enhancements to support
-         missing types, Dictionary string lookups and indexing fixes.
-         Also reflect some correction by [MC-NBFX] (MS OSPed document).
-       * XmlBinaryReaderSession.cs : implemented.
-
-2009-03-18  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlDictionaryReader.cs : more not-understandable bits.
-
-2009-03-18  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlDictionaryReader.cs : implemented ReadFullStartElement (full??).
-
-2009-03-18  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlDictionaryReader.cs : implemented missing && understandable
-         members.
-
-2009-03-02  Chris Toshok  <toshok@ximian.com>
-
-       * XmlBinaryDictionaryReader.cs, XmlSimpleDictionaryReader.cs: 2.1
-       has HasValue.
-
-2009-02-13  Jonathan Pryor  <jpryor@novell.com>
-
-       * UniqueId.cs: Remove most [MonoTODO]s and NotImplementedExceptions.
-         Revert the 2009-02-12 UniqueId.IsGuid "fix", as .NET says that 
-         new UniqueId(new Guid()).IsGuid==false (which makes no sense, as
-         .ToString() on the same instance includes the "urn:uuid:" prefix,
-         which is used by Guids...).
-
-2009-02-13  Jonathan Pryor  <jpryor@novell.com>
-
-       * XmlDictionaryWriter.cs: Implement WriteValue(IStreamProvider).
-
-2009-02-13  Jonathan Pryor  <jpryor@novell.com>
-
-       * XmlDictionaryWriter.cs: Implement
-         WriteTextNode(XmlDictionaryReader,bool).  This requires changes to
-         WriteNode(), as testing had determined that WriteTextNode() is used
-         instead of WriteString() for Text nodes and attribute values when
-         called via WriteNode().
-
-2009-02-12  Jonathan Pryor  <jpryor@novell.com>
-
-       * XmlDictionaryWriter.cs: Implement WriteValue(Guid),
-         WriteValue(TimeSpan), WriteValue(UniqueId).
-       * UniqueId.cs: Fix UniqueId.IsGuid, as `new UniqueId(new Guid())` was
-         previously being detected as a string value, not a Guid value.
-
-2009-02-12  Jonathan Pryor  <jpryor@novell.com>
-
-       * XmlDictionaryWriter.cs (WriteStartElement): Add parameter checking
-         and default arguments to avoid NullReferenceExceptions.
-
-2009-02-11  Jonathan Pryor  <jpryor@novell.com>
-
-       * XmlDictionaryString.cs: Add constructor argument checking.
-
-2009-02-10  Jonathan Pryor  <jpryor@novell.com>
-
-       * IFragmentCapableXmlDictionaryWriter.cs: Added.
-
-2008-09-09  Atsushi Enomoto  <atsushi@ximian.com>
-                       Jb Evain  <jbevain@novell.com>
-
-       * XmlBinaryDictionaryReader.cs, XmlSimpleDictionaryReader.cs:
-       add support to build on the net_2_1 profile.
-
-2008-04-10  Eyal Alaluf <eyala@mainsoft.com>
-
-       * XmlBinaryDictionaryWriter.cs: WriteXmlnsAttribute generates a prefix
-         when given a null prefix.
-
-2008-03-22  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryReader.cs :
-         - It didn't clean namespaces up during Read().
-         - Non-typed attribute nodes should be allowed in get_Value().
-         - Fixed wrong namespace scope push.
-
-2008-02-27 Eyal Alaluf <eyala@mainsoft.com>
-
-       * XmlBinaryDictionaryReader.cs: Handle compilation warnings.
-       * XmlSimpleDictionaryReader.cs: Added onClose handling.
-       * XmlDictionaryReader.cs: Simple implementation of CreateTextReader.
-
-2008-02-08  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlDictionaryWriter.cs : Even with UTF8 (marked) .net does not
-         output BOMs, so use always unmarked utf8 for any UTF8 encodings.
-
-2008-02-08  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlDictionaryWriter.cs : Since it does not support XML declaration
-         its encoding is limited to utf16 and utf8. Null argument check.
-
-2007-11-27  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlDictionaryWriter.cs : WriteNode() is override, not new.
-
-2007-07-27  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlDictionaryWriter.cs : store Depth for dummy prefix output.
-         WriteXmlnsAttribute() writes dummy prefix when null prefix is given.
-       * XmlSimpleDictionaryWriter.cs, XmlBinaryDictionaryWriter.cs :
-         increment Depth on WriteStartElement() and decrement it on
-         WriteEndElement(). They don't have to be complete, just fine as
-         long as it correctly creates a dummy.
-
-2007-04-02  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryFormat.cs : added Base64Fixed (0xA0).
-       * XmlBinaryDictionaryReader.cs : support 0xA0 type above.
-         ReadInt() refactoring. Handle float and double value types.
-
-2007-03-30  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryReader.cs :
-         implemented some ReadContentAs[Type]() methods.
-       * XmlDictionaryReader.cs :
-         Added Read[[Element]ContentAs]String() implementations.
-       * XmlDictionaryReaderAutoGen.cs : regenerated
-
-2007-03-20  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlDictionaryReader.cs : simply return false for
-         TryGet[Base64|Array]Length().
-       * XmlBinaryDictionaryReader.cs : Value string should be pupulated
-         for typed value nodes.
-
-2007-03-19  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlDictionaryReader.cs : more ongoing updates (valuetype support,
-         key support updates, ReadElementContentAsBase64).
-
-2007-03-19  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryFormat.cs, XmlBinaryDictionaryWriter.cs :
-         support following operators; 0x80 (integer 0), 0x82 (integer 1) and
-         0xAE (UniqueId which is created from Guid).
-         Little fix for length output.
-
-2007-03-16  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlDictionaryReader.cs : fix infinite loop.
-
-2007-03-16  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlDictionaryReader.cs : added couple of missing methods.
-
-2007-03-16  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlDictionaryReaderAutoGen.cs : regenerated.
-
-2007-03-16  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryReader.cs : ongoing updates to the 3.0 RTM
-         format.
-
-2007-03-16  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryWriter.cs : for XmlWriterBinarySession lookup,
-         internal dictionary lookup should be string-based, since otherwise
-         it will never return correct dictionary string stored when the
-         dictionary string is from another dictionary.
-       * XmlBinaryWriterSession.cs :
-         TryLookup() is now based on string value comparison.
-         Reverted internal dictionary to int->XmlDictionaryString form,
-         as I don't use TryGetValue() anymore.
-
-2007-03-16  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryWriter.cs : WriteValue(Decimal) is working now.
-
-2007-03-15  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryFormat.cs : new file, collection of constants.
-       * XmlBinaryDictionaryWriter.cs :
-         Stream->BinaryWriter. Support for WriteValue() for almost all
-         types.
-
-2007-03-15  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlDictionaryWriter.cs : removed couple of MonoTODOs.
-
-2007-03-15  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryWriter.cs : more couple of fixes (typed value
-         support and fixes, more element/attribute namespace fixes etc.).
-
-2007-03-15  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryWriter.cs : fixed Base64 operation byte.
-         For comment node there is no corresponding combined EndElement
-         operation, so don't try to combine it.
-         Don't output xmlns and xml namespaces.
-
-2007-03-15  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryWriter.cs : fixed couple of dictionary string
-         issues (on lookup and index output).
-       * XmlBinaryWriterSession.cs : added internal TryLookup(). Changed
-         internal structure to have dictionary string as a key.
-
-2007-03-15  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryWriter.cs : new prefix population is needed
-         in this class too.
-
-2007-03-15  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryWriter.cs : more WriteEndAttribute() is needed.
-         Remove wrong namespaceUri index output. Fixed attribute operation.
-
-2007-03-15  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryWriter.cs : output attribute value.
-
-2007-03-15  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryWriter.cs : for binary output format requirement,
-         every content must be buffered once and wait for next operation so
-         that if the content is one of the content sequence or not. This is
-         almost silly, but that is what Microsoft wanted to do.
-
-2007-03-15  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryWriter.cs : couple of namespaces processing fix.
-
-2007-03-15  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlDictionaryWriter.cs : WriteAttributeString and WriteStartElement
-         should also delegate to dictionary-string based methods.
-       * XmlBinaryDictionaryWriter.cs : ongoing reimplementation as it was
-         based on pretty old design as well as pretty old XmlTextWriter.
-
-2007-03-14  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryWriterSession.cs : implemented.
-       * XmlBinaryDictionaryWriter.cs : a bunch of updates.
-
-2007-03-14  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * UniqueId.cs : hacky Equals() implementation.
-       * XmlDictionaryReaderQuotas.cs : removed Default and fixed Max.
-       * XmlSimpleDictionaryWriter.cs : in .NET 3.0 RTM, it is supported.
-       * XmlDictionaryWriter.cs : WriteStartElement(XmlDictionaryString,
-         XmlDictionaryString) should call WriteStartElement(string,
-         XmlDictionaryString,XmlDictionaryString) since because only the
-         latter is overridable and possible to provide dictionary string.
-
-2007-03-09  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlDictionaryReader.cs : make it partial. Fill Quotas when requested.
-       * XmlDictionaryReaderAutoGen.cs : added autogenerated array reader
-         methods.
-       * XmlDictionaryWriter.cs : make it partial.
-       * XmlDictionaryWruterAutoGen.cs : added autogenerated array writer
-         methods.
-
-2006-10-05  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryReader.cs, XmlSimpleDictionaryReader.cs :
-         implement IXmlNamespaceResolver.
-
-2006-07-31  Ankit Jain  <jankit@novell.com>
-
-       * UniqueId.cs (.ctor): (string overload) Implement.
-       (ToString): Prepend "urn:uuid:" instead of "uuid-".
-
-2006-07-31  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * UniqueId.cs : some implementation.
-
-2006-07-04  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlDictionaryWriter.cs, XmlSimpleDictionaryWriter.cs,
-         XmlDictionaryReaderQuotas.cs : June CTP API update.
-
-2006-07-04  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryReader.cs, IStreamProvider.cs,
-         XmlSimpleDictionaryReader.cs, IXmlMtomReaderInitializer.cs,
-         XmlBinaryWriterSession.cs, IXmlUTF8ReaderInitializer.cs,
-         IXmlMtomWriterInitializer.cs, XmlDictionaryReader.cs :
-         June CTP API updates.
-
-2006-01-17  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlShimWriter.cs : deleted.
-       * XmlBinaryDictionaryWriter.cs, XmlSimpleDictionaryWriter.cs :
-         WriteProcessingInstruction() throws InvalidOperationException.
-
-2005-11-28  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlDictionaryReader.cs, XmlBinaryDictionaryWriter.cs,
-         XmlDictionary.cs, XmlDictionaryWriter.cs, XmlC14NWriter.cs :
-         several API fixes to Nov. CTP.
-
-2005-11-03  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlDictionaryReader.cs : CreateMtomReader() stubs.
-
-2005-10-24  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryWriter.cs : use saved xml_lang and xml_space for
-         those corresponding properties (they bork at the declaring element).
-
-2005-10-24  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * UniqueId.cs : it does not compile.
-
-2005-10-23  Duncan Mak  <duncan@novell.com>
-
-       * UniqueId.cs (.ctor): Implement some overloads by chaining it to
-       other Unimplemented ones.
-       (operator ==, operator !=): Implemented using the Equals method.
-       (Equals, TryGetGuid): Well, at least figure the false case....
-
-2005-10-23  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlDictionary.cs : fixed type of Empty.
-       * XmlDictionaryReaderQuotas.cs : Default and Max were not readonly.
-
-2005-10-05  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryReader.cs : and it can GetContext().
-
-2005-10-05  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryWriter.cs :
-         Fixed index for room-reserved attributes (0x22-0x3B).
-         Added note on 0x9D.
-       * XmlBinaryDictionaryReader.cs :
-         Several fixes to get it work fine.
-
-2005-10-05  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlDictionary.cs : TryLookup() should use TryGetValue().
-         Fixed incorrect upper bound check for TryLookup(int, out dictstr).
-       * XmlBinaryDictionaryWriter.cs : Use 0x8B for empty string everywhere
-         we use 0x83.
-
-2005-10-04  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryReader.cs : new file for CreateBinaryReader().
-       * XmlDictionaryReader.cs : use above.
-       * XmlBinaryDictionaryWriter.cs : several fixes (renamed private
-         fields, added more notes, and much more).
-
-2005-10-04  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryWriter.cs :
-         Added notes on dictionary string support inference. Fixed filename.
-
-2005-10-04  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlBinaryDictionaryWriter.cs : new file for CreateBinaryWriter().
-       * XmlDictionaryWriter.cs : use above.
-
-2005-10-03  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlDictionaryWriter.cs : stubby WriteNode() impl.
-       * XmlBinaryWriterSession.cs : tiny notes.
-
-2005-10-03  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlSimpleDictionaryWriter.cs : new file for CreateDictionaryWriter().
-         Implemented simple XmlWriter functionality.
-       * XmlDictionaryWriter.cs : use above.
-
-2005-10-03  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlDictionaryWriter.cs : implemented some members. Added more stubs.
-
-2005-09-29  Duncan Mak  <duncan@novell.com>
-
-       * XmlDictionaryWriter.cs (CreateBinaryWriter): Added stub.
-
-2005-09-28  Duncan Mak  <duncan@novell.com>
-
-       * XmlDictionaryWriter.cs (CreateDictionaryWriter): Added stub.
-
-2005-09-27  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlDictionaryReader.cs :
-         Some member signature fixes.
-         implemented CreateDictionaryReader().
-         TryGetLocalNameAsDictionaryString() seems always returning false.
-         IsLocalName() is not likely to use TryGet...() above.
-       * XmlSimpleDictionaryReader.cs : for CreateDictionaryReader().
-
-2005-09-26  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlDictionaryString.cs, XmlDictionary.cs,
-         XmlDictionaryReaderQuotas.cs, XmlDictionaryReader.cs:
-         added some implementations.
-
-2005-09-22  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * XmlDictionaryString.cs, XmlShimWriter.cs,
-         IXmlBinaryWriterInitializer.cs, IXmlUTF8WriterInitializer.cs,
-         XmlDictionaryWriter.cs, UniqueId.cs, XmlC14NWriter.cs,
-         XmlDictionary.cs, OnXmlDictionaryReaderClose.cs,
-         XmlBinaryReaderSession.cs, IXmlMtomReaderInitializer.cs,
-         IXmlDictionary.cs, IXmlBinaryReaderInitializer.cs,
-         XmlCanonicalWriter.cs, XmlBinaryWriterSession.cs,
-         XmlDictionaryReaderQuotas.cs, IXmlUTF8ReaderInitializer.cs,
-         IXmlMtomWriterInitializer.cs, XmlDictionaryReader.cs :
-         #if NET_2_0. coding style was updated.
-
-2005-09-22  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * IXmlBinaryReaderInitializer.cs
-         IXmlBinaryWriterInitializer.cs
-         IXmlDictionary.cs
-         IXmlMtomReaderInitializer.cs
-         IXmlMtomWriterInitializer.cs
-         IXmlUTF8ReaderInitializer.cs
-         IXmlUTF8WriterInitializer.cs
-         OnXmlDictionaryReaderClose.cs
-         UniqueId.cs
-         XmlBinaryReaderSession.cs
-         XmlBinaryWriterSession.cs
-         XmlC14NWriter.cs
-         XmlCanonicalWriter.cs
-         XmlDictionary.cs
-         XmlDictionaryReader.cs
-         XmlDictionaryReaderQuotas.cs
-         XmlDictionaryString.cs
-         XmlDictionaryWriter.cs
-         XmlShimWriter.cs : new files.
-
diff --git a/mcs/class/System.Runtime.Serialization/System.Xml/IFragmentCapableXmlDictionaryWriter.cs b/mcs/class/System.Runtime.Serialization/System.Xml/IFragmentCapableXmlDictionaryWriter.cs
deleted file mode 100644 (file)
index f9c8ac2..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-//
-// IFragmentCapableXmlDictionaryWriter.cs
-//
-// Author:
-//     Jonathan Pryor <jpryor@novell.com>
-//
-// Copyright (C) 2009 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System.IO;
-
-namespace System.Xml
-{
-       public interface IFragmentCapableXmlDictionaryWriter
-       {
-               bool CanFragment { get; }
-
-               void StartFragment (Stream stream, bool generateSelfContainedTextFragment);
-               void WriteFragment (byte[] buffer, int offset, int count);
-               void EndFragment ();
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Xml/IStreamProvider.cs b/mcs/class/System.Runtime.Serialization/System.Xml/IStreamProvider.cs
deleted file mode 100644 (file)
index 3856a45..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-//
-// IStreamProvider.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System.IO;
-
-namespace System.Xml
-{
-       public interface IStreamProvider
-       {
-               Stream GetStream ();
-               void ReleaseStream (Stream stream);
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Xml/IXmlBinaryReaderInitializer.cs b/mcs/class/System.Runtime.Serialization/System.Xml/IXmlBinaryReaderInitializer.cs
deleted file mode 100644 (file)
index e0d2840..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-//
-// IXmlBinaryReaderInitializer.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.IO;
-
-namespace System.Xml
-{
-       public interface IXmlBinaryReaderInitializer
-       {
-               void SetInput (
-                       Stream stream,
-                       IXmlDictionary dictionary,
-                       XmlDictionaryReaderQuotas quota,
-                       XmlBinaryReaderSession session,
-                       OnXmlDictionaryReaderClose onClose);
-
-               void SetInput (byte [] buffer, int offset, int count,
-                       IXmlDictionary dictionary,
-                       XmlDictionaryReaderQuotas quota,
-                       XmlBinaryReaderSession session,
-                       OnXmlDictionaryReaderClose onClose);
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Xml/IXmlBinaryWriterInitializer.cs b/mcs/class/System.Runtime.Serialization/System.Xml/IXmlBinaryWriterInitializer.cs
deleted file mode 100644 (file)
index fa34bf5..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-//
-// IXmlBinaryWriterInitializer.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.IO;
-
-namespace System.Xml
-{
-       public interface IXmlBinaryWriterInitializer
-       {
-               void SetOutput (Stream stream,
-                       IXmlDictionary dictionary,
-                       XmlBinaryWriterSession session,
-                       bool ownsStream);
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Xml/IXmlDictionary.cs b/mcs/class/System.Runtime.Serialization/System.Xml/IXmlDictionary.cs
deleted file mode 100644 (file)
index a894ae1..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-//
-// IXmlDictionary.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-namespace System.Xml
-{
-       public interface IXmlDictionary
-       {
-               bool TryLookup (int key, out XmlDictionaryString result);
-               bool TryLookup (string value, out XmlDictionaryString result);
-               bool TryLookup (XmlDictionaryString value,
-                       out XmlDictionaryString result);
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Xml/IXmlMtomReaderInitializer.cs b/mcs/class/System.Runtime.Serialization/System.Xml/IXmlMtomReaderInitializer.cs
deleted file mode 100644 (file)
index 484e776..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-//
-// IXmlMtomReaderInitializer.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.IO;
-using System.Text;
-
-namespace System.Xml
-{
-       public interface IXmlMtomReaderInitializer
-       {
-               void SetInput (Stream stream, Encoding [] encodings,
-                               string contentType,
-                               XmlDictionaryReaderQuotas quotas,
-                               int maxBufferSize,
-                               OnXmlDictionaryReaderClose onClose);
-
-               void SetInput (byte [] buffer, int offset, int count,
-                               Encoding [] encodings, string contentType, 
-                               XmlDictionaryReaderQuotas quotas,
-                               int maxBufferSize,
-                               OnXmlDictionaryReaderClose onClose);
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Xml/IXmlMtomWriterInitializer.cs b/mcs/class/System.Runtime.Serialization/System.Xml/IXmlMtomWriterInitializer.cs
deleted file mode 100644 (file)
index 0f85ada..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-//
-// IXmlMtomWriterInitializer.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.IO;
-using System.Text;
-
-namespace System.Xml
-{
-       public interface IXmlMtomWriterInitializer
-       {
-               void SetOutput (Stream stream, Encoding encoding,
-                       int maxSizeInBytes, string startInfo, string boundary,
-                       string startUri, bool writeMessageHeaders, bool ownsStream);
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Xml/IXmlUTF8ReaderInitializer.cs b/mcs/class/System.Runtime.Serialization/System.Xml/IXmlUTF8ReaderInitializer.cs
deleted file mode 100644 (file)
index 126e7a1..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-//
-// IXmlTextReaderInitializer.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.IO;
-using System.Text;
-
-namespace System.Xml
-{
-       public interface IXmlTextReaderInitializer
-       {
-               void SetInput (byte [] buffer, int offset, int count,
-                       Encoding encoding,
-                       XmlDictionaryReaderQuotas quota,
-                       OnXmlDictionaryReaderClose onClose);
-
-               void SetInput (Stream stream,
-                       Encoding encoding,
-                       XmlDictionaryReaderQuotas quota,
-                       OnXmlDictionaryReaderClose onClose);
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Xml/IXmlUTF8WriterInitializer.cs b/mcs/class/System.Runtime.Serialization/System.Xml/IXmlUTF8WriterInitializer.cs
deleted file mode 100644 (file)
index 83d6fdc..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-// IXmlTextWriterInitializer.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.IO;
-using System.Text;
-
-namespace System.Xml
-{
-       public interface IXmlTextWriterInitializer
-       {
-               void SetOutput (Stream stream, Encoding encoding, bool ownsStream);
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Xml/OnXmlDictionaryReaderClose.cs b/mcs/class/System.Runtime.Serialization/System.Xml/OnXmlDictionaryReaderClose.cs
deleted file mode 100644 (file)
index 54ce036..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-//
-// OnXmlDictionaryReaderClose.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-namespace System.Xml
-{
-       public delegate void OnXmlDictionaryReaderClose (XmlDictionaryReader reader);
-}
-
diff --git a/mcs/class/System.Runtime.Serialization/System.Xml/UniqueId.cs b/mcs/class/System.Runtime.Serialization/System.Xml/UniqueId.cs
deleted file mode 100644 (file)
index 28cbb00..0000000
+++ /dev/null
@@ -1,196 +0,0 @@
-//
-// UniqueId.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//     Jonathan Pryor <jpryor@novell.com>
-//
-// Copyright (C) 2005,2007,2009 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.Collections.Generic;
-using System.Security;
-
-namespace System.Xml
-{
-       public class UniqueId
-       {
-               Guid guid;
-               string id;
-
-               public UniqueId ()
-                       : this (Guid.NewGuid ())
-               {
-               }
-
-               public UniqueId (byte [] id)
-                       : this (id, 0)
-               {
-               }
-
-               public UniqueId (Guid id)
-               {
-                       this.guid = id;
-               }
-
-               public UniqueId (string value)
-               {
-                       if (value == null)
-                               throw new ArgumentNullException ("value cannot be null", "value");
-
-                       if (value.Length == 0)
-                               throw new FormatException ("UniqueId cannot be zero length");
-
-                       this.id = value;
-               }
-
-               public UniqueId (byte [] id, int offset)
-               {
-                       if (id == null)
-                               throw new ArgumentNullException ();
-                       if (offset < 0)
-                               throw new ArgumentOutOfRangeException ("offset");
-                       if (offset >= id.Length)
-                               throw new ArgumentException ("id too small.", "offset");
-
-                       if (id.Length - offset != 16)
-                               throw new ArgumentException ("id and offset provide less than 16 bytes");
-
-                       if (offset == 0)
-                               guid = new Guid (id);
-                       else {
-                               List<byte> buf = new List<byte> (id);
-                               buf.RemoveRange (0, offset);
-                               guid = new Guid (buf.ToArray ());
-                       }
-               }
-
-               public UniqueId (char [] id, int offset, int count)
-               {
-                       if (id == null)
-                               throw new ArgumentNullException ("id");
-                       if (offset < 0 || offset >= id.Length)
-                               throw new ArgumentOutOfRangeException ("offset");
-                       if (count < 0 || id.Length - offset < count)
-                               throw new ArgumentOutOfRangeException ("count");
-                       if (count == 0)
-                               throw new FormatException ();
-
-                       // Does it start with "urn:uuid:"?  If so, it's a Guid.
-                       if (count > 8 && id [offset] == 'u' && id [offset+1] == 'r' && 
-                                       id [offset+2] == 'n' && id [offset+3] == ':' &&
-                                       id [offset+4] == 'u' && id [offset+5] == 'u' &&
-                                       id [offset+6] == 'i' && id [offset+7] == 'd' &&
-                                       id [offset+8] == ':') {
-                               if (count != 45)
-                                       throw new ArgumentOutOfRangeException ("Invalid Guid");
-                               this.guid = new Guid (new string (id, offset+9, count-9));
-                       } else
-                               this.id = new string (id, offset, count);
-               }
-
-               public int CharArrayLength {
-                       get {return id != null ? id.Length : 45;}
-               }
-
-               public bool IsGuid {
-                       get { return guid != default (Guid); }
-               }
-
-               public override bool Equals (Object obj)
-               {
-                       UniqueId other = obj as UniqueId;
-
-                       if (other == null)
-                               return false;
-
-                       if (IsGuid && other.IsGuid) {
-                               return guid.Equals (other.guid);
-                       }
-
-                       return id == other.id;
-               }
-
-               [MonoTODO ("Determine semantics when IsGuid==true")]
-               public override int GetHashCode ()
-               {
-                       return id != null ? id.GetHashCode () : guid.GetHashCode ();
-               }
-
-               public static bool operator == (UniqueId id1, UniqueId id2)
-               {
-                       return object.Equals (id1, id2);
-               }
-
-               public static bool operator != (UniqueId id1, UniqueId id2)
-               {
-                       return ! (id1 == id2);
-               }
-
-               public int ToCharArray (char [] array, int offset)
-               {
-                       if (array == null)
-                               throw new ArgumentNullException ("array");
-                       if (offset < 0 || offset >= array.Length)
-                               throw new ArgumentOutOfRangeException ("offset");
-
-                       string s = ToString ();
-                       s.CopyTo (0, array, offset, s.Length);
-                       return s.Length;
-               }
-
-               public override string ToString ()
-               {
-                       if (id == null)
-                               return "urn:uuid:" + guid;
-
-                       return id;
-               }
-
-               public bool TryGetGuid (out Guid guid)
-               {
-                       if (IsGuid) {
-                               guid = this.guid;
-                               return true;
-                       } else {
-                               guid = default (Guid);
-                               return false;
-                       }
-               }
-
-               public bool TryGetGuid (byte [] buffer, int offset)
-               {
-                       if (!IsGuid)
-                               return false;
-
-                       if (buffer == null)
-                               throw new ArgumentNullException ("buffer");
-                       if (offset < 0 || offset >= buffer.Length)
-                               throw new ArgumentOutOfRangeException ("offset");
-                       if (buffer.Length - offset < 16)
-                               throw new ArgumentOutOfRangeException ("offset");
-
-                       guid.ToByteArray ().CopyTo (buffer, offset);
-                       return true;
-               }
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Xml/XmlBinaryDictionaryReader.cs b/mcs/class/System.Runtime.Serialization/System.Xml/XmlBinaryDictionaryReader.cs
deleted file mode 100644 (file)
index acc4ad0..0000000
+++ /dev/null
@@ -1,1197 +0,0 @@
-//
-// XmlBinaryDictionaryReader.cs
-//
-// Author:
-//     Atsushi Enomoto  <atsushi@ximian.com>
-//
-// Copyright (C) 2005, 2007 Novell, Inc.  http://www.novell.com
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.Collections;
-using System.Collections.Specialized;
-using System.Collections.Generic;
-using System.Globalization;
-using System.IO;
-using System.Text;
-
-using QName = System.Xml.XmlQualifiedName;
-using BF = System.Xml.XmlBinaryFormat;
-
-namespace System.Xml
-{
-       // FIXME:
-       //      - support XmlDictionaryReaderQuotas.
-
-       internal class XmlBinaryDictionaryReader : XmlDictionaryReader, IXmlNamespaceResolver
-       {
-               internal interface ISource
-               {
-                       int Position { get; }
-                       int ReadByte ();
-                       int Read (byte [] data, int offset, int count);
-                       BinaryReader Reader { get; }
-               }
-
-               internal class StreamSource : ISource
-               {
-                       BinaryReader reader;
-
-                       public StreamSource (Stream stream)
-                       {
-                               this.reader = new BinaryReader (stream);
-                       }
-
-                       public int Position {
-                               get { return (int) reader.BaseStream.Position; }
-                       }
-
-                       public BinaryReader Reader {
-                               get { return reader; }
-                       }
-
-                       public int ReadByte ()
-                       {
-                               return reader.BaseStream.ReadByte ();
-                       }
-
-                       public int Read (byte [] data, int offset, int count)
-                       {
-                               return reader.BaseStream.Read (data, offset, count);
-                       }
-               }
-
-               class NodeInfo
-               {
-                       public NodeInfo ()
-                       {
-                       }
-
-                       public NodeInfo (bool isAttr)
-                       {
-                               IsAttributeValue = isAttr;
-                       }
-
-                       public bool IsAttributeValue;
-                       public int Position;
-                       public string Prefix;
-                       public XmlDictionaryString DictLocalName;
-                       public XmlDictionaryString DictNS;
-                       public XmlDictionaryString DictValue; // BF.TextIndex
-                       public XmlNodeType NodeType;
-                       public object TypedValue;
-                       public byte ValueType;
-
-                       // -1 for nothing,
-                       // -2 for that of element (only for attribute),
-                       // 0 or more to fill later
-                       public int NSSlot;
-
-                       string name = String.Empty;
-                       string local_name = String.Empty;
-                       string ns = String.Empty;
-                       string value;
-
-                       public string LocalName {
-                               get { return DictLocalName != null ? DictLocalName.Value : local_name; }
-                               set {
-                                       DictLocalName = null;
-                                       local_name = value;
-                               }
-                       }
-
-                       public string NS {
-                               get { return DictNS != null ? DictNS.Value : ns; }
-                               set {
-                                       DictNS = null;
-                                       ns = value;
-                               }
-                       }
-
-                       public string Name {
-                               get {
-                                       if (name.Length == 0)
-                                               name = Prefix.Length > 0 ?
-                                                       String.Concat (Prefix, ":", LocalName) :
-                                                       LocalName;
-                                       return name;
-                               }
-                       }
-
-                       public virtual string Value {
-                               get {
-                                       switch (ValueType) {
-                                       case 0:
-                                       case BF.Comment:
-                                       case BF.Chars8:
-                                       case BF.Chars16:
-                                       case BF.Chars32:
-                                       case BF.EmptyText:
-                                       case BF.Utf16_8:
-                                       case BF.Utf16_16:
-                                       case BF.Utf16_32:
-                                               return value;
-                                       case BF.TextIndex:
-                                               return DictValue.Value;
-                                       case BF.Zero:
-                                               return "0";
-                                       case BF.One:
-                                               return "1";
-                                       case BF.BoolTrue:
-                                               return "true";
-                                       case BF.BoolFalse:
-                                               return "false";
-                                       case BF.Int8:
-                                               return XmlConvert.ToString ((byte) TypedValue);
-                                       case BF.Int16:
-                                               return XmlConvert.ToString ((short) TypedValue);
-                                       case BF.Int32:
-                                               return XmlConvert.ToString ((int) TypedValue);
-                                       case BF.Int64:
-                                               return XmlConvert.ToString ((long) TypedValue);
-                                       case BF.Single:
-                                               return XmlConvert.ToString ((float) TypedValue);
-                                       case BF.Double:
-                                               return XmlConvert.ToString ((double) TypedValue);
-                                       case BF.Decimal:
-                                               return XmlConvert.ToString ((decimal) TypedValue);
-                                       case BF.DateTime:
-                                               return XmlConvert.ToString ((DateTime) TypedValue, XmlDateTimeSerializationMode.RoundtripKind);
-                                       case BF.TimeSpan:
-                                               return XmlConvert.ToString ((TimeSpan) TypedValue);
-                                       case BF.Guid:
-                                               return XmlConvert.ToString ((Guid) TypedValue);
-                                       case BF.UniqueId:
-                                               return TypedValue.ToString ();
-                                       case BF.Bytes8:
-                                       case BF.Bytes16:
-                                       case BF.Bytes32:
-                                               return Convert.ToBase64String ((byte []) TypedValue);
-                                       case BF.QNameIndex:
-                                               return Name;
-                                       default:
-                                               throw new NotImplementedException ("ValueType " + ValueType + " on node " + NodeType);
-                                       }
-                               }
-                               set { this.value = value; }
-                       }
-
-                       public virtual void Reset ()
-                       {
-                               Position = 0;
-                               DictLocalName = DictNS = null;
-                               LocalName = NS = Prefix = Value = name = String.Empty;
-                               NodeType = XmlNodeType.None;
-                               TypedValue = null;
-                               ValueType = 0;
-                               NSSlot = -1;
-                       }
-               }
-
-               class AttrNodeInfo : NodeInfo
-               {
-                       public AttrNodeInfo (XmlBinaryDictionaryReader owner)
-                       {
-                               this.owner = owner;
-                       }
-
-                       XmlBinaryDictionaryReader owner;
-                       public int ValueIndex;
-
-                       public override void Reset ()
-                       {
-                               base.Reset ();
-                               ValueIndex = -1;
-                               NodeType = XmlNodeType.Attribute;
-                       }
-
-                       public override string Value {
-                               get { return owner.attr_values [ValueIndex].Value; }
-                       }
-               }
-
-               ISource source;
-               IXmlDictionary dictionary;
-               XmlDictionaryReaderQuotas quota;
-               XmlBinaryReaderSession session;
-               OnXmlDictionaryReaderClose on_close;
-               XmlParserContext context;
-
-               ReadState state = ReadState.Initial;
-               NodeInfo node;
-               NodeInfo current;
-               List<AttrNodeInfo> attributes = new List<AttrNodeInfo> ();
-               List<NodeInfo> attr_values = new List<NodeInfo> ();
-               List<NodeInfo> node_stack = new List<NodeInfo> ();
-               List<QName> ns_store = new List<QName> ();
-               Dictionary<int,XmlDictionaryString> ns_dict_store =
-                       new Dictionary<int,XmlDictionaryString> ();
-               int attr_count;
-               int attr_value_count;
-               int current_attr = -1;
-               int depth = 0;
-               // used during Read()
-               int ns_slot;
-               // next byte in the source (one byte token ahead always
-               // happens because there is no "end of start element" mark).
-               int next = -1;
-               bool is_next_end_element;
-               // temporary buffer for utf8enc.GetString()
-               byte [] tmp_buffer = new byte [128];
-               UTF8Encoding utf8enc = new UTF8Encoding ();
-
-               // See comment at Read()
-               int array_item_remaining;
-               byte array_item_type;
-               XmlNodeType array_state;
-
-               public XmlBinaryDictionaryReader (byte [] buffer, int offset,
-                       int count, IXmlDictionary dictionary,
-                       XmlDictionaryReaderQuotas quota,
-                       XmlBinaryReaderSession session,
-                       OnXmlDictionaryReaderClose onClose)
-               {
-                       source = /*new ArraySource (buffer, offset, count);*/
-                               new StreamSource (new MemoryStream (buffer, offset, count));
-                       Initialize (dictionary, quota, session, onClose);
-               }
-
-               public XmlBinaryDictionaryReader (Stream stream,
-                       IXmlDictionary dictionary,
-                       XmlDictionaryReaderQuotas quota,
-                       XmlBinaryReaderSession session,
-                       OnXmlDictionaryReaderClose onClose)
-               {
-                       source = new StreamSource (stream);
-                       Initialize (dictionary, quota, session, onClose);
-               }
-
-               private void Initialize (IXmlDictionary dictionary,
-                       XmlDictionaryReaderQuotas quotas,
-                       XmlBinaryReaderSession session,
-                       OnXmlDictionaryReaderClose onClose)
-               {
-                       if (quotas == null)
-                               throw new ArgumentNullException ("quotas");
-                       if (dictionary == null)
-                               dictionary = new XmlDictionary ();
-                       this.dictionary = dictionary;
-
-                       this.quota = quotas;
-
-                       if (session == null)
-                               session = new XmlBinaryReaderSession ();
-                       this.session = session;
-
-                       on_close = onClose;
-                       NameTable nt = new NameTable ();
-                       this.context = new XmlParserContext (nt,
-                               new XmlNamespaceManager (nt),
-                               null, XmlSpace.None);
-
-                       current = node = new NodeInfo ();
-                       current.Reset ();
-                       node_stack.Add (node);
-               }
-
-               public override int AttributeCount {
-                       get { return attr_count; }
-               }
-
-               public override string BaseURI {
-                       get { return context.BaseURI; }
-               }
-
-               public override int Depth {
-                       get { return current == node ? depth : NodeType == XmlNodeType.Attribute ? depth + 1 : depth + 2; }
-               }
-
-               public override bool EOF {
-                       get { return state == ReadState.EndOfFile || state == ReadState.Error; }
-               }
-
-               public override bool HasValue {
-                       get { return Value.Length > 0; }
-               }
-
-               public override bool IsEmptyElement {
-                       get { return false; }
-               }
-
-               public override XmlNodeType NodeType {
-                       get { return current.NodeType; }
-               }
-
-               public override string Prefix {
-                       get { return current_attr >= 0 ? attributes [current_attr].Prefix : current.Prefix; }
-               }
-
-               // looks like it may return attribute's name even if it is on its value node.
-               public override string LocalName {
-                       get { return current_attr >= 0 ? attributes [current_attr].LocalName : current.LocalName; }
-               }
-
-               public override string Name {
-                       get { return current_attr >= 0 ? attributes [current_attr].Name : current.Name; }
-               }
-
-               public override string NamespaceURI {
-                       get { return current_attr >= 0 ? attributes [current_attr].NS : current.NS; }
-               }
-
-               public override XmlNameTable NameTable {
-                       get { return context.NameTable; }
-               }
-
-               public override XmlDictionaryReaderQuotas Quotas {
-                       get { return quota; }
-               }
-
-               public override ReadState ReadState {
-                       get { return state; }
-               }
-
-               public override string Value {
-                       get { return current.Value; }
-               }
-
-               public override void Close ()
-               {
-                       if (on_close != null)
-                               on_close (this);
-               }
-
-               public override string GetAttribute (int i)
-               {
-                       if (i >= attr_count)
-                               throw new ArgumentOutOfRangeException (String.Format ("Specified attribute index is {0} and should be less than {1}", i, attr_count));
-                       return attributes [i].Value;
-               }
-
-               public override string GetAttribute (string name)
-               {
-                       for (int i = 0; i < attr_count; i++)
-                               if (attributes [i].Name == name)
-                                       return attributes [i].Value;
-                       return null;
-               }
-
-               public override string GetAttribute (string localName, string ns)
-               {
-                       for (int i = 0; i < attr_count; i++)
-                               if (attributes [i].LocalName == localName &&
-                                       attributes [i].NS == ns)
-                                       return attributes [i].Value;
-                       return null;
-               }
-
-               public IDictionary<string,string> GetNamespacesInScope (
-                       XmlNamespaceScope scope)
-               {
-                       return context.NamespaceManager.GetNamespacesInScope (scope);
-               }
-
-               public string LookupPrefix (string ns)
-               {
-                       return context.NamespaceManager.LookupPrefix (NameTable.Get (ns));
-               }
-
-               public override string LookupNamespace (string prefix)
-               {
-                       return context.NamespaceManager.LookupNamespace (
-                               NameTable.Get (prefix));
-               }
-
-               public override bool IsArray (out Type type)
-               {
-                       if (array_state == XmlNodeType.Element) {
-                               type = GetArrayType (array_item_type);
-                               return true;
-                       } else {
-                               type = null;
-                               return false;
-                       }
-               }
-
-               public override bool MoveToElement ()
-               {
-                       bool ret = current_attr >= 0;
-                       current_attr = -1;
-                       current = node;
-                       return ret;
-               }
-
-               public override bool MoveToFirstAttribute ()
-               {
-                       if (attr_count == 0)
-                               return false;
-                       current_attr = 0;
-                       current = attributes [current_attr];
-                       return true;
-               }
-
-               public override bool MoveToNextAttribute ()
-               {
-                       if (++current_attr < attr_count) {
-                               current = attributes [current_attr];
-                               return true;
-                       } else {
-                               --current_attr;
-                               return false;
-                       }
-               }
-
-               public override void MoveToAttribute (int i)
-               {
-                       if (i >= attr_count)
-                               throw new ArgumentOutOfRangeException (String.Format ("Specified attribute index is {0} and should be less than {1}", i, attr_count));
-                       current_attr = i;
-                       current = attributes [i];
-               }
-
-               public override bool MoveToAttribute (string name)
-               {
-                       for (int i = 0; i < attributes.Count; i++) {
-                               if (attributes [i].Name == name) {
-                                       MoveToAttribute (i);
-                                       return true;
-                               }
-                       }
-                       return false;
-               }
-
-               public override bool MoveToAttribute (string localName, string ns)
-               {
-                       for (int i = 0; i < attributes.Count; i++) {
-                               if (attributes [i].LocalName == localName &&
-                                       attributes [i].NS == ns) {
-                                       MoveToAttribute (i);
-                                       return true;
-                               }
-                       }
-                       return false;
-               }
-
-               public override bool ReadAttributeValue ()
-               {
-                       if (current_attr < 0)
-                               return false;
-                       int start = attributes [current_attr].ValueIndex;
-                       int end = current_attr + 1 == attr_count ? attr_value_count : attributes [current_attr + 1].ValueIndex;
-                       if (start == end)
-                               return false;
-                       if (!current.IsAttributeValue) {
-                               current = attr_values [start];
-                               return true;
-                       }
-                       // Actually there is no case for attribute whose value is split to more than two nodes. We could simplify the node structure.
-                       return false;
-               }
-
-               // When reading an array (0x03), it requires extraneously
-               // complex procedure for XmlReader. First, it reads element,
-               // type of operation and length of the items. And this XmlReader
-               // has to return Element state. On the next Read(), it proceeds
-               // to the value node of the first item of the array, so it
-               // reads the value stream. On the next Read(), it proceeds to
-               // EndElement, so it should not read anything from stream while
-               // it has to move to the node state to EndElement.
-               public override bool Read ()
-               {
-                       switch (state) {
-                       case ReadState.Closed:
-                       case ReadState.EndOfFile:
-                       case ReadState.Error:
-                               return false;
-                       }
-
-                       // clear.
-                       state = ReadState.Interactive;
-                       MoveToElement ();
-                       attr_count = 0;
-                       attr_value_count = 0;
-                       ns_slot = 0;
-
-                       if (node.NodeType == XmlNodeType.Element) {
-                               // push element scope
-                               if (node_stack.Count <= ++depth) {
-                                       if (depth == quota.MaxDepth)
-                                               throw new XmlException (String.Format ("Binary XML stream quota exceeded. Depth must be less than {0}", quota.MaxDepth));
-                                       node = new NodeInfo ();
-                                       node_stack.Add (node);
-                               } else {
-                                       node = node_stack [depth]; // reuse
-                                       node.Reset ();
-                               }
-                       }
-                       current = node;
-
-                       if (is_next_end_element) {
-                               is_next_end_element = false;
-                               node.Reset ();
-                               ProcessEndElement ();
-                               return true;
-                       }
-
-                       // process array node after preparing node stack.
-                       switch (array_state) {
-                       case XmlNodeType.Element:
-                               ReadArrayItem ();
-                               return true;
-                       case XmlNodeType.Text:
-                               ShiftToArrayItemEndElement ();
-                               return true;
-                       case XmlNodeType.EndElement:
-                               if (--array_item_remaining == 0) {
-                                       array_state = XmlNodeType.None;
-                                       break;
-                               } else {
-                                       ShiftToArrayItemElement ();
-                                       return true;
-                               }
-                       }
-
-                       // array consumer does not expect Reset whlie it's on reading. So call it later than array check.
-                       node.Reset ();
-
-                       int ident = next >= 0 ? next : source.ReadByte ();
-                       next = -1;
-
-                       // check end of source.
-                       if (ident < 0) {
-                               state = ReadState.EndOfFile;
-                               current.Reset ();
-                               return false;
-                       }
-
-                       is_next_end_element = ident > 0x80 && (ident & 1) == 1;
-                       ident -= is_next_end_element ? 1 : 0;
-
-                       switch (ident) {
-                       case BF.EndElement:
-                               ProcessEndElement ();
-                               break;
-                       case BF.Comment:
-                               node.Value = ReadUTF8 ();
-                               node.ValueType = BF.Comment;
-                               node.NodeType = XmlNodeType.Comment;
-                               break;
-                       case BF.ElemString:
-                       case BF.ElemStringPrefix:
-                       case BF.ElemIndex:
-                       case BF.ElemIndexPrefix:
-                               ReadElementBinary ((byte) ident);
-                               break;
-
-                       case BF.Array:
-                               ident = ReadByteOrError ();
-                               ReadElementBinary ((byte) ident);
-                               ident = ReadByteOrError ();
-                               if (ident != 0x01)
-                                       throw new XmlException (String.Format ("EndElement is expected after element in an array. The actual byte was {0:X} in hexadecimal", ident));
-                               ident = ReadByteOrError () - 1; // -1 becauseit contains EndElement
-                               VerifyValidArrayItemType (ident);
-                               if (ident < 0)
-                                       throw new XmlException ("The stream has ended where the array item type is expected");
-                               array_item_type = (byte) ident;
-                               array_item_remaining = ReadVariantSize ();
-                               if (array_item_remaining > quota.MaxArrayLength)
-                                       throw new Exception (String.Format ("Binary xml stream exceeded max array length quota. Items are {0} and should be less than quota.MaxArrayLength", quota.MaxArrayLength));
-                               array_state = XmlNodeType.Element;
-                               break;
-
-                       default:
-                               if (BF.PrefixNElemIndexStart <= ident && ident <= BF.PrefixNElemIndexEnd ||
-                                   BF.PrefixNElemStringStart <= ident && ident <= BF.PrefixNElemStringEnd)
-                                       goto case BF.ElemString;
-                               ReadTextOrValue ((byte) ident, node, false);
-                               break;
-                       }
-
-                       return true;
-               }
-
-               void ReadArrayItem ()
-               {
-                       ReadTextOrValue (array_item_type, node, false);
-                       array_state = XmlNodeType.Text;
-               }
-
-               void ShiftToArrayItemEndElement ()
-               {
-                       ProcessEndElement ();
-                       array_state = XmlNodeType.EndElement;
-               }
-
-               void ShiftToArrayItemElement ()
-               {
-                       node.NodeType = XmlNodeType.Element;
-                       context.NamespaceManager.PushScope ();
-                       array_state = XmlNodeType.Element;
-               }
-
-               void VerifyValidArrayItemType (int ident)
-               {
-                       if (GetArrayType (ident) == null)
-                               throw new XmlException (String.Format ("Unexpected array item type {0:X} in hexadecimal", ident));
-               }
-               
-               Type GetArrayType (int ident)
-               {
-                       switch (ident) {
-                       case BF.Bool:
-                               return typeof (bool);
-                       case BF.Int16:
-                               return typeof (short);
-                       case BF.Int32:
-                               return typeof (int);
-                       case BF.Int64:
-                               return typeof (long);
-                       case BF.Single:
-                               return typeof (float);
-                       case BF.Double:
-                               return typeof (double);
-                       case BF.Decimal:
-                               return typeof (decimal);
-                       case BF.DateTime:
-                               return typeof (DateTime);
-                       case BF.TimeSpan:
-                               return typeof (TimeSpan);
-                       case BF.Guid:
-                               return typeof (Guid);
-                       }
-                       return null;
-               }
-
-               private void ProcessEndElement ()
-               {
-                       if (depth == 0)
-                               throw new XmlException ("Unexpected end of element while there is no element started.");
-                       current = node = node_stack [--depth];
-                       node.NodeType = XmlNodeType.EndElement;
-                       context.NamespaceManager.PopScope ();
-               }
-
-               private void ReadElementBinary (int ident)
-               {
-                       // element
-                       node.NodeType = XmlNodeType.Element;
-                       node.Prefix = String.Empty;
-                       context.NamespaceManager.PushScope ();
-                       switch (ident) {
-                       case BF.ElemString:
-                               node.LocalName = ReadUTF8 ();
-                               break;
-                       case BF.ElemStringPrefix:
-                               node.Prefix = ReadUTF8 ();
-                               node.NSSlot = ns_slot++;
-                               goto case BF.ElemString;
-                       case BF.ElemIndex:
-                               node.DictLocalName = ReadDictName ();
-                               break;
-                       case BF.ElemIndexPrefix:
-                               node.Prefix = ReadUTF8 ();
-                               node.NSSlot = ns_slot++;
-                               goto case BF.ElemIndex;
-                       default:
-                               if (BF.PrefixNElemIndexStart <= ident && ident <= BF.PrefixNElemIndexEnd) {
-                                       node.Prefix = ((char) (ident - BF.PrefixNElemIndexStart + 'a')).ToString ();
-                                       node.DictLocalName = ReadDictName ();
-                               } else if (BF.PrefixNElemStringStart <= ident && ident <= BF.PrefixNElemStringEnd) {
-                                       node.Prefix = ((char) (ident - BF.PrefixNElemStringStart + 'a')).ToString ();
-                                       node.LocalName = ReadUTF8 ();
-                               }
-                               else
-                                       throw new XmlException (String.Format ("Invalid element node type {0:X02} in hexadecimal", ident));
-                               break;
-                       }
-
-                       bool loop = true;
-                       do {
-                               ident = ReadByteOrError ();
-
-                               switch (ident) {
-                               case BF.AttrString:
-                               case BF.AttrStringPrefix:
-                               case BF.AttrIndex:
-                               case BF.AttrIndexPrefix:
-                                       ReadAttribute ((byte) ident);
-                                       break;
-                               case BF.DefaultNSString:
-                               case BF.PrefixNSString:
-                               case BF.DefaultNSIndex:
-                               case BF.PrefixNSIndex:
-                                       ReadNamespace ((byte) ident);
-                                       break;
-                               default:
-                                       if (BF.PrefixNAttrStringStart <= ident && ident <= BF.PrefixNAttrStringEnd ||
-                                           BF.PrefixNAttrIndexStart <= ident && ident <= BF.PrefixNAttrIndexEnd)
-                                               ReadAttribute ((byte) ident);
-                                       else {
-                                               next = ident;
-                                               loop = false;
-                                       }
-                                       break;
-                               }
-                       } while (loop);
-
-                       node.NS = context.NamespaceManager.LookupNamespace (node.Prefix) ?? String.Empty;
-                       foreach (AttrNodeInfo a in attributes)
-                               if (a.Prefix.Length > 0)
-                                       a.NS = context.NamespaceManager.LookupNamespace (a.Prefix);
-
-                       ns_store.Clear ();
-                       ns_dict_store.Clear ();
-               }
-
-               private void ReadAttribute (byte ident)
-               {
-                       if (attributes.Count == attr_count)
-                               attributes.Add (new AttrNodeInfo (this));
-                       AttrNodeInfo a = attributes [attr_count++];
-                       a.Reset ();
-                       a.Position = source.Position;
-
-                       switch (ident) {
-                       case BF.AttrString:
-                               a.LocalName = ReadUTF8 ();
-                               break;
-                       case BF.AttrStringPrefix:
-                               a.Prefix = ReadUTF8 ();
-                               a.NSSlot = ns_slot++;
-                               goto case BF.AttrString;
-                       case BF.AttrIndex:
-                               a.DictLocalName = ReadDictName ();
-                               break;
-                       case BF.AttrIndexPrefix:
-                               a.Prefix = ReadUTF8 ();
-                               a.NSSlot = ns_slot++;
-                               goto case BF.AttrIndex;
-                       default:
-                               if (BF.PrefixNAttrStringStart <= ident && ident <= BF.PrefixNAttrStringEnd) {
-                                       a.Prefix = ((char) ('a' + ident - BF.PrefixNAttrStringStart)).ToString ();
-                                       a.LocalName = ReadUTF8 ();
-                                       break;
-                               }
-                               else if (BF.PrefixNAttrIndexStart <= ident && ident <= BF.PrefixNAttrIndexEnd) {
-                                       a.Prefix = ((char) ('a' + ident - BF.PrefixNAttrIndexStart)).ToString ();
-                                       a.DictLocalName = ReadDictName ();
-                                       break;
-                               }
-                               else throw new XmlException (String.Format ("Unexpected attribute node type: 0x{0:X02}", ident));
-                       }
-                       ReadAttributeValueBinary (a);
-               }
-
-               private void ReadNamespace (byte ident)
-               {
-                       // create attrubute slot.
-                       if (attributes.Count == attr_count)
-                               attributes.Add (new AttrNodeInfo (this));
-                       AttrNodeInfo a = attributes [attr_count++];
-                       a.Reset ();
-                       a.Position = source.Position;
-
-                       string prefix = null, ns = null;
-                       XmlDictionaryString dns = null;
-
-                       switch (ident) {
-                       case BF.DefaultNSString:
-                               prefix = String.Empty;
-                               ns = ReadUTF8 ();
-                               break;
-                       case BF.PrefixNSString:
-                               prefix = ReadUTF8 ();
-                               ns = ReadUTF8 ();
-                               break;
-                       case BF.DefaultNSIndex:
-                               prefix = String.Empty;
-                               dns = ReadDictName ();
-                               ns_dict_store.Add (ns_store.Count, dns);
-                               ns = dns.Value;
-                               break;
-                       case BF.PrefixNSIndex:
-                               prefix = ReadUTF8 ();
-                               dns = ReadDictName ();
-                               ns_dict_store.Add (ns_store.Count, dns);
-                               ns = dns.Value;
-                               break;
-                       }
-
-                       // fill attribute slot.
-                       a.Prefix = prefix.Length > 0 ? "xmlns" : String.Empty;
-                       a.LocalName = prefix.Length > 0 ? prefix : "xmlns";
-                       a.NS = "http://www.w3.org/2000/xmlns/";
-                       a.ValueIndex = attr_value_count;
-                       if (attr_value_count == attr_values.Count)
-                               attr_values.Add (new NodeInfo (true));
-                       NodeInfo v = attr_values [attr_value_count++];
-                       v.Reset ();
-                       v.Value = ns;
-                       v.ValueType = BF.Chars8;
-                       v.NodeType = XmlNodeType.Text;
-
-                       ns_store.Add (new QName (prefix, ns));
-                       context.NamespaceManager.AddNamespace (prefix, ns);
-               }
-
-               private void ReadAttributeValueBinary (AttrNodeInfo a)
-               {
-                       a.ValueIndex = attr_value_count;
-                       if (attr_value_count == attr_values.Count)
-                               attr_values.Add (new NodeInfo (true));
-                       NodeInfo v = attr_values [attr_value_count++];
-                       v.Reset ();
-                       int ident = ReadByteOrError ();
-                       bool end = ident > 0x80 && (ident & 1) == 1;
-                       ident -= end ? 1 : 0;
-                       ReadTextOrValue ((byte) ident, v, true);
-               }
-
-               private bool ReadTextOrValue (byte ident, NodeInfo node, bool canSkip)
-               {
-                       node.Value = null;
-                       node.ValueType = ident;
-                       node.NodeType = XmlNodeType.Text;
-                       switch (ident) {
-                       case BF.Zero:
-                               node.TypedValue = 0;
-                               break;
-                       case BF.One:
-                               node.TypedValue = 1;
-                               break;
-                       case BF.BoolFalse:
-                               node.TypedValue = false;
-                               break;
-                       case BF.BoolTrue:
-                               node.TypedValue = true;
-                               break;
-                       case BF.Int8:
-                               node.TypedValue = ReadByteOrError ();
-                               break;
-                       case BF.Int16:
-                               node.TypedValue = source.Reader.ReadInt16 ();
-                               break;
-                       case BF.Int32:
-                               node.TypedValue = source.Reader.ReadInt32 ();
-                               break;
-                       case BF.Int64:
-                               node.TypedValue = source.Reader.ReadInt64 ();
-                               break;
-                       case BF.Single:
-                               node.TypedValue = source.Reader.ReadSingle ();
-                               break;
-                       case BF.Double:
-                               node.TypedValue = source.Reader.ReadDouble ();
-                               break;
-                       case BF.Decimal:
-                               int [] bits = new int [4];
-                               bits [3] = source.Reader.ReadInt32 ();
-                               bits [2] = source.Reader.ReadInt32 ();
-                               bits [0] = source.Reader.ReadInt32 ();
-                               bits [1] = source.Reader.ReadInt32 ();
-                               node.TypedValue = new Decimal (bits);
-                               break;
-                       case BF.DateTime:
-                               node.TypedValue = DateTime.FromBinary (source.Reader.ReadInt64 ());
-                               break;
-                       //case BF.UniqueId: // identical to .Text
-                       case BF.Bytes8:
-                       case BF.Bytes16:
-                       case BF.Bytes32:
-                               int size =
-                                       (ident == BF.Bytes8) ? source.Reader.ReadByte () :
-                                       (ident == BF.Bytes16) ? source.Reader.ReadUInt16 () :
-                                       source.Reader.ReadInt32 ();
-                               byte [] base64 = Alloc (size);
-                               source.Reader.Read (base64, 0, base64.Length);
-                               node.TypedValue = base64;
-                               break;
-                       case BF.TimeSpan:
-                               node.TypedValue = new TimeSpan (source.Reader.ReadInt64 ());
-                               break;
-                       case BF.UniqueId:
-                               byte [] guid = new byte [16];
-                               source.Reader.Read (guid, 0, guid.Length);
-                               node.TypedValue = new UniqueId (new Guid (guid));
-                               break;
-                       case BF.Guid:
-                               guid = new byte [16];
-                               source.Reader.Read (guid, 0, guid.Length);
-                               node.TypedValue = new Guid (guid);
-                               break;
-                       case BF.Chars8:
-                       case BF.Chars16:
-                       case BF.Chars32:
-                       case BF.Utf16_8:
-                       case BF.Utf16_16:
-                       case BF.Utf16_32:
-                               Encoding enc = ident <= BF.Chars32 ? Encoding.UTF8 : Encoding.Unicode;
-                               size =
-                                       (ident == BF.Chars8 || ident == BF.Utf16_8) ? source.Reader.ReadByte () :
-                                       (ident == BF.Chars16 || ident == BF.Utf16_16) ? source.Reader.ReadUInt16 () :
-                                       source.Reader.ReadInt32 ();
-                               byte [] bytes = Alloc (size);
-                               source.Reader.Read (bytes, 0, size);
-                               node.Value = enc.GetString (bytes, 0, size);
-                               node.NodeType = XmlNodeType.Text;
-                               break;
-                       case BF.EmptyText:
-                               node.Value = String.Empty;
-                               node.NodeType = XmlNodeType.Text;
-                               break;
-                       case BF.TextIndex:
-                               node.DictValue = ReadDictName ();
-                               node.NodeType = XmlNodeType.Text;
-                               break;
-                       case BF.QNameIndex:
-                               node.Prefix = ((char) (ReadByteOrError () + 'a')).ToString ();
-                               node.DictLocalName = ReadDictName();
-                               break;  
-                       default:
-                               if (!canSkip)
-                                       throw new ArgumentException (String.Format ("Unexpected binary XML data at position {1}: {0:X}", ident + (is_next_end_element ? 1 : 0), source.Position));
-                               next = ident;
-                               return false;
-                       }
-                       return true;
-               }
-
-               byte [] Alloc (int size)
-               {
-                       if (size > quota.MaxStringContentLength || size < 0)
-                               throw new XmlException (String.Format ("Text content buffer exceeds the quota limitation at {2}. {0} bytes and should be less than {1} bytes", size, quota.MaxStringContentLength, source.Position));
-                       return new byte [size];
-               }
-
-               private int ReadVariantSize ()
-               {
-                       int size = 0;
-                       // If sizeSpec < 0, then it is variant size specifier.
-                       // Otherwise it is fixed size s = sizeSpec + 1 byte(s).
-                       int d = 0;
-                       do {
-                               byte got = ReadByteOrError ();
-                               size += (got & 0x7F) << d;
-                               d += 7;
-                               if (got < 0x80)
-                                       break;
-                       } while (true);
-                       return size;
-               }
-
-               private string ReadUTF8 ()
-               {
-                       int size = ReadVariantSize ();
-                       if (size == 0)
-                               return String.Empty;
-                       if (tmp_buffer.Length < size) {
-                               int extlen = tmp_buffer.Length * 2;
-                               tmp_buffer = Alloc (size < extlen ? extlen : size);
-                       }
-                       size = source.Read (tmp_buffer, 0, size);
-                       return utf8enc.GetString (tmp_buffer, 0, size);
-               }
-
-               private XmlDictionaryString ReadDictName ()
-               {
-                       int key = ReadVariantSize ();
-                       XmlDictionaryString s;
-                       if ((key & 1) == 1) {
-                               if (session.TryLookup (key >> 1, out s))
-                                       return s;
-                       } else {
-                               if (dictionary.TryLookup (key >> 1, out s))
-                                       return s;
-                       }
-                       throw new XmlException (String.Format ("Input XML binary stream is invalid. No matching XML dictionary string entry at {0}. Binary stream position at {1}", key, source.Position));
-               }
-
-               private byte ReadByteOrError ()
-               {
-                       if (next >= 0) {
-                               byte b = (byte) next;
-                               next = -1;
-                               return b;
-                       }
-                       int ret = source.ReadByte ();
-                       if (ret < 0)
-                               throw new XmlException (String.Format ("Unexpected end of binary stream. Position is at {0}", source.Position));
-                       return (byte) ret;
-               }
-
-               public override void ResolveEntity ()
-               {
-                       throw new NotSupportedException ("this XmlReader does not support ResolveEntity.");
-               }
-
-               public override bool TryGetBase64ContentLength (out int length)
-               {
-                       length = 0;
-                       switch (current.ValueType) {
-                       case BF.Bytes8:
-                       case BF.Bytes16:
-                       case BF.Bytes32:
-                               length = ((byte []) current.TypedValue).Length;
-                               return true;
-                       }
-                       return false;
-               }
-
-               public override string ReadContentAsString ()
-               {
-                       string value = String.Empty;
-                       do {
-                               switch (NodeType) {
-                               case XmlNodeType.Element:
-                               case XmlNodeType.EndElement:
-                                       return value;
-                               case XmlNodeType.Text:
-                                       value += Value;
-                                       break;
-                               }
-                       } while (Read ());
-                       return value;
-               }
-
-               #region read typed content
-
-               public override int ReadContentAsInt ()
-               {
-                       int ret = GetIntValue ();
-                       Read ();
-                       return ret;
-               }
-               
-               int GetIntValue ()
-               {
-                       switch (node.ValueType) {
-                       case BF.Zero:
-                               return 0;
-                       case BF.One:
-                               return 1;
-                       case BF.Int8:
-                               return (byte) current.TypedValue;
-                       case BF.Int16:
-                               return (short) current.TypedValue;
-                       case BF.Int32:
-                               return (int) current.TypedValue;
-                       }
-                       throw new InvalidOperationException (String.Format ("Current content is not an integer. (Internal value type:{0:X02})", (int) node.ValueType));
-               }
-
-               public override long ReadContentAsLong ()
-               {
-                       if (node.ValueType == BF.Int64) {
-                               long v = (long) current.TypedValue;
-                               Read ();
-                               return v;
-                       }
-                       return ReadContentAsInt ();
-               }
-
-               public override float ReadContentAsFloat ()
-               {
-                       if (node.ValueType != BF.Single)
-                               throw new InvalidOperationException ("Current content is not a single");
-                       float v = (float) current.TypedValue;
-                       Read ();
-                       return v;
-               }
-
-               public override double ReadContentAsDouble ()
-               {
-                       if (node.ValueType != BF.Double)
-                               throw new InvalidOperationException ("Current content is not a double");
-                       double v = (double) current.TypedValue;
-                       Read ();
-                       return v;
-               }
-
-               bool IsBase64Node (byte b)
-               {
-                       switch (b) {
-                       case BF.Bytes8:
-                       case BF.Bytes16:
-                       case BF.Bytes32:
-                               return true;
-                       }
-                       return false;
-               }
-
-               // FIXME: this is not likely to consume sequential base64 nodes.
-               public override byte [] ReadContentAsBase64 ()
-               {
-                       byte [] ret = null;
-                       if (!IsBase64Node (node.ValueType))
-                               throw new InvalidOperationException ("Current content is not base64");
-
-                       while (NodeType == XmlNodeType.Text && IsBase64Node (node.ValueType)) {
-                               if (ret == null)
-                                       ret = (byte []) node.TypedValue;
-                               else {
-                                       byte [] tmp = (byte []) node.TypedValue;
-                                       byte [] tmp2 = Alloc (ret.Length + tmp.Length);
-                                       Array.Copy (ret, tmp2, ret.Length);
-                                       Array.Copy (tmp, 0, tmp2, ret.Length, tmp.Length);
-                                       ret = tmp2;
-                               }
-                               Read ();
-                               //MoveToContent ();
-                       }
-                       return ret;
-               }
-
-               public override Guid ReadContentAsGuid ()
-               {
-                       if (node.ValueType != BF.Guid)
-                               throw new InvalidOperationException ("Current content is not a Guid");
-                       Guid ret = (Guid) node.TypedValue;
-                       Read ();
-                       return ret;
-               }
-
-               public override UniqueId ReadContentAsUniqueId ()
-               {
-                       switch (node.ValueType) {
-                       case BF.Chars8:
-                       case BF.Chars16:
-                       case BF.Chars32:
-                       case BF.Utf16_8:
-                       case BF.Utf16_16:
-                       case BF.Utf16_32:
-                               UniqueId ret = new UniqueId (node.Value);
-                               Read ();
-                               return ret;
-                       case BF.UniqueId:
-                               ret = (UniqueId) node.TypedValue;
-                               Read ();
-                               return ret;
-                       default:
-                               throw new InvalidOperationException ("Current content is not a UniqueId");
-                       }
-               }
-
-               #endregion
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Xml/XmlBinaryDictionaryWriter.cs b/mcs/class/System.Runtime.Serialization/System.Xml/XmlBinaryDictionaryWriter.cs
deleted file mode 100644 (file)
index 4f0674d..0000000
+++ /dev/null
@@ -1,1102 +0,0 @@
-//
-// XmlBinaryDictionaryWriter.cs
-//
-// Author:
-//     Atsushi Enomoto  <atsushi@ximian.com>
-//
-// Copyright (C) 2005, 2007 Novell, Inc.  http://www.novell.com
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.Collections;
-using System.Collections.Specialized;
-using System.Collections.Generic;
-using System.Globalization;
-using System.IO;
-using System.Linq;
-using System.Text;
-
-using BF = System.Xml.XmlBinaryFormat;
-
-namespace System.Xml
-{
-       internal partial class XmlBinaryDictionaryWriter : XmlDictionaryWriter
-       {
-               class MyBinaryWriter : BinaryWriter
-               {
-                       public MyBinaryWriter (Stream s)
-                               : base (s)
-                       {
-                       }
-
-                       public void WriteFlexibleInt (int value)
-                       {
-                               Write7BitEncodedInt (value);
-                       }
-               }
-
-               #region Fields
-               MyBinaryWriter original, writer, buffer_writer;
-               IXmlDictionary dict_ext;
-               XmlDictionary dict_int = new XmlDictionary ();
-               XmlBinaryWriterSession session;
-               bool owns_stream;
-               Encoding utf8Enc = new UTF8Encoding ();
-               MemoryStream buffer = new MemoryStream ();
-
-               const string XmlNamespace = "http://www.w3.org/XML/1998/namespace";
-               const string XmlnsNamespace = "http://www.w3.org/2000/xmlns/";
-
-               WriteState state = WriteState.Start;
-               bool open_start_element = false;
-               // transient current node info
-               List<KeyValuePair<string,object>> namespaces = new List<KeyValuePair<string,object>> ();
-               string xml_lang = null;
-               XmlSpace xml_space = XmlSpace.None;
-               int ns_index = 0;
-               // stacked info
-               Stack<int> ns_index_stack = new Stack<int> ();
-               Stack<string> xml_lang_stack = new Stack<string> ();
-               Stack<XmlSpace> xml_space_stack = new Stack<XmlSpace> ();
-               Stack<string> element_ns_stack = new Stack<string> ();
-               string element_ns = String.Empty;
-               int element_count;
-               string element_prefix; // only meaningful at Element state
-               // current attribute info
-               string attr_value;
-               string current_attr_prefix;
-               object current_attr_name, current_attr_ns;
-               bool attr_typed_value;
-               SaveTarget save_target;
-
-               enum SaveTarget {
-                       None,
-                       Namespaces,
-                       XmlLang,
-                       XmlSpace
-               }
-
-               // XmlWriterSettings support
-
-               #endregion
-
-               #region Constructors
-
-               public XmlBinaryDictionaryWriter (Stream stream,
-                       IXmlDictionary dictionary,
-                       XmlBinaryWriterSession session, bool ownsStream)
-               {
-                       if (dictionary == null)
-                               dictionary = new XmlDictionary ();
-                       if (session == null)
-                               session = new XmlBinaryWriterSession ();
-
-                       original = new MyBinaryWriter (stream);
-                       this.writer = original;
-                       buffer_writer = new MyBinaryWriter (buffer);
-                       this.dict_ext = dictionary;
-                       this.session = session;
-                       owns_stream = ownsStream;
-
-                       AddNamespace ("xml", "http://www.w3.org/XML/1998/namespace");
-                       AddNamespace ("xml", "http://www.w3.org/2000/xmlns/");
-                       ns_index = 2;
-               }
-
-               #endregion
-
-               #region Properties
-
-               public override WriteState WriteState {
-                       get { return state; }
-               }
-               
-               public override string XmlLang {
-                       get { return xml_lang; }
-               }
-
-               public override XmlSpace XmlSpace {
-                       get { return xml_space; }
-               }
-
-               #endregion
-
-               #region Methods
-
-               private void AddMissingElementXmlns ()
-               {
-                       // push new namespaces to manager.
-                       for (int i = ns_index; i < namespaces.Count; i++) {
-                               var ent = namespaces [i];
-                               string prefix = (string) ent.Key;
-                               string ns = ent.Value as string;
-                               XmlDictionaryString dns = ent.Value as XmlDictionaryString;
-                               if (ns != null) {
-                                       if (prefix.Length > 0) {
-                                               writer.Write (BF.PrefixNSString);
-                                               writer.Write (prefix);
-                                       }
-                                       else
-                                               writer.Write (BF.DefaultNSString);
-                                       writer.Write (ns);
-                               } else {
-                                       if (prefix.Length > 0) {
-                                               writer.Write (BF.PrefixNSIndex);
-                                               writer.Write (prefix);
-                                       }
-                                       else
-                                               writer.Write (BF.DefaultNSIndex);
-                                       WriteDictionaryIndex (dns);
-                               }
-                       }
-                       ns_index = namespaces.Count;
-               }
-
-               private void CheckState ()
-               {
-                       if (state == WriteState.Closed) {
-                               throw new InvalidOperationException ("The Writer is closed.");
-                       }
-               }
-
-               void ProcessStateForContent ()
-               {
-                       CheckState ();
-
-                       if (state == WriteState.Element)
-                               CloseStartElement ();
-
-                       ProcessPendingBuffer (false, false);
-                       if (state != WriteState.Attribute)
-                               writer = buffer_writer;
-               }
-
-               void ProcessTypedValue ()
-               {
-                       ProcessStateForContent ();
-                       if (state == WriteState.Attribute) {
-                               if (attr_typed_value)
-                                       throw new InvalidOperationException (String.Format ("A typed value for the attribute '{0}' in namespace '{1}' was already written", current_attr_name, current_attr_ns));
-                               attr_typed_value = true;
-                       }
-               }
-
-               void ProcessPendingBuffer (bool last, bool endElement)
-               {
-                       if (buffer.Position > 0) {
-                               byte [] arr = buffer.GetBuffer ();
-                               if (endElement)
-                                       arr [0]++;
-                               original.Write (arr, 0, (int) buffer.Position);
-                               buffer.SetLength (0);
-                       }
-                       if (last)
-                               writer = original;
-               }
-
-               public override void Close ()
-               {
-                       CloseOpenAttributeAndElements ();
-
-                       if (owns_stream)
-                               writer.Close ();
-                       else if (state != WriteState.Closed)
-                               writer.Flush ();
-                       state = WriteState.Closed;
-               }
-
-               private void CloseOpenAttributeAndElements ()
-               {
-                       CloseStartElement ();
-
-                        while (element_count > 0)
-                               WriteEndElement ();
-               }
-
-               private void CloseStartElement ()
-               {
-                       if (!open_start_element)
-                               return;
-
-                       if (state == WriteState.Attribute)
-                               WriteEndAttribute ();
-
-                       AddMissingElementXmlns ();
-
-                       state = WriteState.Content;
-                       open_start_element = false;
-               }
-
-               public override void Flush ()
-               {
-                       writer.Flush ();
-               }
-
-               public override string LookupPrefix (string ns)
-               {
-                       if (ns == null || ns == String.Empty)
-                               throw new ArgumentException ("The Namespace cannot be empty.");
-
-                       var de = namespaces.LastOrDefault (i => i.Value.ToString () == ns);
-                       return de.Key; // de is KeyValuePair and its default key is null.
-               }
-
-               public override void WriteBase64 (byte[] buffer, int index, int count)
-               {
-                       if (count < 0)
-                               throw new IndexOutOfRangeException ("Negative count");
-                       ProcessStateForContent ();
-
-                       if (count < 0x100) {
-                               writer.Write (BF.Bytes8);
-                               writer.Write ((byte) count);
-                               writer.Write (buffer, index, count);
-                       } else if (count < 0x10000) {
-                               writer.Write (BF.Bytes8);
-                               writer.Write ((ushort) count);
-                               writer.Write (buffer, index, count);
-                       } else {
-                               writer.Write (BF.Bytes32);
-                               writer.Write (count);
-                               writer.Write (buffer, index, count);
-                       }
-               }
-
-               public override void WriteCData (string text)
-               {
-                       if (text.IndexOf ("]]>") >= 0)
-                               throw new ArgumentException ("CDATA section cannot contain text \"]]>\".");
-
-                       ProcessStateForContent ();
-
-                       WriteTextBinary (text);
-               }
-
-               public override void WriteCharEntity (char ch)
-               {
-                       WriteChars (new char [] {ch}, 0, 1);
-               }
-
-               public override void WriteChars (char[] buffer, int index, int count)
-               {
-                       ProcessStateForContent ();
-
-                       int blen = Encoding.UTF8.GetByteCount (buffer, index, count);
-
-                       if (blen == 0)
-                               writer.Write (BF.EmptyText);
-                       else if (count == 1 && buffer [0] == '0')
-                               writer.Write (BF.Zero);
-                       else if (count == 1 && buffer [0] == '1')
-                               writer.Write (BF.One);
-                       else if (blen < 0x100) {
-                               writer.Write (BF.Chars8);
-                               writer.Write ((byte) blen);
-                               writer.Write (buffer, index, count);
-                       } else if (blen < 0x10000) {
-                               writer.Write (BF.Chars16);
-                               writer.Write ((ushort) blen);
-                               writer.Write (buffer, index, count);
-                       } else {
-                               writer.Write (BF.Chars32);
-                               writer.Write (blen);
-                               writer.Write (buffer, index, count);
-                       }
-               }
-
-               public override void WriteComment (string text)
-               {
-                       if (text.EndsWith("-"))
-                               throw new ArgumentException ("An XML comment cannot contain \"--\" inside.");
-                       else if (text.IndexOf("--") > 0)
-                               throw new ArgumentException ("An XML comment cannot end with \"-\".");
-
-                       ProcessStateForContent ();
-
-                       if (state == WriteState.Attribute)
-                               throw new InvalidOperationException ("Comment node is not allowed inside an attribute");
-
-                       writer.Write (BF.Comment);
-                       writer.Write (text);
-               }
-
-               public override void WriteDocType (string name, string pubid, string sysid, string subset)
-               {
-                       throw new NotSupportedException ("This XmlWriter implementation does not support document type.");
-               }
-
-               public override void WriteEndAttribute ()
-               {
-                       if (state != WriteState.Attribute)
-                               throw new InvalidOperationException("Token EndAttribute in state Start would result in an invalid XML document.");
-
-                       CheckState ();
-
-                       if (attr_value == null)
-                               attr_value = String.Empty;
-
-                       switch (save_target) {
-                       case SaveTarget.XmlLang:
-                               xml_lang = attr_value;
-                               goto default;
-                       case SaveTarget.XmlSpace:
-                               switch (attr_value) {
-                               case "preserve":
-                                       xml_space = XmlSpace.Preserve;
-                                       break;
-                               case "default":
-                                       xml_space = XmlSpace.Default;
-                                       break;
-                               default:
-                                       throw new ArgumentException (String.Format ("Invalid xml:space value: '{0}'", attr_value));
-                               }
-                               goto default;
-                       case SaveTarget.Namespaces:
-                               if (current_attr_name.ToString ().Length > 0 && attr_value.Length == 0)
-                                       throw new ArgumentException ("Cannot use prefix with an empty namespace.");
-
-                               AddNamespaceChecked (current_attr_name.ToString (), attr_value);
-                               break;
-                       default:
-                               if (!attr_typed_value)
-                                       WriteTextBinary (attr_value);
-                               break;
-                       }
-
-                       if (current_attr_prefix.Length > 0 && save_target != SaveTarget.Namespaces)
-                               AddNamespaceChecked (current_attr_prefix, current_attr_ns);
-
-                       state = WriteState.Element;
-                       current_attr_prefix = null;
-                       current_attr_name = null;
-                       current_attr_ns = null;
-                       attr_value = null;
-                       attr_typed_value = false;
-               }
-
-               public override void WriteEndDocument ()
-               {
-                       CloseOpenAttributeAndElements ();
-
-                       switch (state) {
-                       case WriteState.Start:
-                               throw new InvalidOperationException ("Document has not started.");
-                       case WriteState.Prolog:
-                               throw new ArgumentException ("This document does not have a root element.");
-                       }
-
-                       state = WriteState.Start;
-               }
-
-               bool SupportsCombinedEndElementSupport (byte operation)
-               {
-                       switch (operation) {
-                       case BF.Comment:
-                               return false;
-                       }
-                       return true;
-               }
-
-               public override void WriteEndElement ()
-               {
-                       if (element_count-- == 0)
-                               throw new InvalidOperationException("There was no XML start tag open.");
-
-                       if (state == WriteState.Attribute)
-                               WriteEndAttribute ();
-
-                       // Comment+EndElement does not exist
-                       bool needExplicitEndElement = buffer.Position == 0 || !SupportsCombinedEndElementSupport (buffer.GetBuffer () [0]);
-                       ProcessPendingBuffer (true, !needExplicitEndElement);
-                       CheckState ();
-                       AddMissingElementXmlns ();
-
-                       if (needExplicitEndElement)
-                               writer.Write (BF.EndElement);
-
-                       element_ns = element_ns_stack.Pop ();
-                       xml_lang = xml_lang_stack.Pop ();
-                       xml_space = xml_space_stack.Pop ();
-                       int cur = namespaces.Count;
-                       ns_index = ns_index_stack.Pop ();
-                       namespaces.RemoveRange (ns_index, cur - ns_index);
-                       open_start_element = false;
-
-                       Depth--;
-               }
-
-               public override void WriteEntityRef (string name)
-               {
-                       throw new NotSupportedException ("This XmlWriter implementation does not support entity references.");
-               }
-
-               public override void WriteFullEndElement ()
-               {
-                       WriteEndElement ();
-               }
-
-               public override void WriteProcessingInstruction (string name, string text)
-               {
-                       if (name != "xml")
-                               throw new ArgumentException ("Processing instructions are not supported. ('xml' is allowed for XmlDeclaration; this is because of design problem of ECMA XmlWriter)");
-                       // Otherwise, silently ignored. WriteStartDocument()
-                       // is still callable after this method(!)
-               }
-
-               public override void WriteQualifiedName (XmlDictionaryString local, XmlDictionaryString ns)
-               {
-                       string prefix = namespaces.LastOrDefault (i => i.Value.ToString () == ns.ToString ()).Key;
-                       bool use_dic = prefix != null;
-                       if (prefix == null)
-                               prefix = LookupPrefix (ns.Value);
-                       if (prefix == null)
-                               throw new ArgumentException (String.Format ("Namespace URI '{0}' is not bound to any of the prefixes", ns));
-
-                       ProcessTypedValue ();
-
-                       if (use_dic && prefix.Length == 1) {
-                               writer.Write (BF.QNameIndex);
-                               writer.Write ((byte) (prefix [0] - 'a'));
-                               WriteDictionaryIndex (local);
-                       } else {
-                               // QNameIndex is not applicable.
-                               WriteString (prefix);
-                               WriteString (":");
-                               WriteString (local);
-                       }
-               }
-
-               public override void WriteRaw (string data)
-               {
-                       WriteString (data);
-               }
-
-               public override void WriteRaw (char[] buffer, int index, int count)
-               {
-                       WriteChars (buffer, index, count);
-               }
-
-               void CheckStateForAttribute ()
-               {
-                       CheckState ();
-
-                       if (state != WriteState.Element)
-                               throw new InvalidOperationException ("Token StartAttribute in state " + WriteState + " would result in an invalid XML document.");
-               }
-
-               string CreateNewPrefix ()
-               {
-                       return CreateNewPrefix (String.Empty);
-               }
-               
-               string CreateNewPrefix (string p)
-               {
-                       for (char c = 'a'; c <= 'z'; c++)
-                               if (!namespaces.Any (iter => iter.Key == p + c))
-                                       return p + c;
-                       for (char c = 'a'; c <= 'z'; c++) {
-                               var s = CreateNewPrefix (c.ToString ());
-                               if (s != null)
-                                       return s;
-                       }
-                       throw new InvalidOperationException ("too many prefix population");
-               }
-
-               bool CollectionContains (ICollection col, string value)
-               {
-                       foreach (string v in col)
-                               if (v == value)
-                                       return true;
-                       return false;
-               }
-
-               void ProcessStartAttributeCommon (ref string prefix, string localName, string ns, object nameObj, object nsObj)
-               {
-                       // dummy prefix is created here, while the caller
-                       // still uses empty string as the prefix there.
-                       if (prefix.Length == 0 && ns.Length > 0) {
-                               prefix = LookupPrefix (ns);
-                               // Not only null but also ""; when the returned
-                               // string is empty, then it still needs a dummy
-                               // prefix, since default namespace does not
-                               // apply to attribute
-                               if (String.IsNullOrEmpty (prefix))
-                                       prefix = CreateNewPrefix ();
-                       }
-                       else if (prefix.Length > 0 && ns.Length == 0) {
-                               switch (prefix) {
-                               case "xml":
-                                       nsObj = ns = XmlNamespace;
-                                       break;
-                               case "xmlns":
-                                       nsObj = ns = XmlnsNamespace;
-                                       break;
-                               default:
-                                       throw new ArgumentException ("Cannot use prefix with an empty namespace.");
-                               }
-                       }
-                       // here we omit such cases that it is used for writing
-                       // namespace-less xml, unlike XmlTextWriter.
-                       if (prefix == "xmlns" && ns != XmlnsNamespace)
-                               throw new ArgumentException (String.Format ("The 'xmlns' attribute is bound to the reserved namespace '{0}'", XmlnsNamespace));
-
-                       CheckStateForAttribute ();
-
-                       state = WriteState.Attribute;
-
-                       save_target = SaveTarget.None;
-                       switch (prefix) {
-                       case "xml":
-                               // MS.NET looks to allow other names than 
-                               // lang and space (e.g. xml:link, xml:hack).
-                               ns = XmlNamespace;
-                               switch (localName) {
-                               case "lang":
-                                       save_target = SaveTarget.XmlLang;
-                                       break;
-                               case "space":
-                                       save_target = SaveTarget.XmlSpace;
-                                       break;
-                               }
-                               break;
-                       case "xmlns":
-                               save_target = SaveTarget.Namespaces;
-                               break;
-                       }
-
-                       current_attr_prefix = prefix;
-                       current_attr_name = nameObj;
-                       current_attr_ns = nsObj;
-               }
-
-               public override void WriteStartAttribute (string prefix, string localName, string ns)
-               {
-                       if (prefix == null)
-                               prefix = String.Empty;
-                       if (ns == null)
-                               ns = String.Empty;
-                       if (localName == "xmlns" && prefix.Length == 0) {
-                               prefix = "xmlns";
-                               localName = String.Empty;
-                       }
-
-                       ProcessStartAttributeCommon (ref prefix, localName, ns, localName, ns);
-
-                       // for namespace nodes we don't write attribute node here.
-                       if (save_target == SaveTarget.Namespaces)
-                               return;
-
-                       byte op = prefix.Length == 1 && 'a' <= prefix [0] && prefix [0] <= 'z' ?
-                                 (byte) (prefix [0] - 'a' + BF.PrefixNAttrStringStart) :
-                                 prefix.Length == 0 ? BF.AttrString :
-                                 BF.AttrStringPrefix;
-
-                       if (BF.PrefixNAttrStringStart <= op && op <= BF.PrefixNAttrStringEnd) {
-                               writer.Write (op);
-                               writer.Write (localName);
-                       } else {
-                               writer.Write (op);
-                               if (prefix.Length > 0)
-                                       writer.Write (prefix);
-                               writer.Write (localName);
-                       }
-               }
-
-               public override void WriteStartDocument ()
-               {
-                       WriteStartDocument (false);
-               }
-
-               public override void WriteStartDocument (bool standalone)
-               {
-                       if (state != WriteState.Start)
-                               throw new InvalidOperationException("WriteStartDocument should be the first call.");
-
-                       CheckState ();
-
-                       // write nothing to stream.
-
-                       state = WriteState.Prolog;
-               }
-
-               void PrepareStartElement ()
-               {
-                       ProcessPendingBuffer (true, false);
-                       CheckState ();
-                       CloseStartElement ();
-
-                       Depth++;
-
-                       element_ns_stack.Push (element_ns);
-                       xml_lang_stack.Push (xml_lang);
-                       xml_space_stack.Push (xml_space);
-                       ns_index_stack.Push (ns_index);
-               }
-
-               public override void WriteStartElement (string prefix, string localName, string ns)
-               {
-                       PrepareStartElement ();
-
-                       if ((prefix != null && prefix != String.Empty) && ((ns == null) || (ns == String.Empty)))
-                               throw new ArgumentException ("Cannot use a prefix with an empty namespace.");
-
-                       if (ns == null)
-                               ns = String.Empty;
-                       if (ns == String.Empty)
-                               prefix = String.Empty;
-                       if (prefix == null)
-                               prefix = String.Empty;
-
-                       byte op = prefix.Length == 1 && 'a' <= prefix [0] && prefix [0] <= 'z' ?
-                                 (byte) (prefix [0] - 'a' + BF.PrefixNElemStringStart) :
-                                 prefix.Length == 0 ? BF.ElemString :
-                                 BF.ElemStringPrefix;
-
-                       if (BF.PrefixNElemStringStart <= op && op <= BF.PrefixNElemStringEnd) {
-                               writer.Write (op);
-                               writer.Write (localName);
-                       } else {
-                               writer.Write (op);
-                               if (prefix.Length > 0)
-                                       writer.Write (prefix);
-                               writer.Write (localName);
-                       }
-
-                       OpenElement (prefix, ns);
-               }
-
-               void OpenElement (string prefix, object nsobj)
-               {
-                       string ns = nsobj.ToString ();
-
-                       state = WriteState.Element;
-                       open_start_element = true;
-                       element_prefix = prefix;
-                       element_count++;
-                       element_ns = nsobj.ToString ();
-
-                       if (element_ns != String.Empty && LookupPrefix (element_ns) != prefix)
-                               AddNamespace (prefix, nsobj);
-               }
-
-               void AddNamespace (string prefix, object nsobj)
-               {
-                       namespaces.Add (new KeyValuePair<string,object> (prefix, nsobj));
-               }
-
-               void CheckIfTextAllowed ()
-               {
-                       switch (state) {
-                       case WriteState.Start:
-                       case WriteState.Prolog:
-                               throw new InvalidOperationException ("Token content in state Prolog would result in an invalid XML document.");
-                       }
-               }
-
-               public override void WriteString (string text)
-               {
-                       if (text == null)
-                               throw new ArgumentNullException ("text");
-                       CheckIfTextAllowed ();
-
-                       if (text == null)
-                               text = String.Empty;
-
-                       ProcessStateForContent ();
-
-                       if (state == WriteState.Attribute)
-                               attr_value += text;
-                       else
-                               WriteTextBinary (text);
-               }
-
-               public override void WriteString (XmlDictionaryString text)
-               {
-                       if (text == null)
-                               throw new ArgumentNullException ("text");
-                       CheckIfTextAllowed ();
-
-                       if (text == null)
-                               text = XmlDictionaryString.Empty;
-
-                       ProcessStateForContent ();
-
-                       if (state == WriteState.Attribute)
-                               attr_value += text.Value;
-                       else if (text.Equals (XmlDictionary.Empty))
-                               writer.Write (BF.EmptyText);
-                       else {
-                               writer.Write (BF.TextIndex);
-                               WriteDictionaryIndex (text);
-                       }
-               }
-
-               public override void WriteSurrogateCharEntity (char lowChar, char highChar)
-               {
-                       WriteChars (new char [] {highChar, lowChar}, 0, 2);
-               }
-
-               public override void WriteWhitespace (string ws)
-               {
-                       for (int i = 0; i < ws.Length; i++) {
-                               switch (ws [i]) {
-                               case ' ': case '\t': case '\r': case '\n':
-                                       continue;
-                               default:
-                                       throw new ArgumentException ("Invalid Whitespace");
-                               }
-                       }
-
-                       ProcessStateForContent ();
-
-                       WriteTextBinary (ws);
-               }
-
-               public override void WriteXmlnsAttribute (string prefix, string namespaceUri)
-               {
-                       if (namespaceUri == null)
-                               throw new ArgumentNullException ("namespaceUri");
-
-                       if (String.IsNullOrEmpty (prefix))
-                               prefix = CreateNewPrefix ();
-
-                       CheckStateForAttribute ();
-
-                       AddNamespaceChecked (prefix, namespaceUri);
-
-                       state = WriteState.Element;
-               }
-
-               void AddNamespaceChecked (string prefix, object ns)
-               {
-                       switch (ns.ToString ()) {
-                       case XmlnsNamespace:
-                       case XmlNamespace:
-                               return;
-                       }
-
-                       if (prefix == null)
-                               throw new InvalidOperationException ();
-                       var o = namespaces.LastOrDefault (i => i.Key == prefix);
-                       if (o.Key != null) { // i.e. exists
-                               if (o.Value.ToString () != ns.ToString ()) {
-                                       if (namespaces.LastIndexOf (o) >= ns_index)
-                                               throw new ArgumentException (String.Format ("The prefix '{0}' is already mapped to another namespace URI '{1}' in this element scope and cannot be mapped to '{2}'", prefix ?? "(null)", o.Value ?? "(null)", ns.ToString ()));
-                                       else
-                                               AddNamespace  (prefix, ns);
-                               }
-                       }
-                       else
-                               AddNamespace  (prefix, ns);
-               }
-
-               #region DictionaryString
-
-               void WriteDictionaryIndex (XmlDictionaryString ds)
-               {
-                       XmlDictionaryString ds2;
-                       bool isSession = false;
-                       int idx = ds.Key;
-                       if (ds.Dictionary != dict_ext) {
-                               isSession = true;
-                               if (dict_int.TryLookup (ds.Value, out ds2))
-                                       ds = ds2;
-                               if (!session.TryLookup (ds, out idx))
-                                       session.TryAdd (dict_int.Add (ds.Value), out idx);
-                       }
-                       if (idx >= 0x80) {
-                               writer.Write ((byte) (0x80 + ((idx % 0x80) << 1) + (isSession ? 1 : 0)));
-                               writer.Write ((byte) ((byte) (idx / 0x80) << 1));
-                       }
-                       else
-                               writer.Write ((byte) (((idx % 0x80) << 1) + (isSession ? 1 : 0)));
-               }
-
-               public override void WriteStartElement (string prefix, XmlDictionaryString localName, XmlDictionaryString namespaceUri)
-               {
-                       PrepareStartElement ();
-
-                       if (prefix == null)
-                               prefix = String.Empty;
-
-                       byte op = prefix.Length == 1 && 'a' <= prefix [0] && prefix [0] <= 'z' ?
-                                 (byte) (prefix [0] - 'a' + BF.PrefixNElemIndexStart) :
-                                 prefix.Length == 0 ? BF.ElemIndex :
-                                 BF.ElemIndexPrefix;
-
-                       if (BF.PrefixNElemIndexStart <= op && op <= BF.PrefixNElemIndexEnd) {
-                               writer.Write (op);
-                               WriteDictionaryIndex (localName);
-                       } else {
-                               writer.Write (op);
-                               if (prefix.Length > 0)
-                                       writer.Write (prefix);
-                               WriteDictionaryIndex (localName);
-                       }
-
-                       OpenElement (prefix, namespaceUri);
-               }
-
-               public override void WriteStartAttribute (string prefix, XmlDictionaryString localName, XmlDictionaryString ns)
-               {
-                       if (localName == null)
-                               throw new ArgumentNullException ("localName");
-                       if (prefix == null)
-                               prefix = String.Empty;
-                       if (ns == null)
-                               ns = XmlDictionaryString.Empty;
-                       if (localName.Value == "xmlns" && prefix.Length == 0) {
-                               prefix = "xmlns";
-                               localName = XmlDictionaryString.Empty;
-                       }
-
-                       ProcessStartAttributeCommon (ref prefix, localName.Value, ns.Value, localName, ns);
-
-                       if (save_target == SaveTarget.Namespaces)
-                               return;
-
-                       if (prefix.Length == 1 && 'a' <= prefix [0] && prefix [0] <= 'z') {
-                               writer.Write ((byte) (prefix [0] - 'a' + BF.PrefixNAttrIndexStart));
-                               WriteDictionaryIndex (localName);
-                       } else {
-                               byte op = ns.Value.Length == 0 ? BF.AttrIndex :BF.AttrIndexPrefix;
-                               // Write to Stream
-                               writer.Write (op);
-                               if (prefix.Length > 0)
-                                       writer.Write (prefix);
-                               WriteDictionaryIndex (localName);
-                       }
-               }
-
-               public override void WriteXmlnsAttribute (string prefix, XmlDictionaryString namespaceUri)
-               {
-                       if (namespaceUri == null)
-                               throw new ArgumentNullException ("namespaceUri");
-
-                       if (String.IsNullOrEmpty (prefix))
-                               prefix = CreateNewPrefix ();
-
-                       CheckStateForAttribute ();
-
-                       AddNamespaceChecked (prefix, namespaceUri);
-
-                       state = WriteState.Element;
-               }
-               #endregion
-
-               #region WriteValue
-               public override void WriteValue (bool value)
-               {
-                       ProcessTypedValue ();
-                       writer.Write ((byte) (value ? BF.BoolTrue : BF.BoolFalse));
-               }
-
-               public override void WriteValue (int value)
-               {
-                       WriteValue ((long) value);
-               }
-
-               public override void WriteValue (long value)
-               {
-                       ProcessTypedValue ();
-
-                       if (value == 0)
-                               writer.Write (BF.Zero);
-                       else if (value == 1)
-                               writer.Write (BF.One);
-                       else if (value < 0 || value > uint.MaxValue) {
-                               writer.Write (BF.Int64);
-                               for (int i = 0; i < 8; i++) {
-                                       writer.Write ((byte) (value & 0xFF));
-                                       value >>= 8;
-                               }
-                       } else if (value <= byte.MaxValue) {
-                               writer.Write (BF.Int8);
-                               writer.Write ((byte) value);
-                       } else if (value <= short.MaxValue) {
-                               writer.Write (BF.Int16);
-                               writer.Write ((byte) (value & 0xFF));
-                               writer.Write ((byte) (value >> 8));
-                       } else if (value <= int.MaxValue) {
-                               writer.Write (BF.Int32);
-                               for (int i = 0; i < 4; i++) {
-                                       writer.Write ((byte) (value & 0xFF));
-                                       value >>= 8;
-                               }
-                       }
-               }
-
-               public override void WriteValue (float value)
-               {
-                       ProcessTypedValue ();
-                       writer.Write (BF.Single);
-                       WriteValueContent (value);
-               }
-
-               void WriteValueContent (float value)
-               {
-                       writer.Write (value);
-               }
-
-               public override void WriteValue (double value)
-               {
-                       ProcessTypedValue ();
-                       writer.Write (BF.Double);
-                       WriteValueContent (value);
-               }
-
-               void WriteValueContent (double value)
-               {
-                       writer.Write (value);
-               }
-
-               public override void WriteValue (decimal value)
-               {
-                       ProcessTypedValue ();
-                       writer.Write (BF.Decimal);
-                       WriteValueContent (value);
-               }
-
-               void WriteValueContent (decimal value)
-               {
-                       int [] bits = Decimal.GetBits (value);
-                       // so, looks like it is saved as its internal form,
-                       // not the returned order.
-                       // BinaryWriter.Write(Decimal) is useless here.
-                       writer.Write (bits [3]);
-                       writer.Write (bits [2]);
-                       writer.Write (bits [0]);
-                       writer.Write (bits [1]);
-               }
-
-               public override void WriteValue (DateTime value)
-               {
-                       ProcessTypedValue ();
-                       writer.Write (BF.DateTime);
-                       WriteValueContent (value);
-               }
-
-               void WriteValueContent (DateTime value)
-               {
-                       writer.Write (value.ToBinary ());
-               }
-
-               public override void WriteValue (Guid value)
-               {
-                       ProcessTypedValue ();
-                       writer.Write (BF.Guid);
-                       WriteValueContent (value);
-               }
-
-               void WriteValueContent (Guid value)
-               {
-                       byte [] bytes = value.ToByteArray ();
-                       writer.Write (bytes, 0, bytes.Length);
-               }
-
-               public override void WriteValue (UniqueId value)
-               {
-                       if (value == null)
-                               throw new ArgumentNullException ("value");
-
-                       Guid guid;
-                       if (value.TryGetGuid (out guid)) {
-                               // this conditional branching is required for
-                               // attr_typed_value not being true.
-                               ProcessTypedValue ();
-
-                               writer.Write (BF.UniqueId);
-                               byte [] bytes = guid.ToByteArray ();
-                               writer.Write (bytes, 0, bytes.Length);
-                       } else {
-                               WriteValue (value.ToString ());
-                       }
-               }
-
-               public override void WriteValue (TimeSpan value)
-               {
-                       ProcessTypedValue ();
-
-                       writer.Write (BF.TimeSpan);
-                       WriteValueContent (value);
-               }
-
-               void WriteValueContent (TimeSpan value)
-               {
-                       WriteBigEndian (value.Ticks, 8);
-               }
-               #endregion
-
-               private void WriteBigEndian (long value, int digits)
-               {
-                       long v = 0;
-                       for (int i = 0; i < digits; i++) {
-                               v = (v << 8) + (value & 0xFF);
-                               value >>= 8;
-                       }
-                       for (int i = 0; i < digits; i++) {
-                               writer.Write ((byte) (v & 0xFF));
-                               v >>= 8;
-                       }
-               }
-
-               private void WriteTextBinary (string text)
-               {
-                       if (text.Length == 0)
-                               writer.Write (BF.EmptyText);
-                       else {
-                               char [] arr = text.ToCharArray ();
-                               WriteChars (arr, 0, arr.Length);
-                       }
-               }
-
-               #endregion
-
-               #region Write typed array content
-
-               // they are packed in WriteValue(), so we cannot reuse
-               // them for array content.
-
-               void WriteValueContent (bool value)
-               {
-                       writer.Write (value ? (byte) 1 : (byte) 0);
-               }
-
-               void WriteValueContent (short value)
-               {
-                       writer.Write (value);
-               }
-
-               void WriteValueContent (int value)
-               {
-                       writer.Write (value);
-               }
-
-               void WriteValueContent (long value)
-               {
-                       writer.Write (value);
-               }
-
-               #endregion
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Xml/XmlBinaryDictionaryWriterAutoGen.cs b/mcs/class/System.Runtime.Serialization/System.Xml/XmlBinaryDictionaryWriterAutoGen.cs
deleted file mode 100644 (file)
index fb1c7ea..0000000
+++ /dev/null
@@ -1,303 +0,0 @@
-
-using System;
-using BF = System.Xml.XmlBinaryFormat;
-
-namespace System.Xml
-{
-       internal partial class XmlBinaryDictionaryWriter : XmlDictionaryWriter
-       {
-               void CheckWriteArrayArguments (Array array, int offset, int length)
-               {
-                       if (array == null)
-                               throw new ArgumentNullException ("array");
-                       if (offset < 0)
-                               throw new ArgumentOutOfRangeException ("offset is negative");
-                       if (offset > array.Length)
-                               throw new ArgumentOutOfRangeException ("offset exceeds the length of the destination array");
-                       if (length < 0)
-                               throw new ArgumentOutOfRangeException ("length is negative");
-                       if (length > array.Length - offset)
-                               throw new ArgumentOutOfRangeException ("length + offset exceeds the length of the destination array");
-               }
-
-               void CheckDictionaryStringArgs (XmlDictionaryString localName, XmlDictionaryString namespaceUri)
-               {
-                       if (localName == null)
-                               throw new ArgumentNullException ("localName");
-                       if (namespaceUri == null)
-                               throw new ArgumentNullException ("namespaceUri");
-               }
-
-
-
-               public override void WriteArray (string prefix, XmlDictionaryString localName, XmlDictionaryString namespaceUri, bool [] array, int offset, int length)
-               {
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       writer.Write (BF.Array);
-                       WriteStartElement (prefix, localName, namespaceUri);
-                       WriteEndElement ();
-                       WriteArrayRemaining (array, offset, length);
-               }
-
-               public override void WriteArray (string prefix, string localName, string namespaceUri, bool [] array, int offset, int length)
-               {
-                       CheckWriteArrayArguments (array, offset, length);
-                       writer.Write (BF.Array);
-                       WriteStartElement (prefix, localName, namespaceUri);
-                       WriteEndElement ();
-                       WriteArrayRemaining (array, offset, length);
-               }
-
-               void WriteArrayRemaining (bool [] array, int offset, int length)
-               {
-                       writer.Write ((byte) 0xB5); // ident
-                       writer.WriteFlexibleInt (length);
-                       for (int i = offset; i < offset + length; i++)
-                               WriteValueContent (array [i]);
-               }
-
-
-               public override void WriteArray (string prefix, XmlDictionaryString localName, XmlDictionaryString namespaceUri, DateTime [] array, int offset, int length)
-               {
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       writer.Write (BF.Array);
-                       WriteStartElement (prefix, localName, namespaceUri);
-                       WriteEndElement ();
-                       WriteArrayRemaining (array, offset, length);
-               }
-
-               public override void WriteArray (string prefix, string localName, string namespaceUri, DateTime [] array, int offset, int length)
-               {
-                       CheckWriteArrayArguments (array, offset, length);
-                       writer.Write (BF.Array);
-                       WriteStartElement (prefix, localName, namespaceUri);
-                       WriteEndElement ();
-                       WriteArrayRemaining (array, offset, length);
-               }
-
-               void WriteArrayRemaining (DateTime [] array, int offset, int length)
-               {
-                       writer.Write ((byte) 0x97); // ident
-                       writer.WriteFlexibleInt (length);
-                       for (int i = offset; i < offset + length; i++)
-                               WriteValueContent (array [i]);
-               }
-
-
-               public override void WriteArray (string prefix, XmlDictionaryString localName, XmlDictionaryString namespaceUri, decimal [] array, int offset, int length)
-               {
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       writer.Write (BF.Array);
-                       WriteStartElement (prefix, localName, namespaceUri);
-                       WriteEndElement ();
-                       WriteArrayRemaining (array, offset, length);
-               }
-
-               public override void WriteArray (string prefix, string localName, string namespaceUri, decimal [] array, int offset, int length)
-               {
-                       CheckWriteArrayArguments (array, offset, length);
-                       writer.Write (BF.Array);
-                       WriteStartElement (prefix, localName, namespaceUri);
-                       WriteEndElement ();
-                       WriteArrayRemaining (array, offset, length);
-               }
-
-               void WriteArrayRemaining (decimal [] array, int offset, int length)
-               {
-                       writer.Write ((byte) 0x95); // ident
-                       writer.WriteFlexibleInt (length);
-                       for (int i = offset; i < offset + length; i++)
-                               WriteValueContent (array [i]);
-               }
-
-
-               public override void WriteArray (string prefix, XmlDictionaryString localName, XmlDictionaryString namespaceUri, double [] array, int offset, int length)
-               {
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       writer.Write (BF.Array);
-                       WriteStartElement (prefix, localName, namespaceUri);
-                       WriteEndElement ();
-                       WriteArrayRemaining (array, offset, length);
-               }
-
-               public override void WriteArray (string prefix, string localName, string namespaceUri, double [] array, int offset, int length)
-               {
-                       CheckWriteArrayArguments (array, offset, length);
-                       writer.Write (BF.Array);
-                       WriteStartElement (prefix, localName, namespaceUri);
-                       WriteEndElement ();
-                       WriteArrayRemaining (array, offset, length);
-               }
-
-               void WriteArrayRemaining (double [] array, int offset, int length)
-               {
-                       writer.Write ((byte) 0x93); // ident
-                       writer.WriteFlexibleInt (length);
-                       for (int i = offset; i < offset + length; i++)
-                               WriteValueContent (array [i]);
-               }
-
-
-               public override void WriteArray (string prefix, XmlDictionaryString localName, XmlDictionaryString namespaceUri, Guid [] array, int offset, int length)
-               {
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       writer.Write (BF.Array);
-                       WriteStartElement (prefix, localName, namespaceUri);
-                       WriteEndElement ();
-                       WriteArrayRemaining (array, offset, length);
-               }
-
-               public override void WriteArray (string prefix, string localName, string namespaceUri, Guid [] array, int offset, int length)
-               {
-                       CheckWriteArrayArguments (array, offset, length);
-                       writer.Write (BF.Array);
-                       WriteStartElement (prefix, localName, namespaceUri);
-                       WriteEndElement ();
-                       WriteArrayRemaining (array, offset, length);
-               }
-
-               void WriteArrayRemaining (Guid [] array, int offset, int length)
-               {
-                       writer.Write ((byte) 0xB1); // ident
-                       writer.WriteFlexibleInt (length);
-                       for (int i = offset; i < offset + length; i++)
-                               WriteValueContent (array [i]);
-               }
-
-
-               public override void WriteArray (string prefix, XmlDictionaryString localName, XmlDictionaryString namespaceUri, short [] array, int offset, int length)
-               {
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       writer.Write (BF.Array);
-                       WriteStartElement (prefix, localName, namespaceUri);
-                       WriteEndElement ();
-                       WriteArrayRemaining (array, offset, length);
-               }
-
-               public override void WriteArray (string prefix, string localName, string namespaceUri, short [] array, int offset, int length)
-               {
-                       CheckWriteArrayArguments (array, offset, length);
-                       writer.Write (BF.Array);
-                       WriteStartElement (prefix, localName, namespaceUri);
-                       WriteEndElement ();
-                       WriteArrayRemaining (array, offset, length);
-               }
-
-               void WriteArrayRemaining (short [] array, int offset, int length)
-               {
-                       writer.Write ((byte) 0x8B); // ident
-                       writer.WriteFlexibleInt (length);
-                       for (int i = offset; i < offset + length; i++)
-                               WriteValueContent (array [i]);
-               }
-
-
-               public override void WriteArray (string prefix, XmlDictionaryString localName, XmlDictionaryString namespaceUri, int [] array, int offset, int length)
-               {
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       writer.Write (BF.Array);
-                       WriteStartElement (prefix, localName, namespaceUri);
-                       WriteEndElement ();
-                       WriteArrayRemaining (array, offset, length);
-               }
-
-               public override void WriteArray (string prefix, string localName, string namespaceUri, int [] array, int offset, int length)
-               {
-                       CheckWriteArrayArguments (array, offset, length);
-                       writer.Write (BF.Array);
-                       WriteStartElement (prefix, localName, namespaceUri);
-                       WriteEndElement ();
-                       WriteArrayRemaining (array, offset, length);
-               }
-
-               void WriteArrayRemaining (int [] array, int offset, int length)
-               {
-                       writer.Write ((byte) 0x8D); // ident
-                       writer.WriteFlexibleInt (length);
-                       for (int i = offset; i < offset + length; i++)
-                               WriteValueContent (array [i]);
-               }
-
-
-               public override void WriteArray (string prefix, XmlDictionaryString localName, XmlDictionaryString namespaceUri, long [] array, int offset, int length)
-               {
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       writer.Write (BF.Array);
-                       WriteStartElement (prefix, localName, namespaceUri);
-                       WriteEndElement ();
-                       WriteArrayRemaining (array, offset, length);
-               }
-
-               public override void WriteArray (string prefix, string localName, string namespaceUri, long [] array, int offset, int length)
-               {
-                       CheckWriteArrayArguments (array, offset, length);
-                       writer.Write (BF.Array);
-                       WriteStartElement (prefix, localName, namespaceUri);
-                       WriteEndElement ();
-                       WriteArrayRemaining (array, offset, length);
-               }
-
-               void WriteArrayRemaining (long [] array, int offset, int length)
-               {
-                       writer.Write ((byte) 0x8F); // ident
-                       writer.WriteFlexibleInt (length);
-                       for (int i = offset; i < offset + length; i++)
-                               WriteValueContent (array [i]);
-               }
-
-
-               public override void WriteArray (string prefix, XmlDictionaryString localName, XmlDictionaryString namespaceUri, float [] array, int offset, int length)
-               {
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       writer.Write (BF.Array);
-                       WriteStartElement (prefix, localName, namespaceUri);
-                       WriteEndElement ();
-                       WriteArrayRemaining (array, offset, length);
-               }
-
-               public override void WriteArray (string prefix, string localName, string namespaceUri, float [] array, int offset, int length)
-               {
-                       CheckWriteArrayArguments (array, offset, length);
-                       writer.Write (BF.Array);
-                       WriteStartElement (prefix, localName, namespaceUri);
-                       WriteEndElement ();
-                       WriteArrayRemaining (array, offset, length);
-               }
-
-               void WriteArrayRemaining (float [] array, int offset, int length)
-               {
-                       writer.Write ((byte) 0x91); // ident
-                       writer.WriteFlexibleInt (length);
-                       for (int i = offset; i < offset + length; i++)
-                               WriteValueContent (array [i]);
-               }
-
-
-               public override void WriteArray (string prefix, XmlDictionaryString localName, XmlDictionaryString namespaceUri, TimeSpan [] array, int offset, int length)
-               {
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       writer.Write (BF.Array);
-                       WriteStartElement (prefix, localName, namespaceUri);
-                       WriteEndElement ();
-                       WriteArrayRemaining (array, offset, length);
-               }
-
-               public override void WriteArray (string prefix, string localName, string namespaceUri, TimeSpan [] array, int offset, int length)
-               {
-                       CheckWriteArrayArguments (array, offset, length);
-                       writer.Write (BF.Array);
-                       WriteStartElement (prefix, localName, namespaceUri);
-                       WriteEndElement ();
-                       WriteArrayRemaining (array, offset, length);
-               }
-
-               void WriteArrayRemaining (TimeSpan [] array, int offset, int length)
-               {
-                       writer.Write ((byte) 0xAF); // ident
-                       writer.WriteFlexibleInt (length);
-                       for (int i = offset; i < offset + length; i++)
-                               WriteValueContent (array [i]);
-               }
-
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Xml/XmlBinaryFormat.cs b/mcs/class/System.Runtime.Serialization/System.Xml/XmlBinaryFormat.cs
deleted file mode 100644 (file)
index 2d95052..0000000
+++ /dev/null
@@ -1,181 +0,0 @@
-//
-// XmlBinaryFormat.cs
-//
-// Author:
-//     Atsushi Enomoto  <atsushi@ximian.com>
-//
-// Copyright (C) 2007 Novell, Inc.  http://www.novell.com
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-
-namespace System.Xml
-{
-       internal class XmlBinaryFormat
-       {
-               public const byte EndElement = 0x01;
-               public const byte Comment = 0x02;
-               public const byte Array = 0x03;
-               public const byte AttrString = 0x04;
-               public const byte AttrStringPrefix = 0x05;
-               public const byte AttrIndex = 0x06;
-               public const byte AttrIndexPrefix = 0x07;
-               public const byte DefaultNSString = 0x08;
-               public const byte PrefixNSString = 0x09;
-               public const byte DefaultNSIndex = 0x0A;
-               public const byte PrefixNSIndex = 0x0B;
-               public const byte PrefixNAttrIndexStart = 0x0C;
-               public const byte PrefixNAttrIndexEnd = 0x0C + 26 - 1;
-               public const byte PrefixNAttrStringStart = 0x26;
-               public const byte PrefixNAttrStringEnd = 0x26 + 26 - 1;
-               public const byte ElemString = 0x40;
-               public const byte ElemStringPrefix = 0x41;
-               public const byte ElemIndex = 0x42;
-               public const byte ElemIndexPrefix = 0x43;
-               public const byte PrefixNElemIndexStart = 0x44;
-               public const byte PrefixNElemIndexEnd = 0x44 + 26 - 1;
-               public const byte PrefixNElemStringStart = 0x5E;
-               public const byte PrefixNElemStringEnd = 0x5E + 26 - 1;
-
-               public const byte Zero = 0x80;
-               public const byte One = 0x82;
-               public const byte BoolFalse = 0x84;
-               public const byte BoolTrue = 0x86;
-               public const byte Int8 = 0x88;
-               public const byte Int16 = 0x8A;
-               public const byte Int32 = 0x8C;
-               public const byte Int64 = 0x8E;
-               public const byte Single = 0x90;
-               public const byte Double = 0x92;
-               public const byte Decimal = 0x94;
-               public const byte DateTime = 0x96;
-               public const byte Chars8 = 0x98;
-               public const byte Chars16 = 0x9A;
-               public const byte Chars32 = 0x9C;
-               public const byte Bytes8 = 0x9E;
-               public const byte Bytes16 = 0xA0;
-               public const byte Bytes32 = 0xA2;
-
-               public const byte EmptyText = 0xA8;
-               public const byte TextIndex = 0xAA;
-               public const byte UniqueId = 0xAC;
-               public const byte TimeSpan = 0xAE;
-               public const byte Guid = 0xB0;
-               public const byte UInt64 = 0xB2;
-               public const byte Bool = 0xB4; // e.g. for typed array
-               public const byte Utf16_8 = 0xB6;
-               public const byte Utf16_16 = 0xB8;
-               public const byte Utf16_32 = 0xBA;
-               public const byte QNameIndex = 0xBC;
-       }
-
-       /* Binary Format (incomplete):
-
-               Literal strings are represented as UTF-8 string, with a length
-               prefixed to the string itself.
-
-               Key indices are based on the rules below:
-               - dictionary strings which can be found in IXmlDictionary are 
-                 doubled its Key. e.g. if the string.Key is 4, then the
-                 output is 8.
-               - dictionary strings which cannot be found in IXmlDictionary
-                 are stored in the XmlBinaryWriterSession, and its output
-                 number is doubled + 1 e.g. if the string is the first
-                 non-dictionary entry, then the output is 1, and 7 for the
-                 fourth one.
-               - When the index goes beyond 128, then it becomes 2 bytes,
-                 where the first byte becomes 0x80 + idx % 0x80 and
-                 the second byte becomes idx / 0x80.
-
-               Below are operations. Prefixes are always raw strings.
-               $string is length-prefixed string. @index is index as
-               described above. [value] is length-prefixed raw array.
-
-               // 2009-03-25: now that the binary format is open under OSP
-               // [MC-NBFX], I have added some notes beyond current
-               // implementation status (marked as TODO).
-
-               01                      : EndElement
-               02 $value               : Comment
-               03                      : array
-               04 $name                : local attribute by string
-               05 $prefix $name        : global attribute by string
-               06 @name                : local attribute by index
-               07 $prefix @name        : global attribute by index
-               08 $name                : default namespace by string
-               09 $prefix $name        : prefixed namespace by string
-               0A @name                : default namespace by index
-               0B $prefix @name        : prefixed namespace by index
-               0C @name                : global attribute by index,
-               ... 0x25                : in current element's namespace
-               26 ... 0x3F             : attributes with prefix
-               40 $name                : element w/o namespace by string
-               41 $prefix $name        : element with namespace by string
-               42 @name                : element w/o namespace by index
-               43 $prefix @name        : element with namespace by index
-               44 @name                : global element by index,
-               ... 0x5D                : in current element's namespace
-               5E ... 0x77             : elements with prefix
-               98 $value               : text/cdata/chars
-               99 $value               : text/cdata/chars + EndElement
-
-               FIXME: Below are not implemented:
-               (Uri is simply 98, QName is 98 '{' ns '}' 98 name)
-
-               Combined EndElement for below are supported:
-               80 : 0 (integer)
-               82 : 1 (integer)
-               84 : false (bool)
-               86 : true (bool)
-               88 : 1-byte integer
-               8A : 2-bytes integer
-               8C : 4-bytes integer
-               8E : 8-bytes integer
-               90 : single
-               92 : double
-               94 : decimal
-               96 : DateTime
-               98 : chars8
-               9A : chars16
-               9C : chars32
-               9E : bytes8 (base64)
-               A0 : bytes16 (base64)
-               A2 : bytes32 (base64)
-               A4 : TODO: start of list
-               A6 : TODO: end of list
-               A8 : empty text
-               AA : text index
-               AC : UniqueId (IsGuid = true)
-               AE : TimeSpan
-               B0 : UUID
-               B2 : UInt64
-               B4 : bool text
-               B6 : utf16_8
-               B8 : utf16_16
-               BA : utf16_32
-               BC : QName index
-
-               Error: PIs, doctype
-               Ignored: XMLdecl
-       */
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Xml/XmlBinaryReaderSession.cs b/mcs/class/System.Runtime.Serialization/System.Xml/XmlBinaryReaderSession.cs
deleted file mode 100644 (file)
index 94c1438..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-//
-// XmlBinaryReaderSession.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.Collections.Generic;
-
-namespace System.Xml
-{
-       public class XmlBinaryReaderSession : IXmlDictionary
-       {
-               XmlDictionary dic = new XmlDictionary ();
-               Dictionary<int,XmlDictionaryString> store = new Dictionary<int,XmlDictionaryString> ();
-
-               public XmlBinaryReaderSession ()
-               {
-               }
-
-               public XmlDictionaryString Add (int id, string value)
-               {
-                       var v = dic.Add (value);
-                       store [id] = v;
-                       return v;
-               }
-
-               public void Clear ()
-               {
-                       store.Clear ();
-               }
-
-               public bool TryLookup (int key, out XmlDictionaryString result)
-               {
-                       return store.TryGetValue (key, out result);
-               }
-
-               public bool TryLookup (string value, out XmlDictionaryString result)
-               {
-                       foreach (var v in store.Values)
-                               if (v.Value == value) {
-                                       result = v;
-                                       return true;
-                               }
-                       result = null;
-                       return false;
-               }
-
-               public bool TryLookup (XmlDictionaryString value,
-                       out XmlDictionaryString result)
-               {
-                       foreach (var v in store.Values)
-                               if (v == value) {
-                                       result = v;
-                                       return true;
-                               }
-                       result = null;
-                       return false;
-               }
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Xml/XmlBinaryWriterSession.cs b/mcs/class/System.Runtime.Serialization/System.Xml/XmlBinaryWriterSession.cs
deleted file mode 100644 (file)
index 64753b8..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-//
-// XmlBinaryWriterSession.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005, 2007 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System.Collections.Generic;
-
-namespace System.Xml
-{
-       public class XmlBinaryWriterSession
-       {
-               Dictionary<int,XmlDictionaryString> dic =
-                       new Dictionary<int,XmlDictionaryString> ();
-
-               public XmlBinaryWriterSession ()
-               {
-               }
-
-               public void Reset ()
-               {
-                       dic.Clear ();
-               }
-
-               // Unlike XmlDictionary, it throws an InvalidOperationException
-               // if the same string already exists.
-               public virtual bool TryAdd (XmlDictionaryString value,
-                       out int key)
-               {
-                       if (value == null)
-                               throw new ArgumentNullException ("value");
-                       if (TryLookup (value, out key))
-                               throw new InvalidOperationException ("Argument XmlDictionaryString was already added to the writer session");
-                       key = dic.Count;
-                       dic.Add (key, value);
-                       return true;
-               }
-
-               internal bool TryLookup (XmlDictionaryString value,
-                       out int key)
-               {
-                       foreach (KeyValuePair<int,XmlDictionaryString> e in dic)
-                               if (e.Value.Value == value.Value) {
-                                       key = e.Key;
-                                       return true;
-                               }
-                       key = -1;
-                       return false;
-               }
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Xml/XmlC14NWriter.cs b/mcs/class/System.Runtime.Serialization/System.Xml/XmlC14NWriter.cs
deleted file mode 100644 (file)
index bedf337..0000000
+++ /dev/null
@@ -1,185 +0,0 @@
-//
-// XmlC14NWriter.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-#if USE_DEPRECATED
-using System;
-using System.IO;
-
-namespace System.Xml
-{
-       [MonoTODO]
-       public sealed class XmlC14NWriter : XmlCanonicalWriter
-       {
-               bool include_comments;
-
-               public XmlC14NWriter (Stream stream)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public XmlC14NWriter (Stream stream, bool includeComments,
-                       params string [] inclusivePrefixes)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public bool IncludeComments {
-                       get { return include_comments; }
-                       set {
-                               throw new NotImplementedException ();
-                       }
-               }
-
-               public override void Close ()
-               {
-                       Flush ();
-               }
-
-               public override void Flush ()
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public void SetOutput (Stream stream)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public void SetOutput (Stream stream, bool includeComments,
-                       params string [] inclusivePrefixes)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public override void WriteBase64 (byte [] buffer, int index, int count)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public override void WriteCharEntity (int ch)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public override void WriteComment (string text)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public override void WriteComment (byte [] data, int offset, int count)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public override void WriteDeclaration ()
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public override void WriteEndAttribute ()
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public override void WriteEndElement (string prefix, string localName)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public override void WriteEndElement (byte [] prefix, int offset1, int count1, byte [] localName, int offset2, int count2)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public override void WriteEndStartElement (bool isEmpty)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public override void WriteEscapedText (string text)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public override void WriteEscapedText (byte [] text, int offset, int count)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public override void WriteNode (XmlReader reader)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public override void WriteStartAttribute (string prefix, string localName)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public override void WriteStartAttribute (byte [] prefix, int offset1, int count1, byte [] localName, int offset2, int count2)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public override void WriteStartElement (string prefix, string localName)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public override void WriteStartElement (byte [] prefix, int offset1, int count1, byte [] localName, int offset2, int count2)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public override void WriteText (string text)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public override void WriteText (int ch)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public override void WriteText (byte [] text, int offset, int count)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public override void WriteXmlnsAttribute (
-                       string prefix, string namespaceUri)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public override void WriteXmlnsAttribute (byte [] prefix, int offset1, int count1, byte [] namespaceUri, int offset2, int count2)
-               {
-                       throw new NotImplementedException ();
-               }
-       }
-}
-#endif
diff --git a/mcs/class/System.Runtime.Serialization/System.Xml/XmlCanonicalWriter.cs b/mcs/class/System.Runtime.Serialization/System.Xml/XmlCanonicalWriter.cs
deleted file mode 100644 (file)
index e0bdd38..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-//
-// XmlCanonicalWriter.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-#if USE_DEPRECATED
-using System;
-using System.IO;
-
-namespace System.Xml
-{
-       [MonoTODO]
-       public abstract class XmlCanonicalWriter
-       {
-               protected XmlCanonicalWriter ()
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public abstract void Close ();
-
-               public abstract void Flush ();
-
-               public abstract void WriteBase64 (byte [] buffer, int index, int count);
-
-               public abstract void WriteCharEntity (int ch);
-
-               public abstract void WriteComment (string text);
-
-               public abstract void WriteComment (byte [] data, int offset, int count);
-
-               public abstract void WriteDeclaration ();
-
-               public abstract void WriteEndAttribute ();
-
-               public abstract void WriteEndElement (string prefix, string localName);
-
-               public abstract void WriteEndElement (byte [] prefix, int offset1, int count1, byte [] localName, int offset2, int count2);
-
-               public abstract void WriteEndStartElement (bool isEmpty);
-
-               public abstract void WriteEscapedText (string text);
-
-               public abstract void WriteEscapedText (byte [] text, int offset, int count);
-
-               public abstract void WriteNode (XmlReader reader);
-
-               public abstract void WriteStartAttribute (string prefix, string localName);
-
-               public abstract void WriteStartAttribute (byte [] prefix, int offset1, int count1, byte [] localName, int offset2, int count2);
-
-               public abstract void WriteStartElement (string prefix, string localName);
-
-               public abstract void WriteStartElement (byte [] prefix, int offset1, int count1, byte [] localName, int offset2, int count2);
-
-               public abstract void WriteText (string text);
-
-               public abstract void WriteText (byte [] text, int offset, int count);
-
-               public abstract void WriteText (int ch);
-
-               public abstract void WriteXmlnsAttribute (
-                       string prefix, string namespaceUri);
-
-               public abstract void WriteXmlnsAttribute (byte [] prefix, int offset1, int count1, byte [] namespaceUri, int offset2, int count2);
-       }
-}
-#endif
diff --git a/mcs/class/System.Runtime.Serialization/System.Xml/XmlDictionary.cs b/mcs/class/System.Runtime.Serialization/System.Xml/XmlDictionary.cs
deleted file mode 100644 (file)
index 7537274..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-//
-// XmlDictionary.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.Collections;
-using System.Collections.Generic;
-
-namespace System.Xml
-{
-       public class XmlDictionary : IXmlDictionary
-       {
-               internal class EmptyDictionary : XmlDictionary
-               {
-                       public static readonly EmptyDictionary Instance =
-                               new EmptyDictionary ();
-
-                       public EmptyDictionary ()
-                               : base (1)
-                       {
-                       }
-               }
-
-               static XmlDictionary empty = new XmlDictionary (true);
-
-               public static IXmlDictionary Empty {
-                       get { return empty; }
-               }
-
-               readonly bool is_readonly;
-               Dictionary<string, XmlDictionaryString> dict;
-               List<XmlDictionaryString> list;
-
-               public XmlDictionary ()
-               {
-                       dict = new Dictionary<string, XmlDictionaryString> ();
-                       list = new List<XmlDictionaryString> ();
-               }
-
-               public XmlDictionary (int capacity)
-               {
-                       dict = new Dictionary<string, XmlDictionaryString> (capacity);
-                       list = new List<XmlDictionaryString> (capacity);
-               }
-
-               // for static empty.
-               private XmlDictionary (bool isReadOnly)
-                       : this (1)
-               {
-                       is_readonly = isReadOnly;
-               }
-
-               public virtual XmlDictionaryString Add (string value)
-               {
-                       if (is_readonly)
-                               throw new InvalidOperationException ();
-                       XmlDictionaryString ret;
-                       if (dict.TryGetValue (value, out ret))
-                               return ret;
-                       ret = new XmlDictionaryString (this, value, dict.Count);
-                       dict.Add (value, ret);
-                       list.Add (ret);
-                       return ret;
-               }
-
-               public virtual bool TryLookup (
-                       int key, out XmlDictionaryString result)
-               {
-                       if (key < 0 || dict.Count <= key) {
-                               result = null;
-                               return false;
-                       }
-                       result = list [key];
-                       return true;
-               }
-
-               public virtual bool TryLookup (string value,
-                       out XmlDictionaryString result)
-               {
-                       if (value == null)
-                               throw new ArgumentNullException ();
-                       return dict.TryGetValue (value, out result);
-               }
-
-               public virtual bool TryLookup (XmlDictionaryString value,
-                       out XmlDictionaryString result)
-               {
-                       if (value == null)
-                               throw new ArgumentNullException ();
-                       if (value.Dictionary != this) {
-                               result = null;
-                               return false;
-                       }
-                       for (int i = 0; i < list.Count; i++) {
-                               if (object.ReferenceEquals (list [i], value)) {
-                                       result = value;
-                                       return true;
-                               }
-                       }
-                       result = null;
-                       return false;
-               }
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Xml/XmlDictionaryReader.cs b/mcs/class/System.Runtime.Serialization/System.Xml/XmlDictionaryReader.cs
deleted file mode 100644 (file)
index f1407dc..0000000
+++ /dev/null
@@ -1,662 +0,0 @@
-//
-// XmlDictionaryReader.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005, 2007 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.IO;
-using System.Reflection;
-using System.Text;
-using System.Xml;
-
-namespace System.Xml
-{
-       public abstract partial class XmlDictionaryReader : XmlReader
-       {
-               protected XmlDictionaryReader ()
-               {
-               }
-
-               XmlDictionaryReaderQuotas quotas;
-
-               public virtual bool CanCanonicalize {
-                       get { return false; }
-               }
-
-               public virtual XmlDictionaryReaderQuotas Quotas {
-                       get {
-                               if (quotas == null)
-                                       quotas = new XmlDictionaryReaderQuotas ();
-                               return quotas;
-                       }
-               }
-
-               public virtual void EndCanonicalization ()
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public virtual string GetAttribute (
-                       XmlDictionaryString localName,
-                       XmlDictionaryString namespaceUri)
-               {
-                       if (localName == null)
-                               throw new ArgumentNullException ("localName");
-                       if (namespaceUri == null)
-                               throw new ArgumentNullException ("namespaceUri");
-                       return GetAttribute (localName.Value, namespaceUri.Value);
-               }
-
-               public virtual int IndexOfLocalName (
-                       string [] localNames, string namespaceUri)
-               {
-                       if (localNames == null)
-                               throw new ArgumentNullException ("localNames");
-                       if (namespaceUri == null)
-                               throw new ArgumentNullException ("namespaceUri");
-                       if (NamespaceURI != namespaceUri)
-                               return -1;
-                       for (int i = 0; i < localNames.Length; i++)
-                               if (localNames [i] == LocalName)
-                                       return i;
-                       return -1;
-               }
-
-               public virtual int IndexOfLocalName (
-                       XmlDictionaryString [] localNames,
-                       XmlDictionaryString namespaceUri)
-               {
-                       if (localNames == null)
-                               throw new ArgumentNullException ("localNames");
-                       if (namespaceUri == null)
-                               throw new ArgumentNullException ("namespaceUri");
-                       if (NamespaceURI != namespaceUri.Value)
-                               return -1;
-                       XmlDictionaryString localName;
-                       if (!TryGetLocalNameAsDictionaryString (out localName))
-                               return -1;
-                       IXmlDictionary dict = localName.Dictionary;
-                       XmlDictionaryString iter;
-                       for (int i = 0; i < localNames.Length; i++)
-                               if (dict.TryLookup (localNames [i], out iter) && object.ReferenceEquals (iter, localName))
-                                       return i;
-                       return -1;
-               }
-
-               public virtual bool IsArray (out Type type)
-               {
-                       type = null;
-                       return false;
-               }
-
-               public virtual bool IsLocalName (string localName)
-               {
-                       return LocalName == localName;
-               }
-
-               public virtual bool IsLocalName (XmlDictionaryString localName)
-               {
-                       if (localName == null)
-                               throw new ArgumentNullException ("localName");
-                       return LocalName == localName.Value;
-               }
-
-               public virtual bool IsNamespaceUri (string namespaceUri)
-               {
-                       return NamespaceURI == namespaceUri;
-               }
-
-               public virtual bool IsNamespaceUri (XmlDictionaryString namespaceUri)
-               {
-                       if (namespaceUri == null)
-                               throw new ArgumentNullException ("namespaceUri");
-                       return NamespaceURI == namespaceUri.Value;
-               }
-
-               public virtual bool IsStartArray (out Type type)
-               {
-                       type = null;
-                       return false;
-               }
-
-               public virtual bool IsStartElement (
-                       XmlDictionaryString localName,
-                       XmlDictionaryString namespaceUri)
-               {
-                       if (localName == null)
-                               throw new ArgumentNullException ("localName");
-                       if (namespaceUri == null)
-                               throw new ArgumentNullException ("namespaceUri");
-                       return IsStartElement (localName.Value, namespaceUri.Value);
-               }
-
-               protected bool IsTextNode (XmlNodeType nodeType)
-               {
-                       switch (nodeType) {
-                       case XmlNodeType.Attribute: // wow, it isn't indeed.
-                       case XmlNodeType.Text:
-                       case XmlNodeType.CDATA:
-                       case XmlNodeType.Whitespace:
-                       case XmlNodeType.SignificantWhitespace:
-                               return true;
-                       default:
-                               return false;
-                       }
-               }
-
-               XmlException XmlError (string message)
-               {
-                       IXmlLineInfo li = this as IXmlLineInfo;
-                       if (li == null || !li.HasLineInfo ())
-                               return new XmlException (message);
-                       else
-                               return new XmlException (String.Format ("{0} in {1} , at ({2},{3})", message, BaseURI, li.LineNumber, li.LinePosition));
-               }
-
-               public virtual void MoveToStartElement ()
-               {
-                       MoveToContent ();
-                       if (NodeType != XmlNodeType.Element)
-                               throw XmlError (String.Format ("Element node is expected, but got {0} node.", NodeType));
-               }
-
-               public virtual void MoveToStartElement (string name)
-               {
-                       if (name == null)
-                               throw new ArgumentNullException ("name");
-                       MoveToStartElement ();
-                       if (Name != name)
-                               throw XmlError (String.Format ("Element node '{0}' is expected, but got '{1}' element.", name, Name));
-               }
-
-               public virtual void MoveToStartElement (
-                       string localName, string namespaceUri)
-               {
-                       if (localName == null)
-                               throw new ArgumentNullException ("localName");
-                       if (namespaceUri == null)
-                               throw new ArgumentNullException ("namespaceUri");
-                       MoveToStartElement ();
-                       if (LocalName != localName || NamespaceURI != namespaceUri)
-                               throw XmlError (String.Format ("Element node '{0}' in namespace '{1}' is expected, but got '{2}' in namespace '{3}' element.", localName, namespaceUri, LocalName, NamespaceURI));
-               }
-
-               public virtual void MoveToStartElement (
-                       XmlDictionaryString localName,
-                       XmlDictionaryString namespaceUri)
-               {
-                       if (localName == null)
-                               throw new ArgumentNullException ("localName");
-                       if (namespaceUri == null)
-                               throw new ArgumentNullException ("namespaceUri");
-                       MoveToStartElement (localName.Value, namespaceUri.Value);
-               }
-
-               public virtual void StartCanonicalization (
-                       Stream stream, bool includeComments,
-                       string [] inclusivePrefixes)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public virtual bool TryGetArrayLength (out int count)
-               {
-                       count = -1;
-                       return false;
-               }
-
-               public virtual bool TryGetBase64ContentLength (out int count)
-               {
-                       count = -1;
-                       return false;
-               }
-
-               public virtual bool TryGetLocalNameAsDictionaryString (
-                       out XmlDictionaryString localName)
-               {
-                       localName = null;
-                       return false;
-               }
-
-               public virtual bool TryGetNamespaceUriAsDictionaryString (
-                       out XmlDictionaryString namespaceUri)
-               {
-                       namespaceUri = null;
-                       return false;
-               }
-
-               #region Content Reader Methods
-
-               public override object ReadContentAs (Type type, IXmlNamespaceResolver nsResolver)
-               {
-                       return base.ReadContentAs (type, nsResolver);
-               }
-
-               public virtual byte [] ReadContentAsBase64 ()
-               {
-                       int len;
-                       if (!TryGetBase64ContentLength (out len))
-                               return Convert.FromBase64String (ReadContentAsString ());
-                       byte [] bytes = new byte [len];
-                       ReadContentAsBase64 (bytes, 0, len);
-                       return bytes;
-               }
-
-               MethodInfo xmlconv_from_bin_hex = typeof (XmlConvert).GetMethod ("FromBinHexString", BindingFlags.Static | BindingFlags.NonPublic, null, new Type [] {typeof (string)}, null);
-
-               byte [] FromBinHexString (string s)
-               {
-                       return (byte []) xmlconv_from_bin_hex.Invoke (null, new object [] {s});
-               }
-
-               public virtual byte [] ReadContentAsBinHex ()
-               {
-                       int len;
-                       if (!TryGetArrayLength (out len))
-                               return FromBinHexString (ReadContentAsString ());
-                       return ReadContentAsBinHex (len);
-               }
-
-               protected byte [] ReadContentAsBinHex (int maxByteArrayContentLength)
-               {
-                       byte [] bytes = new byte [maxByteArrayContentLength];
-                       ReadContentAsBinHex (bytes, 0, maxByteArrayContentLength);
-                       return bytes;
-               }
-
-               [MonoTODO]
-               public virtual int ReadContentAsChars (char [] chars, int offset, int count)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public override decimal ReadContentAsDecimal ()
-               {
-                       return base.ReadContentAsDecimal ();
-               }
-
-               public override float ReadContentAsFloat ()
-               {
-                       return base.ReadContentAsFloat ();
-               }
-
-               public virtual Guid ReadContentAsGuid ()
-               {
-                       return XmlConvert.ToGuid (ReadContentAsString ());
-               }
-
-               public virtual void ReadContentAsQualifiedName (out string localName, out string namespaceUri)
-               {
-                       XmlQualifiedName qname = (XmlQualifiedName) ReadContentAs (typeof (XmlQualifiedName), this as IXmlNamespaceResolver);
-                       localName = qname.Name;
-                       namespaceUri = qname.Namespace;
-               }
-
-               public override string ReadContentAsString ()
-               {
-                       return ReadContentAsString (Quotas.MaxStringContentLength);
-               }
-
-               [MonoTODO]
-               protected string ReadContentAsString (int maxStringContentLength)
-               {
-                       return base.ReadContentAsString ();
-               }
-
-               [MonoTODO ("there is exactly no information on the web")]
-               public virtual string ReadContentAsString (string [] strings, out int index)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO ("there is exactly no information on the web")]
-               public virtual string ReadContentAsString (XmlDictionaryString [] strings, out int index)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public virtual TimeSpan ReadContentAsTimeSpan ()
-               {
-                       return XmlConvert.ToTimeSpan (ReadContentAsString ());
-               }
-
-               public virtual UniqueId ReadContentAsUniqueId ()
-               {
-                       return new UniqueId (ReadContentAsString ());
-               }
-
-               public virtual byte [] ReadElementContentAsBase64 ()
-               {
-                       ReadStartElement ();
-                       byte [] ret = ReadContentAsBase64 ();
-                       ReadEndElement ();
-                       return ret;
-               }
-
-               public virtual byte [] ReadElementContentAsBinHex ()
-               {
-                       ReadStartElement ();
-                       byte [] ret = ReadContentAsBinHex ();
-                       ReadEndElement ();
-                       return ret;
-               }
-
-               public virtual Guid ReadElementContentAsGuid ()
-               {
-                       ReadStartElement ();
-                       Guid ret = ReadContentAsGuid ();
-                       ReadEndElement ();
-                       return ret;
-               }
-
-               public virtual TimeSpan ReadElementContentAsTimeSpan ()
-               {
-                       ReadStartElement ();
-                       TimeSpan ret = ReadContentAsTimeSpan ();
-                       ReadEndElement ();
-                       return ret;
-               }
-
-               public virtual UniqueId ReadElementContentAsUniqueId ()
-               {
-                       ReadStartElement ();
-                       UniqueId ret = ReadContentAsUniqueId ();
-                       ReadEndElement ();
-                       return ret;
-               }
-
-               public override string ReadElementContentAsString ()
-               {
-                       if (IsEmptyElement) {
-                               Read ();
-                               return String.Empty;
-                       } else {
-                               ReadStartElement ();
-                               string s;
-                               if (NodeType == XmlNodeType.EndElement)
-                                       s = String.Empty;
-                               else
-                                       s = ReadContentAsString ();
-                               ReadEndElement ();
-                               return s;
-                       }
-               }
-
-               public virtual void ReadFullStartElement ()
-               {
-                       if (!IsStartElement ())
-                               throw new XmlException ("Current node is not a start element");
-                       ReadStartElement ();
-               }
-
-               public virtual void ReadFullStartElement (string name)
-               {
-                       if (!IsStartElement (name))
-                               throw new XmlException (String.Format ("Current node is not a start element '{0}'", name));
-                       ReadStartElement (name);
-               }
-
-               public virtual void ReadFullStartElement (string localName, string namespaceUri)
-               {
-                       if (!IsStartElement (localName, namespaceUri))
-                               throw new XmlException (String.Format ("Current node is not a start element '{0}' in namesapce '{1}'", localName, namespaceUri));
-                       ReadStartElement (localName, namespaceUri);
-               }
-
-               public virtual void ReadFullStartElement (XmlDictionaryString localName, XmlDictionaryString namespaceUri)
-               {
-                       if (!IsStartElement (localName, namespaceUri))
-                               throw new XmlException (String.Format ("Current node is not a start element '{0}' in namesapce '{1}'", localName, namespaceUri));
-                       ReadStartElement (localName.Value, namespaceUri.Value);
-               }
-
-               public virtual void ReadStartElement (XmlDictionaryString localName, XmlDictionaryString namespaceUri)
-               {
-                       if (localName == null)
-                               throw new ArgumentNullException ("localName");
-                       if (namespaceUri == null)
-                               throw new ArgumentNullException ("namespaceUri");
-                       ReadStartElement (localName.Value, namespaceUri.Value);
-               }
-
-               public override string ReadString ()
-               {
-                       return ReadString (Quotas.MaxStringContentLength);
-               }
-
-               [MonoTODO]
-               protected string ReadString (int maxStringContentLength)
-               {
-                       return base.ReadString ();
-               }
-
-               public virtual int ReadValueAsBase64 (byte [] bytes, int start, int length)
-               {
-                       throw new NotSupportedException (); // as it is documented ...
-               }
-
-               public virtual bool TryGetValueAsDictionaryString (out XmlDictionaryString value)
-               {
-                       throw new NotSupportedException (); // as documented
-               }
-
-               #endregion
-
-               #region Factory Methods
-
-               public static XmlDictionaryReader CreateBinaryReader (
-                       byte [] buffer, XmlDictionaryReaderQuotas quotas)
-               {
-                       return CreateBinaryReader (buffer, 0, buffer.Length, quotas);
-               }
-
-               public static XmlDictionaryReader CreateBinaryReader (
-                       byte [] buffer, int offset, int count, 
-                       XmlDictionaryReaderQuotas quotas)
-               {
-                       return CreateBinaryReader (buffer, offset, count, new XmlDictionary (), quotas);
-               }
-
-               public static XmlDictionaryReader CreateBinaryReader (
-                       byte [] buffer, int offset, int count,
-                       IXmlDictionary dictionary,
-                       XmlDictionaryReaderQuotas quotas)
-               {
-                       return CreateBinaryReader (buffer, offset, count,
-                               dictionary, quotas,
-                               new XmlBinaryReaderSession (), null);
-               }
-
-               public static XmlDictionaryReader CreateBinaryReader (
-                       byte [] buffer, int offset, int count,
-                       IXmlDictionary dictionary,
-                       XmlDictionaryReaderQuotas quotas,
-                       XmlBinaryReaderSession session)
-               {
-                       return CreateBinaryReader (buffer, offset, count,
-                               dictionary, quotas,
-                               session, null);
-               }
-
-               public static XmlDictionaryReader CreateBinaryReader (
-                       byte [] buffer, int offset, int count,
-                       IXmlDictionary dictionary,
-                       XmlDictionaryReaderQuotas quotas,
-                       XmlBinaryReaderSession session,
-                       OnXmlDictionaryReaderClose onClose)
-               {
-                       return new XmlBinaryDictionaryReader (buffer,
-                               offset, count,
-                               dictionary, quotas, session, onClose);
-               }
-
-               public static XmlDictionaryReader CreateBinaryReader (
-                       Stream stream, XmlDictionaryReaderQuotas quotas)
-               {
-                       return CreateBinaryReader (stream, new XmlDictionary (), quotas);
-               }
-
-               public static XmlDictionaryReader CreateBinaryReader (
-                       Stream stream, IXmlDictionary dictionary, 
-                       XmlDictionaryReaderQuotas quotas)
-               {
-                       return CreateBinaryReader (stream, dictionary, quotas,
-                               new XmlBinaryReaderSession (), null);
-               }
-
-               public static XmlDictionaryReader CreateBinaryReader (
-                       Stream stream, IXmlDictionary dictionary, 
-                       XmlDictionaryReaderQuotas quotas,
-                       XmlBinaryReaderSession session)
-               {
-                       return CreateBinaryReader (stream, dictionary, quotas,
-                               session, null);
-               }
-
-               public static XmlDictionaryReader CreateBinaryReader (
-                       Stream stream, IXmlDictionary dictionary,
-                       XmlDictionaryReaderQuotas quotas,
-                       XmlBinaryReaderSession session,
-                       OnXmlDictionaryReaderClose onClose)
-               {
-                       return new XmlBinaryDictionaryReader (stream,
-                               dictionary, quotas, session, onClose);
-               }
-
-               public static XmlDictionaryReader CreateDictionaryReader (
-                       XmlReader reader)
-               {
-                       return new XmlSimpleDictionaryReader (reader);
-               }
-
-#if !NET_2_1
-               public static XmlDictionaryReader CreateMtomReader (
-                       Stream stream, Encoding encoding,
-                       XmlDictionaryReaderQuotas quotas)
-               {
-                       return new XmlMtomDictionaryReader (stream, encoding, quotas);
-               }
-
-               public static XmlDictionaryReader CreateMtomReader (
-                       Stream stream, Encoding [] encodings,
-                       XmlDictionaryReaderQuotas quotas)
-               {
-                       return CreateMtomReader (stream, encodings, null, quotas);
-               }
-
-               public static XmlDictionaryReader CreateMtomReader (
-                       Stream stream, Encoding [] encodings, string contentType,
-                       XmlDictionaryReaderQuotas quotas)
-               {
-                       return CreateMtomReader (stream, encodings, contentType, quotas, int.MaxValue, null);
-               }
-
-               public static XmlDictionaryReader CreateMtomReader (
-                       Stream stream, Encoding [] encodings, string contentType,
-                       XmlDictionaryReaderQuotas quotas,
-                       int maxBufferSize,
-                       OnXmlDictionaryReaderClose onClose)
-               {
-                       return new XmlMtomDictionaryReader (stream, encodings, contentType, quotas, maxBufferSize, onClose);
-               }
-
-               public static XmlDictionaryReader CreateMtomReader (
-                       byte [] buffer, int offset, int count,
-                       Encoding encoding, XmlDictionaryReaderQuotas quotas)
-               {
-                       return CreateMtomReader (new MemoryStream (buffer, offset, count), encoding, quotas);
-               }
-
-               public static XmlDictionaryReader CreateMtomReader (
-                       byte [] buffer, int offset, int count,
-                       Encoding [] encodings, XmlDictionaryReaderQuotas quotas)
-               {
-                       return CreateMtomReader (new MemoryStream (buffer, offset, count), encodings, quotas);
-               }
-
-               public static XmlDictionaryReader CreateMtomReader (
-                       byte [] buffer, int offset, int count,
-                       Encoding [] encodings, string contentType,
-                       XmlDictionaryReaderQuotas quotas)
-               {
-                       return CreateMtomReader (new MemoryStream (buffer, offset, count), encodings, contentType, quotas);
-               }
-
-               public static XmlDictionaryReader CreateMtomReader (
-                       byte [] buffer, int offset, int count,
-                       Encoding [] encodings, string contentType,
-                       XmlDictionaryReaderQuotas quotas,
-                       int maxBufferSize,
-                       OnXmlDictionaryReaderClose onClose)
-               {
-                       return CreateMtomReader (new MemoryStream (buffer, offset, count), encodings, contentType, quotas, maxBufferSize, onClose);
-               }
-#endif
-
-               public static XmlDictionaryReader CreateTextReader (byte [] buffer, XmlDictionaryReaderQuotas quotas)
-               {
-                       return CreateTextReader (buffer, 0, buffer.Length, quotas);
-               }
-
-               public static XmlDictionaryReader CreateTextReader (
-                       byte [] buffer, int offset, int count,
-                       XmlDictionaryReaderQuotas quotas)
-               {
-                       return CreateTextReader (buffer, offset, count,
-                               Encoding.UTF8, quotas, null);
-               }
-
-               public static XmlDictionaryReader CreateTextReader (
-                       byte [] buffer, int offset, int count,
-                       Encoding encoding,
-                       XmlDictionaryReaderQuotas quotas,
-                       OnXmlDictionaryReaderClose onClose)
-               {
-                       return CreateTextReader (new MemoryStream (buffer, offset, count), encoding, quotas, onClose);
-               }
-
-               public static XmlDictionaryReader CreateTextReader (
-                       Stream stream, XmlDictionaryReaderQuotas quotas)
-               {
-                       return CreateTextReader (stream, Encoding.UTF8, quotas, null);
-               }
-
-               public static XmlDictionaryReader CreateTextReader (
-                       Stream stream, Encoding encoding,
-                       XmlDictionaryReaderQuotas quotas,
-                       OnXmlDictionaryReaderClose onClose)
-               {
-                       XmlReaderSettings s = new XmlReaderSettings ();
-                       XmlNameTable nt = new NameTable ();
-                       XmlParserContext c = new XmlParserContext (nt, new XmlNamespaceManager (nt), String.Empty, XmlSpace.None, encoding);
-                       XmlDictionaryReader res = new XmlSimpleDictionaryReader (XmlReader.Create (stream, s, c), null, onClose);
-                       res.quotas = quotas;
-                       return res;
-               }
-
-               #endregion
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Xml/XmlDictionaryReaderAutoGen.cs b/mcs/class/System.Runtime.Serialization/System.Xml/XmlDictionaryReaderAutoGen.cs
deleted file mode 100644 (file)
index 46c8456..0000000
+++ /dev/null
@@ -1,522 +0,0 @@
-
-#pragma warning disable 612
-using System;
-using System.Collections.Generic;
-
-namespace System.Xml
-{
-       public abstract partial class XmlDictionaryReader : XmlReader
-       {
-               static readonly char [] wsChars = new char [] {' ', '\t', '\n', '\r'};
-
-               void CheckReadArrayArguments (Array array, int offset, int length)
-               {
-                       if (array == null)
-                               throw new ArgumentNullException ("array");
-                       if (offset < 0)
-                               throw new ArgumentOutOfRangeException ("offset is negative");
-                       if (offset > array.Length)
-                               throw new ArgumentOutOfRangeException ("offset exceeds the length of the destination array");
-                       if (length < 0)
-                               throw new ArgumentOutOfRangeException ("length is negative");
-                       if (length > array.Length - offset)
-                               throw new ArgumentOutOfRangeException ("length + offset exceeds the length of the destination array");
-               }
-
-               void CheckDictionaryStringArgs (XmlDictionaryString localName, XmlDictionaryString namespaceUri)
-               {
-                       if (localName == null)
-                               throw new ArgumentNullException ("localName");
-                       if (namespaceUri == null)
-                               throw new ArgumentNullException ("namespaceUri");
-               }
-
-
-               public virtual int ReadArray (XmlDictionaryString localName, XmlDictionaryString namespaceUri, bool [] array, int offset, int length)
-               {
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       return ReadArray (localName.Value, namespaceUri.Value, array, offset, length);
-               }
-
-               public virtual int ReadArray (string localName, string namespaceUri, bool [] array, int offset, int length)
-               {
-                       CheckReadArrayArguments (array, offset, length);
-                       for (int i = 0; i < length; i++) {
-                               MoveToContent ();
-                               if (NodeType != XmlNodeType.Element)
-                                       return i;
-                               ReadStartElement (localName, namespaceUri);
-                               array [offset + i] = XmlConvert.ToBoolean (ReadContentAsString ());
-                               ReadEndElement ();
-                       }
-                       return length;
-               }
-
-               public virtual bool [] ReadBooleanArray (string localName, string namespaceUri)
-               {
-                       List<bool> list = new List<bool> ();
-                       while (true) {
-                               MoveToContent ();
-                               if (NodeType != XmlNodeType.Element)
-                                       break;
-                               ReadStartElement (localName, namespaceUri);
-                               list.Add (XmlConvert.ToBoolean (ReadContentAsString ()));
-                               ReadEndElement ();
-                               if (list.Count == Quotas.MaxArrayLength)
-                                       // FIXME: check if raises an error or not
-                                       break;
-                       }
-                       return list.ToArray ();
-               }
-
-               public virtual bool [] ReadBooleanArray (XmlDictionaryString localName, XmlDictionaryString namespaceUri)
-               {
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       return ReadBooleanArray (localName.Value, namespaceUri.Value);
-               }
-
-               public virtual int ReadArray (XmlDictionaryString localName, XmlDictionaryString namespaceUri, DateTime [] array, int offset, int length)
-               {
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       return ReadArray (localName.Value, namespaceUri.Value, array, offset, length);
-               }
-
-               public virtual int ReadArray (string localName, string namespaceUri, DateTime [] array, int offset, int length)
-               {
-                       CheckReadArrayArguments (array, offset, length);
-                       for (int i = 0; i < length; i++) {
-                               MoveToContent ();
-                               if (NodeType != XmlNodeType.Element)
-                                       return i;
-                               ReadStartElement (localName, namespaceUri);
-                               array [offset + i] = XmlConvert.ToDateTime (ReadContentAsString ());
-                               ReadEndElement ();
-                       }
-                       return length;
-               }
-
-               public virtual DateTime [] ReadDateTimeArray (string localName, string namespaceUri)
-               {
-                       List<DateTime> list = new List<DateTime> ();
-                       while (true) {
-                               MoveToContent ();
-                               if (NodeType != XmlNodeType.Element)
-                                       break;
-                               ReadStartElement (localName, namespaceUri);
-                               list.Add (XmlConvert.ToDateTime (ReadContentAsString ()));
-                               ReadEndElement ();
-                               if (list.Count == Quotas.MaxArrayLength)
-                                       // FIXME: check if raises an error or not
-                                       break;
-                       }
-                       return list.ToArray ();
-               }
-
-               public virtual DateTime [] ReadDateTimeArray (XmlDictionaryString localName, XmlDictionaryString namespaceUri)
-               {
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       return ReadDateTimeArray (localName.Value, namespaceUri.Value);
-               }
-
-               public virtual int ReadArray (XmlDictionaryString localName, XmlDictionaryString namespaceUri, decimal [] array, int offset, int length)
-               {
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       return ReadArray (localName.Value, namespaceUri.Value, array, offset, length);
-               }
-
-               public virtual int ReadArray (string localName, string namespaceUri, decimal [] array, int offset, int length)
-               {
-                       CheckReadArrayArguments (array, offset, length);
-                       for (int i = 0; i < length; i++) {
-                               MoveToContent ();
-                               if (NodeType != XmlNodeType.Element)
-                                       return i;
-                               ReadStartElement (localName, namespaceUri);
-                               array [offset + i] = XmlConvert.ToDecimal (ReadContentAsString ());
-                               ReadEndElement ();
-                       }
-                       return length;
-               }
-
-               public virtual decimal [] ReadDecimalArray (string localName, string namespaceUri)
-               {
-                       List<decimal> list = new List<decimal> ();
-                       while (true) {
-                               MoveToContent ();
-                               if (NodeType != XmlNodeType.Element)
-                                       break;
-                               ReadStartElement (localName, namespaceUri);
-                               list.Add (XmlConvert.ToDecimal (ReadContentAsString ()));
-                               ReadEndElement ();
-                               if (list.Count == Quotas.MaxArrayLength)
-                                       // FIXME: check if raises an error or not
-                                       break;
-                       }
-                       return list.ToArray ();
-               }
-
-               public virtual decimal [] ReadDecimalArray (XmlDictionaryString localName, XmlDictionaryString namespaceUri)
-               {
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       return ReadDecimalArray (localName.Value, namespaceUri.Value);
-               }
-
-               public virtual int ReadArray (XmlDictionaryString localName, XmlDictionaryString namespaceUri, double [] array, int offset, int length)
-               {
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       return ReadArray (localName.Value, namespaceUri.Value, array, offset, length);
-               }
-
-               public virtual int ReadArray (string localName, string namespaceUri, double [] array, int offset, int length)
-               {
-                       CheckReadArrayArguments (array, offset, length);
-                       for (int i = 0; i < length; i++) {
-                               MoveToContent ();
-                               if (NodeType != XmlNodeType.Element)
-                                       return i;
-                               ReadStartElement (localName, namespaceUri);
-                               array [offset + i] = XmlConvert.ToDouble (ReadContentAsString ());
-                               ReadEndElement ();
-                       }
-                       return length;
-               }
-
-               public virtual double [] ReadDoubleArray (string localName, string namespaceUri)
-               {
-                       List<double> list = new List<double> ();
-                       while (true) {
-                               MoveToContent ();
-                               if (NodeType != XmlNodeType.Element)
-                                       break;
-                               ReadStartElement (localName, namespaceUri);
-                               list.Add (XmlConvert.ToDouble (ReadContentAsString ()));
-                               ReadEndElement ();
-                               if (list.Count == Quotas.MaxArrayLength)
-                                       // FIXME: check if raises an error or not
-                                       break;
-                       }
-                       return list.ToArray ();
-               }
-
-               public virtual double [] ReadDoubleArray (XmlDictionaryString localName, XmlDictionaryString namespaceUri)
-               {
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       return ReadDoubleArray (localName.Value, namespaceUri.Value);
-               }
-
-               public virtual int ReadArray (XmlDictionaryString localName, XmlDictionaryString namespaceUri, Guid [] array, int offset, int length)
-               {
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       return ReadArray (localName.Value, namespaceUri.Value, array, offset, length);
-               }
-
-               public virtual int ReadArray (string localName, string namespaceUri, Guid [] array, int offset, int length)
-               {
-                       CheckReadArrayArguments (array, offset, length);
-                       for (int i = 0; i < length; i++) {
-                               MoveToContent ();
-                               if (NodeType != XmlNodeType.Element)
-                                       return i;
-                               ReadStartElement (localName, namespaceUri);
-                               array [offset + i] = XmlConvert.ToGuid (ReadContentAsString ());
-                               ReadEndElement ();
-                       }
-                       return length;
-               }
-
-               public virtual Guid [] ReadGuidArray (string localName, string namespaceUri)
-               {
-                       List<Guid> list = new List<Guid> ();
-                       while (true) {
-                               MoveToContent ();
-                               if (NodeType != XmlNodeType.Element)
-                                       break;
-                               ReadStartElement (localName, namespaceUri);
-                               list.Add (XmlConvert.ToGuid (ReadContentAsString ()));
-                               ReadEndElement ();
-                               if (list.Count == Quotas.MaxArrayLength)
-                                       // FIXME: check if raises an error or not
-                                       break;
-                       }
-                       return list.ToArray ();
-               }
-
-               public virtual Guid [] ReadGuidArray (XmlDictionaryString localName, XmlDictionaryString namespaceUri)
-               {
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       return ReadGuidArray (localName.Value, namespaceUri.Value);
-               }
-
-               public virtual int ReadArray (XmlDictionaryString localName, XmlDictionaryString namespaceUri, short [] array, int offset, int length)
-               {
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       return ReadArray (localName.Value, namespaceUri.Value, array, offset, length);
-               }
-
-               public virtual int ReadArray (string localName, string namespaceUri, short [] array, int offset, int length)
-               {
-                       CheckReadArrayArguments (array, offset, length);
-                       for (int i = 0; i < length; i++) {
-                               MoveToContent ();
-                               if (NodeType != XmlNodeType.Element)
-                                       return i;
-                               ReadStartElement (localName, namespaceUri);
-                               array [offset + i] = XmlConvert.ToInt16 (ReadContentAsString ());
-                               ReadEndElement ();
-                       }
-                       return length;
-               }
-
-               public virtual short [] ReadInt16Array (string localName, string namespaceUri)
-               {
-                       List<short> list = new List<short> ();
-                       while (true) {
-                               MoveToContent ();
-                               if (NodeType != XmlNodeType.Element)
-                                       break;
-                               ReadStartElement (localName, namespaceUri);
-                               list.Add (XmlConvert.ToInt16 (ReadContentAsString ()));
-                               ReadEndElement ();
-                               if (list.Count == Quotas.MaxArrayLength)
-                                       // FIXME: check if raises an error or not
-                                       break;
-                       }
-                       return list.ToArray ();
-               }
-
-               public virtual short [] ReadInt16Array (XmlDictionaryString localName, XmlDictionaryString namespaceUri)
-               {
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       return ReadInt16Array (localName.Value, namespaceUri.Value);
-               }
-
-               public virtual int ReadArray (XmlDictionaryString localName, XmlDictionaryString namespaceUri, int [] array, int offset, int length)
-               {
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       return ReadArray (localName.Value, namespaceUri.Value, array, offset, length);
-               }
-
-               public virtual int ReadArray (string localName, string namespaceUri, int [] array, int offset, int length)
-               {
-                       CheckReadArrayArguments (array, offset, length);
-                       for (int i = 0; i < length; i++) {
-                               MoveToContent ();
-                               if (NodeType != XmlNodeType.Element)
-                                       return i;
-                               ReadStartElement (localName, namespaceUri);
-                               array [offset + i] = XmlConvert.ToInt32 (ReadContentAsString ());
-                               ReadEndElement ();
-                       }
-                       return length;
-               }
-
-               public virtual int [] ReadInt32Array (string localName, string namespaceUri)
-               {
-                       List<int> list = new List<int> ();
-                       while (true) {
-                               MoveToContent ();
-                               if (NodeType != XmlNodeType.Element)
-                                       break;
-                               ReadStartElement (localName, namespaceUri);
-                               list.Add (XmlConvert.ToInt32 (ReadContentAsString ()));
-                               ReadEndElement ();
-                               if (list.Count == Quotas.MaxArrayLength)
-                                       // FIXME: check if raises an error or not
-                                       break;
-                       }
-                       return list.ToArray ();
-               }
-
-               public virtual int [] ReadInt32Array (XmlDictionaryString localName, XmlDictionaryString namespaceUri)
-               {
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       return ReadInt32Array (localName.Value, namespaceUri.Value);
-               }
-
-               public virtual int ReadArray (XmlDictionaryString localName, XmlDictionaryString namespaceUri, long [] array, int offset, int length)
-               {
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       return ReadArray (localName.Value, namespaceUri.Value, array, offset, length);
-               }
-
-               public virtual int ReadArray (string localName, string namespaceUri, long [] array, int offset, int length)
-               {
-                       CheckReadArrayArguments (array, offset, length);
-                       for (int i = 0; i < length; i++) {
-                               MoveToContent ();
-                               if (NodeType != XmlNodeType.Element)
-                                       return i;
-                               ReadStartElement (localName, namespaceUri);
-                               array [offset + i] = XmlConvert.ToInt64 (ReadContentAsString ());
-                               ReadEndElement ();
-                       }
-                       return length;
-               }
-
-               public virtual long [] ReadInt64Array (string localName, string namespaceUri)
-               {
-                       List<long> list = new List<long> ();
-                       while (true) {
-                               MoveToContent ();
-                               if (NodeType != XmlNodeType.Element)
-                                       break;
-                               ReadStartElement (localName, namespaceUri);
-                               list.Add (XmlConvert.ToInt64 (ReadContentAsString ()));
-                               ReadEndElement ();
-                               if (list.Count == Quotas.MaxArrayLength)
-                                       // FIXME: check if raises an error or not
-                                       break;
-                       }
-                       return list.ToArray ();
-               }
-
-               public virtual long [] ReadInt64Array (XmlDictionaryString localName, XmlDictionaryString namespaceUri)
-               {
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       return ReadInt64Array (localName.Value, namespaceUri.Value);
-               }
-
-               public virtual int ReadArray (XmlDictionaryString localName, XmlDictionaryString namespaceUri, float [] array, int offset, int length)
-               {
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       return ReadArray (localName.Value, namespaceUri.Value, array, offset, length);
-               }
-
-               public virtual int ReadArray (string localName, string namespaceUri, float [] array, int offset, int length)
-               {
-                       CheckReadArrayArguments (array, offset, length);
-                       for (int i = 0; i < length; i++) {
-                               MoveToContent ();
-                               if (NodeType != XmlNodeType.Element)
-                                       return i;
-                               ReadStartElement (localName, namespaceUri);
-                               array [offset + i] = XmlConvert.ToSingle (ReadContentAsString ());
-                               ReadEndElement ();
-                       }
-                       return length;
-               }
-
-               public virtual float [] ReadSingleArray (string localName, string namespaceUri)
-               {
-                       List<float> list = new List<float> ();
-                       while (true) {
-                               MoveToContent ();
-                               if (NodeType != XmlNodeType.Element)
-                                       break;
-                               ReadStartElement (localName, namespaceUri);
-                               list.Add (XmlConvert.ToSingle (ReadContentAsString ()));
-                               ReadEndElement ();
-                               if (list.Count == Quotas.MaxArrayLength)
-                                       // FIXME: check if raises an error or not
-                                       break;
-                       }
-                       return list.ToArray ();
-               }
-
-               public virtual float [] ReadSingleArray (XmlDictionaryString localName, XmlDictionaryString namespaceUri)
-               {
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       return ReadSingleArray (localName.Value, namespaceUri.Value);
-               }
-
-               public virtual int ReadArray (XmlDictionaryString localName, XmlDictionaryString namespaceUri, TimeSpan [] array, int offset, int length)
-               {
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       return ReadArray (localName.Value, namespaceUri.Value, array, offset, length);
-               }
-
-               public virtual int ReadArray (string localName, string namespaceUri, TimeSpan [] array, int offset, int length)
-               {
-                       CheckReadArrayArguments (array, offset, length);
-                       for (int i = 0; i < length; i++) {
-                               MoveToContent ();
-                               if (NodeType != XmlNodeType.Element)
-                                       return i;
-                               ReadStartElement (localName, namespaceUri);
-                               array [offset + i] = XmlConvert.ToTimeSpan (ReadContentAsString ());
-                               ReadEndElement ();
-                       }
-                       return length;
-               }
-
-               public virtual TimeSpan [] ReadTimeSpanArray (string localName, string namespaceUri)
-               {
-                       List<TimeSpan> list = new List<TimeSpan> ();
-                       while (true) {
-                               MoveToContent ();
-                               if (NodeType != XmlNodeType.Element)
-                                       break;
-                               ReadStartElement (localName, namespaceUri);
-                               list.Add (XmlConvert.ToTimeSpan (ReadContentAsString ()));
-                               ReadEndElement ();
-                               if (list.Count == Quotas.MaxArrayLength)
-                                       // FIXME: check if raises an error or not
-                                       break;
-                       }
-                       return list.ToArray ();
-               }
-
-               public virtual TimeSpan [] ReadTimeSpanArray (XmlDictionaryString localName, XmlDictionaryString namespaceUri)
-               {
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       return ReadTimeSpanArray (localName.Value, namespaceUri.Value);
-               }
-
-               public override bool ReadElementContentAsBoolean ()
-               {
-                       ReadStartElement (LocalName, NamespaceURI);
-                       bool ret = ReadContentAsBoolean ();
-                       ReadEndElement ();
-                       return ret;
-               }
-
-               public override DateTime ReadElementContentAsDateTime ()
-               {
-                       ReadStartElement (LocalName, NamespaceURI);
-                       DateTime ret = ReadContentAsDateTime ();
-                       ReadEndElement ();
-                       return ret;
-               }
-
-               public override decimal ReadElementContentAsDecimal ()
-               {
-                       ReadStartElement (LocalName, NamespaceURI);
-                       decimal ret = ReadContentAsDecimal ();
-                       ReadEndElement ();
-                       return ret;
-               }
-
-               public override double ReadElementContentAsDouble ()
-               {
-                       ReadStartElement (LocalName, NamespaceURI);
-                       double ret = ReadContentAsDouble ();
-                       ReadEndElement ();
-                       return ret;
-               }
-
-               public override float ReadElementContentAsFloat ()
-               {
-                       ReadStartElement (LocalName, NamespaceURI);
-                       float ret = ReadContentAsFloat ();
-                       ReadEndElement ();
-                       return ret;
-               }
-
-               public override int ReadElementContentAsInt ()
-               {
-                       ReadStartElement (LocalName, NamespaceURI);
-                       int ret = ReadContentAsInt ();
-                       ReadEndElement ();
-                       return ret;
-               }
-
-               public override long ReadElementContentAsLong ()
-               {
-                       ReadStartElement (LocalName, NamespaceURI);
-                       long ret = ReadContentAsLong ();
-                       ReadEndElement ();
-                       return ret;
-               }
-
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Xml/XmlDictionaryReaderQuotas.cs b/mcs/class/System.Runtime.Serialization/System.Xml/XmlDictionaryReaderQuotas.cs
deleted file mode 100644 (file)
index 1a8ad4a..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-//
-// XmlDictionaryReaderQuotas.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-namespace System.Xml
-{
-       public sealed class XmlDictionaryReaderQuotas
-       {
-               static XmlDictionaryReaderQuotas max;
-
-               static XmlDictionaryReaderQuotas ()
-               {
-                       max = new XmlDictionaryReaderQuotas (true);
-               }
-
-               readonly bool is_readonly;
-               int array_len, bytes, depth, nt_chars, text_len;
-
-               public XmlDictionaryReaderQuotas ()
-                       : this (false)
-               {
-               }
-
-               private XmlDictionaryReaderQuotas (bool max)
-               {
-                       is_readonly = max;
-                       array_len = max ? int.MaxValue : 0x4000;
-                       bytes = max ? int.MaxValue : 0x1000;
-                       depth = max ? int.MaxValue : 0x20;
-                       nt_chars = max ? int.MaxValue : 0x4000;
-                       text_len = max ? int.MaxValue : 0x2000;
-               }
-
-               public static XmlDictionaryReaderQuotas Max {
-                       get { return max; }
-               }
-
-               public int MaxArrayLength {
-                       get { return array_len; }
-                       set { array_len = Check (value); }
-               }
-
-               public int MaxBytesPerRead {
-                       get { return bytes; }
-                       set { bytes = Check (value); }
-               }
-
-               public int MaxDepth {
-                       get { return depth; }
-                       set { depth = Check (value); }
-               }
-
-               public int MaxNameTableCharCount {
-                       get { return nt_chars; }
-                       set { nt_chars = Check (value); }
-               }
-
-               public int MaxStringContentLength {
-                       get { return text_len; }
-                       set { text_len = Check (value); }
-               }
-
-               private int Check (int value)
-               {
-                       if (is_readonly)
-                               throw new InvalidOperationException ("This quota is read-only.");
-                       if (value <= 0)
-                               throw new ArgumentException ("Value must be positive integer.");
-                       return value;
-               }
-
-               public void CopyTo (XmlDictionaryReaderQuotas quota)
-               {
-                       quota.array_len = array_len;
-                       quota.bytes = bytes;
-                       quota.depth = depth;
-                       quota.nt_chars = nt_chars;
-                       quota.text_len = text_len;
-               }
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Xml/XmlDictionaryString.cs b/mcs/class/System.Runtime.Serialization/System.Xml/XmlDictionaryString.cs
deleted file mode 100644 (file)
index 374b451..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-//
-// XmlDictionaryString.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.Collections;
-
-namespace System.Xml
-{
-       public class XmlDictionaryString
-       {
-               static XmlDictionaryString empty = new XmlDictionaryString (
-                       XmlDictionary.EmptyDictionary.Instance,
-                       String.Empty, 0);
-
-               public static XmlDictionaryString Empty {
-                       get { return empty; }
-               }
-
-               readonly IXmlDictionary dict;
-               readonly string value;
-               readonly int key;
-
-               public XmlDictionaryString (IXmlDictionary dictionary,
-                       string value, int key)
-               {
-                       if (dictionary == null)
-                               throw new ArgumentNullException ("dictionary");
-                       if (value == null)
-                               throw new ArgumentNullException ("value");
-                       if (key < 0 || key > (int.MaxValue/4))
-                               throw new ArgumentOutOfRangeException ("key");
-                       this.dict = dictionary;
-                       this.value = value;
-                       this.key = key;
-               }
-
-               public IXmlDictionary Dictionary {
-                       get { return dict; }
-               }
-
-               public int Key {
-                       get { return key; }
-               }
-
-               public string Value {
-                       get { return value; }
-               }
-
-               public override string ToString ()
-               {
-                       return value;
-               }
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Xml/XmlDictionaryWriter.cs b/mcs/class/System.Runtime.Serialization/System.Xml/XmlDictionaryWriter.cs
deleted file mode 100644 (file)
index 6e909a8..0000000
+++ /dev/null
@@ -1,409 +0,0 @@
-//
-// XmlDictionaryWriter.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.IO;
-using System.Text;
-
-namespace System.Xml
-{
-       public abstract partial class XmlDictionaryWriter : XmlWriter
-       {
-               static readonly Encoding utf8_unmarked = new UTF8Encoding (false);
-
-               protected XmlDictionaryWriter ()
-               {
-               }
-
-               internal int Depth { get; set; }
-
-               internal int NSIndex { get; set; }
-
-               public virtual bool CanCanonicalize {
-                       get { return false; }
-               }
-
-               public static XmlDictionaryWriter CreateBinaryWriter (
-                       Stream stream)
-               {
-                       return CreateBinaryWriter (stream, null, null, false);
-               }
-
-               public static XmlDictionaryWriter CreateBinaryWriter (
-                       Stream stream, IXmlDictionary dictionary)
-               {
-                       return CreateBinaryWriter (stream, dictionary, null, false);
-               }
-
-               public static XmlDictionaryWriter CreateBinaryWriter (
-                       Stream stream, IXmlDictionary dictionary,
-                       XmlBinaryWriterSession session)
-               {
-                       return CreateBinaryWriter (stream, dictionary, session, false);
-               }
-
-               public static XmlDictionaryWriter CreateBinaryWriter (
-                       Stream stream, IXmlDictionary dictionary,
-                       XmlBinaryWriterSession session, bool ownsStream)
-               {
-                       return new XmlBinaryDictionaryWriter (stream,
-                               dictionary, session, ownsStream);
-               }
-
-               public static XmlDictionaryWriter CreateDictionaryWriter (XmlWriter writer)
-               {
-                       return new XmlSimpleDictionaryWriter (writer);
-               }
-#if !NET_2_1
-               public static XmlDictionaryWriter CreateMtomWriter (
-                       Stream stream, Encoding encoding, int maxSizeInBytes,
-                       string startInfo)
-               {
-                       return CreateMtomWriter (stream, encoding,
-                               maxSizeInBytes, startInfo, Guid.NewGuid () + "id=1", "http://tempuri.org/0/" + DateTime.Now.Ticks, true, false);
-               }
-
-               public static XmlDictionaryWriter CreateMtomWriter (
-                       Stream stream, Encoding encoding, int maxSizeInBytes,
-                       string startInfo, string boundary, string startUri,
-                       bool writeMessageHeaders, bool ownsStream)
-               {
-                       return new XmlMtomDictionaryWriter (stream, encoding, maxSizeInBytes, startInfo, boundary, startUri, writeMessageHeaders, ownsStream);
-               }
-#endif
-               public static XmlDictionaryWriter CreateTextWriter (
-                       Stream stream)
-               {
-                       return CreateTextWriter (stream, Encoding.UTF8);
-               }
-
-               public static XmlDictionaryWriter CreateTextWriter (
-                       Stream stream, Encoding encoding)
-               {
-                       return CreateTextWriter (stream, encoding, false);
-               }
-
-               // BTW looks like it creates an instance of different
-               // implementation than those from XmlWriter.Create().
-               public static XmlDictionaryWriter CreateTextWriter (
-                       Stream stream, Encoding encoding, bool ownsStream)
-               {
-                       if (stream == null)
-                               throw new ArgumentNullException ("stream");
-                       if (encoding == null)
-                               throw new ArgumentNullException ("encoding");
-
-                       switch (encoding.CodePage) {
-                       case 1200:
-                       case 1201: // utf-16
-                       case 65001: // utf-8
-                               encoding = utf8_unmarked;
-                               break;
-                       default:
-                               throw new XmlException (String.Format ("XML declaration is required for encoding code page {0} but this XmlWriter does not support XML declaration.", encoding.CodePage));
-                       }
-
-                       XmlWriterSettings s = new XmlWriterSettings ();
-                       s.Encoding = encoding;
-                       s.CloseOutput = ownsStream;
-                       s.OmitXmlDeclaration = true;
-                       return CreateDictionaryWriter (XmlWriter.Create (stream, s));
-               }
-
-               
-
-               public virtual void EndCanonicalization ()
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public virtual void StartCanonicalization (
-                       Stream stream, bool includeComments,
-                       string [] inclusivePrefixes)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public void WriteAttributeString (
-                       XmlDictionaryString localName,
-                       XmlDictionaryString namespaceUri,
-                       string value)
-               {
-                       WriteAttributeString (null, localName, namespaceUri, value);
-               }
-
-               public void WriteAttributeString (string prefix,
-                       XmlDictionaryString localName,
-                       XmlDictionaryString namespaceUri,
-                       string value)
-               {
-                       WriteStartAttribute (prefix, localName, namespaceUri);
-                       WriteString (value);
-                       WriteEndAttribute ();
-               }
-
-               public void WriteElementString (
-                       XmlDictionaryString localName,
-                       XmlDictionaryString namespaceUri,
-                       string value)
-               {
-                       WriteElementString (null, localName, namespaceUri, value);
-               }
-
-               public void WriteElementString (string prefix,
-                       XmlDictionaryString localName,
-                       XmlDictionaryString namespaceUri,
-                       string value)
-               {
-                       WriteStartElement (prefix, localName, namespaceUri);
-                       WriteString (value);
-                       WriteEndElement ();
-               }
-
-               public virtual void WriteNode (XmlDictionaryReader reader,
-                       bool defattr)
-               {
-                       if (reader == null)
-                               throw new ArgumentNullException ("reader");
-
-                       if (reader.ReadState == ReadState.Initial)
-                               reader.Read ();
-                       
-                       switch (reader.NodeType) {
-                       case XmlNodeType.Element:
-                               // gratuitously copied from System.XML/System.Xml/XmlWriter.cs:WriteNode(XmlReader,bool)
-                               // as there doesn't seem to be a way to hook into attribute writing w/o handling Element.
-                               XmlDictionaryString ename, ens;
-                               if (reader.TryGetLocalNameAsDictionaryString (out ename) && reader.TryGetLocalNameAsDictionaryString (out ens))
-                                       WriteStartElement (reader.Prefix, ename, ens);
-                               else
-                                       WriteStartElement (reader.Prefix, reader.LocalName, reader.NamespaceURI);
-                               // Well, I found that MS.NET took this way, since
-                               // there was a error-prone SgmlReader that fails
-                               // MoveToNextAttribute().
-                               if (reader.HasAttributes) {
-                                       for (int i = 0; i < reader.AttributeCount; i++) {
-                                               reader.MoveToAttribute (i);
-                                               WriteAttribute (reader, defattr);
-                                       }
-                                       reader.MoveToElement ();
-                               }
-                               if (reader.IsEmptyElement)
-                                       WriteEndElement ();
-                               else {
-                                       int depth = reader.Depth;
-                                       reader.Read ();
-                                       if (reader.NodeType != XmlNodeType.EndElement) {
-                                               do {
-                                                       WriteNode (reader, defattr);
-                                               } while (depth < reader.Depth);
-                                       }
-                                       WriteFullEndElement ();
-                               }
-                               reader.Read ();
-                               break;
-                       case XmlNodeType.Attribute:
-                       case XmlNodeType.Text:
-                               WriteTextNode (reader, defattr);
-                               break;
-                       default:
-                               base.WriteNode (reader, defattr);
-                               break;
-                       }
-               }
-
-               private void WriteAttribute (XmlDictionaryReader reader, bool defattr)
-               {
-                       if (!defattr && reader.IsDefault)
-                               return;
-
-                       XmlDictionaryString name, ns;
-                       if (reader.TryGetLocalNameAsDictionaryString (out name) && reader.TryGetLocalNameAsDictionaryString (out ns))
-                               WriteStartAttribute (reader.Prefix, name, ns);
-                       else
-                               WriteStartAttribute (reader.Prefix, reader.LocalName, reader.NamespaceURI);
-#if NET_2_1
-                       // no ReadAttributeValue() in 2.1 profile.
-                       WriteTextNode (reader, true);
-#else
-                       while (reader.ReadAttributeValue ()) {
-                               switch (reader.NodeType) {
-                               case XmlNodeType.Text:
-                                       WriteTextNode (reader, true);
-                                       break;
-                               case XmlNodeType.EntityReference:
-                                       WriteEntityRef (reader.Name);
-                                       break;
-                               }
-                       }
-#endif
-                       WriteEndAttribute ();
-               }
-
-               public override void WriteNode (XmlReader reader, bool defattr)
-               {
-                       if (reader == null)
-                               throw new ArgumentNullException ("reader");
-
-                       XmlDictionaryReader dr = reader as XmlDictionaryReader;
-                       if (dr != null)
-                               WriteNode (dr, defattr);
-                       else
-                               base.WriteNode (reader, defattr);
-               }
-
-               public virtual void WriteQualifiedName (
-                       XmlDictionaryString localName,
-                       XmlDictionaryString namespaceUri)
-               {
-                       WriteQualifiedName (localName.Value, namespaceUri.Value);
-               }
-
-               public void WriteStartAttribute (
-                       XmlDictionaryString localName,
-                       XmlDictionaryString namespaceUri)
-               {
-                       WriteStartAttribute (localName.Value, namespaceUri.Value);
-               }
-
-               public virtual void WriteStartAttribute (string prefix,
-                       XmlDictionaryString localName,
-                       XmlDictionaryString namespaceUri)
-               {
-                       WriteStartAttribute (prefix, localName.Value, namespaceUri.Value);
-               }
-
-               public void WriteStartElement (
-                       XmlDictionaryString localName,
-                       XmlDictionaryString namespaceUri)
-               {
-                       WriteStartElement (null, localName, namespaceUri);
-               }
-
-               public virtual void WriteStartElement (string prefix,
-                       XmlDictionaryString localName,
-                       XmlDictionaryString namespaceUri)
-               {
-                       if (localName == null)
-                               throw new ArgumentException ("localName must not be null.", "localName");
-                       WriteStartElement (prefix, localName.Value,
-                                       namespaceUri != null ? namespaceUri.Value : null);
-               }
-
-               public virtual void WriteString (XmlDictionaryString value)
-               {
-                       WriteString (value.Value);
-               }
-
-               protected virtual void WriteTextNode (XmlDictionaryReader reader, bool isAttribute)
-               {
-                       WriteString (reader.Value);
-                       if (!isAttribute)
-                               reader.Read ();
-               }
-
-               public virtual void WriteValue (Guid guid)
-               {
-                       WriteString (guid.ToString ());
-               }
-
-               public virtual void WriteValue (IStreamProvider value)
-               {
-                       if (value == null)
-                               throw new ArgumentNullException ("value");
-
-                       Stream stream = value.GetStream ();
-                       byte[] buf = new byte [Math.Min (2048, stream.CanSeek ? stream.Length : 2048)];
-                       int read;
-                       while ((read = stream.Read (buf, 0, buf.Length)) > 0) {
-                               WriteBase64 (buf, 0, read);
-                       }
-                       value.ReleaseStream (stream);
-               }
-
-               public virtual void WriteValue (TimeSpan duration)
-               {
-                       WriteString (XmlConvert.ToString (duration));
-               }
-
-               public virtual void WriteValue (UniqueId id)
-               {
-                       if (id == null)
-                               throw new ArgumentNullException ("id");
-                       WriteString (id.ToString ());
-               }
-
-               public virtual void WriteValue (XmlDictionaryString value)
-               {
-                       WriteValue (value.Value);
-               }
-
-               public virtual void WriteXmlAttribute (string localName, string value)
-               {
-                       WriteAttributeString ("xml", localName, "http://www.w3.org/XML/1998/namespace", value);
-               }
-
-               public virtual void WriteXmlAttribute (XmlDictionaryString localName,
-                       XmlDictionaryString value)
-               {
-                       WriteXmlAttribute (localName.Value, value.Value);
-               }
-
-               public virtual void WriteXmlnsAttribute (
-                       string prefix, string namespaceUri)
-               {
-                       // BTW .NET 2.0 those XmlWriters from XmlWrite.Create()
-                       // rejects namespace overriding i.e.
-                       //
-                       //      xw.WriteStartElement ("foo", "urn:foo");
-                       //      xw.WriteXmlnsAttribute ("foo", "urn:bar");
-                       //
-                       // causes an XmlException. We need fix in sys.xml.dll
-
-                       // When the prefix is null, this writer must mock
-                       // a dummy namespace up. It is then up to the actual
-                       // writer how it is determined in the output. (When
-                       // there is a duplicate, then it will be further 
-                       // modified.)
-                       if (prefix == null && String.IsNullOrEmpty (namespaceUri))
-                               prefix = String.Empty;
-                       else if (prefix == null)
-                               prefix = "d" + Depth + "p" + (++NSIndex);
-
-                       if (prefix == String.Empty)
-                               WriteAttributeString ("xmlns", namespaceUri);
-                       else
-                               WriteAttributeString ("xmlns", prefix, "http://www.w3.org/2000/xmlns/", namespaceUri);
-               }
-
-               public virtual void WriteXmlnsAttribute (string prefix,
-                       XmlDictionaryString namespaceUri)
-               {
-                       WriteXmlnsAttribute (prefix, namespaceUri.Value);
-               }
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Xml/XmlDictionaryWriterAutoGen.cs b/mcs/class/System.Runtime.Serialization/System.Xml/XmlDictionaryWriterAutoGen.cs
deleted file mode 100644 (file)
index 76bc185..0000000
+++ /dev/null
@@ -1,202 +0,0 @@
-
-using System;
-
-namespace System.Xml
-{
-       public abstract partial class XmlDictionaryWriter : XmlWriter
-       {
-               void CheckWriteArrayArguments (Array array, int offset, int length)
-               {
-                       if (array == null)
-                               throw new ArgumentNullException ("array");
-                       if (offset < 0)
-                               throw new ArgumentOutOfRangeException ("offset is negative");
-                       if (offset > array.Length)
-                               throw new ArgumentOutOfRangeException ("offset exceeds the length of the destination array");
-                       if (length < 0)
-                               throw new ArgumentOutOfRangeException ("length is negative");
-                       if (length > array.Length - offset)
-                               throw new ArgumentOutOfRangeException ("length + offset exceeds the length of the destination array");
-               }
-
-               void CheckDictionaryStringArgs (XmlDictionaryString localName, XmlDictionaryString namespaceUri)
-               {
-                       if (localName == null)
-                               throw new ArgumentNullException ("localName");
-                       if (namespaceUri == null)
-                               throw new ArgumentNullException ("namespaceUri");
-               }
-
-
-               public virtual void WriteArray (string prefix, XmlDictionaryString localName, XmlDictionaryString namespaceUri, bool [] array, int offset, int length)
-               {
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       WriteArray (prefix, localName.Value, namespaceUri.Value, array, offset, length);
-               }
-
-               public virtual void WriteArray (string prefix, string localName, string namespaceUri, bool [] array, int offset, int length)
-               {
-                       CheckWriteArrayArguments (array, offset, length);
-                       for (int i = 0; i < length; i++) {
-                               WriteStartElement (prefix, localName, namespaceUri);
-                               WriteValue (array [offset + i]);
-                               WriteEndElement ();
-                       }
-
-               }
-
-               public virtual void WriteArray (string prefix, XmlDictionaryString localName, XmlDictionaryString namespaceUri, DateTime [] array, int offset, int length)
-               {
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       WriteArray (prefix, localName.Value, namespaceUri.Value, array, offset, length);
-               }
-
-               public virtual void WriteArray (string prefix, string localName, string namespaceUri, DateTime [] array, int offset, int length)
-               {
-                       CheckWriteArrayArguments (array, offset, length);
-                       for (int i = 0; i < length; i++) {
-                               WriteStartElement (prefix, localName, namespaceUri);
-                               WriteValue (array [offset + i]);
-                               WriteEndElement ();
-                       }
-
-               }
-
-               public virtual void WriteArray (string prefix, XmlDictionaryString localName, XmlDictionaryString namespaceUri, decimal [] array, int offset, int length)
-               {
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       WriteArray (prefix, localName.Value, namespaceUri.Value, array, offset, length);
-               }
-
-               public virtual void WriteArray (string prefix, string localName, string namespaceUri, decimal [] array, int offset, int length)
-               {
-                       CheckWriteArrayArguments (array, offset, length);
-                       for (int i = 0; i < length; i++) {
-                               WriteStartElement (prefix, localName, namespaceUri);
-                               WriteValue (array [offset + i]);
-                               WriteEndElement ();
-                       }
-
-               }
-
-               public virtual void WriteArray (string prefix, XmlDictionaryString localName, XmlDictionaryString namespaceUri, double [] array, int offset, int length)
-               {
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       WriteArray (prefix, localName.Value, namespaceUri.Value, array, offset, length);
-               }
-
-               public virtual void WriteArray (string prefix, string localName, string namespaceUri, double [] array, int offset, int length)
-               {
-                       CheckWriteArrayArguments (array, offset, length);
-                       for (int i = 0; i < length; i++) {
-                               WriteStartElement (prefix, localName, namespaceUri);
-                               WriteValue (array [offset + i]);
-                               WriteEndElement ();
-                       }
-
-               }
-
-               public virtual void WriteArray (string prefix, XmlDictionaryString localName, XmlDictionaryString namespaceUri, Guid [] array, int offset, int length)
-               {
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       WriteArray (prefix, localName.Value, namespaceUri.Value, array, offset, length);
-               }
-
-               public virtual void WriteArray (string prefix, string localName, string namespaceUri, Guid [] array, int offset, int length)
-               {
-                       CheckWriteArrayArguments (array, offset, length);
-                       for (int i = 0; i < length; i++) {
-                               WriteStartElement (prefix, localName, namespaceUri);
-                               WriteValue (array [offset + i]);
-                               WriteEndElement ();
-                       }
-
-               }
-
-               public virtual void WriteArray (string prefix, XmlDictionaryString localName, XmlDictionaryString namespaceUri, short [] array, int offset, int length)
-               {
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       WriteArray (prefix, localName.Value, namespaceUri.Value, array, offset, length);
-               }
-
-               public virtual void WriteArray (string prefix, string localName, string namespaceUri, short [] array, int offset, int length)
-               {
-                       CheckWriteArrayArguments (array, offset, length);
-                       for (int i = 0; i < length; i++) {
-                               WriteStartElement (prefix, localName, namespaceUri);
-                               WriteValue (array [offset + i]);
-                               WriteEndElement ();
-                       }
-
-               }
-
-               public virtual void WriteArray (string prefix, XmlDictionaryString localName, XmlDictionaryString namespaceUri, int [] array, int offset, int length)
-               {
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       WriteArray (prefix, localName.Value, namespaceUri.Value, array, offset, length);
-               }
-
-               public virtual void WriteArray (string prefix, string localName, string namespaceUri, int [] array, int offset, int length)
-               {
-                       CheckWriteArrayArguments (array, offset, length);
-                       for (int i = 0; i < length; i++) {
-                               WriteStartElement (prefix, localName, namespaceUri);
-                               WriteValue (array [offset + i]);
-                               WriteEndElement ();
-                       }
-
-               }
-
-               public virtual void WriteArray (string prefix, XmlDictionaryString localName, XmlDictionaryString namespaceUri, long [] array, int offset, int length)
-               {
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       WriteArray (prefix, localName.Value, namespaceUri.Value, array, offset, length);
-               }
-
-               public virtual void WriteArray (string prefix, string localName, string namespaceUri, long [] array, int offset, int length)
-               {
-                       CheckWriteArrayArguments (array, offset, length);
-                       for (int i = 0; i < length; i++) {
-                               WriteStartElement (prefix, localName, namespaceUri);
-                               WriteValue (array [offset + i]);
-                               WriteEndElement ();
-                       }
-
-               }
-
-               public virtual void WriteArray (string prefix, XmlDictionaryString localName, XmlDictionaryString namespaceUri, float [] array, int offset, int length)
-               {
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       WriteArray (prefix, localName.Value, namespaceUri.Value, array, offset, length);
-               }
-
-               public virtual void WriteArray (string prefix, string localName, string namespaceUri, float [] array, int offset, int length)
-               {
-                       CheckWriteArrayArguments (array, offset, length);
-                       for (int i = 0; i < length; i++) {
-                               WriteStartElement (prefix, localName, namespaceUri);
-                               WriteValue (array [offset + i]);
-                               WriteEndElement ();
-                       }
-
-               }
-
-               public virtual void WriteArray (string prefix, XmlDictionaryString localName, XmlDictionaryString namespaceUri, TimeSpan [] array, int offset, int length)
-               {
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       WriteArray (prefix, localName.Value, namespaceUri.Value, array, offset, length);
-               }
-
-               public virtual void WriteArray (string prefix, string localName, string namespaceUri, TimeSpan [] array, int offset, int length)
-               {
-                       CheckWriteArrayArguments (array, offset, length);
-                       for (int i = 0; i < length; i++) {
-                               WriteStartElement (prefix, localName, namespaceUri);
-                               WriteValue (array [offset + i]);
-                               WriteEndElement ();
-                       }
-
-               }
-
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Xml/XmlMtomDictionaryReader.cs b/mcs/class/System.Runtime.Serialization/System.Xml/XmlMtomDictionaryReader.cs
deleted file mode 100644 (file)
index b2ca93c..0000000
+++ /dev/null
@@ -1,630 +0,0 @@
-//
-// XmlMtomDictionaryReader.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2009 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Net.Mime;
-using System.Reflection;
-using System.Text;
-using System.Xml;
-
-namespace System.Xml
-{
-       internal class XmlMtomDictionaryReader : XmlDictionaryReader
-       {
-               public XmlMtomDictionaryReader (
-                       Stream stream, Encoding encoding,
-                       XmlDictionaryReaderQuotas quotas)
-               {
-                       this.stream = stream;
-                       this.encoding = encoding;
-                       this.quotas = quotas;
-
-                       Initialize ();
-               }
-
-               public XmlMtomDictionaryReader (
-                       Stream stream, Encoding [] encodings, string contentType,
-                       XmlDictionaryReaderQuotas quotas,
-                       int maxBufferSize,
-                       OnXmlDictionaryReaderClose onClose)
-               {
-                       this.stream = stream;
-                       this.encodings = encodings;
-                       content_type = contentType != null ? CreateContentType (contentType) : null;
-                       this.quotas = quotas;
-                       this.max_buffer_size = maxBufferSize;
-                       on_close = onClose;
-
-                       Initialize ();
-               }
-
-               Stream stream;
-               Encoding encoding;
-               Encoding [] encodings;
-               ContentType content_type;
-               XmlDictionaryReaderQuotas quotas;
-               int max_buffer_size;
-               OnXmlDictionaryReaderClose on_close;
-
-               Dictionary<string,MimeEncodedStream> readers = new Dictionary<string,MimeEncodedStream> ();
-
-               void Initialize ()
-               {
-                       var nt = new NameTable ();
-                       initial_reader = new NonInteractiveStateXmlReader (String.Empty, nt, ReadState.Initial);
-                       eof_reader = new NonInteractiveStateXmlReader (String.Empty, nt, ReadState.EndOfFile);
-                       xml_reader = initial_reader;
-               }
-
-               ContentType CreateContentType (string contentTypeString)
-               {
-                       ContentType c = null;
-                       foreach (var s_ in contentTypeString.Split (';')) {
-                               var s = s_.Trim ();
-                               if (c == null) {
-                                       // first one
-                                       c = new ContentType (s);
-                                       continue;
-                               }
-                               int idx = s.IndexOf ('=');
-                               if (idx < 0)
-                                       throw new XmlException ("Invalid content type header");
-                               var val = StripBraces (s.Substring (idx + 1));
-                               c.Parameters [s.Substring (0, idx)] = val;
-                       }
-                       return c;
-               }
-
-               XmlReader xml_reader, initial_reader, eof_reader, part_reader;
-               XmlReader Reader {
-                       get { return part_reader ?? xml_reader; }
-               }
-
-               public override bool EOF {
-                       get { return Reader == eof_reader; }
-               }
-
-               public override void Close ()
-               {
-                       if (!EOF && on_close != null)
-                               on_close (this);
-                       xml_reader = eof_reader;
-               }
-
-               public override bool Read ()
-               {
-                       if (EOF)
-                               return false;
-
-                       if (Reader == initial_reader)
-                               SetupPrimaryReader ();
-
-                       if (part_reader != null)
-                               part_reader = null;
-
-                       if (!Reader.Read ()) {
-                               xml_reader = eof_reader;
-                               return false;
-                       }
-                       if (Reader.LocalName == "Include" && Reader.NamespaceURI == "http://www.w3.org/2004/08/xop/include") {
-                               string cid = Reader.GetAttribute ("href");
-                               if (!cid.StartsWith ("cid:"))
-                                       throw new XmlException ("Cannot resolve non-cid href attribute value in XOP Include element");
-                               cid = cid.Substring (4);
-                               if (!readers.ContainsKey (cid))
-                                       ReadToIdentifiedStream (cid);
-                               part_reader = new MultiPartedXmlReader (Reader, readers [cid]);
-                       }
-                       return true;
-               }
-
-               void SetupPrimaryReader ()
-               {
-                       ReadOptionalMimeHeaders ();
-                       if (current_content_type != null)
-                               content_type = current_content_type;
-
-                       if (content_type == null)
-                               throw new XmlException ("Content-Type header for the MTOM message was not found");
-                       if (content_type.Boundary == null)
-                               throw new XmlException ("Content-Type header for the MTOM message must contain 'boundary' parameter");
-
-                       if (encoding == null && content_type.CharSet != null)
-                               encoding = Encoding.GetEncoding (content_type.CharSet);
-                       if (encoding == null && encodings == null)
-                               throw new XmlException ("Encoding specification is required either in the constructor argument or the content-type header");
-
-                       // consume the first identifier.
-                       string ident = "--" + content_type.Boundary;
-                       string idline;
-
-                       while (true) {
-                               idline = ReadAsciiLine ().Trim ();
-                               if (idline == null)
-                                       return;
-                               if (idline.Length != 0)
-                                       break;
-                       }
-                       if (!idline.StartsWith (ident, StringComparison.Ordinal))
-                               throw new XmlException (String.Format ("Unexpected boundary line was found. Expected boundary is '{0}' but it was '{1}'", content_type.Boundary, idline));
-
-                       string start = content_type.Parameters ["start"];
-                       ReadToIdentifiedStream (start);
-
-                       xml_reader = XmlReader.Create (readers [start].CreateTextReader ());
-               }
-
-               int buffer_length;
-               byte [] buffer;
-               int peek_char;
-
-               ContentType current_content_type;
-               int content_index;
-               string current_content_id, current_content_encoding;
-
-               void ReadToIdentifiedStream (string id)
-               {
-                       while (true) {
-                               if (!ReadNextStream ())
-                                       throw new XmlException (String.Format ("The stream '{0}' did not appear", id));
-                               if (current_content_id == id || id == null)
-                                       break;
-                       }
-               }
-
-               bool ReadNextStream ()
-               {
-                       ReadOptionalMimeHeaders ();
-                       string ident = "--" + content_type.Boundary;
-
-                       StringBuilder sb = new StringBuilder ();
-                       while (true) {
-                               string n = ReadAsciiLine ();
-                               if (n == null && sb.Length == 0)
-                                       return false;
-                               else if (n == null || n.StartsWith (ident, StringComparison.Ordinal))
-                                       break;
-                               sb.Append (n);
-                       }
-                       readers.Add (current_content_id, new MimeEncodedStream (current_content_id, current_content_encoding, sb.ToString ()));
-                       return true;
-               }
-
-               void ReadOptionalMimeHeaders ()
-               {
-                       peek_char = stream.ReadByte ();
-                       if (peek_char == '-') // no header
-                               return;
-                       ReadMimeHeaders ();
-               }
-
-               string ReadAllHeaderLines ()
-               {
-                       string s = String.Empty;
-
-                       while (true) {
-                               var n = ReadAsciiLine ();
-                               if (n.Length == 0)
-                                       return s;
-                               n = n.TrimEnd ();
-                               s += n;
-                               if (n [n.Length - 1] != ';')
-                                       s += '\n';
-                       }
-               }
-
-               void ReadMimeHeaders ()
-               {
-                       foreach (var s in ReadAllHeaderLines ().Split ('\n')) {
-                               if (s.Length == 0)
-                                       continue;
-                               int idx = s.IndexOf (':');
-                               if (idx < 0)
-                                       throw new XmlException (String.Format ("Unexpected header string: {0}", s));
-                               string v = StripBraces (s.Substring (idx + 1).Trim ());
-                               switch (s.Substring (0, idx).ToLower ()) {
-                               case "content-type":
-                                       current_content_type = CreateContentType (v);
-                                       break;
-                               case "content-id":
-                                       current_content_id = v;
-                                       break;
-                               case "content-transfer-encoding":
-                                       current_content_encoding = v;
-                                       break;
-                               }
-                       }
-               }
-
-               string StripBraces (string s)
-               {
-                       // could be foo, <foo>, "foo" and "<foo>".
-                       if (s.Length >= 2 && s [0] == '"' && s [s.Length - 1] == '"')
-                               s = s.Substring (1, s.Length - 2);
-                       if (s.Length >= 2 && s [0] == '<' && s [s.Length - 1] == '>')
-                               s = s.Substring (1, s.Length - 2);
-                       return s;
-               }
-
-               string ReadAsciiLine ()
-               {
-                       if (buffer == null)
-                               buffer = new byte [1024];
-                       int bpos = 0;
-                       int b = peek_char;
-                       bool skipRead = b >= 0;
-                       peek_char = -1;
-                       while (true) {
-                               if (skipRead)
-                                       skipRead = false;
-                               else
-                                       b = stream.ReadByte ();
-                               if (b < 0) {
-                                       if (bpos > 0)
-                                               throw new XmlException ("The stream ends without end of line");
-                                       return null;
-                               }
-                               if (b == '\r') {
-                                       b = stream.ReadByte ();
-                                       if (b < 0) {
-                                               buffer [bpos++] = (byte) '\r';
-                                               break;
-                                       }
-                                       else if (b == '\n')
-                                               break;
-                                       buffer [bpos++] = (byte) '\r';
-                                       skipRead = true;
-                               }
-                               else
-                                       buffer [bpos++] = (byte) b;
-                               if (bpos == buffer.Length) {
-                                       var newbuf = new byte [buffer.Length << 1];
-                                       Array.Copy (buffer, 0, newbuf, 0, buffer.Length);
-                                       buffer = newbuf;
-                               }
-                       }
-                       return Encoding.ASCII.GetString (buffer, 0, bpos);
-               }
-
-               // The rest are just reader delegation.
-
-               public override int AttributeCount {
-                       get { return Reader.AttributeCount; }
-               }
-
-               public override string BaseURI {
-                       get { return Reader.BaseURI; }
-               }
-
-               public override int Depth {
-                       get { return Reader.Depth; }
-               }
-
-               public override bool HasValue {
-                       get { return Reader.HasValue; }
-               }
-
-               public override bool IsEmptyElement {
-                       get { return Reader.IsEmptyElement; }
-               }
-
-               public override string LocalName {
-                       get { return Reader.LocalName; }
-               }
-
-               public override string NamespaceURI {
-                       get { return Reader.NamespaceURI; }
-               }
-
-               public override XmlNameTable NameTable {
-                       get { return Reader.NameTable; }
-               }
-
-               public override XmlNodeType NodeType {
-                       get { return Reader.NodeType; }
-               }
-
-               public override string Prefix {
-                       get { return Reader.Prefix; }
-               }
-
-               public override ReadState ReadState {
-                       get { return Reader.ReadState; }
-               }
-
-               public override string Value {
-                       get { return Reader.Value; }
-               }
-
-               public override bool MoveToElement ()
-               {
-                       return Reader.MoveToElement ();
-               }
-
-               public override string GetAttribute (int index)
-               {
-                       return Reader.GetAttribute (index);
-               }
-
-               public override string GetAttribute (string name)
-               {
-                       return Reader.GetAttribute (name);
-               }
-
-               public override string GetAttribute (string localName, string namespaceURI)
-               {
-                       return Reader.GetAttribute (localName, namespaceURI);
-               }
-
-               public override void MoveToAttribute (int index)
-               {
-                       Reader.MoveToAttribute (index);
-               }
-
-               public override bool MoveToAttribute (string name)
-               {
-                       return Reader.MoveToAttribute (name);
-               }
-
-               public override bool MoveToAttribute (string localName, string namespaceURI)
-               {
-                       return Reader.MoveToAttribute (localName, namespaceURI);
-               }
-
-               public override bool MoveToFirstAttribute ()
-               {
-                       return Reader.MoveToFirstAttribute ();
-               }
-
-               public override bool MoveToNextAttribute ()
-               {
-                       return Reader.MoveToNextAttribute ();
-               }
-
-               public override string LookupNamespace (string prefix)
-               {
-                       return Reader.LookupNamespace (prefix);
-               }
-
-               public override bool ReadAttributeValue ()
-               {
-                       return Reader.ReadAttributeValue ();
-               }
-
-               public override void ResolveEntity ()
-               {
-                       Reader.ResolveEntity ();
-               }
-       }
-
-       class NonInteractiveStateXmlReader : DummyStateXmlReader
-       {
-               public NonInteractiveStateXmlReader (string baseUri, XmlNameTable nameTable, ReadState readState)
-                       : base (baseUri, nameTable, readState)
-               {
-               }
-
-               public override int Depth {
-                       get { return 0; }
-               }
-
-               public override bool HasValue {
-                       get { return false; }
-               }
-
-               public override string Value {
-                       get { return String.Empty; }
-               }
-
-               public override XmlNodeType NodeType {
-                       get { return XmlNodeType.None; }
-               }
-       }
-
-       class MultiPartedXmlReader : DummyStateXmlReader
-       {
-               public MultiPartedXmlReader (XmlReader reader, MimeEncodedStream value)
-                       : base (reader.BaseURI, reader.NameTable, reader.ReadState)
-               {
-                       this.owner = reader;
-                       this.value = value.CreateTextReader ().ReadToEnd ();
-               }
-
-               XmlReader owner;
-               string value;
-
-               public override int Depth {
-                       get { return owner.Depth; }
-               }
-
-               public override bool HasValue {
-                       get { return true; }
-               }
-
-               public override string Value {
-                       get { return value; }
-               }
-
-               public override XmlNodeType NodeType {
-                       get { return XmlNodeType.Text; }
-               }
-       }
-
-       abstract class DummyStateXmlReader : XmlReader
-       {
-               protected DummyStateXmlReader (string baseUri, XmlNameTable nameTable, ReadState readState)
-               {
-                       base_uri = baseUri;
-                       name_table = nameTable;
-                       read_state = readState;
-               }
-
-               string base_uri;
-               XmlNameTable name_table;
-               ReadState read_state;
-
-               public override string BaseURI {
-                       get { return base_uri; }
-               }
-
-               public override bool EOF {
-                       get { return false; }
-               }
-
-               public override void Close ()
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public override bool Read ()
-               {
-                       throw new NotSupportedException ();
-               }
-
-               // The rest are just reader delegation.
-
-               public override int AttributeCount {
-                       get { return 0; }
-               }
-
-               public override bool IsEmptyElement {
-                       get { return false; }
-               }
-
-               public override string LocalName {
-                       get { return String.Empty; }
-               }
-
-               public override string NamespaceURI {
-                       get { return String.Empty; }
-               }
-
-               public override XmlNameTable NameTable {
-                       get { return name_table; }
-               }
-
-               public override string Prefix {
-                       get { return String.Empty; }
-               }
-
-               public override ReadState ReadState {
-                       get { return read_state; }
-               }
-
-               public override bool MoveToElement ()
-               {
-                       return false;
-               }
-
-               public override string GetAttribute (int index)
-               {
-                       return null;
-               }
-
-               public override string GetAttribute (string name)
-               {
-                       return null;
-               }
-
-               public override string GetAttribute (string localName, string namespaceURI)
-               {
-                       return null;
-               }
-
-               public override void MoveToAttribute (int index)
-               {
-                       throw new ArgumentOutOfRangeException ();
-               }
-
-               public override bool MoveToAttribute (string name)
-               {
-                       return false;
-               }
-
-               public override bool MoveToAttribute (string localName, string namespaceURI)
-               {
-                       return false;
-               }
-
-               public override bool MoveToFirstAttribute ()
-               {
-                       return false;
-               }
-
-               public override bool MoveToNextAttribute ()
-               {
-                       return false;
-               }
-
-               public override string LookupNamespace (string prefix)
-               {
-                       return null;
-               }
-
-               public override bool ReadAttributeValue ()
-               {
-                       return false;
-               }
-
-               public override void ResolveEntity ()
-               {
-                       throw new InvalidOperationException ();
-               }
-       }
-
-       class MimeEncodedStream
-       {
-               public MimeEncodedStream (string id, string contentEncoding, string value)
-               {
-                       Id = id;
-                       ContentEncoding = contentEncoding;
-                       EncodedString = value;
-               }
-
-               public string Id { get; set; }
-               public string ContentEncoding { get; set; }
-               public string EncodedString { get; set; }
-
-               public string DecodedBase64String {
-                       get { return Convert.ToBase64String (Encoding.ASCII.GetBytes (EncodedString)); }
-               }
-
-               public TextReader CreateTextReader ()
-               {
-                       switch (ContentEncoding) {
-                       case "7bit":
-                       case "8bit":
-                               return new StringReader (EncodedString);
-                       default:
-                               return new StringReader (DecodedBase64String);
-                       }
-               }
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Xml/XmlMtomDictionaryWriter.cs b/mcs/class/System.Runtime.Serialization/System.Xml/XmlMtomDictionaryWriter.cs
deleted file mode 100644 (file)
index 0d1a081..0000000
+++ /dev/null
@@ -1,316 +0,0 @@
-//
-// XmlMtomDictionaryWriter.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2009 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.IO;
-using System.Net.Mime;
-using System.Text;
-
-namespace System.Xml
-{
-       internal class XmlMtomDictionaryWriter : XmlDictionaryWriter
-       {
-               public XmlMtomDictionaryWriter (Stream stream, Encoding encoding, int maxSizeInBytes, string startInfo, string boundary, string startUri, bool writeMessageHeaders, bool ownsStream)
-               {
-                       writer = new StreamWriter (stream, encoding);
-                       max_bytes = maxSizeInBytes;
-                       write_headers = writeMessageHeaders;
-                       owns_stream = ownsStream;
-
-                       var settings = new XmlWriterSettings ();
-                       settings.Encoding = encoding;
-                       settings.OmitXmlDeclaration = true;
-                       settings.ConformanceLevel = ConformanceLevel.Fragment;
-                       settings.NewLineChars = "\r\n";
-                       xml_writer_settings = settings;
-
-                       // FIXME: actually it does not likely use ContentType.ToString() but writes those header items by own.
-                       // (so that it could generate "start" header dynamically)
-                       var c = new ContentType ("multipart/related");
-                       c.Parameters ["type"] = "application/xop+xml";
-                       c.Boundary = boundary;
-                       c.Parameters ["start"] = "<" + startUri + ">";
-                       c.Parameters ["start-info"] = startInfo;
-                       content_type = c;
-               }
-
-               // constructor arguments
-               TextWriter writer;
-               XmlWriterSettings xml_writer_settings;
-               Encoding encoding;
-               int max_bytes;
-               bool write_headers;
-               bool owns_stream;
-               ContentType content_type;
-
-               // state
-               XmlWriter w;
-               int depth;
-               int section_count;
-
-               XmlWriter CreateWriter ()
-               {
-                       return XmlWriter.Create (writer, xml_writer_settings);
-               }
-
-               public override void Close ()
-               {
-                       w.Close ();
-                       if (owns_stream)
-                               writer.Close ();
-               }
-
-               public override void Flush ()
-               {
-                       w.Flush ();
-               }
-
-               public override string LookupPrefix (string namespaceUri)
-               {
-                       return w.LookupPrefix (namespaceUri);
-               }
-
-               public override void WriteBase64 (byte [] bytes, int start, int length)
-               {
-                       CheckState ();
-                       w.WriteBase64 (bytes, start, length);
-               }
-
-               public override void WriteCData (string text)
-               {
-                       CheckState ();
-                       w.WriteCData (text);
-               }
-
-               public override void WriteCharEntity (char c)
-               {
-                       CheckState ();
-                       w.WriteCharEntity (c);
-               }
-
-               public override void WriteChars (char [] buffer, int index, int count)
-               {
-                       CheckState ();
-                       w.WriteChars (buffer, index, count);
-               }
-
-               public override void WriteComment (string comment)
-               {
-                       CheckState ();
-                       w.WriteComment (comment);
-               }
-
-               public override void WriteDocType (string name, string pubid, string sysid, string intSubset)
-               {
-                       throw new NotSupportedException (); // indeed
-               }
-
-               public override void WriteEndAttribute ()
-               {
-                       w.WriteEndAttribute ();
-               }
-
-               public override void WriteEndDocument ()
-               {
-                       // We don't call w.WriteEndElement() because that causes state error
-                       // (which is correct; MTOM writer just does not expect it).
-               }
-
-               public override void WriteEndElement ()
-               {
-                       w.WriteEndElement ();
-                       if (--depth == 0)
-                               WriteEndOfMimeSection ();
-               }
-
-               public override void WriteEntityRef (string name)
-               {
-                       w.WriteEntityRef (name);
-               }
-
-               public override void WriteFullEndElement ()
-               {
-                       w.WriteFullEndElement ();
-                       if (--depth == 0)
-                               WriteEndOfMimeSection ();
-               }
-
-               public override void WriteProcessingInstruction (string name, string data)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public override void WriteRaw (string raw)
-               {
-                       CheckState ();
-                       w.WriteRaw (raw);
-               }
-
-               public override void WriteRaw (char [] chars, int index, int count)
-               {
-                       CheckState ();
-                       w.WriteRaw (chars, index, count);
-               }
-
-               public override void WriteStartAttribute (string prefix, string localName, string namespaceURI)
-               {
-                       CheckState ();
-                       w.WriteStartAttribute (prefix, localName, namespaceURI);
-               }
-
-               public override void WriteStartDocument ()
-               {
-                       CheckState ();
-                       // We don't call w.WriteStartDocument() because that causes state error
-                       // (which is correct; MTOM writer just does not expect it).
-               }
-
-               public override void WriteStartDocument (bool standalone)
-               {
-                       CheckState ();
-                       // We don't call w.WriteStartDocument() because that causes state error
-                       // (which is correct; MTOM writer just does not expect it).
-               }
-
-               public override void WriteStartElement (string prefix, string localName, string namespaceURI)
-               {
-                       CheckState ();
-
-                       if (depth == 0)
-                               WriteStartOfMimeSection ();
-
-                       w.WriteStartElement (prefix, localName, namespaceURI);
-                       depth++;
-               }
-
-               public override WriteState WriteState {
-                       get { return w.WriteState; }
-               }
-
-               static readonly char [] eol_chars = "\r\n".ToCharArray ();
-
-               public override void WriteString (string text)
-               {
-                       CheckState ();
-
-                       int i1, i2 = 0;
-                       do {
-                               i1 = text.IndexOfAny (eol_chars, i2);
-                               if (i1 >= 0) {
-                                       w.WriteString (text.Substring (i2, i1 - i2));
-                                       if (text [i1] == '\r')
-                                               w.WriteCharEntity ('\r');
-                                       else
-                                               w.WriteRaw ("\r\n");
-                                       i2 = i1 + 1;
-                               } else {
-                                       w.WriteString (text.Substring (i2));
-                                       break;
-                               }
-                       } while (true);
-               }
-
-               public override void WriteSurrogateCharEntity (char low, char high)
-               {
-                       CheckState ();
-                       w.WriteSurrogateCharEntity (low, high);
-               }
-
-               public override void WriteWhitespace (string text)
-               {
-                       CheckState ();
-                       w.WriteWhitespace (text);
-               }
-
-               public override string XmlLang {
-                       get { return w.XmlLang; }
-               }
-
-               public override XmlSpace XmlSpace {
-                       get { return w.XmlSpace; }
-               }
-
-               void CheckState ()
-               {
-                       if (w == null && write_headers)
-                               WriteMimeHeaders ();
-                       
-                       if (w == null || w.WriteState == WriteState.Closed || w.WriteState == WriteState.Error)
-                               w = CreateWriter ();
-               }
-
-               void WriteMimeHeaders ()
-               {
-                       w.Flush ();
-                       writer.Write ("MIME-Version: 1.0\r\n");
-                       writer.Write ("Content-Type: ");
-                       writer.Write (content_type.ToString ());
-                       writer.Write ("\r\n\r\n\r\n");
-               }
-
-               void WriteStartOfMimeSection ()
-               {
-                       section_count++;
-
-                       // I'm not sure what's the expected behavior of this
-                       // strange XmlWriter, but so far - it outputs only one
-                       // section.
-                       if (section_count > 1)
-                               return;
-
-                       writer.Write ("\r\n");
-                       writer.Write ("--");
-                       writer.Write (content_type.Boundary);
-                       writer.Write ("\r\n");
-                       writer.Write ("Content-ID: ");
-                       writer.Write (content_type.Parameters ["start"]);
-                       writer.Write ("\r\n");
-                       writer.Write ("Content-Transfer-Encoding: 8bit\r\n");
-                       writer.Write ("Content-Type: application/xop+xml;charset=");
-                       writer.Write (xml_writer_settings.Encoding.HeaderName);
-                       writer.Write (";type=\"");
-                       writer.Write (content_type.Parameters ["start-info"].Replace ("\"", "\\\""));
-                       writer.Write ("\"\r\n\r\n");
-               }
-
-               void WriteEndOfMimeSection ()
-               {
-                       // I'm not sure what's the expected behavior of this
-                       // strange XmlWriter, but so far - it outputs only one
-                       // section.
-                       if (section_count > 1)
-                               return;
-
-                       w.Flush ();
-                       writer.Write ("\r\n");
-                       writer.Write ("--");
-                       writer.Write (content_type.Boundary);
-                       writer.Write ("--\r\n");
-               }
-       }
-}
-
diff --git a/mcs/class/System.Runtime.Serialization/System.Xml/XmlSimpleDictionaryReader.cs b/mcs/class/System.Runtime.Serialization/System.Xml/XmlSimpleDictionaryReader.cs
deleted file mode 100644 (file)
index 77682e4..0000000
+++ /dev/null
@@ -1,300 +0,0 @@
-using System;
-using System.Collections;
-using System.Collections.Generic;
-
-namespace System.Xml
-{
-       internal class XmlSimpleDictionaryReader :
-               XmlDictionaryReader, IXmlLineInfo, IXmlNamespaceResolver
-       {
-               XmlDictionary dict;
-               XmlReader reader;
-               XmlDictionaryReader as_dict_reader;
-               IXmlLineInfo as_line_info;
-               OnXmlDictionaryReaderClose onClose;
-
-               public XmlSimpleDictionaryReader (XmlReader reader)
-                       : this (reader, null)
-               {
-               }
-
-               public XmlSimpleDictionaryReader (XmlReader reader,
-                       XmlDictionary dictionary)
-                       : this (reader, dictionary, null)
-               {
-               }
-
-               public XmlSimpleDictionaryReader (XmlReader reader,
-                       XmlDictionary dictionary, OnXmlDictionaryReaderClose onClose)
-               {
-                       this.reader = reader;
-                       this.onClose = onClose;
-                       as_line_info = reader as IXmlLineInfo;
-                       as_dict_reader = reader as XmlDictionaryReader;
-
-                       if (dictionary == null)
-                               dictionary = new XmlDictionary ();
-                       dict = dictionary;
-               }
-
-               #region IXmlLineInfo
-               public int LineNumber {
-                       get { return as_line_info != null ? as_line_info.LineNumber : 0; }
-               }
-
-               public int LinePosition {
-                       get { return as_line_info != null ? as_line_info.LinePosition : 0; }
-               }
-
-               public bool HasLineInfo ()
-               {
-                       return as_line_info != null ? as_line_info.HasLineInfo () : false;
-               }
-               #endregion
-
-               #region XmlDictionaryReader
-
-               public override bool CanCanonicalize {
-                       get { return as_dict_reader != null ? as_dict_reader.CanCanonicalize : false; }
-               }
-
-               public override void EndCanonicalization ()
-               {
-                       if (as_dict_reader != null)
-                               as_dict_reader.EndCanonicalization ();
-                       else
-                               throw new NotSupportedException ();
-               }
-
-               // no need to override for GetAttribute(), IndexOfLocalName(),
-               // IsLocalName(), IsNamespaceUri(), IsStartElement()
-
-               public override bool TryGetLocalNameAsDictionaryString (
-                       out XmlDictionaryString localName)
-               {
-                       // FIXME: find out when it returns true.
-                       localName = null;
-                       return false;
-//                     if (!dict.TryLookup (LocalName, out localName))
-//                             return false;
-//                     return true;
-               }
-
-               public override bool TryGetNamespaceUriAsDictionaryString (
-                       out XmlDictionaryString namespaceUri)
-               {
-                       // FIXME: find out when it returns true.
-                       namespaceUri = null;
-                       return false;
-//                     if (!dict.TryLookup (NamespaceURI, out namespaceUri))
-//                             return false;
-//                     return true;
-               }
-               #endregion
-
-               #region IXmlNamespaceResolver
-
-               public IDictionary<string,string> GetNamespacesInScope (
-                       XmlNamespaceScope scope)
-               {
-                       IXmlNamespaceResolver nsr = reader as IXmlNamespaceResolver;
-                       return nsr.GetNamespacesInScope (scope);
-               }
-
-               public string LookupPrefix (string ns)
-               {
-                       IXmlNamespaceResolver nsr = reader as IXmlNamespaceResolver;
-                       return nsr.LookupPrefix (NameTable.Get (ns));
-               }
-
-               #endregion
-
-               #region XmlReader
-
-               public override int AttributeCount {
-                       get { return reader.AttributeCount; }
-               }
-
-               public override string BaseURI {
-                       get { return reader.BaseURI; }
-               }
-
-               public override int Depth {
-                       get { return reader.Depth; }
-               }
-
-               public override XmlNodeType NodeType 
-               {
-                       get { return reader.NodeType; }
-               }
-
-               public override string Name {
-                       get { return reader.Name; }
-               }
-
-               public override string LocalName {
-                       get { return reader.LocalName; }
-               }
-
-               public override string NamespaceURI {
-                       get { return reader.NamespaceURI; }
-               }
-
-               public override string Prefix {
-                       get { return reader.Prefix; }
-               }
-
-               public override bool HasValue {
-                       get { return reader.HasValue; }
-               }
-
-               public override string Value {
-                       get { return reader.Value; }
-               }
-
-               public override bool IsEmptyElement {
-                       get { return reader.IsEmptyElement; }
-               }
-
-               public override bool IsDefault {
-                       get { return reader.IsDefault; }
-               }
-
-               public override char QuoteChar {
-                       get { return reader.QuoteChar; }
-               }
-
-               public override string XmlLang {
-                       get { return reader.XmlLang; }
-               }
-
-               public override XmlSpace XmlSpace {
-                       get { return reader.XmlSpace; }
-               }
-
-               public override string this [int i] {
-                       get { return reader [i]; }
-               }
-
-               public override string this [string name] {
-                       get { return reader [name]; }
-               }
-
-               public override string this [string localName, string namespaceURI] {
-                       get { return reader [localName, namespaceURI]; }
-               }
-
-               public override bool EOF {
-                       get { return reader.EOF; }
-               }
-
-               public override ReadState ReadState {
-                       get { return reader.ReadState; }
-               }
-
-               public override XmlNameTable NameTable {
-                       get { return reader.NameTable; }
-               }
-
-               public override string GetAttribute (string name)
-               {
-                       return reader.GetAttribute (name);
-               }
-
-               public override string GetAttribute (string localName, string namespaceURI)
-               {
-                       return reader.GetAttribute (localName, namespaceURI);
-               }
-
-               public override string GetAttribute (int i)
-               {
-                       return reader.GetAttribute (i);
-               }
-
-               public override bool MoveToAttribute (string name)
-               {
-                       return reader.MoveToAttribute (name);
-               }
-
-               public override bool MoveToAttribute (string localName, string namespaceURI)
-               {
-                       return reader.MoveToAttribute (localName, namespaceURI);
-               }
-
-               public override void MoveToAttribute (int i)
-               {
-                       reader.MoveToAttribute (i);
-               }
-
-               public override bool MoveToFirstAttribute ()
-               {
-                       return reader.MoveToFirstAttribute ();
-               }
-
-               public override bool MoveToNextAttribute ()
-               {
-                       return reader.MoveToNextAttribute ();
-               }
-
-               public override bool MoveToElement ()
-               {
-                       return reader.MoveToElement ();
-               }
-
-               public override void Close ()
-               {
-                       reader.Close ();
-                       if (onClose != null)
-                               onClose (this);
-               }
-
-               public override bool Read ()
-               {
-                       if (!reader.Read ())
-                               return false;
-                       dict.Add (reader.Prefix);
-                       dict.Add (reader.LocalName);
-                       dict.Add (reader.NamespaceURI);
-                       if (reader.MoveToFirstAttribute ()) {
-                               do {
-                                       dict.Add (reader.Prefix);
-                                       dict.Add (reader.LocalName);
-                                       dict.Add (reader.NamespaceURI);
-                                       dict.Add (reader.Value);
-                               } while (reader.MoveToNextAttribute ());
-                               reader.MoveToElement ();
-                       }
-                       return true;
-               }
-
-               public override string ReadString ()
-               {
-                       return reader.ReadString ();
-               }
-
-               public override string ReadInnerXml ()
-               {
-                       return reader.ReadInnerXml ();
-               }
-
-               public override string ReadOuterXml ()
-               {
-                       return reader.ReadOuterXml ();
-               }
-
-               public override string LookupNamespace (string prefix)
-               {
-                       return reader.LookupNamespace (prefix);
-               }
-
-               public override void ResolveEntity ()
-               {
-                       reader.ResolveEntity ();
-               }
-               public override bool ReadAttributeValue ()
-               {
-                       return reader.ReadAttributeValue ();
-               }
-               #endregion
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/System.Xml/XmlSimpleDictionaryWriter.cs b/mcs/class/System.Runtime.Serialization/System.Xml/XmlSimpleDictionaryWriter.cs
deleted file mode 100644 (file)
index 8f2116f..0000000
+++ /dev/null
@@ -1,212 +0,0 @@
-//
-// XmlDictionaryWriter.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2005 Novell, Inc.  http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.IO;
-using System.Text;
-
-namespace System.Xml
-{
-       internal class XmlSimpleDictionaryWriter : XmlDictionaryWriter
-       {
-               XmlWriter writer;
-
-               // FIXME: find out how soapCompliant argument is used.
-               public XmlSimpleDictionaryWriter (XmlWriter writer)
-               {
-                       this.writer = writer;
-               }
-
-               public override void Close ()
-               {
-                       writer.Close ();
-               }
-
-               public override void Flush ()
-               {
-                       writer.Flush ();
-               }
-
-               public override string LookupPrefix (string ns)
-               {
-                       return writer.LookupPrefix (ns);
-               }
-
-               public override void WriteBase64 (byte [] buffer, int index, int count)
-               {
-                       writer.WriteBase64 (buffer, index, count);
-               }
-
-               public override void WriteBinHex (byte [] buffer, int index, int count)
-               {
-                       writer.WriteBinHex (buffer, index, count);
-               }
-
-               public override void WriteCData (string text)
-               {
-                       writer.WriteCData (text);
-               }
-
-               public override void WriteCharEntity (char ch)
-               {
-                       writer.WriteCharEntity (ch);
-               }
-
-               public override void WriteChars (char [] buffer, int index, int count)
-               {
-                       writer.WriteChars (buffer, index, count);
-               }
-
-               public override void WriteComment (string text)
-               {
-                       writer.WriteComment (text);
-               }
-
-               public override void WriteDocType (string name, string pubid, string sysid, string subset)
-               {
-                       writer.WriteDocType (name, pubid, sysid, subset);
-               }
-
-               public override void WriteEndAttribute ()
-               {
-                       writer.WriteEndAttribute ();
-               }
-
-               public override void WriteEndDocument ()
-               {
-                       writer.WriteEndDocument ();
-               }
-
-               public override void WriteEndElement ()
-               {
-                       Depth--;
-                       NSIndex = 0;
-                       writer.WriteEndElement ();
-               }
-
-               public override void WriteEntityRef (string name)
-               {
-                       writer.WriteEntityRef (name);
-               }
-
-               public override void WriteFullEndElement ()
-               {
-                       writer.WriteFullEndElement ();
-               }
-
-               public override void WriteName (string name)
-               {
-                       writer.WriteName (name);
-               }
-
-               public override void WriteNmToken (string name)
-               {
-                       writer.WriteNmToken (name);
-               }
-
-               public override void WriteNode (XmlReader reader, bool defattr)
-               {
-                       writer.WriteNode (reader, defattr);
-               }
-
-               public override void WriteProcessingInstruction (string name, string text)
-               {
-                       writer.WriteProcessingInstruction (name, text);
-               }
-
-               public override void WriteQualifiedName (string localName, string ns)
-               {
-                       writer.WriteQualifiedName (localName, ns);
-               }
-
-               public override void WriteRaw (string data)
-               {
-                       writer.WriteRaw (data);
-               }
-
-               public override void WriteRaw (char [] buffer, int index, int count)
-               {
-                       writer.WriteRaw (buffer, index, count);
-               }
-
-               public override void WriteStartAttribute (string prefix, string localName, string ns)
-               {
-                       writer.WriteStartAttribute (prefix, localName, ns);
-               }
-
-               public override void WriteStartDocument (bool standalone)
-               {
-                       writer.WriteStartDocument (standalone);
-               }
-
-               public override void WriteStartDocument ()
-               {
-                       writer.WriteStartDocument ();
-               }
-
-               public override void WriteStartElement (string prefix, string localName, string ns)
-               {
-                       Depth++;
-                       NSIndex = 0;
-                       writer.WriteStartElement (prefix, localName, ns);
-               }
-
-               public override void WriteString (string text)
-               {
-                       writer.WriteString (text);
-               }
-
-               public override void WriteSurrogateCharEntity (char lowChar, char highChar)
-               {
-                       writer.WriteSurrogateCharEntity (lowChar, highChar);
-               }
-
-               public override void WriteWhitespace (string ws)
-               {
-                       writer.WriteWhitespace (ws);
-               }
-
-               public override WriteState WriteState {
-                       get {
-                               return writer.WriteState;
-                       }
-               }
-
-               public override string XmlLang {
-                       get {
-                               return writer.XmlLang;
-                       }
-               }
-
-               public override XmlSpace XmlSpace {
-                       get {
-                               return writer.XmlSpace;
-                       }
-               }
-
-       }
-}
diff --git a/mcs/class/System.Runtime.Serialization/binary-writer-method-gen.cs b/mcs/class/System.Runtime.Serialization/binary-writer-method-gen.cs
deleted file mode 100644 (file)
index df3e5d9..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-// mono binary-writer-method-gen.exe > System.Xml/XmlBinaryDictionaryWriterAutoGen.cs
-using System;
-using System.Collections.Generic;
-using System.Globalization;
-using System.CodeDom;
-using System.CodeDom.Compiler;
-using Microsoft.CSharp;
-
-public class Generator
-{
-       public static void Main ()
-       {
-               Console.Out.NewLine = "\n";
-               Type [] types = new Type [] {
-                       typeof (bool), typeof (DateTime), typeof (decimal), typeof (double),
-                       typeof (Guid), typeof (short), typeof (int), typeof (long), typeof (float), typeof (TimeSpan) };
-
-               Dictionary<Type,byte> table = new Dictionary<Type,byte> ();
-               // LAMESPEC: [MC-NBFX] section 2.3.3 dedscribes wrong RecordTypes.
-               table.Add (typeof (bool), 0xB5);
-               table.Add (typeof (short), 0x8B);
-               table.Add (typeof (int), 0x8D);
-               table.Add (typeof (long), 0x8F);
-               table.Add (typeof (float), 0x91);
-               table.Add (typeof (double), 0x93);
-               table.Add (typeof (decimal), 0x95);
-               table.Add (typeof (DateTime), 0x97);
-               table.Add (typeof (TimeSpan), 0xAF);
-               table.Add (typeof (Guid), 0xB1);
-
-               Console.WriteLine (@"
-using System;
-using BF = System.Xml.XmlBinaryFormat;
-
-namespace System.Xml
-{
-       internal partial class XmlBinaryDictionaryWriter : XmlDictionaryWriter
-       {
-               void CheckWriteArrayArguments (Array array, int offset, int length)
-               {
-                       if (array == null)
-                               throw new ArgumentNullException (""array"");
-                       if (offset < 0)
-                               throw new ArgumentOutOfRangeException (""offset is negative"");
-                       if (offset > array.Length)
-                               throw new ArgumentOutOfRangeException (""offset exceeds the length of the destination array"");
-                       if (length < 0)
-                               throw new ArgumentOutOfRangeException (""length is negative"");
-                       if (length > array.Length - offset)
-                               throw new ArgumentOutOfRangeException (""length + offset exceeds the length of the destination array"");
-               }
-
-               void CheckDictionaryStringArgs (XmlDictionaryString localName, XmlDictionaryString namespaceUri)
-               {
-                       if (localName == null)
-                               throw new ArgumentNullException (""localName"");
-                       if (namespaceUri == null)
-                               throw new ArgumentNullException (""namespaceUri"");
-               }
-");
-
-               foreach (Type type in types) {
-                       Console.WriteLine (@"
-
-               public override void WriteArray (string prefix, XmlDictionaryString localName, XmlDictionaryString namespaceUri, {0} [] array, int offset, int length)
-               {{
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       writer.Write (BF.Array);
-                       WriteStartElement (prefix, localName, namespaceUri);
-                       WriteEndElement ();
-                       WriteArrayRemaining (array, offset, length);
-               }}
-
-               public override void WriteArray (string prefix, string localName, string namespaceUri, {0} [] array, int offset, int length)
-               {{
-                       CheckWriteArrayArguments (array, offset, length);
-                       writer.Write (BF.Array);
-                       WriteStartElement (prefix, localName, namespaceUri);
-                       WriteEndElement ();
-                       WriteArrayRemaining (array, offset, length);
-               }}
-
-               void WriteArrayRemaining ({0} [] array, int offset, int length)
-               {{
-                       writer.Write ((byte) 0x{2:X02}); // ident
-                       writer.WriteFlexibleInt (length);
-                       for (int i = offset; i < offset + length; i++)
-                               WriteValueContent (array [i]);
-               }}", ToCSharp (type), type.Name, table [type]);
-
-               // <note>
-               // WriteArrayRemaining() is generated, but are modified and moved into 
-               // XmlBinaryDictionaryWriter. (I keep it open here so that we
-               // make sure to remove this before compiling. Remove this to get
-               // it working fine).
-               // </note>
-
-
-               }
-               Console.WriteLine (@"
-       }
-}");
-       }
-
-       static CodeDomProvider cs = new CSharpCodeProvider ();
-
-       static string ToCSharp (Type type)
-       {
-               string r = cs.GetTypeOutput (new CodeTypeReference (type));
-               return r != type.FullName ? r : type.Name;
-       }
-}
-
diff --git a/mcs/class/System.Runtime.Serialization/net_4_0_System.Runtime.Serialization.dll.sources b/mcs/class/System.Runtime.Serialization/net_4_0_System.Runtime.Serialization.dll.sources
deleted file mode 100644 (file)
index 1a04edc..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#include System.Runtime.Serialization.dll.sources
-
-../System.ServiceModel.Web/System.Runtime.Serialization.Json/DataContractJsonSerializer.cs
-../System.ServiceModel.Web/System.Runtime.Serialization.Json/IXmlJsonReaderInitializer.cs
-../System.ServiceModel.Web/System.Runtime.Serialization.Json/IXmlJsonWriterInitializer.cs
-../System.ServiceModel.Web/System.Runtime.Serialization.Json/JsonReader.cs
-../System.ServiceModel.Web/System.Runtime.Serialization.Json/JsonReaderWriterFactory.cs
-../System.ServiceModel.Web/System.Runtime.Serialization.Json/JsonSerializationReader.cs
-../System.ServiceModel.Web/System.Runtime.Serialization.Json/JsonSerializationWriter.cs
-../System.ServiceModel.Web/System.Runtime.Serialization.Json/JsonWriter.cs
-../System.ServiceModel.Web/System.Runtime.Serialization.Json/TypeMap.cs
diff --git a/mcs/class/System.Runtime.Serialization/reader-method-gen.cs b/mcs/class/System.Runtime.Serialization/reader-method-gen.cs
deleted file mode 100644 (file)
index e360b21..0000000
+++ /dev/null
@@ -1,157 +0,0 @@
-// mono reader-method-gen.exe > System.Xml/XmlDictionaryReaderAutoGen.cs
-using System;
-using System.Globalization;
-using System.CodeDom;
-using System.CodeDom.Compiler;
-using System.Reflection;
-using System.Xml;
-using Microsoft.CSharp;
-
-public class Generator
-{
-       public static void Main ()
-       {
-               Console.Out.NewLine = "\n";
-               Type [] types = new Type [] {
-                       typeof (bool), typeof (DateTime), typeof (decimal), typeof (double),
-                       typeof (Guid), typeof (short), typeof (int), typeof (long), typeof (float), typeof (TimeSpan) };
-
-               Console.WriteLine (@"
-#pragma warning disable 612
-using System;
-using System.Collections.Generic;
-
-namespace System.Xml
-{
-       public abstract partial class XmlDictionaryReader : XmlReader
-       {
-               static readonly char [] wsChars = new char [] {' ', '\t', '\n', '\r'};
-
-               void CheckReadArrayArguments (Array array, int offset, int length)
-               {
-                       if (array == null)
-                               throw new ArgumentNullException (""array"");
-                       if (offset < 0)
-                               throw new ArgumentOutOfRangeException (""offset is negative"");
-                       if (offset > array.Length)
-                               throw new ArgumentOutOfRangeException (""offset exceeds the length of the destination array"");
-                       if (length < 0)
-                               throw new ArgumentOutOfRangeException (""length is negative"");
-                       if (length > array.Length - offset)
-                               throw new ArgumentOutOfRangeException (""length + offset exceeds the length of the destination array"");
-               }
-
-               void CheckDictionaryStringArgs (XmlDictionaryString localName, XmlDictionaryString namespaceUri)
-               {
-                       if (localName == null)
-                               throw new ArgumentNullException (""localName"");
-                       if (namespaceUri == null)
-                               throw new ArgumentNullException (""namespaceUri"");
-               }
-");
-
-               foreach (Type type in types) {
-                       Console.WriteLine (@"
-               public virtual int ReadArray (XmlDictionaryString localName, XmlDictionaryString namespaceUri, {0} [] array, int offset, int length)
-               {{
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       return ReadArray (localName.Value, namespaceUri.Value, array, offset, length);
-               }}
-
-               public virtual int ReadArray (string localName, string namespaceUri, {0} [] array, int offset, int length)
-               {{
-                       CheckReadArrayArguments (array, offset, length);
-                       for (int i = 0; i < length; i++) {{
-                               MoveToContent ();
-                               if (NodeType != XmlNodeType.Element)
-                                       return i;
-                               ReadStartElement (localName, namespaceUri);
-                               array [offset + i] = XmlConvert.To{1} (ReadContentAsString ());
-                               ReadEndElement ();
-                       }}
-                       return length;
-               }}
-
-               public virtual {0} [] Read{1}Array (string localName, string namespaceUri)
-               {{
-                       List<{0}> list = new List<{0}> ();
-                       while (true) {{
-                               MoveToContent ();
-                               if (NodeType != XmlNodeType.Element)
-                                       break;
-                               ReadStartElement (localName, namespaceUri);
-                               list.Add (XmlConvert.To{1} (ReadContentAsString ()));
-                               ReadEndElement ();
-                               if (list.Count == Quotas.MaxArrayLength)
-                                       // FIXME: check if raises an error or not
-                                       break;
-                       }}
-                       return list.ToArray ();
-               }}
-
-               public virtual {0} [] Read{1}Array (XmlDictionaryString localName, XmlDictionaryString namespaceUri)
-               {{
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       return Read{1}Array (localName.Value, namespaceUri.Value);
-               }}", ToCSharp (type), type.Name);
-
-               }
-
-               Type xr = typeof (XmlReader);
-               string name = "ReadElementContentAs";
-               foreach (MethodInfo mi in xr.GetMethods ()) {
-                       if (!mi.Name.StartsWith (name))
-                               continue;
-                       ParameterInfo [] pl = mi.GetParameters ();
-                       if (pl.Length != 2 || pl [0].ParameterType != typeof (string))
-                               continue;
-                       if (mi.Name.EndsWith ("AsObject"))
-                               continue; // special case to filter out.
-                       if (mi.Name.EndsWith ("AsString"))
-                               continue; // special case to filter out.
-
-                       bool isOverride = xr.GetMethod (mi.Name, Type.EmptyTypes) != null;
-                       Console.WriteLine (@"
-               public {3}{0} {1} ()
-               {{
-                       ReadStartElement (LocalName, NamespaceURI);
-                       {0} ret = {2} ();
-                       ReadEndElement ();
-                       return ret;
-               }}",
-                               ToCSharp (mi.ReturnType),
-                               mi.Name,
-                               mi.Name.Replace ("Element", String.Empty),
-                               isOverride ? "override " : null);
-               }
-
-               Console.WriteLine (@"
-       }
-}");
-       }
-
-       static CodeDomProvider cs = new CSharpCodeProvider ();
-
-       static string ToCSharp (Type type)
-       {
-               string r = cs.GetTypeOutput (new CodeTypeReference (type));
-               return r != type.FullName ? r : type.Name;
-       }
-
-       static string ToOldName (Type type)
-       {
-               switch (type.Name) {
-               case "Single":
-                       return "Float";
-               case "Int32":
-                       return "Int";
-               case "Int64":
-                       return "Long";
-               case "Int16":
-                       return "Short";
-               default:
-                       return type.Name;
-               }
-       }
-}
-
diff --git a/mcs/class/System.Runtime.Serialization/resources/mstypes.schema b/mcs/class/System.Runtime.Serialization/resources/mstypes.schema
deleted file mode 100644 (file)
index d5677f6..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0"?>
-<xs:schema xmlns:tns="http://schemas.microsoft.com/2003/10/Serialization/" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://schemas.microsoft.com/2003/10/Serialization/" xmlns:xs="http://www.w3.org/2001/XMLSchema">
-       <xs:element name="anyType" nillable="true" type="xs:anyType" />
-       <xs:element name="anyURI" nillable="true" type="xs:anyURI" />
-       <xs:element name="base64Binary" nillable="true" type="xs:base64Binary" />
-       <xs:element name="boolean" nillable="true" type="xs:boolean" />
-       <xs:element name="byte" nillable="true" type="xs:byte" />
-       <xs:element name="dateTime" nillable="true" type="xs:dateTime" />
-       <xs:element name="decimal" nillable="true" type="xs:decimal" />
-       <xs:element name="double" nillable="true" type="xs:double" />
-       <xs:element name="float" nillable="true" type="xs:float" />
-       <xs:element name="int" nillable="true" type="xs:int" />
-       <xs:element name="long" nillable="true" type="xs:long" />
-       <xs:element name="QName" nillable="true" type="xs:QName" />
-       <xs:element name="short" nillable="true" type="xs:short" />
-       <xs:element name="string" nillable="true" type="xs:string" />
-       <xs:element name="unsignedByte" nillable="true" type="xs:unsignedByte" />
-       <xs:element name="unsignedInt" nillable="true" type="xs:unsignedInt" />
-       <xs:element name="unsignedLong" nillable="true" type="xs:unsignedLong" />
-       <xs:element name="unsignedShort" nillable="true" type="xs:unsignedShort" />
-       <xs:element name="char" nillable="true" type="tns:char" />
-       <xs:simpleType name="char">
-               <xs:restriction base="xs:int" />
-       </xs:simpleType>
-       <xs:element name="duration" nillable="true" type="tns:duration" />
-       <xs:simpleType name="duration">
-               <xs:restriction base="xs:duration">
-                       <xs:pattern value="\-?P(\d*D)?(T(\d*H)?(\d*M)?(\d*(\.\d*)?S)?)?" />
-                       <xs:minInclusive value="-P10675199DT2H48M5.4775808S" />
-                       <xs:maxInclusive value="P10675199DT2H48M5.4775807S" />
-               </xs:restriction>
-       </xs:simpleType>
-       <xs:element name="guid" nillable="true" type="tns:guid" />
-       <xs:simpleType name="guid">
-               <xs:restriction base="xs:string">
-                       <xs:pattern value="[\da-fA-F]{8}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{12}" />
-               </xs:restriction>
-       </xs:simpleType>
-       <xs:attribute name="FactoryType" type="xs:QName" />
-       <xs:attribute name="Id" type="xs:ID" />
-       <xs:attribute name="Ref" type="xs:IDREF" />
-</xs:schema>
diff --git a/mcs/class/System.Runtime.Serialization/writer-method-gen.cs b/mcs/class/System.Runtime.Serialization/writer-method-gen.cs
deleted file mode 100644 (file)
index ed7518f..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-// mono writer-method-gen.exe > System.Xml/XmlDictionaryWriterAutoGen.cs
-using System;
-using System.Globalization;
-using System.CodeDom;
-using System.CodeDom.Compiler;
-using Microsoft.CSharp;
-
-public class Generator
-{
-       public static void Main ()
-       {
-               Console.Out.NewLine = "\n";
-               Type [] types = new Type [] {
-                       typeof (bool), typeof (DateTime), typeof (decimal), typeof (double),
-                       typeof (Guid), typeof (short), typeof (int), typeof (long), typeof (float), typeof (TimeSpan) };
-
-               Console.WriteLine (@"
-using System;
-
-namespace System.Xml
-{
-       public abstract partial class XmlDictionaryWriter : XmlWriter
-       {
-               void CheckWriteArrayArguments (Array array, int offset, int length)
-               {
-                       if (array == null)
-                               throw new ArgumentNullException (""array"");
-                       if (offset < 0)
-                               throw new ArgumentOutOfRangeException (""offset is negative"");
-                       if (offset > array.Length)
-                               throw new ArgumentOutOfRangeException (""offset exceeds the length of the destination array"");
-                       if (length < 0)
-                               throw new ArgumentOutOfRangeException (""length is negative"");
-                       if (length > array.Length - offset)
-                               throw new ArgumentOutOfRangeException (""length + offset exceeds the length of the destination array"");
-               }
-
-               void CheckDictionaryStringArgs (XmlDictionaryString localName, XmlDictionaryString namespaceUri)
-               {
-                       if (localName == null)
-                               throw new ArgumentNullException (""localName"");
-                       if (namespaceUri == null)
-                               throw new ArgumentNullException (""namespaceUri"");
-               }
-");
-
-               foreach (Type type in types) {
-                       Console.WriteLine (@"
-               public virtual void WriteArray (string prefix, XmlDictionaryString localName, XmlDictionaryString namespaceUri, {0} [] array, int offset, int length)
-               {{
-                       CheckDictionaryStringArgs (localName, namespaceUri);
-                       WriteArray (prefix, localName.Value, namespaceUri.Value, array, offset, length);
-               }}
-
-               public virtual void WriteArray (string prefix, string localName, string namespaceUri, {0} [] array, int offset, int length)
-               {{
-                       CheckWriteArrayArguments (array, offset, length);
-                       for (int i = 0; i < length; i++) {{
-                               WriteStartElement (prefix, localName, namespaceUri);
-                               WriteValue (array [offset + i]);
-                               WriteEndElement ();
-                       }}
-
-               }}", ToCSharp (type), type.Name);
-
-               }
-               Console.WriteLine (@"
-       }
-}");
-       }
-
-       static CodeDomProvider cs = new CSharpCodeProvider ();
-
-       static string ToCSharp (Type type)
-       {
-               string r = cs.GetTypeOutput (new CodeTypeReference (type));
-               return r != type.FullName ? r : type.Name;
-       }
-}
-
index 3a948f1126aafa0ad1de31f8706ea0cf58a6c8b2..d0223334e7d6018247664ecadbc0bb7d04241204 100644 (file)
@@ -3102,7 +3102,7 @@ namespace System.Windows.Forms
                {
                        foreach (var item in Items) {
                                var fi = item as FileViewListViewItem;
-                               if (fi != null && fi.FSEntry != null && fi.FSEntry.IsImageFile())
+                               if (fi == null || fi.FSEntry == null)
                                        continue;
                                fi.FSEntry.Dispose();
                                fi.FSEntry = null;
index 896f3e204ce255074fdb76a397b527c727ec517d..808fa1ace2823ced7f8d6f457b77a147170f417f 100644 (file)
@@ -36,6 +36,7 @@ using System.Runtime.InteropServices;
 using System.Security;
 using System.Security.Policy;
 using System.Xml.XPath;
+using System.Xml.XmlConfiguration;
 
 namespace System.Xml.Xsl
 {
@@ -173,18 +174,18 @@ namespace System.Xml.Xsl
 
                public void Load (XmlReader stylesheet)
                {
-                       Load (stylesheet, null, null);
+                       Load (stylesheet, XsltSettings.Default, XsltConfigSection.CreateDefaultResolver());
                }
 
                public void Load (IXPathNavigable stylesheet)
                {
-                       Load (stylesheet.CreateNavigator(), null, null);
+                       Load (stylesheet.CreateNavigator(), XsltSettings.Default, XsltConfigSection.CreateDefaultResolver());
                }
 
                public void Load (IXPathNavigable stylesheet, XsltSettings settings, XmlResolver stylesheetResolver)
                {
-                       if (!settings.EnableDocumentFunction)
-                               throw new NotSupportedException ("'document' function cannot be disabled on this framework because it just runs XslTransform which does not support XsltSettings");
+//                     if (!settings.EnableDocumentFunction)
+//                             throw new NotSupportedException ("'document' function cannot be disabled on this framework because it just runs XslTransform which does not support XsltSettings");
                        if (settings.EnableScript)
                                throw new NotSupportedException ("'msxsl:script' element is not supported on this framework because it does not support run-time code generation");
                        impl.Load (stylesheet, stylesheetResolver);
index 6a68818450b53654f6102bc7107b69d229fdb0a9..aa333328d962b5cf0d7640c6500f03d266c21e83 100644 (file)
@@ -36,6 +36,7 @@ xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
                }
 
                [Test]
+               [Category ("MobileNotWorking")]
                public void MSXslNodeSetAcceptsNodeSet ()
                {
                        string xsl = @"<xsl:stylesheet version='1.0'
@@ -57,6 +58,7 @@ xmlns:xsl='http://www.w3.org/1999/XSL/Transform' xmlns:msxsl='urn:schemas-micros
                }
 
                [Test]
+               [Category ("MobileNotWorking")]
                public void MSXslNodeSetAcceptsEmptyString ()
                {
                        string xsl = @"<xsl:stylesheet version='1.0'
@@ -135,14 +137,19 @@ xmlns:xsl='http://www.w3.org/1999/XSL/Transform' xmlns:msxsl='urn:schemas-micros
                        t.Load (new XmlTextReader (new StringReader (xsl)));
 
                        var source = "<?xml version='1.0' encoding='utf-8' ?><Node><Name>123</Name></Node>";
+#if MOBILE
+                       var expected = "<?xml version=\"1.0\" encoding=\"utf-16\"?><Node name=\"123\"></Node>";
+#else
                        var expected = "<?xml version=\"1.0\" encoding=\"utf-16\"?><Node name=\"123\" />";
-
+#endif
                        StringWriter sw = new StringWriter ();
-                       t.Transform (new XPathDocument (new XmlTextReader (new StringReader (source))), null, sw);
+                       var xp = new XPathDocument (new XmlTextReader (new StringReader (source)));
+                       t.Transform (xp, null, sw);
                        Assert.AreEqual (expected, sw.ToString ());
                }
                
                [Test] // bug 2917
+               [Category ("MobileNotWorking")]
                public void XslOutputSettings ()
                {
                        XslCompiledTransform xslCompiledTransform = new XslCompiledTransform();
index 7b8c0dfd92063a89d2543afc13374d44f769f9cc..08a6316255f515cf465818c90c565267b220a2ba 100644 (file)
@@ -40,6 +40,7 @@ using System.Runtime.Remoting.Proxies;
 using System.Runtime.Remoting.Activation;
 using System.Runtime.Remoting.Messaging;
 using System.Runtime.Remoting.Lifetime;
+using System.Runtime.CompilerServices;
 using System.Runtime.InteropServices;
 
 
@@ -80,11 +81,16 @@ namespace System.Runtime.Remoting.Contexts {
                static DynamicPropertyCollection global_dynamic_properties;
                DynamicPropertyCollection context_dynamic_properties;
                ContextCallbackObject callback_object = null;
+
+               [MethodImpl (MethodImplOptions.InternalCall)]
+               extern static void RegisterContext (Context ctx);
                
                public Context ()
                {
                        domain_id = Thread.GetDomainID();
-                       context_id = 1 + global_count++;
+                       context_id = Interlocked.Increment (ref global_count);
+
+                       RegisterContext (this);
                }
 
                ~Context ()
index 129ee6d0bcc4693cafca827dad552fc5a012101c..892e722b990fa64a107f6d39bb74115f4a87be96 100644 (file)
@@ -633,7 +633,7 @@ namespace MonoTests.System.Collections.Generic {
                        }
                }
 
-#if !MONO
+#if !MOBILE
                [Test]
                public void SerializationCompatibilty ()
                {
index 852282a8a1f39753c390f64d61187819370f2969..6ef6cd49e7c17b18b8e38fda4e22408984ab1562 100644 (file)
@@ -347,30 +347,26 @@ namespace MonoTests.System.Reflection
                        Assert.AreEqual (UnmanagedType.ByValTStr, attr.Value, "#E2");
                        Assert.AreEqual (100, attr.SizeConst, "#E3");
 
+#if FEATURE_COMINTEROP
                        attrs = typeof (Class2).GetField ("f3").GetCustomAttributes (true);
                        Assert.AreEqual (1, attrs.Length, "#F1");
                        attr = (MarshalAsAttribute) attrs [0];
-#if FEATURE_COMINTEROP
                        Assert.AreEqual (UnmanagedType.CustomMarshaler, attr.Value, "#F2");
-#endif
+
                        Assert.AreEqual ("5", attr.MarshalCookie, "#F3");
                        Assert.AreEqual (typeof (Marshal1), Type.GetType (attr.MarshalType), "#F4");
 
                        attrs = typeof (Class3).GetField ("f3").GetCustomAttributes (false);
                        Assert.AreEqual (1, attrs.Length, "#G1");
                        attr = (MarshalAsAttribute) attrs [0];
-#if FEATURE_COMINTEROP
                        Assert.AreEqual (UnmanagedType.CustomMarshaler, attr.Value, "#G2");
-#endif
                        Assert.AreEqual ("5", attr.MarshalCookie, "#G3");
                        Assert.AreEqual (typeof (Marshal1), Type.GetType (attr.MarshalType), "#G4");
 
                        attrs = typeof (Class3).GetField ("f3").GetCustomAttributes (true);
                        Assert.AreEqual (1, attrs.Length, "#H1");
                        attr = (MarshalAsAttribute) attrs [0];
-#if FEATURE_COMINTEROP
                        Assert.AreEqual (UnmanagedType.CustomMarshaler, attr.Value, "#H2");
-#endif
                        Assert.AreEqual ("5", attr.MarshalCookie, "#H3");
                        Assert.AreEqual (typeof (Marshal1), Type.GetType (attr.MarshalType), "#H4");
 
@@ -378,11 +374,10 @@ namespace MonoTests.System.Reflection
                        attrs = typeof (Class2).GetField ("f3").GetCustomAttributes (true);
                        Assert.AreEqual (1, attrs.Length, "#I1");
                        attr = (MarshalAsAttribute) attrs [0];
-#if FEATURE_COMINTEROP
                        Assert.AreEqual (UnmanagedType.CustomMarshaler, attr.Value, "#I2");
-#endif
                        Assert.AreEqual ("5", attr.MarshalCookie, "#I3");
                        Assert.AreEqual (typeof (Marshal1), Type.GetType (attr.MarshalType), "#I4");
+#endif
                }
 
                // Disable "field not used warning", this is intended.
index c37ffea83ee0ef8863964386de58a77365e9bb50..88690944df3851ad2a9d846b0fbbae50723d8eb5 100644 (file)
@@ -90,6 +90,7 @@ namespace MonoTests.System.Resources
                }
 
                [Test]
+               [Category ("MobileNotWorking")]
                [ExpectedException (typeof (BadImageFormatException))]
                public void ConstructorString_Bad ()
                {
index 843f48ca330f57c859aebe41697dae1c9d0c49b6..2458b9831a608b1993d7e8682370f6bad6132a17 100644 (file)
@@ -1069,6 +1069,27 @@ namespace MonoTests.System
                        action_int (42);
                }
 
+               struct FooStruct {
+                       public int i, j, k, l;
+
+                       public int GetProp (int a, int b, int c, int d) {
+                               return i;
+                       }
+               }
+
+               delegate int ByRefDelegate (ref FooStruct s, int a, int b, int c, int d);
+
+#if MONOTOUCH
+               [Category ("NotWorking")]
+#endif
+               [Test]
+               public void CallVirtVType ()
+               {
+                       var action = (ByRefDelegate)Delegate.CreateDelegate (typeof (ByRefDelegate), null, typeof (FooStruct).GetMethod ("GetProp"));
+                       var s = new FooStruct () { i = 42 };
+                       Assert.AreEqual (42, action (ref s, 1, 2, 3, 4));
+               }
+
                class Foo {
 
                        public void Bar ()
index b308e9eed298f9c6ef85a5bf7631d9adc46fb648..9f87bcd74d19a29f1b4e41b2d7171f2c1af2835c 100644 (file)
@@ -3058,6 +3058,9 @@ namespace MonoTests.System
                }
 
                [Test]
+#if MONOTOUCH
+               [ExpectedException (typeof (NotSupportedException))]
+#endif
                public void MakeGenericType_NestedUserDefinedType ()
                {
                        Type ut = new UserType (new UserType (typeof (int)));
@@ -3072,6 +3075,9 @@ namespace MonoTests.System
                }
                
                [Test]
+#if MONOTOUCH
+               [ExpectedException (typeof (NotSupportedException))]
+#endif
                public void TestMakeGenericType_UserDefinedType_DotNet20SP1 () 
                {
                        Type ut = new UserType(typeof(int));
index 65d3941c63fb03caf276cd3aa326cfa3b92c1f84..f1723d2352a868dbdc1e6f016fa884b9516d67c7 100644 (file)
@@ -6447,8 +6447,13 @@ namespace Mono.CSharp {
                                        return;
                                }
 
-                               if (TypeSpec.IsValueType (InstanceExpression.Type) && InstanceExpression is VariableReference)
+                               if (TypeSpec.IsValueType (InstanceExpression.Type)) {
+                                       var le = SkipLeftValueTypeAccess (InstanceExpression);
+                                       if (le != null)
+                                               le.FlowAnalysis (fc);
+
                                        return;
+                               }
                        }
 
                        base.FlowAnalysis (fc);
@@ -6457,6 +6462,24 @@ namespace Mono.CSharp {
                                fc.ConditionalAccessEnd ();
                }
 
+               static Expression SkipLeftValueTypeAccess (Expression expr)
+               {
+                       if (!TypeSpec.IsValueType (expr.Type))
+                               return expr;
+
+                       if (expr is VariableReference)
+                               return null;
+
+                       var fe = expr as FieldExpr;
+                       if (fe == null)
+                               return expr;
+
+                       if (fe.InstanceExpression == null)
+                               return expr;
+
+                       return SkipLeftValueTypeAccess (fe.InstanceExpression);
+               }
+
                public override int GetHashCode ()
                {
                        return spec.GetHashCode ();
diff --git a/mcs/tests/test-923.cs b/mcs/tests/test-923.cs
new file mode 100644 (file)
index 0000000..17710cd
--- /dev/null
@@ -0,0 +1,37 @@
+using System;
+
+public struct Location
+{
+       public int x;
+       public int y;
+}
+
+public struct LocationWrapper
+{
+       public Location location;
+}
+
+class Program
+{
+       static void Main ()
+       {
+       }
+
+       public static void Test (out Location location)
+       {
+               location.x = 0;
+               location.y = location.x;
+       }
+
+       public static void Test (LocationWrapper member)
+       {
+               member.location.x = 0;
+               member.location.y = member.location.x;
+       }
+
+       public static void Test (out LocationWrapper member)
+       {
+               member.location.x = 0;
+               member.location.y = member.location.x;
+       }
+}
\ No newline at end of file
index f4666b6515252c3590ee45cba320263c19872d0f..e16164b873a807fc7288d68672a55871e935e5f9 100644 (file)
       </method>
     </type>
   </test>
+  <test name="test-923.cs">
+    <type name="Program">
+      <method name="Void Main()" attrs="145">
+        <size>2</size>
+      </method>
+      <method name="Void Test(Location ByRef)" attrs="150">
+        <size>21</size>
+      </method>
+      <method name="Void Test(LocationWrapper)" attrs="150">
+        <size>39</size>
+      </method>
+      <method name="Void Test(LocationWrapper ByRef)" attrs="150">
+        <size>36</size>
+      </method>
+      <method name="Void .ctor()" attrs="6278">
+        <size>7</size>
+      </method>
+    </type>
+  </test>
   <test name="test-93.cs">
     <type name="N1.C">
       <method name="Void .ctor()" attrs="6278">
       <method name="Void set_PropNullable(System.Nullable`1[System.Byte])" attrs="2182">
         <size>8</size>
       </method>
+      <method name="System.Object get_PropReference()" attrs="2182">
+        <size>14</size>
+      </method>
+      <method name="Void set_PropReference(System.Object)" attrs="2182">
+        <size>8</size>
+      </method>
       <method name="Void add_ev1(System.Action)" attrs="2182">
         <size>42</size>
       </method>
       </method>
     </type>
     <type name="C">
-      <method name="Int32 Main()" attrs="145">
-        <size>64</size>
-      </method>
-      <method name="Void .ctor()" attrs="6278">
-        <size>7</size>
-      </method>
       <method name="Int32 TestProperty()" attrs="145">
         <size>359</size>
       </method>
       <method name="Int32 TestField()" attrs="145">
         <size>351</size>
       </method>
-    </type>
-    <type name="CI">
-      <method name="System.Object get_PropReference()" attrs="2182">
-        <size>14</size>
+      <method name="Int32 Main()" attrs="145">
+        <size>64</size>
       </method>
-      <method name="Void set_PropReference(System.Object)" attrs="2182">
-        <size>8</size>
+      <method name="Void .ctor()" attrs="6278">
+        <size>7</size>
       </method>
     </type>
   </test>
index efb6d1e101d3777b8b6b9e09fbb5be6a2bfa51c6..a3cbe2abfee3419be56e504891aa2e749f9ed3cf 100755 (executable)
@@ -14,9 +14,9 @@
 #if defined(__WIN32__) || defined(_WIN32)
 /* Native win32 */
 #define __USE_W32_SOCKETS
+#include <winsock2.h>
 #include <windows.h>
 #include <winbase.h>
-#include <winsock2.h>
 /*
  * The mingw version says:
  * /usr/i686-pc-mingw32/sys-root/mingw/include/ws2tcpip.h:38:2: error: #error "ws2tcpip.h is not compatible with winsock.h. Include winsock2.h instead."
index 6b4467aefbdf447524495d4640fb95df16282a8b..6db10c716ab4b526b485d03e429b550b75965df8 100644 (file)
@@ -12,6 +12,9 @@
  * wapi_<funcname>.
  */
 
+#define GetLastError wapi_GetLastError
+#define SetLastError wapi_SetLastError
+#define TransmitFile wapi_TransmitFile
 #define GetThreadContext wapi_GetThreadContext
 #define CreateEvent wapi_CreateEvent 
 #define PulseEvent wapi_PulseEvent 
index 93339cfa317a7e69c11bddccffb7449045e4f856..5fa6706c1907ac9cd3961e02cc4541bf8dbf2250 100644 (file)
@@ -340,6 +340,7 @@ mono_context_init (MonoDomain *domain)
        context = (MonoAppContext *) mono_object_new_pinned (domain, class);
        context->domain_id = domain->domain_id;
        context->context_id = 0;
+       ves_icall_System_Runtime_Remoting_Contexts_Context_RegisterContext (context);
        domain->default_context = context;
 }
 
index 977c71d69a0692e51d17322bb1e23f8b8bf0563e..9d2c426a6f22df347333c95c2042db32f58d0ea7 100644 (file)
@@ -739,24 +739,6 @@ mono_debug_symfile_get_line_numbers (MonoDebugMethodInfo *minfo, char **source_f
 {
        mono_debug_symfile_get_line_numbers_full (minfo, source_file, NULL, n_il_offsets, il_offsets, line_numbers, NULL, NULL, NULL, NULL);
 }
-       
-int32_t
-_mono_debug_address_from_il_offset (MonoDebugMethodJitInfo *jit, uint32_t il_offset)
-{
-       int i;
-
-       if (!jit || !jit->line_numbers)
-               return -1;
-
-       for (i = jit->num_line_numbers - 1; i >= 0; i--) {
-               MonoDebugLineNumberEntry lne = jit->line_numbers [i];
-
-               if (lne.il_offset <= il_offset)
-                       return lne.native_offset;
-       }
-
-       return 0;
-}
 
 static int
 compare_method (const void *key, const void *object)
index 6d9a3c20d34b988dc34f4dd17dde9cd6d78e038c..2eb42c0bcf8d4ecd33169bc2c8e4d57195c7b17c 100644 (file)
@@ -141,10 +141,6 @@ mono_debug_symfile_lookup_location (MonoDebugMethodInfo      *minfo,
 MONO_API void
 mono_debug_symfile_free_location   (MonoDebugSourceLocation  *location);
 
-int32_t
-_mono_debug_address_from_il_offset (MonoDebugMethodJitInfo   *jit,
-                                   uint32_t                  il_offset);
-
 MONO_API MonoDebugMethodInfo *
 mono_debug_symfile_lookup_method   (MonoDebugHandle          *handle,
                                    MonoMethod               *method);
index 39fdc4cb70f722ef948e4d7ee0243211a8d5dd42..167e5f71ee0a88c3a073d87405a1598c9b5134bd 100644 (file)
@@ -115,7 +115,7 @@ gboolean    mono_gc_ephemeron_array_add (MonoObject *obj);
 gboolean    mono_gc_set_allow_synchronous_major (gboolean flag);
 
 MonoBoolean
-GCHandle_CheckCurrentDomain (guint32 gchandle);
+mono_gc_GCHandle_CheckCurrentDomain (guint32 gchandle);
 
 /* User defined marking function */
 /* It should work like this:
index f6a4eb920822c0d2570d55a23c93893dfcc81ab0..621ce3f825fcc635e463a84c0af12024ebfd64e4 100644 (file)
@@ -986,7 +986,7 @@ mono_gchandle_free_domain (MonoDomain *domain)
 }
 
 MonoBoolean
-GCHandle_CheckCurrentDomain (guint32 gchandle)
+mono_gc_GCHandle_CheckCurrentDomain (guint32 gchandle)
 {
        return mono_gchandle_is_in_domain (gchandle, mono_domain_get ());
 }
index f3e35ac68094f1d079f3f6e188b9be4330f681f7..1f65a7b2cc49311ee0da89c5a6eb4b2c672f4bbe 100644 (file)
@@ -634,7 +634,7 @@ ICALL(RUNH_5h, "SufficientExecutionStack", ves_icall_System_Runtime_CompilerServ
 ICALL(RUNH_6, "get_OffsetToStringData", ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_GetOffsetToStringData)
 
 ICALL_TYPE(GCH, "System.Runtime.InteropServices.GCHandle", GCH_1)
-ICALL(GCH_1, "CheckCurrentDomain", GCHandle_CheckCurrentDomain)
+ICALL(GCH_1, "CheckCurrentDomain", mono_gc_GCHandle_CheckCurrentDomain)
 ICALL(GCH_2, "FreeHandle", ves_icall_System_GCHandle_FreeHandle)
 ICALL(GCH_3, "GetAddrOfPinnedObject", ves_icall_System_GCHandle_GetAddrOfPinnedObject)
 ICALL(GCH_4, "GetTarget", ves_icall_System_GCHandle_GetTarget)
@@ -701,6 +701,9 @@ ICALL_TYPE(ACTS, "System.Runtime.Remoting.Activation.ActivationServices", ACTS_1
 ICALL(ACTS_1, "AllocateUninitializedClassInstance", ves_icall_System_Runtime_Activation_ActivationServices_AllocateUninitializedClassInstance)
 ICALL(ACTS_2, "EnableProxyActivation", ves_icall_System_Runtime_Activation_ActivationServices_EnableProxyActivation)
 
+ICALL_TYPE(CONTEXT, "System.Runtime.Remoting.Contexts.Context", CONTEXT_1)
+ICALL(CONTEXT_1, "RegisterContext", ves_icall_System_Runtime_Remoting_Contexts_Context_RegisterContext)
+
 ICALL_TYPE(ARES, "System.Runtime.Remoting.Messaging.AsyncResult", ARES_1)
 ICALL(ARES_1, "Invoke", ves_icall_System_Runtime_Remoting_Messaging_AsyncResult_Invoke)
 
index aca5b9a628c773d6e51a8084efaea946f1376c4f..f6daa4f7eb00c4259239331a1eec5bd0891ebeb8 100644 (file)
@@ -7072,7 +7072,7 @@ ves_icall_System_StackFrame_GetILOffsetFromFile (MonoString *path, guint32 metho
        guint32 il_offset;
        char *path_str = mono_string_to_utf8 (path);
 
-       if (!seq_point_data_get_il_offset (path_str, method_token, method_index, native_offset, &il_offset))
+       if (!mono_seq_point_data_get_il_offset (path_str, method_token, method_index, native_offset, &il_offset))
                il_offset = -1;
 
        g_free (path_str);
index ba6494c58018cedfe7837b84c5c732144d0d0293..f2300aff49a53ddf5c45e72dcaf2d255d34aee0f 100644 (file)
@@ -3231,11 +3231,18 @@ mono_marshal_get_delegate_invoke_internal (MonoMethod *method, gboolean callvirt
 
        if (callvirt) {
                if (!closed_over_null) {
-                       mono_mb_emit_ldarg (mb, 1);
-                       mono_mb_emit_op (mb, CEE_CASTCLASS, target_class);
-                       for (i = 1; i < sig->param_count; ++i)
-                               mono_mb_emit_ldarg (mb, i + 1);
-                       mono_mb_emit_op (mb, CEE_CALLVIRT, target_method);
+                       if (target_class->valuetype) {
+                               mono_mb_emit_ldarg (mb, 1);
+                               for (i = 1; i < sig->param_count; ++i)
+                                       mono_mb_emit_ldarg (mb, i + 1);
+                               mono_mb_emit_op (mb, CEE_CALL, target_method);
+                       } else {
+                               mono_mb_emit_ldarg (mb, 1);
+                               mono_mb_emit_op (mb, CEE_CASTCLASS, target_class);
+                               for (i = 1; i < sig->param_count; ++i)
+                                       mono_mb_emit_ldarg (mb, i + 1);
+                               mono_mb_emit_op (mb, CEE_CALLVIRT, target_method);
+                       }
                } else {
                        mono_mb_emit_byte (mb, CEE_LDNULL);
                        for (i = 0; i < sig->param_count; ++i)
@@ -7642,7 +7649,7 @@ mono_marshal_emit_managed_wrapper (MonoMethodBuilder *mb, MonoMethodSignature *i
 #ifdef USE_COOP_GC
        /* local 4, the local to be used when calling the reset_blocking funcs */
        /* tons of code hardcode 3 to be the return var */
-       coop_gc_var = mono_mb_add_local (mb, &mono_defaults.int32_class->byval_arg);
+       coop_gc_var = mono_mb_add_local (mb, &mono_defaults.int_class->byval_arg);
 #endif
 
        mono_mb_emit_icon (mb, 0);
index 800b3032b2733ab26b0c5a15f91591574e813b4a..b56dd2c82654d5527158b61fb5d1d8fb33086b82 100644 (file)
@@ -6275,6 +6275,9 @@ mono_print_unhandled_exception (MonoObject *exc)
        if (exc == (MonoObject*)mono_object_domain (exc)->out_of_memory_ex) {
                message = g_strdup ("OutOfMemoryException");
                free_message = TRUE;
+       } else if (exc == (MonoObject*)mono_object_domain (exc)->stack_overflow_ex) {
+               message = g_strdup ("StackOverflowException"); //if we OVF, we can't expect to have stack space to JIT Exception::ToString.
+               free_message = TRUE;
        } else {
                
                if (((MonoException*)exc)->native_trace_ips) {
index 391a1b63c6ad7cdd008f0c0c9978a603c2a2fa23..b8b1bcdb6f45dc7115067857bf3362efe2c8cd13 100644 (file)
@@ -95,7 +95,7 @@ seq_point_info_inflate (MonoSeqPointInfo *info)
 }
 
 MonoSeqPointInfo*
-seq_point_info_new (int len, gboolean alloc_data, guint8 *data, gboolean has_debug_data, int *out_size)
+mono_seq_point_info_new (int len, gboolean alloc_data, guint8 *data, gboolean has_debug_data, int *out_size)
 {
        MonoSeqPointInfo *info;
        guint8 *info_ptr;
@@ -128,7 +128,7 @@ seq_point_info_new (int len, gboolean alloc_data, guint8 *data, gboolean has_deb
 }
 
 void
-seq_point_info_free (gpointer ptr)
+mono_seq_point_info_free (gpointer ptr)
 {
        MonoSeqPointInfo* info = (MonoSeqPointInfo*) ptr;
        g_free (info);
@@ -168,7 +168,7 @@ seq_point_read (SeqPoint* seq_point, guint8* ptr, guint8* buffer_ptr, gboolean h
 }
 
 gboolean
-seq_point_info_add_seq_point (GByteArray* array, SeqPoint *sp, SeqPoint *last_seq_point, GSList *next, gboolean has_debug_data)
+mono_seq_point_info_add_seq_point (GByteArray* array, SeqPoint *sp, SeqPoint *last_seq_point, GSList *next, gboolean has_debug_data)
 {
        int il_delta, native_delta;
        GSList *l;
@@ -218,11 +218,11 @@ seq_point_info_add_seq_point (GByteArray* array, SeqPoint *sp, SeqPoint *last_se
 }
 
 gboolean
-seq_point_find_next_by_native_offset (MonoSeqPointInfo* info, int native_offset, SeqPoint* seq_point)
+mono_seq_point_find_next_by_native_offset (MonoSeqPointInfo* info, int native_offset, SeqPoint* seq_point)
 {
        SeqPointIterator it;
-       seq_point_iterator_init (&it, info);
-       while (seq_point_iterator_next (&it)) {
+       mono_seq_point_iterator_init (&it, info);
+       while (mono_seq_point_iterator_next (&it)) {
                if (it.seq_point.native_offset >= native_offset) {
                        memcpy (seq_point, &it.seq_point, sizeof (SeqPoint));
                        return TRUE;
@@ -233,13 +233,13 @@ seq_point_find_next_by_native_offset (MonoSeqPointInfo* info, int native_offset,
 }
 
 gboolean
-seq_point_find_prev_by_native_offset (MonoSeqPointInfo* info, int native_offset, SeqPoint* seq_point)
+mono_seq_point_find_prev_by_native_offset (MonoSeqPointInfo* info, int native_offset, SeqPoint* seq_point)
 {
        SeqPoint prev_seq_point;
        gboolean  is_first = TRUE;
        SeqPointIterator it;
-       seq_point_iterator_init (&it, info);
-       while (seq_point_iterator_next (&it) && it.seq_point.native_offset <= native_offset) {
+       mono_seq_point_iterator_init (&it, info);
+       while (mono_seq_point_iterator_next (&it) && it.seq_point.native_offset <= native_offset) {
                memcpy (&prev_seq_point, &it.seq_point, sizeof (SeqPoint));
                is_first = FALSE;
        }
@@ -253,11 +253,11 @@ seq_point_find_prev_by_native_offset (MonoSeqPointInfo* info, int native_offset,
 }
 
 gboolean
-seq_point_find_by_il_offset (MonoSeqPointInfo* info, int il_offset, SeqPoint* seq_point)
+mono_seq_point_find_by_il_offset (MonoSeqPointInfo* info, int il_offset, SeqPoint* seq_point)
 {
        SeqPointIterator it;
-       seq_point_iterator_init (&it, info);
-       while (seq_point_iterator_next (&it)) {
+       mono_seq_point_iterator_init (&it, info);
+       while (mono_seq_point_iterator_next (&it)) {
                if (it.seq_point.il_offset == il_offset) {
                        memcpy (seq_point, &it.seq_point, sizeof (SeqPoint));
                        return TRUE;
@@ -268,7 +268,7 @@ seq_point_find_by_il_offset (MonoSeqPointInfo* info, int il_offset, SeqPoint* se
 }
 
 void
-seq_point_init_next (MonoSeqPointInfo* info, SeqPoint sp, SeqPoint* next)
+mono_seq_point_init_next (MonoSeqPointInfo* info, SeqPoint sp, SeqPoint* next)
 {
        int i;
        guint8* ptr;
@@ -278,8 +278,8 @@ seq_point_init_next (MonoSeqPointInfo* info, SeqPoint sp, SeqPoint* next)
 
        g_assert (info_inflated.has_debug_data);
 
-       seq_point_iterator_init (&it, info);
-       while (seq_point_iterator_next (&it))
+       mono_seq_point_iterator_init (&it, info);
+       while (mono_seq_point_iterator_next (&it))
                g_array_append_vals (seq_points, &it.seq_point, 1);
 
        ptr = info_inflated.data + sp.next_offset;
@@ -294,7 +294,7 @@ seq_point_init_next (MonoSeqPointInfo* info, SeqPoint sp, SeqPoint* next)
 }
 
 gboolean
-seq_point_iterator_next (SeqPointIterator* it)
+mono_seq_point_iterator_next (SeqPointIterator* it)
 {
        if (it->ptr >= it->end)
                return FALSE;
@@ -305,7 +305,7 @@ seq_point_iterator_next (SeqPointIterator* it)
 }
 
 void
-seq_point_iterator_init (SeqPointIterator* it, MonoSeqPointInfo* info)
+mono_seq_point_iterator_init (SeqPointIterator* it, MonoSeqPointInfo* info)
 {
        SeqPointInfoInflated info_inflated = seq_point_info_inflate (info);
        it->ptr = info_inflated.data;
@@ -316,7 +316,7 @@ seq_point_iterator_init (SeqPointIterator* it, MonoSeqPointInfo* info)
 }
 
 int
-seq_point_info_write (MonoSeqPointInfo* info, guint8* buffer)
+mono_seq_point_info_write (MonoSeqPointInfo* info, guint8* buffer)
 {
        guint8* buffer0 = buffer;
        SeqPointInfoInflated info_inflated = seq_point_info_inflate (info);
@@ -332,7 +332,7 @@ seq_point_info_write (MonoSeqPointInfo* info, guint8* buffer)
 }
 
 int
-seq_point_info_read (MonoSeqPointInfo** info, guint8* buffer, gboolean copy)
+mono_seq_point_info_read (MonoSeqPointInfo** info, guint8* buffer, gboolean copy)
 {
        guint8* buffer0 = buffer;
        int size, info_size;
@@ -341,7 +341,7 @@ seq_point_info_read (MonoSeqPointInfo** info, guint8* buffer, gboolean copy)
        has_debug_data = decode_var_int (buffer, &buffer);
 
        size = decode_var_int (buffer, &buffer);
-       (*info) = seq_point_info_new (size, copy, buffer, has_debug_data, &info_size);
+       (*info) = mono_seq_point_info_new (size, copy, buffer, has_debug_data, &info_size);
        buffer += size;
 
        return buffer - buffer0;
@@ -351,7 +351,7 @@ seq_point_info_read (MonoSeqPointInfo** info, guint8* buffer, gboolean copy)
  * Returns the maximum size of mono_seq_point_info_write.
  */
 int
-seq_point_info_get_write_size (MonoSeqPointInfo* info)
+mono_seq_point_info_get_write_size (MonoSeqPointInfo* info)
 {
        SeqPointInfoInflated info_inflated = seq_point_info_inflate (info);
 
@@ -368,7 +368,7 @@ seq_point_info_get_write_size (MonoSeqPointInfo* info)
  */
 
 void
-seq_point_data_init (SeqPointData *data, int entry_capacity)
+mono_seq_point_data_init (SeqPointData *data, int entry_capacity)
 {
        data->entry_count = 0;
        data->entry_capacity = entry_capacity;
@@ -376,7 +376,7 @@ seq_point_data_init (SeqPointData *data, int entry_capacity)
 }
 
 void
-seq_point_data_free (SeqPointData *data)
+mono_seq_point_data_free (SeqPointData *data)
 {
        int i;
        for (i=0; i<data->entry_count; i++) {
@@ -387,7 +387,7 @@ seq_point_data_free (SeqPointData *data)
 }
 
 gboolean
-seq_point_data_read (SeqPointData *data, char *path)
+mono_seq_point_data_read (SeqPointData *data, char *path)
 {
        guint8 *buffer, *buffer_orig;
        int entry_count, i;
@@ -407,13 +407,13 @@ seq_point_data_read (SeqPointData *data, char *path)
        fclose(f);
 
        entry_count = decode_var_int (buffer, &buffer);
-       seq_point_data_init (data, entry_count);
+       mono_seq_point_data_init (data, entry_count);
        data->entry_count = entry_count;
 
        for (i=0; i<entry_count; i++) {
                data->entries [i].method_token = decode_var_int (buffer, &buffer);
                data->entries [i].method_index = decode_var_int (buffer, &buffer);
-               buffer += seq_point_info_read (&data->entries [i].seq_points, buffer, TRUE);
+               buffer += mono_seq_point_info_read (&data->entries [i].seq_points, buffer, TRUE);
                data->entries [i].free_seq_points = TRUE;
        }
 
@@ -422,7 +422,7 @@ seq_point_data_read (SeqPointData *data, char *path)
 }
 
 gboolean
-seq_point_data_write (SeqPointData *data, char *path)
+mono_seq_point_data_write (SeqPointData *data, char *path)
 {
        guint8 *buffer, *buffer_orig;
        FILE *f;
@@ -433,7 +433,7 @@ seq_point_data_write (SeqPointData *data, char *path)
                return FALSE;
 
        for (i=0; i<data->entry_count; i++) {
-               size += seq_point_info_get_write_size (data->entries [i].seq_points);
+               size += mono_seq_point_info_get_write_size (data->entries [i].seq_points);
        }
        // Add size of entry_count and native_base_offsets
        size += 4 + data->entry_count * 4;
@@ -445,7 +445,7 @@ seq_point_data_write (SeqPointData *data, char *path)
        for (i=0; i<data->entry_count; i++) {
                encode_var_int (buffer, &buffer, data->entries [i].method_token);
                encode_var_int (buffer, &buffer, data->entries [i].method_index);
-               buffer += seq_point_info_write (data->entries [i].seq_points, buffer);
+               buffer += mono_seq_point_info_write (data->entries [i].seq_points, buffer);
        }
 
        fwrite (buffer_orig, 1, buffer - buffer_orig, f);
@@ -455,7 +455,7 @@ seq_point_data_write (SeqPointData *data, char *path)
 }
 
 void
-seq_point_data_add (SeqPointData *data, guint32 method_token, guint32 method_index, MonoSeqPointInfo* info)
+mono_seq_point_data_add (SeqPointData *data, guint32 method_token, guint32 method_index, MonoSeqPointInfo* info)
 {
        int i;
 
@@ -468,7 +468,7 @@ seq_point_data_add (SeqPointData *data, guint32 method_token, guint32 method_ind
 }
 
 gboolean
-seq_point_data_get (SeqPointData *data, guint32 method_token, guint32 method_index, MonoSeqPointInfo** info)
+mono_seq_point_data_get (SeqPointData *data, guint32 method_token, guint32 method_index, MonoSeqPointInfo** info)
 {
        int i;
 
@@ -482,19 +482,19 @@ seq_point_data_get (SeqPointData *data, guint32 method_token, guint32 method_ind
 }
 
 gboolean
-seq_point_data_get_il_offset (char *path, guint32 method_token, guint32 method_index, guint32 native_offset, guint32 *il_offset)
+mono_seq_point_data_get_il_offset (char *path, guint32 method_token, guint32 method_index, guint32 native_offset, guint32 *il_offset)
 {
        SeqPointData sp_data;
        MonoSeqPointInfo *seq_points;
        SeqPoint sp;
 
-       if (!seq_point_data_read (&sp_data, path))
+       if (!mono_seq_point_data_read (&sp_data, path))
                return FALSE;
 
-       if (!seq_point_data_get (&sp_data, method_token, method_index, &seq_points))
+       if (!mono_seq_point_data_get (&sp_data, method_token, method_index, &seq_points))
                return FALSE;
 
-       if (!seq_point_find_prev_by_native_offset (seq_points, native_offset, &sp))
+       if (!mono_seq_point_find_prev_by_native_offset (seq_points, native_offset, &sp))
                return FALSE;
 
        *il_offset = sp.il_offset;
index 730770001783454cd3a7caca36c8b0ca83cc95bc..babdea43c861f9efa0580747ec19822f0a90ff0f 100644 (file)
@@ -40,40 +40,40 @@ typedef struct {
 } SeqPointIterator;
 
 void
-seq_point_info_free (gpointer info);
+mono_seq_point_info_free (gpointer info);
 
 gboolean
-seq_point_iterator_next (SeqPointIterator* it);
+mono_seq_point_iterator_next (SeqPointIterator* it);
 
 void
-seq_point_iterator_init (SeqPointIterator* it, MonoSeqPointInfo* info);
+mono_seq_point_iterator_init (SeqPointIterator* it, MonoSeqPointInfo* info);
 
 void
-seq_point_init_next (MonoSeqPointInfo* info, SeqPoint sp, SeqPoint* next);
+mono_seq_point_init_next (MonoSeqPointInfo* info, SeqPoint sp, SeqPoint* next);
 
 int
-seq_point_info_write (MonoSeqPointInfo* info, guint8* buffer);
+mono_seq_point_info_write (MonoSeqPointInfo* info, guint8* buffer);
 
 int
-seq_point_info_read (MonoSeqPointInfo** info, guint8* buffer, gboolean copy);
+mono_seq_point_info_read (MonoSeqPointInfo** info, guint8* buffer, gboolean copy);
 
 int
-seq_point_info_get_write_size (MonoSeqPointInfo* info);
+mono_seq_point_info_get_write_size (MonoSeqPointInfo* info);
 
 gboolean
-seq_point_info_add_seq_point (GByteArray* array, SeqPoint *sp, SeqPoint *last_seq_point, GSList *next, gboolean has_debug_data);
+mono_seq_point_info_add_seq_point (GByteArray* array, SeqPoint *sp, SeqPoint *last_seq_point, GSList *next, gboolean has_debug_data);
 
 MonoSeqPointInfo*
-seq_point_info_new (int len, gboolean alloc_data, guint8 *data, gboolean has_debug_data, int *out_size);
+mono_seq_point_info_new (int len, gboolean alloc_data, guint8 *data, gboolean has_debug_data, int *out_size);
 
 gboolean
-seq_point_find_prev_by_native_offset (MonoSeqPointInfo* info, int native_offset, SeqPoint* seq_point);
+mono_seq_point_find_prev_by_native_offset (MonoSeqPointInfo* info, int native_offset, SeqPoint* seq_point);
 
 gboolean
-seq_point_find_next_by_native_offset (MonoSeqPointInfo* info, int native_offset, SeqPoint* seq_point);
+mono_seq_point_find_next_by_native_offset (MonoSeqPointInfo* info, int native_offset, SeqPoint* seq_point);
 
 gboolean
-seq_point_find_by_il_offset (MonoSeqPointInfo* info, int il_offset, SeqPoint* seq_point);
+mono_seq_point_find_by_il_offset (MonoSeqPointInfo* info, int il_offset, SeqPoint* seq_point);
 
 /*
  * SeqPointData struct and functions
@@ -94,24 +94,24 @@ typedef struct {
 } SeqPointData;
 
 void
-seq_point_data_init (SeqPointData *data, int entry_capacity);
+mono_seq_point_data_init (SeqPointData *data, int entry_capacity);
 
 void
-seq_point_data_free (SeqPointData *data);
+mono_seq_point_data_free (SeqPointData *data);
 
 gboolean
-seq_point_data_read (SeqPointData *data, char *path);
+mono_seq_point_data_read (SeqPointData *data, char *path);
 
 gboolean
-seq_point_data_write (SeqPointData *data, char *path);
+mono_seq_point_data_write (SeqPointData *data, char *path);
 
 void
-seq_point_data_add (SeqPointData *data, guint32 methodToken, guint32 methodIndex, MonoSeqPointInfo* info);
+mono_seq_point_data_add (SeqPointData *data, guint32 methodToken, guint32 methodIndex, MonoSeqPointInfo* info);
 
 gboolean
-seq_point_data_get (SeqPointData *data, guint32 methodToken, guint32 methodIndex, MonoSeqPointInfo** info);
+mono_seq_point_data_get (SeqPointData *data, guint32 methodToken, guint32 methodIndex, MonoSeqPointInfo** info);
 
 gboolean
-seq_point_data_get_il_offset (char *path, guint32 methodToken, guint32 methodIndex, guint32 native_offset, guint32 *il_offset);
+mono_seq_point_data_get_il_offset (char *path, guint32 methodToken, guint32 methodIndex, guint32 native_offset, guint32 *il_offset);
 
-#endif /* __MONO_SEQ_POINTS_DATA_H__ */
\ No newline at end of file
+#endif /* __MONO_SEQ_POINTS_DATA_H__ */
index a4b592078522cda64e3cacbd3a050694cbb7e6fe..99e9b5456bd30d6860230a6bcd25c1aa8ed77255 100644 (file)
@@ -75,9 +75,9 @@
 typedef union {
        struct {
                gint16 max_working; /* determined by heuristic */
-               gint16 active; /* working or waiting on thread_work_sem; warm threads */
-               gint16 working;
-               gint16 parked;
+               gint16 active; /* executing worker_thread */
+               gint16 working; /* actively executing worker_thread, not parked */
+               gint16 parked; /* parked */
        } _;
        gint64 as_gint64;
 } ThreadPoolCounter;
@@ -178,6 +178,7 @@ static ThreadPool* threadpool;
 #define COUNTER_CHECK(counter) \
        do { \
                g_assert (counter._.max_working > 0); \
+               g_assert (counter._.working >= 0); \
                g_assert (counter._.active >= 0); \
        } while (0)
 
@@ -344,7 +345,7 @@ ensure_cleanedup (void)
        for (;;) {
                guint i;
                ThreadPoolCounter counter = COUNTER_READ ();
-               if (counter._.active == 0 && counter._.parked == 0)
+               if (counter._.active == 0)
                        break;
                if (counter._.active == 1) {
                        MonoInternalThread *thread = mono_thread_internal_current ();
@@ -585,7 +586,10 @@ worker_thread (gpointer data)
        g_assert (tpdomain->domain);
 
        if (mono_runtime_is_shutting_down () || mono_domain_is_unloading (tpdomain->domain)) {
-               COUNTER_ATOMIC (counter, { counter._.active --; });
+               COUNTER_ATOMIC (counter, {
+                       counter._.working --;
+                       counter._.active --;
+               });
                return;
        }
 
@@ -602,6 +606,10 @@ worker_thread (gpointer data)
        thread = mono_thread_internal_current ();
        g_assert (thread);
 
+       mono_mutex_lock (&threadpool->working_threads_lock);
+       g_ptr_array_add (threadpool->working_threads, thread);
+       mono_mutex_unlock (&threadpool->working_threads_lock);
+
        mono_mutex_lock (&threadpool->domains_lock);
 
        do {
@@ -614,12 +622,6 @@ worker_thread (gpointer data)
 
                mono_mutex_unlock (&threadpool->domains_lock);
 
-               mono_mutex_lock (&threadpool->working_threads_lock);
-               g_ptr_array_add (threadpool->working_threads, thread);
-               mono_mutex_unlock (&threadpool->working_threads_lock);
-
-               COUNTER_ATOMIC (counter, { counter._.working ++; });
-
                mono_thread_push_appdomain_ref (tpdomain->domain);
                if (mono_domain_set (tpdomain->domain, FALSE)) {
                        MonoObject *exc = NULL;
@@ -635,12 +637,6 @@ worker_thread (gpointer data)
                }
                mono_thread_pop_appdomain_ref ();
 
-               COUNTER_ATOMIC (counter, { counter._.working --; });
-
-               mono_mutex_lock (&threadpool->working_threads_lock);
-               g_ptr_array_remove_fast (threadpool->working_threads, thread);
-               mono_mutex_unlock (&threadpool->working_threads_lock);
-
                mono_mutex_lock (&threadpool->domains_lock);
 
                tpdomain->domain->threadpool_jobs --;
@@ -669,11 +665,11 @@ worker_thread (gpointer data)
                                gboolean park = TRUE;
 
                                COUNTER_ATOMIC (counter, {
-                                       if (counter._.active <= counter._.max_working) {
+                                       if (counter._.working <= counter._.max_working) {
                                                park = FALSE;
                                                break;
                                        }
-                                       counter._.active --;
+                                       counter._.working --;
                                        counter._.parked ++;
                                });
 
@@ -685,7 +681,7 @@ worker_thread (gpointer data)
                                        mono_mutex_lock (&threadpool->domains_lock);
 
                                        COUNTER_ATOMIC (counter, {
-                                               counter._.active ++;
+                                               counter._.working ++;
                                                counter._.parked --;
                                        });
                                }
@@ -697,7 +693,14 @@ worker_thread (gpointer data)
 
        mono_mutex_unlock (&threadpool->domains_lock);
 
-       COUNTER_ATOMIC (counter, { counter._.active --; });
+       mono_mutex_lock (&threadpool->working_threads_lock);
+       g_ptr_array_remove_fast (threadpool->working_threads, thread);
+       mono_mutex_unlock (&threadpool->working_threads_lock);
+
+       COUNTER_ATOMIC (counter, {
+               counter._.working--;
+               counter._.active --;
+       });
 }
 
 static gboolean
@@ -738,15 +741,19 @@ worker_request (MonoDomain *domain)
                return TRUE;
 
        COUNTER_ATOMIC (counter, {
-               if (counter._.active >= counter._.max_working)
+               if (counter._.working >= counter._.max_working)
                        return FALSE;
+               counter._.working ++;
                counter._.active ++;
        });
 
        if (worker_try_create (tpdomain))
                return TRUE;
 
-       COUNTER_ATOMIC (counter, { counter._.active --; });
+       COUNTER_ATOMIC (counter, {
+               counter._.working --;
+               counter._.active --;
+       });
        return FALSE;
 }
 
@@ -858,8 +865,9 @@ monitor_thread (void)
                                        break;
 
                                COUNTER_TRY_ATOMIC (success, counter, {
-                                       if (counter._.active >= counter._.max_working)
+                                       if (counter._.working >= counter._.max_working)
                                                break;
+                                       counter._.working ++;
                                        counter._.active ++;
                                });
 
@@ -870,7 +878,10 @@ monitor_thread (void)
                                if (tpdomain && worker_try_create (tpdomain))
                                        break;
 
-                               COUNTER_ATOMIC (counter, { counter._.active --; });
+                               COUNTER_ATOMIC (counter, {
+                                       counter._.working --;
+                                       counter._.active --;
+                               });
                        }
                }
        } while (monitor_should_keep_running ());
@@ -1182,7 +1193,7 @@ heuristic_should_adjust (void)
 
        if (threadpool->heuristic_last_dequeue > threadpool->heuristic_last_adjustment + threadpool->heuristic_adjustment_interval) {
                ThreadPoolCounter counter = COUNTER_READ ();
-               if (counter._.active <= counter._.max_working)
+               if (counter._.working <= counter._.max_working)
                        return TRUE;
        }
 
@@ -1510,7 +1521,7 @@ ves_icall_System_Threading_Microsoft_ThreadPool_NotifyWorkItemComplete (void)
                heuristic_adjust ();
 
        counter = COUNTER_READ ();
-       return counter._.active <= counter._.max_working;
+       return counter._.working <= counter._.max_working;
 }
 
 void
index 064a0335a774a50b2d4da33f35c1510b2307298f..ae7b15885611e205e9d83f8c66353afb24b38557 100644 (file)
@@ -184,6 +184,8 @@ void ves_icall_System_Threading_Thread_MemoryBarrier (void);
 void ves_icall_System_Threading_Thread_Interrupt_internal (MonoInternalThread *this_obj);
 void ves_icall_System_Threading_Thread_SpinWait_nop (void);
 
+void ves_icall_System_Runtime_Remoting_Contexts_Context_RegisterContext (MonoAppContext *ctx);
+
 MonoInternalThread *mono_thread_internal_current (void);
 
 void mono_thread_internal_stop (MonoInternalThread *thread);
@@ -193,7 +195,6 @@ gboolean mono_thread_internal_has_appdomain_ref (MonoInternalThread *thread, Mon
 void mono_thread_internal_reset_abort (MonoInternalThread *thread);
 
 void mono_alloc_special_static_data_free (GHashTable *special_static_fields);
-void mono_special_static_data_free_slot (guint32 offset, guint32 size);
 uint32_t mono_thread_alloc_tls   (MonoReflectionType *type);
 void     mono_thread_destroy_tls (uint32_t tls_offset);
 void     mono_thread_destroy_domain_tls (MonoDomain *domain);
index e37b1c27448222f5b299bc94635b985670d1892a..cfd6f9e2e8a9dd098fda9bc773e76fba6047e375 100644 (file)
@@ -31,6 +31,7 @@
 #include <mono/io-layer/io-layer.h>
 #include <mono/metadata/object-internals.h>
 #include <mono/metadata/mono-debug-debugger.h>
+#include <mono/utils/monobitset.h>
 #include <mono/utils/mono-compiler.h>
 #include <mono/utils/mono-mmap.h>
 #include <mono/utils/mono-membar.h>
@@ -104,9 +105,9 @@ typedef union {
        gdouble fval;
 } LongDoubleUnion;
  
-typedef struct _MonoThreadDomainTls MonoThreadDomainTls;
-struct _MonoThreadDomainTls {
-       MonoThreadDomainTls *next;
+typedef struct _StaticDataFreeList StaticDataFreeList;
+struct _StaticDataFreeList {
+       StaticDataFreeList *next;
        guint32 offset;
        guint32 size;
 };
@@ -114,7 +115,7 @@ struct _MonoThreadDomainTls {
 typedef struct {
        int idx;
        int offset;
-       MonoThreadDomainTls *freelist;
+       StaticDataFreeList *freelist;
 } StaticDataInfo;
 
 /* Number of cached culture objects in the MonoThread->cached_culture_info array
@@ -130,11 +131,6 @@ static void mono_threads_lock (void);
 static void mono_threads_unlock (void);
 static mono_mutex_t threads_mutex;
 
-/* Controls access to context static data */
-#define mono_contexts_lock() mono_mutex_lock (&contexts_mutex)
-#define mono_contexts_unlock() mono_mutex_unlock (&contexts_mutex)
-static mono_mutex_t contexts_mutex;
-
 /* Controls access to the 'joinable_threads' hash table */
 #define joinable_threads_lock() mono_mutex_lock (&joinable_threads_mutex)
 #define joinable_threads_unlock() mono_mutex_unlock (&joinable_threads_mutex)
@@ -149,6 +145,11 @@ static StaticDataInfo context_static_info;
  */
 static MonoGHashTable *threads=NULL;
 
+/* List of app context GC handles.
+ * Added to from ves_icall_System_Runtime_Remoting_Contexts_Context_RegisterContext ().
+ */
+static GHashTable *contexts = NULL;
+
 /*
  * Threads which are starting up and they are not in the 'threads' hash yet.
  * When handle_store is called for a thread, it will be removed from this hash table.
@@ -200,7 +201,8 @@ static guint32 default_stacksize = 0;
 #define default_stacksize_for_thread(thread) ((thread)->stack_size? (thread)->stack_size: default_stacksize)
 
 static void thread_adjust_static_data (MonoInternalThread *thread);
-static void mono_free_static_data (gpointer* static_data, gboolean threadlocal);
+static void context_adjust_static_data (MonoAppContext *ctx);
+static void mono_free_static_data (gpointer* static_data);
 static void mono_init_static_data_info (StaticDataInfo *static_data);
 static guint32 mono_alloc_static_data_slot (StaticDataInfo *static_data, guint32 size, guint32 align);
 static gboolean mono_thread_resume (MonoInternalThread* thread);
@@ -473,7 +475,7 @@ static void thread_cleanup (MonoInternalThread *thread)
 
        thread->cached_culture_info = NULL;
 
-       mono_free_static_data (thread->static_data, TRUE);
+       mono_free_static_data (thread->static_data);
        thread->static_data = NULL;
        ref_stack_destroy (thread->appdomain_refs);
        thread->appdomain_refs = NULL;
@@ -487,14 +489,51 @@ static void thread_cleanup (MonoInternalThread *thread)
        }
 }
 
+/*
+ * A special static data offset (guint32) consists of 3 parts:
+ *
+ * [0]   6-bit index into the array of chunks.
+ * [6]   25-bit offset into the array.
+ * [31]  Bit indicating thread or context static.
+ */
+
+typedef union {
+       struct {
+               guint32 index : 6;
+               guint32 offset : 25;
+               guint32 type : 1;
+       } fields;
+       guint32 raw;
+} SpecialStaticOffset;
+
+#define SPECIAL_STATIC_OFFSET_TYPE_THREAD 0
+#define SPECIAL_STATIC_OFFSET_TYPE_CONTEXT 1
+
+#define MAKE_SPECIAL_STATIC_OFFSET(index, offset, type) \
+       ((SpecialStaticOffset) { .fields = { (index), (offset), (type) } }.raw)
+#define ACCESS_SPECIAL_STATIC_OFFSET(x,f) \
+       (((SpecialStaticOffset *) &(x))->fields.f)
+
 static gpointer
 get_thread_static_data (MonoInternalThread *thread, guint32 offset)
 {
-       int idx;
-       g_assert ((offset & 0x80000000) == 0);
-       offset &= 0x7fffffff;
-       idx = (offset >> 24) - 1;
-       return ((char*) thread->static_data [idx]) + (offset & 0xffffff);
+       g_assert (ACCESS_SPECIAL_STATIC_OFFSET (offset, type) == SPECIAL_STATIC_OFFSET_TYPE_THREAD);
+
+       int idx = ACCESS_SPECIAL_STATIC_OFFSET (offset, index);
+       int off = ACCESS_SPECIAL_STATIC_OFFSET (offset, offset);
+
+       return ((char *) thread->static_data [idx]) + off;
+}
+
+static gpointer
+get_context_static_data (MonoAppContext *ctx, guint32 offset)
+{
+       g_assert (ACCESS_SPECIAL_STATIC_OFFSET (offset, type) == SPECIAL_STATIC_OFFSET_TYPE_CONTEXT);
+
+       int idx = ACCESS_SPECIAL_STATIC_OFFSET (offset, index);
+       int off = ACCESS_SPECIAL_STATIC_OFFSET (offset, offset);
+
+       return ((char *) ctx->static_data [idx]) + off;
 }
 
 static MonoThread**
@@ -2526,6 +2565,23 @@ ves_icall_System_Threading_Volatile_Write_T (void *ptr, MonoObject *value)
        mono_gc_wbarrier_generic_store_atomic (ptr, value);
 }
 
+void
+ves_icall_System_Runtime_Remoting_Contexts_Context_RegisterContext (MonoAppContext *ctx)
+{
+       mono_threads_lock ();
+
+       //g_print ("Registering context %d in domain %d\n", ctx->context_id, ctx->domain_id);
+
+       if (!contexts)
+               contexts = g_hash_table_new (NULL, NULL);
+
+       context_adjust_static_data (ctx);
+       gpointer gch = GUINT_TO_POINTER (mono_gchandle_new_weakref (&ctx->obj, FALSE));
+       g_hash_table_insert (contexts, gch, gch);
+
+       mono_threads_unlock ();
+}
+
 void
 mono_thread_init_tls (void)
 {
@@ -2538,7 +2594,6 @@ void mono_thread_init (MonoThreadStartCB start_cb,
 {
        mono_mutex_init_recursive(&threads_mutex);
        mono_mutex_init_recursive(&interlocked_mutex);
-       mono_mutex_init_recursive(&contexts_mutex);
        mono_mutex_init_recursive(&joinable_threads_mutex);
        
        background_change_event = CreateEvent (NULL, TRUE, FALSE, NULL);
@@ -2582,7 +2637,6 @@ void mono_thread_cleanup (void)
         */
        mono_mutex_destroy (&threads_mutex);
        mono_mutex_destroy (&interlocked_mutex);
-       mono_mutex_destroy (&contexts_mutex);
        mono_mutex_destroy (&delayed_free_table_mutex);
        mono_mutex_destroy (&small_id_mutex);
        CloseHandle (background_change_event);
@@ -3487,34 +3541,41 @@ static const int static_data_size [NUM_STATIC_DATA_IDX] = {
 };
 #endif
 
-static uintptr_t* static_reference_bitmaps [NUM_STATIC_DATA_IDX];
+static MonoBitSet *thread_reference_bitmaps [NUM_STATIC_DATA_IDX];
+static MonoBitSet *context_reference_bitmaps [NUM_STATIC_DATA_IDX];
 
 static void
-mark_tls_slots (void *addr, MonoGCMarkFunc mark_func, void *gc_data)
+mark_slots (void *addr, MonoBitSet **bitmaps, MonoGCMarkFunc mark_func, void *gc_data)
 {
-       int i;
        gpointer *static_data = addr;
-       for (i = 0; i < NUM_STATIC_DATA_IDX; ++i) {
-               int j, numwords;
-               void **ptr;
-               if (!static_data [i])
+
+       for (int i = 0; i < NUM_STATIC_DATA_IDX; ++i) {
+               void **ptr = static_data [i];
+
+               if (!ptr)
                        continue;
-               numwords = 1 + static_data_size [i] / sizeof (gpointer) / (sizeof(uintptr_t) * 8);
-               ptr = static_data [i];
-               for (j = 0; j < numwords; ++j, ptr += sizeof (uintptr_t) * 8) {
-                       uintptr_t bmap = static_reference_bitmaps [i][j];
-                       void ** p = ptr;
-                       while (bmap) {
-                               if ((bmap & 1) && *p) {
-                                       mark_func (p, gc_data);
-                               }
-                               p++;
-                               bmap >>= 1;
-                       }
-               }
+
+               MONO_BITSET_FOREACH (bitmaps [i], idx, {
+                       void **p = ptr + idx;
+
+                       if (*p)
+                               mark_func (p, gc_data);
+               });
        }
 }
 
+static void
+mark_tls_slots (void *addr, MonoGCMarkFunc mark_func, void *gc_data)
+{
+       mark_slots (addr, thread_reference_bitmaps, mark_func, gc_data);
+}
+
+static void
+mark_ctx_slots (void *addr, MonoGCMarkFunc mark_func, void *gc_data)
+{
+       mark_slots (addr, context_reference_bitmaps, mark_func, gc_data);
+}
+
 /*
  *  mono_alloc_static_data
  *
@@ -3523,15 +3584,23 @@ mark_tls_slots (void *addr, MonoGCMarkFunc mark_func, void *gc_data)
 static void 
 mono_alloc_static_data (gpointer **static_data_ptr, guint32 offset, gboolean threadlocal)
 {
-       guint idx = (offset >> 24) - 1;
+       guint idx = ACCESS_SPECIAL_STATIC_OFFSET (offset, index);
        int i;
 
        gpointer* static_data = *static_data_ptr;
        if (!static_data) {
-               static void* tls_desc = NULL;
-               if (mono_gc_user_markers_supported () && !tls_desc)
-                       tls_desc = mono_gc_make_root_descr_user (mark_tls_slots);
-               static_data = mono_gc_alloc_fixed (static_data_size [0], threadlocal?tls_desc:NULL);
+               static void *tls_desc = NULL;
+               static void *ctx_desc = NULL;
+
+               if (mono_gc_user_markers_supported ()) {
+                       if (!tls_desc)
+                               tls_desc = mono_gc_make_root_descr_user (mark_tls_slots);
+
+                       if (!ctx_desc)
+                               ctx_desc = mono_gc_make_root_descr_user (mark_ctx_slots);
+               }
+
+               static_data = mono_gc_alloc_fixed (static_data_size [0], threadlocal ? tls_desc : ctx_desc);
                *static_data_ptr = static_data;
                static_data [0] = static_data;
        }
@@ -3539,7 +3608,8 @@ mono_alloc_static_data (gpointer **static_data_ptr, guint32 offset, gboolean thr
        for (i = 1; i <= idx; ++i) {
                if (static_data [i])
                        continue;
-               if (mono_gc_user_markers_supported () && threadlocal)
+
+               if (mono_gc_user_markers_supported ())
                        static_data [i] = g_malloc0 (static_data_size [i]);
                else
                        static_data [i] = mono_gc_alloc_fixed (static_data_size [i], NULL);
@@ -3547,7 +3617,7 @@ mono_alloc_static_data (gpointer **static_data_ptr, guint32 offset, gboolean thr
 }
 
 static void 
-mono_free_static_data (gpointer* static_data, gboolean threadlocal)
+mono_free_static_data (gpointer* static_data)
 {
        int i;
        for (i = 1; i < NUM_STATIC_DATA_IDX; ++i) {
@@ -3558,12 +3628,12 @@ mono_free_static_data (gpointer* static_data, gboolean threadlocal)
                 * At this point, the static data pointer array is still registered with the
                 * GC, so must ensure that mark_tls_slots() will not encounter any invalid
                 * data.  Freeing the individual arrays without first nulling their slots
-                * would make it possible for mark_tls_slots() to encounter a pointer to
+                * would make it possible for mark_tls/ctx_slots() to encounter a pointer to
                 * such an already freed array.  See bug #13813.
                 */
                static_data [i] = NULL;
                mono_memory_write_barrier ();
-               if (mono_gc_user_markers_supported () && threadlocal)
+               if (mono_gc_user_markers_supported ())
                        g_free (p);
                else
                        mono_gc_free_fixed (p);
@@ -3592,8 +3662,6 @@ static void mono_init_static_data_info (StaticDataInfo *static_data)
 static guint32
 mono_alloc_static_data_slot (StaticDataInfo *static_data, guint32 size, guint32 align)
 {
-       guint32 offset;
-
        if (!static_data->idx && !static_data->offset) {
                /* 
                 * we use the first chunk of the first allocation also as
@@ -3609,7 +3677,7 @@ mono_alloc_static_data_slot (StaticDataInfo *static_data, guint32 size, guint32
                g_assert (static_data->idx < NUM_STATIC_DATA_IDX);
                static_data->offset = 0;
        }
-       offset = static_data->offset | ((static_data->idx + 1) << 24);
+       guint32 offset = MAKE_SPECIAL_STATIC_OFFSET (static_data->idx, static_data->offset, 0);
        static_data->offset += size;
        return offset;
 }
@@ -3621,17 +3689,31 @@ mono_alloc_static_data_slot (StaticDataInfo *static_data, guint32 size, guint32
 static void
 thread_adjust_static_data (MonoInternalThread *thread)
 {
-       guint32 offset;
-
        mono_threads_lock ();
        if (thread_static_info.offset || thread_static_info.idx > 0) {
                /* get the current allocated size */
-               offset = thread_static_info.offset | ((thread_static_info.idx + 1) << 24);
-               mono_alloc_static_data (&(thread->static_data), offset, TRUE);
+               guint32 offset = MAKE_SPECIAL_STATIC_OFFSET (thread_static_info.idx, thread_static_info.offset, 0);
+               mono_alloc_static_data (&thread->static_data, offset, TRUE);
        }
        mono_threads_unlock ();
 }
 
+static void
+context_adjust_static_data (MonoAppContext *ctx)
+{
+       mono_threads_lock ();
+
+       if (context_static_info.offset || context_static_info.idx > 0) {
+               guint32 offset = MAKE_SPECIAL_STATIC_OFFSET (context_static_info.idx, context_static_info.offset, 0);
+               mono_alloc_static_data (&ctx->static_data, offset, FALSE);
+       }
+
+       mono_threads_unlock ();
+}
+
+/*
+ * LOCKING: requires that threads_mutex is held
+ */
 static void 
 alloc_thread_static_data_helper (gpointer key, gpointer value, gpointer user)
 {
@@ -3641,11 +3723,30 @@ alloc_thread_static_data_helper (gpointer key, gpointer value, gpointer user)
        mono_alloc_static_data (&(thread->static_data), offset, TRUE);
 }
 
-static MonoThreadDomainTls*
-search_tls_slot_in_freelist (StaticDataInfo *static_data, guint32 size, guint32 align)
+/*
+ * LOCKING: requires that threads_mutex is held
+ */
+static void
+alloc_context_static_data_helper (gpointer key, gpointer value, gpointer user)
+{
+       uint32_t gch = GPOINTER_TO_INT (key);
+       MonoAppContext *ctx = (MonoAppContext *) mono_gchandle_get_target (gch);
+
+       if (!ctx) {
+               g_hash_table_remove (contexts, key);
+               mono_gchandle_free (gch);
+               return;
+       }
+
+       guint32 offset = GPOINTER_TO_UINT (user);
+       mono_alloc_static_data (&ctx->static_data, offset, FALSE);
+}
+
+static StaticDataFreeList*
+search_slot_in_freelist (StaticDataInfo *static_data, guint32 size, guint32 align)
 {
-       MonoThreadDomainTls* prev = NULL;
-       MonoThreadDomainTls* tmp = static_data->freelist;
+       StaticDataFreeList* prev = NULL;
+       StaticDataFreeList* tmp = static_data->freelist;
        while (tmp) {
                if (tmp->size == size) {
                        if (prev)
@@ -3667,100 +3768,88 @@ search_tls_slot_in_freelist (StaticDataInfo *static_data, guint32 size, guint32
 #endif
 
 static void
-update_tls_reference_bitmap (guint32 offset, uintptr_t *bitmap, int numbits)
-{
-       int i;
-       int idx = (offset >> 24) - 1;
-       uintptr_t *rb;
-       if (!static_reference_bitmaps [idx])
-               static_reference_bitmaps [idx] = g_new0 (uintptr_t, 1 + static_data_size [idx] / sizeof(gpointer) / (sizeof(uintptr_t) * 8));
-       rb = static_reference_bitmaps [idx];
-       offset &= 0xffffff;
-       offset /= sizeof (gpointer);
+update_reference_bitmap (MonoBitSet **sets, guint32 offset, uintptr_t *bitmap, int numbits)
+{
+       int idx = ACCESS_SPECIAL_STATIC_OFFSET (offset, index);
+       if (!sets [idx])
+               sets [idx] = mono_bitset_new (static_data_size [idx] / sizeof (uintptr_t), 0);
+       MonoBitSet *rb = sets [idx];
+       offset = ACCESS_SPECIAL_STATIC_OFFSET (offset, offset);
+       offset /= sizeof (uintptr_t);
        /* offset is now the bitmap offset */
-       for (i = 0; i < numbits; ++i) {
+       for (int i = 0; i < numbits; ++i) {
                if (bitmap [i / sizeof (uintptr_t)] & (ONE_P << (i & (sizeof (uintptr_t) * 8 -1))))
-                       rb [(offset + i) / (sizeof (uintptr_t) * 8)] |= (ONE_P << ((offset + i) & (sizeof (uintptr_t) * 8 -1)));
+                       mono_bitset_set_fast (rb, offset + i);
        }
 }
 
 static void
-clear_reference_bitmap (guint32 offset, guint32 size)
-{
-       int idx = (offset >> 24) - 1;
-       uintptr_t *rb;
-       rb = static_reference_bitmaps [idx];
-       offset &= 0xffffff;
-       offset /= sizeof (gpointer);
-       size /= sizeof (gpointer);
-       size += offset;
+clear_reference_bitmap (MonoBitSet **sets, guint32 offset, guint32 size)
+{
+       int idx = ACCESS_SPECIAL_STATIC_OFFSET (offset, index);
+       MonoBitSet *rb = sets [idx];
+       offset = ACCESS_SPECIAL_STATIC_OFFSET (offset, offset);
+       offset /= sizeof (uintptr_t);
        /* offset is now the bitmap offset */
-       for (; offset < size; ++offset)
-               rb [offset / (sizeof (uintptr_t) * 8)] &= ~(1L << (offset & (sizeof (uintptr_t) * 8 -1)));
+       for (int i = 0; i < size / sizeof (uintptr_t); i++)
+               mono_bitset_clear_fast (rb, offset + i);
 }
 
-/*
- * The offset for a special static variable is composed of three parts:
- * a bit that indicates the type of static data (0:thread, 1:context),
- * an index in the array of chunks of memory for the thread (thread->static_data)
- * and an offset in that chunk of mem. This allows allocating less memory in the 
- * common case.
- */
-
 guint32
 mono_alloc_special_static_data (guint32 static_type, guint32 size, guint32 align, uintptr_t *bitmap, int numbits)
 {
+       g_assert (static_type == SPECIAL_STATIC_THREAD || static_type == SPECIAL_STATIC_CONTEXT);
+
+       StaticDataInfo *info;
+       MonoBitSet **sets;
+
+       if (static_type == SPECIAL_STATIC_THREAD) {
+               info = &thread_static_info;
+               sets = thread_reference_bitmaps;
+       } else {
+               info = &context_static_info;
+               sets = context_reference_bitmaps;
+       }
+
+       mono_threads_lock ();
+
+       StaticDataFreeList *item = search_slot_in_freelist (info, size, align);
        guint32 offset;
+
+       if (item) {
+               offset = item->offset;
+               g_free (item);
+       } else {
+               offset = mono_alloc_static_data_slot (info, size, align);
+       }
+
+       update_reference_bitmap (sets, offset, bitmap, numbits);
+
        if (static_type == SPECIAL_STATIC_THREAD) {
-               MonoThreadDomainTls *item;
-               mono_threads_lock ();
-               item = search_tls_slot_in_freelist (&thread_static_info, size, align);
-               /*g_print ("TLS alloc: %d in domain %p (total: %d), cached: %p\n", size, mono_domain_get (), thread_static_info.offset, item);*/
-               if (item) {
-                       offset = item->offset;
-                       g_free (item);
-               } else {
-                       offset = mono_alloc_static_data_slot (&thread_static_info, size, align);
-               }
-               update_tls_reference_bitmap (offset, bitmap, numbits);
                /* This can be called during startup */
                if (threads != NULL)
                        mono_g_hash_table_foreach (threads, alloc_thread_static_data_helper, GUINT_TO_POINTER (offset));
-               mono_threads_unlock ();
        } else {
-               g_assert (static_type == SPECIAL_STATIC_CONTEXT);
-               mono_contexts_lock ();
-               offset = mono_alloc_static_data_slot (&context_static_info, size, align);
-               mono_contexts_unlock ();
-               offset |= 0x80000000;   /* Set the high bit to indicate context static data */
+               if (contexts != NULL)
+                       g_hash_table_foreach (contexts, alloc_context_static_data_helper, GUINT_TO_POINTER (offset));
+
+               ACCESS_SPECIAL_STATIC_OFFSET (offset, type) = SPECIAL_STATIC_OFFSET_TYPE_CONTEXT;
        }
+
+       mono_threads_unlock ();
+
        return offset;
 }
 
 gpointer
 mono_get_special_static_data_for_thread (MonoInternalThread *thread, guint32 offset)
 {
-       /* The high bit means either thread (0) or static (1) data. */
+       guint32 static_type = ACCESS_SPECIAL_STATIC_OFFSET (offset, type);
 
-       guint32 static_type = (offset & 0x80000000);
-       int idx;
-
-       offset &= 0x7fffffff;
-       idx = (offset >> 24) - 1;
-
-       if (static_type == 0) {
+       if (static_type == SPECIAL_STATIC_OFFSET_TYPE_THREAD) {
                return get_thread_static_data (thread, offset);
        } else {
-               /* Allocate static data block under demand, since we don't have a list
-               // of contexts
-               */
-               MonoAppContext *context = mono_context_get ();
-               if (!context->static_data || !context->static_data [idx]) {
-                       mono_contexts_lock ();
-                       mono_alloc_static_data (&(context->static_data), offset, FALSE);
-                       mono_contexts_unlock ();
-               }
-               return ((char*) context->static_data [idx]) + (offset & 0xffffff);      
+               return get_context_static_data (thread->current_appcontext, offset);
        }
 }
 
@@ -3773,47 +3862,90 @@ mono_get_special_static_data (guint32 offset)
 typedef struct {
        guint32 offset;
        guint32 size;
-} TlsOffsetSize;
+} OffsetSize;
 
+/*
+ * LOCKING: requires that threads_mutex is held
+ */
 static void 
 free_thread_static_data_helper (gpointer key, gpointer value, gpointer user)
 {
        MonoInternalThread *thread = value;
-       TlsOffsetSize *data = user;
-       int idx = (data->offset >> 24) - 1;
+       OffsetSize *data = user;
+       int idx = ACCESS_SPECIAL_STATIC_OFFSET (data->offset, index);
+       int off = ACCESS_SPECIAL_STATIC_OFFSET (data->offset, offset);
        char *ptr;
 
        if (!thread->static_data || !thread->static_data [idx])
                return;
-       ptr = ((char*) thread->static_data [idx]) + (data->offset & 0xffffff);
+       ptr = ((char*) thread->static_data [idx]) + off;
+       mono_gc_bzero_atomic (ptr, data->size);
+}
+
+/*
+ * LOCKING: requires that threads_mutex is held
+ */
+static void
+free_context_static_data_helper (gpointer key, gpointer value, gpointer user)
+{
+       uint32_t gch = GPOINTER_TO_INT (key);
+       MonoAppContext *ctx = (MonoAppContext *) mono_gchandle_get_target (gch);
+
+       if (!ctx) {
+               g_hash_table_remove (contexts, key);
+               mono_gchandle_free (gch);
+               return;
+       }
+
+       OffsetSize *data = user;
+       int idx = ACCESS_SPECIAL_STATIC_OFFSET (data->offset, index);
+       int off = ACCESS_SPECIAL_STATIC_OFFSET (data->offset, offset);
+       char *ptr;
+
+       if (!ctx->static_data || !ctx->static_data [idx])
+               return;
+
+       ptr = ((char*) ctx->static_data [idx]) + off;
        mono_gc_bzero_atomic (ptr, data->size);
 }
 
 static void
 do_free_special_slot (guint32 offset, guint32 size)
 {
-       guint32 static_type = (offset & 0x80000000);
-       /*g_print ("free %s , size: %d, offset: %x\n", field->name, size, offset);*/
-       if (static_type == 0) {
-               TlsOffsetSize data;
-               MonoThreadDomainTls *item = g_new0 (MonoThreadDomainTls, 1);
-               data.offset = offset & 0x7fffffff;
-               data.size = size;
-               clear_reference_bitmap (data.offset, data.size);
+       guint32 static_type = ACCESS_SPECIAL_STATIC_OFFSET (offset, type);
+       MonoBitSet **sets;
+       StaticDataInfo *info;
+
+       if (static_type == SPECIAL_STATIC_OFFSET_TYPE_THREAD) {
+               info = &thread_static_info;
+               sets = thread_reference_bitmaps;
+       } else {
+               info = &context_static_info;
+               sets = context_reference_bitmaps;
+       }
+
+       guint32 data_offset = offset;
+       ACCESS_SPECIAL_STATIC_OFFSET (data_offset, type) = 0;
+       OffsetSize data = { data_offset, size };
+
+       clear_reference_bitmap (sets, data.offset, data.size);
+
+       if (static_type == SPECIAL_STATIC_OFFSET_TYPE_THREAD) {
                if (threads != NULL)
                        mono_g_hash_table_foreach (threads, free_thread_static_data_helper, &data);
+       } else {
+               if (contexts != NULL)
+                       g_hash_table_foreach (contexts, free_context_static_data_helper, &data);
+       }
+
+       if (!mono_runtime_is_shutting_down ()) {
+               StaticDataFreeList *item = g_new0 (StaticDataFreeList, 1);
+
                item->offset = offset;
                item->size = size;
 
-               if (!mono_runtime_is_shutting_down ()) {
-                       item->next = thread_static_info.freelist;
-                       thread_static_info.freelist = item;
-               } else {
-                       /* We could be called during shutdown after mono_thread_cleanup () is called */
-                       g_free (item);
-               }
-       } else {
-               /* FIXME: free context static data as well */
+               item->next = info->freelist;
+               info->freelist = item;
        }
 }
 
@@ -3832,13 +3964,18 @@ void
 mono_alloc_special_static_data_free (GHashTable *special_static_fields)
 {
        mono_threads_lock ();
+
        g_hash_table_foreach (special_static_fields, do_free_special, NULL);
+
        mono_threads_unlock ();
 }
 
-void
+static void
 mono_special_static_data_free_slot (guint32 offset, guint32 size)
 {
+       /* Only ever called for ThreadLocal instances */
+       g_assert (ACCESS_SPECIAL_STATIC_OFFSET (offset, type) == SPECIAL_STATIC_OFFSET_TYPE_THREAD);
+
        mono_threads_lock ();
        do_free_special_slot (offset, size);
        mono_threads_unlock ();
index 97778f136c4990a5109eb5d833ebf7b7374bea61..cf80a74070f7288e5974752117cdf0ab12ca7351 100644 (file)
@@ -360,52 +360,52 @@ report_loader_error (MonoAotCompile *acfg, MonoError *error, const char *format,
 static inline void
 emit_section_change (MonoAotCompile *acfg, const char *section_name, int subsection_index)
 {
-       img_writer_emit_section_change (acfg->w, section_name, subsection_index);
+       mono_img_writer_emit_section_change (acfg->w, section_name, subsection_index);
 }
 
 static inline void
 emit_local_symbol (MonoAotCompile *acfg, const char *name, const char *end_label, gboolean func) 
 { 
-       img_writer_emit_local_symbol (acfg->w, name, end_label, func); 
+       mono_img_writer_emit_local_symbol (acfg->w, name, end_label, func); 
 }
 
 static inline void
 emit_label (MonoAotCompile *acfg, const char *name) 
 { 
-       img_writer_emit_label (acfg->w, name); 
+       mono_img_writer_emit_label (acfg->w, name); 
 }
 
 static inline void
 emit_bytes (MonoAotCompile *acfg, const guint8* buf, int size) 
 { 
-       img_writer_emit_bytes (acfg->w, buf, size); 
+       mono_img_writer_emit_bytes (acfg->w, buf, size); 
 }
 
 static inline void
 emit_string (MonoAotCompile *acfg, const char *value) 
 { 
-       img_writer_emit_string (acfg->w, value); 
+       mono_img_writer_emit_string (acfg->w, value); 
 }
 
 static inline void
 emit_line (MonoAotCompile *acfg) 
 { 
-       img_writer_emit_line (acfg->w); 
+       mono_img_writer_emit_line (acfg->w); 
 }
 
 static inline void
 emit_alignment (MonoAotCompile *acfg, int size)
 { 
-       img_writer_emit_alignment (acfg->w, size);
+       mono_img_writer_emit_alignment (acfg->w, size);
 }
 
 static inline void
 emit_alignment_code (MonoAotCompile *acfg, int size)
 {
        if (acfg->align_pad_value)
-               img_writer_emit_alignment_fill (acfg->w, size, acfg->align_pad_value);
+               mono_img_writer_emit_alignment_fill (acfg->w, size, acfg->align_pad_value);
        else
-               img_writer_emit_alignment (acfg->w, size);
+               mono_img_writer_emit_alignment (acfg->w, size);
 }
 
 static inline void
@@ -432,7 +432,7 @@ emit_padding (MonoAotCompile *acfg, int size)
 static inline void
 emit_pointer (MonoAotCompile *acfg, const char *target) 
 { 
-       img_writer_emit_pointer (acfg->w, target); 
+       mono_img_writer_emit_pointer (acfg->w, target); 
 }
 
 static inline void
@@ -440,55 +440,55 @@ emit_pointer_2 (MonoAotCompile *acfg, const char *prefix, const char *target)
 { 
        if (prefix [0] != '\0') {
                char *s = g_strdup_printf ("%s%s", prefix, target);
-               img_writer_emit_pointer (acfg->w, s);
+               mono_img_writer_emit_pointer (acfg->w, s);
                g_free (s);
        } else {
-               img_writer_emit_pointer (acfg->w, target);
+               mono_img_writer_emit_pointer (acfg->w, target);
        }
 }
 
 static inline void
 emit_int16 (MonoAotCompile *acfg, int value) 
 { 
-       img_writer_emit_int16 (acfg->w, value); 
+       mono_img_writer_emit_int16 (acfg->w, value); 
 }
 
 static inline void
 emit_int32 (MonoAotCompile *acfg, int value) 
 { 
-       img_writer_emit_int32 (acfg->w, value); 
+       mono_img_writer_emit_int32 (acfg->w, value); 
 }
 
 static inline void
 emit_symbol_diff (MonoAotCompile *acfg, const char *end, const char* start, int offset) 
 { 
-       img_writer_emit_symbol_diff (acfg->w, end, start, offset); 
+       mono_img_writer_emit_symbol_diff (acfg->w, end, start, offset); 
 }
 
 static inline void
 emit_zero_bytes (MonoAotCompile *acfg, int num) 
 { 
-       img_writer_emit_zero_bytes (acfg->w, num); 
+       mono_img_writer_emit_zero_bytes (acfg->w, num); 
 }
 
 static inline void
 emit_byte (MonoAotCompile *acfg, guint8 val) 
 { 
-       img_writer_emit_byte (acfg->w, val); 
+       mono_img_writer_emit_byte (acfg->w, val); 
 }
 
 #ifdef __native_client_codegen__
 static inline void
 emit_nacl_call_alignment (MonoAotCompile *acfg)
 {
-       img_writer_emit_nacl_call_alignment (acfg->w);
+       mono_img_writer_emit_nacl_call_alignment (acfg->w);
 }
 #endif
 
 static G_GNUC_UNUSED void
 emit_global_inner (MonoAotCompile *acfg, const char *name, gboolean func)
 {
-       img_writer_emit_global (acfg->w, name, func);
+       mono_img_writer_emit_global (acfg->w, name, func);
 }
 
 static void
@@ -496,28 +496,28 @@ emit_global (MonoAotCompile *acfg, const char *name, gboolean func)
 {
        if (acfg->aot_opts.no_dlsym) {
                g_ptr_array_add (acfg->globals, g_strdup (name));
-               img_writer_emit_local_symbol (acfg->w, name, NULL, func);
+               mono_img_writer_emit_local_symbol (acfg->w, name, NULL, func);
        } else {
-               img_writer_emit_global (acfg->w, name, func);
+               mono_img_writer_emit_global (acfg->w, name, func);
        }
 }
 
 static void
 emit_symbol_size (MonoAotCompile *acfg, const char *name, const char *end_label)
 {
-       img_writer_emit_symbol_size (acfg->w, name, end_label);
+       mono_img_writer_emit_symbol_size (acfg->w, name, end_label);
 }
 
 static void
 emit_string_symbol (MonoAotCompile *acfg, const char *name, const char *value)
 {
-       img_writer_emit_section_change (acfg->w, RODATA_SECT, 1);
+       mono_img_writer_emit_section_change (acfg->w, RODATA_SECT, 1);
 #ifdef TARGET_MACH
        /* On apple, all symbols need to be aligned to avoid warnings from ld */
        emit_alignment (acfg, 4);
 #endif
-       img_writer_emit_label (acfg->w, name);
-       img_writer_emit_string (acfg->w, value);
+       mono_img_writer_emit_label (acfg->w, name);
+       mono_img_writer_emit_string (acfg->w, value);
 }
 
 static G_GNUC_UNUSED void
@@ -610,7 +610,7 @@ encode_sleb128 (gint32 value, guint8 *buf, guint8 **endbuf)
 static void
 emit_unset_mode (MonoAotCompile *acfg)
 {
-       img_writer_emit_unset_mode (acfg->w);
+       mono_img_writer_emit_unset_mode (acfg->w);
 }
 
 static G_GNUC_UNUSED void
@@ -816,7 +816,7 @@ arch_emit_direct_call (MonoAotCompile *acfg, const char *target, gboolean extern
                code = buf;
                ARM_BL (code, 0);
 
-               img_writer_emit_reloc (acfg->w, R_ARM_CALL, target, -8);
+               mono_img_writer_emit_reloc (acfg->w, R_ARM_CALL, target, -8);
                emit_bytes (acfg, buf, 4);
        } else {
                emit_unset_mode (acfg);
@@ -998,7 +998,7 @@ arch_emit_objc_selector_ref (MonoAotCompile *acfg, guint8 *code, int index, int
        sprintf (symbol2, "L_OBJC_SELECTOR_REFERENCES_%d", index);
 
        emit_label (acfg, symbol1);
-       img_writer_emit_unset_mode (acfg->w);
+       mono_img_writer_emit_unset_mode (acfg->w);
        fprintf (acfg->fp, ".long %s-(%s+12)", symbol2, symbol1);
 
        *code_size = 12;
@@ -1593,7 +1593,7 @@ arch_emit_unbox_trampoline (MonoAotCompile *acfg, MonoCompile *cfg, MonoMethod *
                code = buf;
                ARM_B (code, 0);
 
-               img_writer_emit_reloc (acfg->w, R_ARM_JUMP24, call_target, -8);
+               mono_img_writer_emit_reloc (acfg->w, R_ARM_JUMP24, call_target, -8);
                emit_bytes (acfg, buf, 4);
        } else {
                if (acfg->thumb_mixed && cfg->compile_llvm)
@@ -5471,7 +5471,7 @@ emit_exception_debug_info (MonoAotCompile *acfg, MonoCompile *cfg, gboolean stor
        }
 
        seq_points = cfg->seq_point_info;
-       seq_points_size = (store_seq_points)? seq_point_info_get_write_size (seq_points) : 0;
+       seq_points_size = (store_seq_points)? mono_seq_point_info_get_write_size (seq_points) : 0;
 
        buf_size = header->num_clauses * 256 + debug_info_size + 2048 + seq_points_size + cfg->gc_map_size;
 
@@ -5685,7 +5685,7 @@ emit_exception_debug_info (MonoAotCompile *acfg, MonoCompile *cfg, gboolean stor
        }
 
        if (seq_points_size)
-               p += seq_point_info_write (seq_points, p);
+               p += mono_seq_point_info_write (seq_points, p);
 
        g_assert (debug_info_size < buf_size);
 
@@ -7932,10 +7932,10 @@ emit_exception_info (MonoAotCompile *acfg)
 
                        if (method_seq_points_to_file) {
                                if (!seq_points_to_file) {
-                                       seq_point_data_init (&sp_data, acfg->nmethods);
+                                       mono_seq_point_data_init (&sp_data, acfg->nmethods);
                                        seq_points_to_file = TRUE;
                                }
-                               seq_point_data_add (&sp_data, cfg->method->token, cfg->method_index, cfg->seq_point_info);
+                               mono_seq_point_data_add (&sp_data, cfg->method->token, cfg->method_index, cfg->seq_point_info);
                        }
                } else {
                        offsets [i] = 0;
@@ -7945,8 +7945,8 @@ emit_exception_info (MonoAotCompile *acfg)
        if (seq_points_to_file) {
                char *seq_points_aot_file;
                mono_image_get_aot_seq_point_path (acfg->image, &seq_points_aot_file);
-               seq_point_data_write (&sp_data, seq_points_aot_file);
-               seq_point_data_free (&sp_data);
+               mono_seq_point_data_write (&sp_data, seq_points_aot_file);
+               mono_seq_point_data_free (&sp_data);
                g_free (seq_points_aot_file);
        }
 
@@ -8578,7 +8578,7 @@ emit_objc_selectors (MonoAotCompile *acfg)
         * EOF
         */
 
-       img_writer_emit_unset_mode (acfg->w);
+       mono_img_writer_emit_unset_mode (acfg->w);
        g_assert (acfg->fp);
        fprintf (acfg->fp, ".section    __DATA,__objc_selrefs,literal_pointers,no_dead_strip\n");
        fprintf (acfg->fp, ".align      3\n");
@@ -9022,7 +9022,7 @@ acfg_free (MonoAotCompile *acfg)
 {
        int i;
 
-       img_writer_destroy (acfg->w);
+       mono_img_writer_destroy (acfg->w);
        for (i = 0; i < acfg->nmethods; ++i)
                if (acfg->cfgs [i])
                        g_free (acfg->cfgs [i]);
@@ -9080,14 +9080,14 @@ static void aot_dump (MonoAotCompile *acfg)
        char * dumpname;
 
        JsonWriter writer;
-       json_writer_init (&writer);
+       mono_json_writer_init (&writer);
 
-       json_writer_object_begin(&writer);
+       mono_json_writer_object_begin(&writer);
 
        // Methods
-       json_writer_indent (&writer);
-       json_writer_object_key(&writer, "methods");
-       json_writer_array_begin (&writer);
+       mono_json_writer_indent (&writer);
+       mono_json_writer_object_key(&writer, "methods");
+       mono_json_writer_array_begin (&writer);
 
        int i;
        for (i = 0; i < acfg->nmethods; ++i) {
@@ -9101,53 +9101,53 @@ static void aot_dump (MonoAotCompile *acfg)
 
                method = cfg->orig_method;
 
-               json_writer_indent (&writer);
-               json_writer_object_begin(&writer);
+               mono_json_writer_indent (&writer);
+               mono_json_writer_object_begin(&writer);
 
-               json_writer_indent (&writer);
-               json_writer_object_key(&writer, "name");
-               json_writer_printf (&writer, "\"%s\",\n", method->name);
+               mono_json_writer_indent (&writer);
+               mono_json_writer_object_key(&writer, "name");
+               mono_json_writer_printf (&writer, "\"%s\",\n", method->name);
 
-               json_writer_indent (&writer);
-               json_writer_object_key(&writer, "signature");
-               json_writer_printf (&writer, "\"%s\",\n", mono_method_full_name (method,
+               mono_json_writer_indent (&writer);
+               mono_json_writer_object_key(&writer, "signature");
+               mono_json_writer_printf (&writer, "\"%s\",\n", mono_method_full_name (method,
                        /*signature=*/TRUE));
 
-               json_writer_indent (&writer);
-               json_writer_object_key(&writer, "code_size");
-               json_writer_printf (&writer, "\"%d\",\n", cfg->code_size);
+               mono_json_writer_indent (&writer);
+               mono_json_writer_object_key(&writer, "code_size");
+               mono_json_writer_printf (&writer, "\"%d\",\n", cfg->code_size);
 
                klass = method->klass;
 
-               json_writer_indent (&writer);
-               json_writer_object_key(&writer, "class");
-               json_writer_printf (&writer, "\"%s\",\n", klass->name);
+               mono_json_writer_indent (&writer);
+               mono_json_writer_object_key(&writer, "class");
+               mono_json_writer_printf (&writer, "\"%s\",\n", klass->name);
 
-               json_writer_indent (&writer);
-               json_writer_object_key(&writer, "namespace");
-               json_writer_printf (&writer, "\"%s\",\n", klass->name_space);
+               mono_json_writer_indent (&writer);
+               mono_json_writer_object_key(&writer, "namespace");
+               mono_json_writer_printf (&writer, "\"%s\",\n", klass->name_space);
 
-               json_writer_indent (&writer);
-               json_writer_object_key(&writer, "wrapper_type");
-               json_writer_printf (&writer, "\"%s\",\n", get_wrapper_type_name(method->wrapper_type));
+               mono_json_writer_indent (&writer);
+               mono_json_writer_object_key(&writer, "wrapper_type");
+               mono_json_writer_printf (&writer, "\"%s\",\n", get_wrapper_type_name(method->wrapper_type));
 
-               json_writer_indent_pop (&writer);
-               json_writer_indent (&writer);
-               json_writer_object_end (&writer);
-               json_writer_printf (&writer, ",\n");
+               mono_json_writer_indent_pop (&writer);
+               mono_json_writer_indent (&writer);
+               mono_json_writer_object_end (&writer);
+               mono_json_writer_printf (&writer, ",\n");
        }
 
-       json_writer_indent_pop (&writer);
-       json_writer_indent (&writer);
-       json_writer_array_end (&writer);
-       json_writer_printf (&writer, ",\n");
+       mono_json_writer_indent_pop (&writer);
+       mono_json_writer_indent (&writer);
+       mono_json_writer_array_end (&writer);
+       mono_json_writer_printf (&writer, ",\n");
 
        // PLT entries
 #ifdef DUMP_PLT
-       json_writer_indent_push (&writer);
-       json_writer_indent (&writer);
-       json_writer_object_key(&writer, "plt");
-       json_writer_array_begin (&writer);
+       mono_json_writer_indent_push (&writer);
+       mono_json_writer_indent (&writer);
+       mono_json_writer_object_key(&writer, "plt");
+       mono_json_writer_array_begin (&writer);
 
        for (i = 0; i < acfg->plt_offset; ++i) {
                MonoPltEntry *plt_entry = NULL;
@@ -9162,44 +9162,44 @@ static void aot_dump (MonoAotCompile *acfg)
                plt_entry = g_hash_table_lookup (acfg->plt_offset_to_entry, GUINT_TO_POINTER (i));
                ji = plt_entry->ji;
 
-               json_writer_indent (&writer);
-               json_writer_printf (&writer, "{ ");
-               json_writer_object_key(&writer, "symbol");
-               json_writer_printf (&writer, "\"%s\" },\n", plt_entry->symbol);
+               mono_json_writer_indent (&writer);
+               mono_json_writer_printf (&writer, "{ ");
+               mono_json_writer_object_key(&writer, "symbol");
+               mono_json_writer_printf (&writer, "\"%s\" },\n", plt_entry->symbol);
        }
 
-       json_writer_indent_pop (&writer);
-       json_writer_indent (&writer);
-       json_writer_array_end (&writer);
-       json_writer_printf (&writer, ",\n");
+       mono_json_writer_indent_pop (&writer);
+       mono_json_writer_indent (&writer);
+       mono_json_writer_array_end (&writer);
+       mono_json_writer_printf (&writer, ",\n");
 #endif
 
        // GOT entries
 #ifdef DUMP_GOT
-       json_writer_indent_push (&writer);
-       json_writer_indent (&writer);
-       json_writer_object_key(&writer, "got");
-       json_writer_array_begin (&writer);
+       mono_json_writer_indent_push (&writer);
+       mono_json_writer_indent (&writer);
+       mono_json_writer_object_key(&writer, "got");
+       mono_json_writer_array_begin (&writer);
 
-       json_writer_indent_push (&writer);
+       mono_json_writer_indent_push (&writer);
        for (i = 0; i < acfg->got_info.got_patches->len; ++i) {
                MonoJumpInfo *ji = g_ptr_array_index (acfg->got_info.got_patches, i);
 
-               json_writer_indent (&writer);
-               json_writer_printf (&writer, "{ ");
-               json_writer_object_key(&writer, "patch_name");
-               json_writer_printf (&writer, "\"%s\" },\n", get_patch_name (ji->type));
+               mono_json_writer_indent (&writer);
+               mono_json_writer_printf (&writer, "{ ");
+               mono_json_writer_object_key(&writer, "patch_name");
+               mono_json_writer_printf (&writer, "\"%s\" },\n", get_patch_name (ji->type));
        }
 
-       json_writer_indent_pop (&writer);
-       json_writer_indent (&writer);
-       json_writer_array_end (&writer);
-       json_writer_printf (&writer, ",\n");
+       mono_json_writer_indent_pop (&writer);
+       mono_json_writer_indent (&writer);
+       mono_json_writer_array_end (&writer);
+       mono_json_writer_printf (&writer, ",\n");
 #endif
 
-       json_writer_indent_pop (&writer);
-       json_writer_indent (&writer);
-       json_writer_object_end (&writer);
+       mono_json_writer_indent_pop (&writer);
+       mono_json_writer_indent (&writer);
+       mono_json_writer_object_end (&writer);
 
        dumpname = g_strdup_printf ("%s.json", g_path_get_basename (acfg->image->name));
        dumpfile = fopen (dumpname, "w+");
@@ -9208,7 +9208,7 @@ static void aot_dump (MonoAotCompile *acfg)
        fprintf (dumpfile, "%s", writer.text->str);
        fclose (dumpfile);
 
-       json_writer_destroy (&writer);
+       mono_json_writer_destroy (&writer);
 }
 
 int
@@ -9333,7 +9333,7 @@ mono_compile_assembly (MonoAssembly *ass, guint32 opts, const char *aot_options)
                acfg->num_trampolines [MONO_AOT_TRAMP_GSHAREDVT_ARG] = acfg->aot_opts.full_aot ? acfg->aot_opts.ngsharedvt_arg_trampolines : 0;
 #endif
 
-       acfg->temp_prefix = img_writer_get_temp_label_prefix (NULL);
+       acfg->temp_prefix = mono_img_writer_get_temp_label_prefix (NULL);
 
        arch_init (acfg);
 
@@ -9447,7 +9447,7 @@ mono_compile_assembly (MonoAssembly *ass, guint32 opts, const char *aot_options)
        }
 #endif
 
-       if (!acfg->aot_opts.asm_only && !acfg->aot_opts.asm_writer && bin_writer_supported ()) {
+       if (!acfg->aot_opts.asm_only && !acfg->aot_opts.asm_writer && mono_bin_writer_supported ()) {
                if (acfg->aot_opts.outfile)
                        outfile_name = g_strdup_printf ("%s", acfg->aot_opts.outfile);
                else
@@ -9465,7 +9465,7 @@ mono_compile_assembly (MonoAssembly *ass, guint32 opts, const char *aot_options)
                        return 1;
                }
 
-               acfg->w = img_writer_create (acfg->fp, TRUE);
+               acfg->w = mono_img_writer_create (acfg->fp, TRUE);
                acfg->use_bin_writer = TRUE;
        } else {
                if (acfg->aot_opts.asm_only) {
@@ -9482,7 +9482,7 @@ mono_compile_assembly (MonoAssembly *ass, guint32 opts, const char *aot_options)
                        aot_printerrf (acfg, "Unable to open file '%s': %s\n", acfg->tmpfname, strerror (errno));
                        return 1;
                }
-               acfg->w = img_writer_create (acfg->fp, FALSE);
+               acfg->w = mono_img_writer_create (acfg->fp, FALSE);
                
                tmp_outfile_name = NULL;
                outfile_name = NULL;
@@ -9521,7 +9521,7 @@ mono_compile_assembly (MonoAssembly *ass, guint32 opts, const char *aot_options)
                acfg->dwarf = mono_dwarf_writer_create (acfg->w, NULL, 0, FALSE, !acfg->gas_line_numbers);
        }
 
-       img_writer_emit_start (acfg->w);
+       mono_img_writer_emit_start (acfg->w);
 
        if (acfg->dwarf)
                mono_dwarf_writer_emit_base_info (acfg->dwarf, g_path_get_basename (acfg->image->name), mono_unwind_get_cie_program ());
@@ -9627,7 +9627,7 @@ mono_compile_assembly (MonoAssembly *ass, guint32 opts, const char *aot_options)
                aot_printf (acfg, "%d methods have other problems (%d%%)\n", acfg->stats.ocount, acfg->stats.mcount ? (acfg->stats.ocount * 100) / acfg->stats.mcount : 100);
 
        TV_GETTIME (atv);
-       res = img_writer_emit_writeout (acfg->w);
+       res = mono_img_writer_emit_writeout (acfg->w);
        if (res != 0) {
                acfg_free (acfg);
                return res;
index a470fdabee63240017e7044470c8b3bf9e6497d0..06f1f5eac70841f0d14ad29f5daab0eff861d41d 100644 (file)
@@ -2846,7 +2846,7 @@ decode_exception_debug_info (MonoAotModule *amodule, MonoDomain *domain,
        if (method && has_seq_points) {
                MonoSeqPointInfo *seq_points;
 
-               p += seq_point_info_read (&seq_points, p, FALSE);
+               p += mono_seq_point_info_read (&seq_points, p, FALSE);
 
                mono_domain_lock (domain);
                g_hash_table_insert (domain_jit_info (domain)->seq_points, method, seq_points);
index 1f3fa95f839800bac201cfb477d756146f45eb6b..4e8edbc8d3e0cd421c415601a46e2fb4f04c7d04 100644 (file)
@@ -354,7 +354,7 @@ icompare_imm: src1:i len:12
 
 long_conv_to_ovf_i4_2: dest:i src1:i src2:i len:36
 
-vcall2: len:64clob:c
+vcall2: len:64 clob:c
 vcall2_reg: src1:i len:64 clob:c
 vcall2_membase: src1:b len:64 clob:c
 dyn_call: src1:i src2:i len:120 clob:c
index 777d1ed73d3c4f0fce8f32d3c5a7bbda2da90cc0..6f5d8b41bcf61f6879976d2dd06c0d59cb599871 100644 (file)
@@ -3089,7 +3089,7 @@ process_frame (StackFrameInfo *info, MonoContext *ctx, gpointer user_data)
        if (info->il_offset == -1) {
                /* mono_debug_il_offset_from_address () doesn't seem to be precise enough (#2092) */
                if (ud->frames == NULL) {
-                       if (find_prev_seq_point_for_native_offset (info->domain, method, info->native_offset, NULL, &sp))
+                       if (mono_find_prev_seq_point_for_native_offset (info->domain, method, info->native_offset, NULL, &sp))
                                info->il_offset = sp.il_offset;
                }
                if (info->il_offset == -1)
@@ -4202,8 +4202,8 @@ insert_breakpoint (MonoSeqPointInfo *seq_points, MonoDomain *domain, MonoJitInfo
        if (error)
                mono_error_init (error);
 
-       seq_point_iterator_init (&it, seq_points);
-       while (seq_point_iterator_next (&it)) {
+       mono_seq_point_iterator_init (&it, seq_points);
+       while (mono_seq_point_iterator_next (&it)) {
                if (it.seq_point.il_offset == bp->il_offset) {
                        it_has_sp = TRUE;
                        break;
@@ -4215,8 +4215,8 @@ insert_breakpoint (MonoSeqPointInfo *seq_points, MonoDomain *domain, MonoJitInfo
                 * The set of IL offsets with seq points doesn't completely match the
                 * info returned by CMD_METHOD_GET_DEBUG_INFO (#407).
                 */
-               seq_point_iterator_init (&it, seq_points);
-               while (seq_point_iterator_next (&it)) {
+               mono_seq_point_iterator_init (&it, seq_points);
+               while (mono_seq_point_iterator_next (&it)) {
                        if (it.seq_point.il_offset != METHOD_ENTRY_IL_OFFSET &&
                                it.seq_point.il_offset != METHOD_EXIT_IL_OFFSET &&
                                it.seq_point.il_offset + 1 == bp->il_offset) {
@@ -4229,8 +4229,8 @@ insert_breakpoint (MonoSeqPointInfo *seq_points, MonoDomain *domain, MonoJitInfo
        if (!it_has_sp) {
                char *s = g_strdup_printf ("Unable to insert breakpoint at %s:%d", mono_method_full_name (jinfo_get_method (ji), TRUE), bp->il_offset);
 
-               seq_point_iterator_init (&it, seq_points);
-               while (seq_point_iterator_next (&it))
+               mono_seq_point_iterator_init (&it, seq_points);
+               while (mono_seq_point_iterator_next (&it))
                        DEBUG_PRINTF (1, "%d\n", it.seq_point.il_offset);
 
                if (error) {
@@ -4688,7 +4688,7 @@ process_breakpoint_inner (DebuggerTlsData *tls, gboolean from_signal)
         * The ip points to the instruction causing the breakpoint event, which is after
         * the offset recorded in the seq point map, so find the prev seq point before ip.
         */
-       found_sp = find_prev_seq_point_for_native_offset (mono_domain_get (), method, native_offset, &info, &sp);
+       found_sp = mono_find_prev_seq_point_for_native_offset (mono_domain_get (), method, native_offset, &info, &sp);
 
        if (!found_sp)
                no_seq_points_found (method);
@@ -4946,7 +4946,7 @@ process_single_step_inner (DebuggerTlsData *tls, gboolean from_signal)
         * The ip points to the instruction causing the single step event, which is before
         * the offset recorded in the seq point map, so find the next seq point after ip.
         */
-       if (!find_next_seq_point_for_native_offset (domain, method, (guint8*)ip - (guint8*)ji->code_start, &info, &sp))
+       if (!mono_find_next_seq_point_for_native_offset (domain, method, (guint8*)ip - (guint8*)ji->code_start, &info, &sp))
                return;
 
        il_offset = sp.il_offset;
@@ -5187,7 +5187,7 @@ ss_start (SingleStepReq *ss_req, MonoMethod *method, SeqPoint* sp, MonoSeqPointI
                                StackFrame *frame = frames [frame_index];
 
                                method = frame->method;
-                               found_sp = find_prev_seq_point_for_native_offset (frame->domain, frame->method, frame->native_offset, &info, &local_sp);
+                               found_sp = mono_find_prev_seq_point_for_native_offset (frame->domain, frame->method, frame->native_offset, &info, &local_sp);
                                sp = (found_sp)? &local_sp : NULL;
                                frame_index ++;
                                if (sp && sp->next_len != 0)
@@ -5202,7 +5202,7 @@ ss_start (SingleStepReq *ss_req, MonoMethod *method, SeqPoint* sp, MonoSeqPointI
                                        StackFrame *frame = frames [frame_index];
 
                                        method = frame->method;
-                                       found_sp = find_prev_seq_point_for_native_offset (frame->domain, frame->method, frame->native_offset, &info, &local_sp);
+                                       found_sp = mono_find_prev_seq_point_for_native_offset (frame->domain, frame->method, frame->native_offset, &info, &local_sp);
                                        sp = (found_sp)? &local_sp : NULL;
                                        if (sp && sp->next_len != 0)
                                                break;
@@ -5215,7 +5215,7 @@ ss_start (SingleStepReq *ss_req, MonoMethod *method, SeqPoint* sp, MonoSeqPointI
                                        StackFrame *frame = frames [frame_index];
 
                                        parent_sp_method = frame->method;
-                                       found_sp = find_prev_seq_point_for_native_offset (frame->domain, frame->method, frame->native_offset, &parent_info, &local_parent_sp);
+                                       found_sp = mono_find_prev_seq_point_for_native_offset (frame->domain, frame->method, frame->native_offset, &parent_info, &local_parent_sp);
                                        parent_sp = found_sp ? &local_parent_sp : NULL;
                                        if (found_sp && parent_sp->next_len != 0)
                                                break;
@@ -5228,7 +5228,7 @@ ss_start (SingleStepReq *ss_req, MonoMethod *method, SeqPoint* sp, MonoSeqPointI
                if (sp && sp->next_len > 0) {
                        SeqPoint* next = g_new(SeqPoint, sp->next_len);
 
-                       seq_point_init_next (info, *sp, next);
+                       mono_seq_point_init_next (info, *sp, next);
                        for (i = 0; i < sp->next_len; i++) {
                                next_sp = &next[i];
 
@@ -5241,7 +5241,7 @@ ss_start (SingleStepReq *ss_req, MonoMethod *method, SeqPoint* sp, MonoSeqPointI
                if (parent_sp) {
                        SeqPoint* next = g_new(SeqPoint, parent_sp->next_len);
 
-                       seq_point_init_next (parent_info, *parent_sp, next);
+                       mono_seq_point_init_next (parent_info, *parent_sp, next);
                        for (i = 0; i < parent_sp->next_len; i++) {
                                next_sp = &next[i];
 
@@ -5275,7 +5275,7 @@ ss_start (SingleStepReq *ss_req, MonoMethod *method, SeqPoint* sp, MonoSeqPointI
                                        for (j = 0; j < jinfo->num_clauses; ++j) {
                                                MonoJitExceptionInfo *ei = &jinfo->clauses [j];
 
-                                               found_sp = find_next_seq_point_for_native_offset (frame->domain, frame->method, (char*)ei->handler_start - (char*)jinfo->code_start, NULL, &local_sp);
+                                               found_sp = mono_find_next_seq_point_for_native_offset (frame->domain, frame->method, (char*)ei->handler_start - (char*)jinfo->code_start, NULL, &local_sp);
                                                sp = (found_sp)? &local_sp : NULL;
                                                if (sp) {
                                                        bp = set_breakpoint (frame->method, sp->il_offset, ss_req->req, NULL);
@@ -5386,7 +5386,7 @@ ss_create (MonoInternalThread *thread, StepSize size, StepDepth depth, StepFilte
                 * Find the seq point corresponding to the landing site ip, which is the first seq
                 * point after ip.
                 */
-               found_sp = find_next_seq_point_for_native_offset (frame.domain, frame.method, frame.native_offset, &info, &local_sp);
+               found_sp = mono_find_next_seq_point_for_native_offset (frame.domain, frame.method, frame.native_offset, &info, &local_sp);
                sp = (found_sp)? &local_sp : NULL;
                if (!sp)
                        no_seq_points_found (frame.method);
@@ -5432,7 +5432,7 @@ ss_create (MonoInternalThread *thread, StepSize size, StepDepth depth, StepFilte
                if (frame) {
                        if (!method && frame->il_offset != -1) {
                                /* FIXME: Sort the table and use a binary search */
-                               found_sp = find_prev_seq_point_for_native_offset (frame->domain, frame->method, frame->native_offset, &info, &local_sp);
+                               found_sp = mono_find_prev_seq_point_for_native_offset (frame->domain, frame->method, frame->native_offset, &info, &local_sp);
                                sp = (found_sp)? &local_sp : NULL;
                                if (!sp)
                                        no_seq_points_found (frame->method);
@@ -8864,7 +8864,7 @@ thread_commands (int command, guint8 *p, guint8 *end, Buffer *buf)
                if (tls->frame_count == 0 || tls->frames [0]->actual_method != method)
                        return ERR_INVALID_ARGUMENT;
 
-               found_sp = find_seq_point (domain, method, il_offset, &seq_points, &sp);
+               found_sp = mono_find_seq_point (domain, method, il_offset, &seq_points, &sp);
 
                g_assert (seq_points);
 
@@ -8951,7 +8951,7 @@ frame_commands (int command, guint8 *p, guint8 *end, Buffer *buf)
 
        sig = mono_method_signature (frame->actual_method);
 
-       if (!get_seq_points (frame->domain, frame->actual_method))
+       if (!mono_get_seq_points (frame->domain, frame->actual_method))
                /*
                 * The method is probably from an aot image compiled without soft-debug, variables might be dead, etc.
                 */
index c7750e189c9c9eec5dd8141f0cccf417f91ea3c6..2a6a56964b2cba43f60c74bc3cb37b705ee9a3a9 100644 (file)
@@ -94,12 +94,12 @@ mono_dwarf_writer_create (MonoImageWriter *writer, FILE *il_file, int il_file_st
        w->appending = appending;
 
        if (appending)
-               g_assert (img_writer_subsections_supported (w->w));
+               g_assert (mono_img_writer_subsections_supported (w->w));
 
        w->emit_line = TRUE;
 
        if (appending) {
-               if (!img_writer_subsections_supported (w->w))
+               if (!mono_img_writer_subsections_supported (w->w))
                        /* Can't emit line number info without subsections */
                        w->emit_line = FALSE;
        } else {
@@ -112,8 +112,8 @@ mono_dwarf_writer_create (MonoImageWriter *writer, FILE *il_file, int il_file_st
                w->collect_line_info = FALSE;
        }
 
-       w->fp = img_writer_get_fp (w->w);
-       w->temp_prefix = img_writer_get_temp_label_prefix (w->w);
+       w->fp = mono_img_writer_get_fp (w->w);
+       w->temp_prefix = mono_img_writer_get_temp_label_prefix (w->w);
 
        w->class_to_die = g_hash_table_new (NULL, NULL);
        w->class_to_vtype_die = g_hash_table_new (NULL, NULL);
@@ -141,85 +141,85 @@ mono_dwarf_writer_get_il_file_line_index (MonoDwarfWriter *w)
 static inline void
 emit_section_change (MonoDwarfWriter *w, const char *section_name, int subsection_index)
 {
-       img_writer_emit_section_change (w->w, section_name, subsection_index);
+       mono_img_writer_emit_section_change (w->w, section_name, subsection_index);
 }
 
 static inline void
 emit_push_section (MonoDwarfWriter *w, const char *section_name, int subsection)
 {
-       img_writer_emit_push_section (w->w, section_name, subsection);
+       mono_img_writer_emit_push_section (w->w, section_name, subsection);
 }
 
 static inline void
 emit_pop_section (MonoDwarfWriter *w)
 {
-       img_writer_emit_pop_section (w->w);
+       mono_img_writer_emit_pop_section (w->w);
 }
 
 static inline void
 emit_label (MonoDwarfWriter *w, const char *name) 
 { 
-       img_writer_emit_label (w->w, name); 
+       mono_img_writer_emit_label (w->w, name); 
 }
 
 static inline void
 emit_bytes (MonoDwarfWriter *w, const guint8* buf, int size) 
 { 
-       img_writer_emit_bytes (w->w, buf, size); 
+       mono_img_writer_emit_bytes (w->w, buf, size); 
 }
 
 static inline void
 emit_string (MonoDwarfWriter *w, const char *value) 
 { 
-       img_writer_emit_string (w->w, value); 
+       mono_img_writer_emit_string (w->w, value); 
 }
 
 static inline void
 emit_line (MonoDwarfWriter *w) 
 { 
-       img_writer_emit_line (w->w); 
+       mono_img_writer_emit_line (w->w); 
 }
 
 static inline void
 emit_alignment (MonoDwarfWriter *w, int size) 
 { 
-       img_writer_emit_alignment (w->w, size); 
+       mono_img_writer_emit_alignment (w->w, size); 
 }
 
 static inline void
 emit_pointer_unaligned (MonoDwarfWriter *w, const char *target) 
 { 
-       img_writer_emit_pointer_unaligned (w->w, target); 
+       mono_img_writer_emit_pointer_unaligned (w->w, target); 
 }
 
 static inline void
 emit_pointer (MonoDwarfWriter *w, const char *target) 
 { 
-       img_writer_emit_pointer (w->w, target); 
+       mono_img_writer_emit_pointer (w->w, target); 
 }
 
 static inline void
 emit_int16 (MonoDwarfWriter *w, int value) 
 { 
-       img_writer_emit_int16 (w->w, value); 
+       mono_img_writer_emit_int16 (w->w, value); 
 }
 
 static inline void
 emit_int32 (MonoDwarfWriter *w, int value) 
 { 
-       img_writer_emit_int32 (w->w, value); 
+       mono_img_writer_emit_int32 (w->w, value); 
 }
 
 static inline void
 emit_symbol_diff (MonoDwarfWriter *w, const char *end, const char* start, int offset) 
 { 
-       img_writer_emit_symbol_diff (w->w, end, start, offset); 
+       mono_img_writer_emit_symbol_diff (w->w, end, start, offset); 
 }
 
 static inline void
 emit_byte (MonoDwarfWriter *w, guint8 val) 
 { 
-       img_writer_emit_byte (w->w, val); 
+       mono_img_writer_emit_byte (w->w, val); 
 }
 
 static G_GNUC_UNUSED void
@@ -841,7 +841,7 @@ emit_debug_info_end (MonoDwarfWriter *w)
 {
        /* This doesn't seem to work/required with recent iphone sdk versions */
 #if 0
-       if (!img_writer_subsections_supported (w->w))
+       if (!mono_img_writer_subsections_supported (w->w))
                fprintf (w->fp, "\n.set %sdebug_info_end,.\n", w->temp_prefix);
 #endif
 }
@@ -901,7 +901,7 @@ mono_dwarf_writer_emit_base_info (MonoDwarfWriter *w, const char *cu_name, GSLis
        emit_int32 (w, 0); /* .debug_abbrev offset */
        emit_byte (w, sizeof (gpointer)); /* address size */
 
-       if (img_writer_subsections_supported (w->w) && w->appending) {
+       if (mono_img_writer_subsections_supported (w->w) && w->appending) {
                /* Emit this into a separate section so it gets placed at the end */
                emit_section_change (w, ".debug_info", 1);
                emit_byte (w, 0); /* close COMPILE_UNIT */
index 03e7aec44a0bf721b0fd95799e49b524ff110a40..2e862f43f18921ead6b4073c8506c73c04e71689 100644 (file)
@@ -718,7 +718,7 @@ mono_arch_exceptions_init (void)
  * for SEHs to behave. This requires hotfix http://support.microsoft.com/kb/976038
  * or (eventually) Windows 7 SP1.
  */
-#ifdef HOST_WIN32
+#ifdef TARGET_WIN32
        DWORD flags;
        FARPROC getter;
        FARPROC setter;
index 2530df38784c7b283bb0c7b4c0a806aaf0eba8b4..0cd3f3b5c815699c87ccd4a2beb6e9e55f633102 100644 (file)
@@ -140,8 +140,12 @@ load_file (const char *name) {
                                */
                        } else if (strncmp (p, "len:", 4) == 0) {
                                unsigned long size;
+                               char* endptr;
                                p += 4;
-                               size = strtoul (p, &p, 10);
+                               size = strtoul (p, &endptr, 10);
+                               if (size == 0 && p == endptr)
+                                       g_error ("Invalid length '%s' at line %d in %s\n", p, line, name);
+                               p = endptr;
                                if (!nacl_length_set) {
                                        desc->spec [MONO_INST_LEN] = size;
                                }
@@ -234,13 +238,13 @@ build_table (const char *fname, const char *name) {
        if (!(f = fopen (fname, "w")))
                g_error ("Cannot open file '%s'", fname);
        fprintf (f, "/* File automatically generated by genmdesc, don't change */\n\n");
-       fprintf (f, "const char %s [] = {\n", name);
+       fprintf (f, "const char mono_%s [] = {\n", name);
        fprintf (f, "\t\"");
        for (j = 0; j < MONO_INST_MAX; ++j)
                fprintf (f, "\\x0");
        fprintf (f, "\"\t/* null entry */\n");
        idx = 1;
-       g_string_append_printf (idx_array, "const guint16 %s_idx [] = {\n", name);
+       g_string_append_printf (idx_array, "const guint16 mono_%s_idx [] = {\n", name);
 
        for (i = OP_LOAD; i < OP_LAST; ++i) {
                desc = opcodes + i;
index b3a4cc8b78b06658dd2f1bf7734dd35beb801c54..2247722107cbd07fa26bc1018f73c38090b5b32b 100644 (file)
@@ -178,6 +178,9 @@ sub build_spec {
                if (defined $vals [$i]) {
                        if ($i == INST_LEN) {
                                $n = $vals [$i];
+                               if ($n =~ /[^0-9]/) {
+                                               die "Invalid instruction length $n\n";
+                               }
                                if ((defined $vals [INST_NACL]) and $nacl == 1){
                                    $n = $vals [INST_NACL];
                                }
@@ -200,11 +203,11 @@ sub build_table {
        my ($fname, $name) = @_;
        my $i;
        my $idx;
-       my $idx_array = "const guint16 ${name}_idx [] = {\n";
+       my $idx_array = "const guint16 mono_${name}_idx [] = {\n";
 
        open (OUT, ">$fname") || die "Cannot open file $fname: $!";
        print OUT "/* File automatically generated by genmdesc, don't change */\n\n";
-       print OUT "const char $name [] = {\n";
+       print OUT "const char mono_$name [] = {\n";
        print OUT "\t\"" . ("\\x0" x INST_MAX) . "\"\t/* null entry */\n";
        $idx = 1;
 
index 99092b74e4e889357c38d4bd7854f84e2cc9001d..b48962fd08dcd0a4dce94a2abd0b1d07f0729d22 100644 (file)
@@ -99,6 +99,7 @@ mono_inst_name (int op) {
        g_error ("unknown opcode name for %d", op);
        return NULL;
 #else
+       g_error ("unknown opcode name for %d", op);
        g_assert_not_reached ();
 #endif
 }
index 0b55c420bcc0d0a0b34bccb3b5f1087b245f9661..0a74bfb4ff875eca13a397a825b55ff506582437 100644 (file)
 #define USE_ELF_RELA 1
 #endif
 
-#if defined(TARGET_X86) && !defined(TARGET_WIN32) && !defined(__APPLE__)
+#if defined(TARGET_X86) && !defined(HOST_WIN32) && !defined(__APPLE__)
 #define USE_ELF_WRITER 1
 #endif
 
@@ -2001,7 +2001,7 @@ asm_writer_emit_zero_bytes (MonoImageWriter *acfg, int num)
 /* EMIT FUNCTIONS */
 
 void
-img_writer_emit_start (MonoImageWriter *acfg)
+mono_img_writer_emit_start (MonoImageWriter *acfg)
 {
 #ifdef USE_BIN_WRITER
        if (acfg->use_bin_writer)
@@ -2014,7 +2014,7 @@ img_writer_emit_start (MonoImageWriter *acfg)
 }
 
 void
-img_writer_emit_section_change (MonoImageWriter *acfg, const char *section_name, int subsection_index)
+mono_img_writer_emit_section_change (MonoImageWriter *acfg, const char *section_name, int subsection_index)
 {
 #ifdef USE_BIN_WRITER
        if (acfg->use_bin_writer)
@@ -2030,26 +2030,26 @@ img_writer_emit_section_change (MonoImageWriter *acfg, const char *section_name,
 }
 
 void
-img_writer_emit_push_section (MonoImageWriter *acfg, const char *section_name, int subsection)
+mono_img_writer_emit_push_section (MonoImageWriter *acfg, const char *section_name, int subsection)
 {
        g_assert (acfg->stack_pos < 16 - 1);
        acfg->section_stack [acfg->stack_pos] = acfg->current_section;
        acfg->subsection_stack [acfg->stack_pos] = acfg->current_subsection;
        acfg->stack_pos ++;
 
-       img_writer_emit_section_change (acfg, section_name, subsection);
+       mono_img_writer_emit_section_change (acfg, section_name, subsection);
 }
 
 void
-img_writer_emit_pop_section (MonoImageWriter *acfg)
+mono_img_writer_emit_pop_section (MonoImageWriter *acfg)
 {
        g_assert (acfg->stack_pos > 0);
        acfg->stack_pos --;
-       img_writer_emit_section_change (acfg, acfg->section_stack [acfg->stack_pos], acfg->subsection_stack [acfg->stack_pos]);
+       mono_img_writer_emit_section_change (acfg, acfg->section_stack [acfg->stack_pos], acfg->subsection_stack [acfg->stack_pos]);
 }
 
 void
-img_writer_set_section_addr (MonoImageWriter *acfg, guint64 addr)
+mono_img_writer_set_section_addr (MonoImageWriter *acfg, guint64 addr)
 {
 #ifdef USE_BIN_WRITER
        if (!acfg->use_bin_writer)
@@ -2062,7 +2062,7 @@ img_writer_set_section_addr (MonoImageWriter *acfg, guint64 addr)
 }
 
 void
-img_writer_emit_global (MonoImageWriter *acfg, const char *name, gboolean func)
+mono_img_writer_emit_global (MonoImageWriter *acfg, const char *name, gboolean func)
 {
 #ifdef USE_BIN_WRITER
        if (acfg->use_bin_writer)
@@ -2075,7 +2075,7 @@ img_writer_emit_global (MonoImageWriter *acfg, const char *name, gboolean func)
 }
 
 void
-img_writer_emit_local_symbol (MonoImageWriter *acfg, const char *name, const char *end_label, gboolean func)
+mono_img_writer_emit_local_symbol (MonoImageWriter *acfg, const char *name, const char *end_label, gboolean func)
 {
 #ifdef USE_BIN_WRITER
        if (acfg->use_bin_writer)
@@ -2088,14 +2088,14 @@ img_writer_emit_local_symbol (MonoImageWriter *acfg, const char *name, const cha
 }
 
 void
-img_writer_emit_symbol_size (MonoImageWriter *acfg, const char *name, const char *end_label)
+mono_img_writer_emit_symbol_size (MonoImageWriter *acfg, const char *name, const char *end_label)
 {
        if (!acfg->use_bin_writer)
                asm_writer_emit_symbol_size (acfg, name, end_label);
 }
 
 void
-img_writer_emit_label (MonoImageWriter *acfg, const char *name)
+mono_img_writer_emit_label (MonoImageWriter *acfg, const char *name)
 {
 #ifdef USE_BIN_WRITER
        if (acfg->use_bin_writer)
@@ -2108,7 +2108,7 @@ img_writer_emit_label (MonoImageWriter *acfg, const char *name)
 }
 
 void
-img_writer_emit_bytes (MonoImageWriter *acfg, const guint8* buf, int size)
+mono_img_writer_emit_bytes (MonoImageWriter *acfg, const guint8* buf, int size)
 {
 #ifdef USE_BIN_WRITER
        if (acfg->use_bin_writer)
@@ -2121,7 +2121,7 @@ img_writer_emit_bytes (MonoImageWriter *acfg, const guint8* buf, int size)
 }
 
 void
-img_writer_emit_string (MonoImageWriter *acfg, const char *value)
+mono_img_writer_emit_string (MonoImageWriter *acfg, const char *value)
 {
 #ifdef USE_BIN_WRITER
        if (acfg->use_bin_writer)
@@ -2134,7 +2134,7 @@ img_writer_emit_string (MonoImageWriter *acfg, const char *value)
 }
 
 void
-img_writer_emit_line (MonoImageWriter *acfg)
+mono_img_writer_emit_line (MonoImageWriter *acfg)
 {
 #ifdef USE_BIN_WRITER
        if (acfg->use_bin_writer)
@@ -2147,7 +2147,7 @@ img_writer_emit_line (MonoImageWriter *acfg)
 }
 
 void
-img_writer_emit_alignment (MonoImageWriter *acfg, int size)
+mono_img_writer_emit_alignment (MonoImageWriter *acfg, int size)
 {
 #ifdef USE_BIN_WRITER
        if (acfg->use_bin_writer)
@@ -2160,7 +2160,7 @@ img_writer_emit_alignment (MonoImageWriter *acfg, int size)
 }
 
 void
-img_writer_emit_alignment_fill (MonoImageWriter *acfg, int size, int fill)
+mono_img_writer_emit_alignment_fill (MonoImageWriter *acfg, int size, int fill)
 {
 #ifdef USE_BIN_WRITER
        if (acfg->use_bin_writer)
@@ -2174,7 +2174,7 @@ img_writer_emit_alignment_fill (MonoImageWriter *acfg, int size, int fill)
 
 #ifdef __native_client_codegen__
 void
-img_writer_emit_nacl_call_alignment (MonoImageWriter *acfg) {
+mono_img_writer_emit_nacl_call_alignment (MonoImageWriter *acfg) {
 #ifdef USE_BIN_WRITER
        if (acfg->use_bin_writer)
                bin_writer_emit_nacl_call_alignment (acfg);
@@ -2187,7 +2187,7 @@ img_writer_emit_nacl_call_alignment (MonoImageWriter *acfg) {
 #endif  /* __native_client_codegen__ */
 
 void
-img_writer_emit_pointer_unaligned (MonoImageWriter *acfg, const char *target)
+mono_img_writer_emit_pointer_unaligned (MonoImageWriter *acfg, const char *target)
 {
 #ifdef USE_BIN_WRITER
        if (acfg->use_bin_writer)
@@ -2200,7 +2200,7 @@ img_writer_emit_pointer_unaligned (MonoImageWriter *acfg, const char *target)
 }
 
 void
-img_writer_emit_pointer (MonoImageWriter *acfg, const char *target)
+mono_img_writer_emit_pointer (MonoImageWriter *acfg, const char *target)
 {
 #ifdef USE_BIN_WRITER
        if (acfg->use_bin_writer)
@@ -2213,7 +2213,7 @@ img_writer_emit_pointer (MonoImageWriter *acfg, const char *target)
 }
 
 void
-img_writer_emit_int16 (MonoImageWriter *acfg, int value)
+mono_img_writer_emit_int16 (MonoImageWriter *acfg, int value)
 {
 #ifdef USE_BIN_WRITER
        if (acfg->use_bin_writer)
@@ -2226,7 +2226,7 @@ img_writer_emit_int16 (MonoImageWriter *acfg, int value)
 }
 
 void
-img_writer_emit_int32 (MonoImageWriter *acfg, int value)
+mono_img_writer_emit_int32 (MonoImageWriter *acfg, int value)
 {
 #ifdef USE_BIN_WRITER
        if (acfg->use_bin_writer)
@@ -2239,7 +2239,7 @@ img_writer_emit_int32 (MonoImageWriter *acfg, int value)
 }
 
 void
-img_writer_emit_symbol_diff (MonoImageWriter *acfg, const char *end, const char* start, int offset)
+mono_img_writer_emit_symbol_diff (MonoImageWriter *acfg, const char *end, const char* start, int offset)
 {
 #ifdef USE_BIN_WRITER
        if (acfg->use_bin_writer)
@@ -2252,7 +2252,7 @@ img_writer_emit_symbol_diff (MonoImageWriter *acfg, const char *end, const char*
 }
 
 void
-img_writer_emit_zero_bytes (MonoImageWriter *acfg, int num)
+mono_img_writer_emit_zero_bytes (MonoImageWriter *acfg, int num)
 {
 #ifdef USE_BIN_WRITER
        if (acfg->use_bin_writer)
@@ -2265,7 +2265,7 @@ img_writer_emit_zero_bytes (MonoImageWriter *acfg, int num)
 }
 
 int
-img_writer_emit_writeout (MonoImageWriter *acfg)
+mono_img_writer_emit_writeout (MonoImageWriter *acfg)
 {
 #ifdef USE_BIN_WRITER
        if (acfg->use_bin_writer)
@@ -2278,9 +2278,9 @@ img_writer_emit_writeout (MonoImageWriter *acfg)
 }
 
 void
-img_writer_emit_byte (MonoImageWriter *acfg, guint8 val)
+mono_img_writer_emit_byte (MonoImageWriter *acfg, guint8 val)
 {
-       img_writer_emit_bytes (acfg, &val, 1);
+       mono_img_writer_emit_bytes (acfg, &val, 1);
 }
 
 /* 
@@ -2288,7 +2288,7 @@ img_writer_emit_byte (MonoImageWriter *acfg, guint8 val)
  * Do not advance PC.
  */
 void
-img_writer_emit_reloc (MonoImageWriter *acfg, int reloc_type, const char *symbol, int addend)
+mono_img_writer_emit_reloc (MonoImageWriter *acfg, int reloc_type, const char *symbol, int addend)
 {
        /* This is only supported by the bin writer */
 #ifdef USE_BIN_WRITER
@@ -2302,26 +2302,26 @@ img_writer_emit_reloc (MonoImageWriter *acfg, int reloc_type, const char *symbol
 }
 
 /*
- * img_writer_emit_unset_mode:
+ * mono_img_writer_emit_unset_mode:
  *
  *   Flush buffered data so it is safe to write to the output file from outside this
  * module. This is a nop for the binary writer.
  */
 void
-img_writer_emit_unset_mode (MonoImageWriter *acfg)
+mono_img_writer_emit_unset_mode (MonoImageWriter *acfg)
 {
        if (!acfg->use_bin_writer)
                asm_writer_emit_unset_mode (acfg);
 }
 
 /*
- * img_writer_get_output:
+ * mono_img_writer_get_output:
  *
  *   Return the output buffer of a binary writer emitting to memory. The returned memory
  * is from malloc, and it is owned by the caller.
  */
 guint8*
-img_writer_get_output (MonoImageWriter *acfg, guint32 *size)
+mono_img_writer_get_output (MonoImageWriter *acfg, guint32 *size)
 {
 #ifdef USE_BIN_WRITER
        guint8 *buf;
@@ -2342,7 +2342,7 @@ img_writer_get_output (MonoImageWriter *acfg, guint32 *size)
  * Return whenever the binary writer is supported on this platform.
  */
 gboolean
-bin_writer_supported (void)
+mono_bin_writer_supported (void)
 {
 #ifdef USE_BIN_WRITER
        return TRUE;
@@ -2352,14 +2352,14 @@ bin_writer_supported (void)
 }
 
 /*
- * img_writer_create:
+ * mono_img_writer_create:
  *
  *   Create an image writer writing to FP. If USE_BIN_WRITER is TRUE, FP can be NULL,
  * in this case the image writer will write to a memory buffer obtainable by calling
- * img_writer_get_output ().
+ * mono_img_writer_get_output ().
  */
 MonoImageWriter*
-img_writer_create (FILE *fp, gboolean use_bin_writer)
+mono_img_writer_create (FILE *fp, gboolean use_bin_writer)
 {
        MonoImageWriter *w = g_new0 (MonoImageWriter, 1);
        
@@ -2378,7 +2378,7 @@ img_writer_create (FILE *fp, gboolean use_bin_writer)
 }
 
 void
-img_writer_destroy (MonoImageWriter *w)
+mono_img_writer_destroy (MonoImageWriter *w)
 {
        // FIXME: Free all the stuff
        mono_mempool_destroy (w->mempool);
@@ -2386,7 +2386,7 @@ img_writer_destroy (MonoImageWriter *w)
 }
 
 gboolean
-img_writer_subsections_supported (MonoImageWriter *acfg)
+mono_img_writer_subsections_supported (MonoImageWriter *acfg)
 {
 #ifdef TARGET_ASM_APPLE
        return acfg->use_bin_writer;
@@ -2396,13 +2396,13 @@ img_writer_subsections_supported (MonoImageWriter *acfg)
 }
 
 FILE *
-img_writer_get_fp (MonoImageWriter *acfg)
+mono_img_writer_get_fp (MonoImageWriter *acfg)
 {
        return acfg->fp;
 }
 
 const char *
-img_writer_get_temp_label_prefix (MonoImageWriter *acfg)
+mono_img_writer_get_temp_label_prefix (MonoImageWriter *acfg)
 {
        return AS_TEMP_LABEL_PREFIX;
 }
index dc9160c4144c198b018b71ec94b48383b11f7473..2af57cbe105d3e93fd8876e59a47fbdf16840694 100644 (file)
@@ -26,72 +26,72 @@ typedef struct _MonoImageWriter MonoImageWriter;
 #define R_ARM_JUMP24 29
 #define R_ARM_ALU_PC_G0_NC 59
 
-gboolean bin_writer_supported (void);
+gboolean mono_bin_writer_supported (void);
 
-MonoImageWriter* img_writer_create (FILE *fp, gboolean use_bin_writer);
+MonoImageWriter* mono_img_writer_create (FILE *fp, gboolean use_bin_writer);
 
-void img_writer_destroy (MonoImageWriter *w);
+void mono_img_writer_destroy (MonoImageWriter *w);
 
-void img_writer_emit_start (MonoImageWriter *w);
+void mono_img_writer_emit_start (MonoImageWriter *w);
 
-int img_writer_emit_writeout (MonoImageWriter *w);
+int mono_img_writer_emit_writeout (MonoImageWriter *w);
 
-guint8* img_writer_get_output (MonoImageWriter *acfg, guint32 *size);
+guint8* mono_img_writer_get_output (MonoImageWriter *acfg, guint32 *size);
 
-void img_writer_emit_section_change (MonoImageWriter *w, const char *section_name, int subsection_index);
+void mono_img_writer_emit_section_change (MonoImageWriter *w, const char *section_name, int subsection_index);
 
-void img_writer_emit_push_section (MonoImageWriter *w, const char *section_name, int subsection);
+void mono_img_writer_emit_push_section (MonoImageWriter *w, const char *section_name, int subsection);
 
-void img_writer_emit_pop_section (MonoImageWriter *w);
+void mono_img_writer_emit_pop_section (MonoImageWriter *w);
 
-void img_writer_set_section_addr (MonoImageWriter *acfg, guint64 addr);
+void mono_img_writer_set_section_addr (MonoImageWriter *acfg, guint64 addr);
 
-void img_writer_emit_global (MonoImageWriter *w, const char *name, gboolean func);
+void mono_img_writer_emit_global (MonoImageWriter *w, const char *name, gboolean func);
 
-void img_writer_emit_local_symbol (MonoImageWriter *w, const char *name, const char *end_label, gboolean func);
+void mono_img_writer_emit_local_symbol (MonoImageWriter *w, const char *name, const char *end_label, gboolean func);
 
-void img_writer_emit_symbol_size (MonoImageWriter *w, const char *start, const char *end_label);
+void mono_img_writer_emit_symbol_size (MonoImageWriter *w, const char *start, const char *end_label);
 
-void img_writer_emit_label (MonoImageWriter *w, const char *name);
+void mono_img_writer_emit_label (MonoImageWriter *w, const char *name);
 
-void img_writer_emit_bytes (MonoImageWriter *w, const guint8* buf, int size);
+void mono_img_writer_emit_bytes (MonoImageWriter *w, const guint8* buf, int size);
 
-void img_writer_emit_string (MonoImageWriter *w, const char *value);
+void mono_img_writer_emit_string (MonoImageWriter *w, const char *value);
 
-void img_writer_emit_line (MonoImageWriter *w);
+void mono_img_writer_emit_line (MonoImageWriter *w);
 
-void img_writer_emit_alignment (MonoImageWriter *w, int size);
+void mono_img_writer_emit_alignment (MonoImageWriter *w, int size);
 
-void img_writer_emit_alignment_fill (MonoImageWriter *w, int size, int fill);
+void mono_img_writer_emit_alignment_fill (MonoImageWriter *w, int size, int fill);
 
 #ifdef __native_client_codegen__
-void img_writer_emit_nacl_call_alignment (MonoImageWriter *w);
+void mono_img_writer_emit_nacl_call_alignment (MonoImageWriter *w);
 #endif
 
-void img_writer_emit_pointer_unaligned (MonoImageWriter *w, const char *target);
+void mono_img_writer_emit_pointer_unaligned (MonoImageWriter *w, const char *target);
 
-void img_writer_emit_pointer (MonoImageWriter *w, const char *target);
+void mono_img_writer_emit_pointer (MonoImageWriter *w, const char *target);
 
-void img_writer_emit_int16 (MonoImageWriter *w, int value);
+void mono_img_writer_emit_int16 (MonoImageWriter *w, int value);
 
-void img_writer_emit_int32 (MonoImageWriter *w, int value);
+void mono_img_writer_emit_int32 (MonoImageWriter *w, int value);
 
-void img_writer_emit_symbol_diff (MonoImageWriter *w, const char *end, const char* start, int offset);
+void mono_img_writer_emit_symbol_diff (MonoImageWriter *w, const char *end, const char* start, int offset);
 
-void img_writer_emit_zero_bytes (MonoImageWriter *w, int num);
+void mono_img_writer_emit_zero_bytes (MonoImageWriter *w, int num);
 
-void img_writer_emit_global (MonoImageWriter *w, const char *name, gboolean func);
+void mono_img_writer_emit_global (MonoImageWriter *w, const char *name, gboolean func);
 
-void img_writer_emit_byte (MonoImageWriter *w, guint8 val);
+void mono_img_writer_emit_byte (MonoImageWriter *w, guint8 val);
 
-void img_writer_emit_reloc (MonoImageWriter *acfg, int reloc_type, const char *symbol, int addend);
+void mono_img_writer_emit_reloc (MonoImageWriter *acfg, int reloc_type, const char *symbol, int addend);
 
-void img_writer_emit_unset_mode (MonoImageWriter *acfg);
+void mono_img_writer_emit_unset_mode (MonoImageWriter *acfg);
 
-gboolean img_writer_subsections_supported (MonoImageWriter *acfg);
+gboolean mono_img_writer_subsections_supported (MonoImageWriter *acfg);
 
-FILE * img_writer_get_fp (MonoImageWriter *acfg);
+FILE * mono_img_writer_get_fp (MonoImageWriter *acfg);
 
-const char *img_writer_get_temp_label_prefix (MonoImageWriter *acfg);
+const char *mono_img_writer_get_temp_label_prefix (MonoImageWriter *acfg);
 
 #endif
index d4c01f0aee1146047ff90bd9923e3584bcb01f36..8243dfb764922f9f5e299da1f7402e9f98e59620 100644 (file)
@@ -2439,16 +2439,10 @@ emit_imt_argument (MonoCompile *cfg, MonoCallInst *call, MonoMethod *method, Mon
 #ifdef ENABLE_LLVM
                call->imt_arg_reg = method_reg;
 #endif
-#ifdef MONO_ARCH_IMT_REG
        mono_call_inst_add_outarg_reg (cfg, call, method_reg, MONO_ARCH_IMT_REG, FALSE);
-#else
-       /* Need this to keep the IMT arg alive */
-       mono_call_inst_add_outarg_reg (cfg, call, method_reg, 0, FALSE);
-#endif
                return;
        }
 
-#ifdef MONO_ARCH_IMT_REG
        method_reg = alloc_preg (cfg);
 
        if (imt_arg) {
@@ -2464,9 +2458,6 @@ emit_imt_argument (MonoCompile *cfg, MonoCallInst *call, MonoMethod *method, Mon
        }
 
        mono_call_inst_add_outarg_reg (cfg, call, method_reg, MONO_ARCH_IMT_REG, FALSE);
-#else
-       mono_arch_emit_imt_argument (cfg, call, imt_arg);
-#endif
 }
 
 static MonoJumpInfo *
@@ -7518,20 +7509,18 @@ emit_managed_static_data_access (MonoCompile *cfg, MonoInst *thread_ins, int off
        MonoInst *addr;
        int static_data_reg, array_reg, dreg;
        int offset2_reg, idx_reg;
-       // inlined access to the tls data
-       // idx = (offset >> 24) - 1;
-       // return ((char*) thread->static_data [idx]) + (offset & 0xffffff);
+       // inlined access to the tls data (see threads.c)
        static_data_reg = alloc_ireg (cfg);
        MONO_EMIT_NEW_LOAD_MEMBASE (cfg, static_data_reg, thread_ins->dreg, MONO_STRUCT_OFFSET (MonoInternalThread, static_data));
        idx_reg = alloc_ireg (cfg);
-       MONO_EMIT_NEW_BIALU_IMM (cfg, OP_ISHR_IMM, idx_reg, offset_reg, 24);
-       MONO_EMIT_NEW_BIALU_IMM (cfg, OP_ISUB_IMM, idx_reg, idx_reg, 1);
+       MONO_EMIT_NEW_BIALU_IMM (cfg, OP_IAND_IMM, idx_reg, offset_reg, 0x3f);
        MONO_EMIT_NEW_BIALU_IMM (cfg, OP_ISHL_IMM, idx_reg, idx_reg, sizeof (gpointer) == 8 ? 3 : 2);
        MONO_EMIT_NEW_BIALU (cfg, OP_PADD, static_data_reg, static_data_reg, idx_reg);
        array_reg = alloc_ireg (cfg);
        MONO_EMIT_NEW_LOAD_MEMBASE (cfg, array_reg, static_data_reg, 0);
        offset2_reg = alloc_ireg (cfg);
-       MONO_EMIT_NEW_BIALU_IMM (cfg, OP_IAND_IMM, offset2_reg, offset_reg, 0xffffff);
+       MONO_EMIT_NEW_BIALU_IMM (cfg, OP_ISHR_UN_IMM, offset2_reg, offset_reg, 6);
+       MONO_EMIT_NEW_BIALU_IMM (cfg, OP_IAND_IMM, offset2_reg, offset2_reg, 0x1ffffff);
        dreg = alloc_ireg (cfg);
        EMIT_NEW_BIALU (cfg, addr, OP_PADD, dreg, array_reg, offset2_reg);
        return addr;
@@ -11040,9 +11029,6 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
 
                                GSHAREDVT_FAILURE (op);
 
-                               // offset &= 0x7fffffff;
-                               // idx = (offset >> 24) - 1;
-                               //      return ((char*) thread->static_data [idx]) + (offset & 0xffffff);
                                MONO_ADD_INS (cfg->cbb, thread_ins);
                                static_data_reg = alloc_ireg (cfg);
                                MONO_EMIT_NEW_LOAD_MEMBASE (cfg, static_data_reg, thread_ins->dreg, MONO_STRUCT_OFFSET (MonoInternalThread, static_data));
@@ -11055,24 +11041,24 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
                                        offset_reg = ins->dreg;
                                        MONO_EMIT_NEW_BIALU_IMM (cfg, OP_IAND_IMM, offset_reg, offset_reg, 0x7fffffff);
                                        idx_reg = alloc_ireg (cfg);
-                                       MONO_EMIT_NEW_BIALU_IMM (cfg, OP_ISHR_IMM, idx_reg, offset_reg, 24);
-                                       MONO_EMIT_NEW_BIALU_IMM (cfg, OP_ISUB_IMM, idx_reg, idx_reg, 1);
+                                       MONO_EMIT_NEW_BIALU_IMM (cfg, OP_IAND_IMM, idx_reg, offset_reg, 0x3f);
                                        MONO_EMIT_NEW_BIALU_IMM (cfg, OP_ISHL_IMM, idx_reg, idx_reg, sizeof (gpointer) == 8 ? 3 : 2);
                                        MONO_EMIT_NEW_BIALU (cfg, OP_PADD, static_data_reg, static_data_reg, idx_reg);
                                        array_reg = alloc_ireg (cfg);
                                        MONO_EMIT_NEW_LOAD_MEMBASE (cfg, array_reg, static_data_reg, 0);
                                        offset2_reg = alloc_ireg (cfg);
-                                       MONO_EMIT_NEW_BIALU_IMM (cfg, OP_IAND_IMM, offset2_reg, offset_reg, 0xffffff);
+                                       MONO_EMIT_NEW_BIALU_IMM (cfg, OP_ISHR_UN_IMM, offset2_reg, offset_reg, 6);
+                                       MONO_EMIT_NEW_BIALU_IMM (cfg, OP_IAND_IMM, offset2_reg, offset2_reg, 0x1ffffff);
                                        dreg = alloc_ireg (cfg);
                                        EMIT_NEW_BIALU (cfg, ins, OP_PADD, dreg, array_reg, offset2_reg);
                                } else {
                                        offset = (gsize)addr & 0x7fffffff;
-                                       idx = (offset >> 24) - 1;
+                                       idx = offset & 0x3f;
 
                                        array_reg = alloc_ireg (cfg);
                                        MONO_EMIT_NEW_LOAD_MEMBASE (cfg, array_reg, static_data_reg, idx * sizeof (gpointer));
                                        dreg = alloc_ireg (cfg);
-                                       EMIT_NEW_BIALU_IMM (cfg, ins, OP_ADD_IMM, dreg, array_reg, (offset & 0xffffff));
+                                       EMIT_NEW_BIALU_IMM (cfg, ins, OP_ADD_IMM, dreg, array_reg, ((offset >> 6) & 0x1ffffff));
                                }
                        } else if ((cfg->opt & MONO_OPT_SHARED) ||
                                        (cfg->compile_aot && is_special_static) ||
index f151c7397ab60e1ad22c64dcae75dafdb68e5b0e..6dec1e35442eac4276b04a8817929fe6a3151448 100644 (file)
@@ -6492,15 +6492,15 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
                        break;
                }
                case OP_GC_SAFE_POINT: {
-                       gpointer polling_func = NULL;
+                       const char *polling_func = NULL;
                        int compare_val = 0;
                        guint8 *br [1];
 
 #if defined (USE_COOP_GC)
-                       polling_func = (gpointer)mono_threads_state_poll;
+                       polling_func = "mono_threads_state_poll";
                        compare_val = 1;
 #elif defined(__native_client_codegen__) && defined(__native_client_gc__)
-                       polling_func = (gpointer)mono_nacl_gc;
+                       polling_func = "mono_nacl_gc";
                        compare_val = 0xFFFFFFFF;
 #endif
                        if (!polling_func)
@@ -6508,7 +6508,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
 
                        amd64_test_membase_imm_size (code, ins->sreg1, 0, compare_val, 4);
                        br[0] = code; x86_branch8 (code, X86_CC_EQ, 0, FALSE);
-                       code = emit_call (cfg, code, MONO_PATCH_INFO_ABS, polling_func, TRUE);
+                       code = emit_call (cfg, code, MONO_PATCH_INFO_INTERNAL_METHOD, polling_func, FALSE);
                        amd64_patch (br[0], code);
                        break;
                }
index 1c525682a09bb616377553404c98e343a1bd95e2..32c4654ffb1b7ccd78cb760377d3447367554bb2 100644 (file)
@@ -114,7 +114,7 @@ struct sigcontext {
 
 #define MONO_ARCH_HAVE_RESTORE_STACK_SUPPORT 1
 
-#define MONO_ARCH_CPU_SPEC amd64_desc
+#define MONO_ARCH_CPU_SPEC mono_amd64_desc
 
 #define MONO_MAX_IREGS 16
 
index f1e84acdef6e43bcb656e20a4e0f244db9900af0..527adfac7a4d8ce144c4f6f2efc5ca9a18f34abf 100644 (file)
@@ -4053,7 +4053,7 @@ emit_move_return_value (MonoCompile *cfg, MonoInst *ins, guint8 *code)
                        else
                                ARM_FSTD (code, cinfo->ret.reg + (i * 2), ARMREG_LR, i * 8);
                }
-               break;
+               return code;
        }
        default:
                break;
index 412f46ce2f12d12ecdd33596ada1fda8d6a03675..0757138a56354cc706a41530700a891eab4589c7 100644 (file)
@@ -41,7 +41,7 @@
 
 #define MONO_ARCH_ARCHITECTURE ARM_ARCHITECTURE "," ARM_FP_MODEL
 
-#define MONO_ARCH_CPU_SPEC arm_cpu_desc
+#define MONO_ARCH_CPU_SPEC mono_arm_cpu_desc
 
 #if G_BYTE_ORDER == G_LITTLE_ENDIAN
 #define ARM_LSW_REG ARMREG_R0
index 7c41e2c3d8d77e6a809eee58ed89134835321730..fef21b9958159dd295540dd98047413905cc09f8 100644 (file)
@@ -715,7 +715,7 @@ ves_icall_get_trace (MonoException *exc, gint32 skip, MonoBoolean need_file_info
                        sf->il_offset = location->il_offset;
                } else {
                        SeqPoint sp;
-                       if (find_prev_seq_point_for_native_offset (domain, jinfo_get_method (ji), sf->native_offset, NULL, &sp))
+                       if (mono_find_prev_seq_point_for_native_offset (domain, jinfo_get_method (ji), sf->native_offset, NULL, &sp))
                                sf->il_offset = sp.il_offset;
                        else
                                sf->il_offset = -1;
@@ -874,7 +874,7 @@ mono_walk_stack_full (MonoJitStackWalk func, MonoContext *start_ctx, MonoDomain
                                il_offset = source->il_offset;
                        } else {
                                SeqPoint sp;
-                               if (find_prev_seq_point_for_native_offset (domain, jinfo_get_method (frame.ji), frame.native_offset, NULL, &sp))
+                               if (mono_find_prev_seq_point_for_native_offset (domain, jinfo_get_method (frame.ji), frame.native_offset, NULL, &sp))
                                        il_offset = sp.il_offset;
                                else
                                        il_offset = -1;
index 82e27a671f545515bb2482a8b85128e8bce40343..eb102115c883e6d6e9acce74d100469a12878ad5 100644 (file)
@@ -4631,12 +4631,6 @@ mono_arch_find_imt_method (mgreg_t *regs, guint8 *code)
        return (MonoMethod*)regs [IA64_R9];
 }
 
-void
-mono_arch_emit_imt_argument (MonoCompile *cfg, MonoCallInst *call, MonoInst *imt_arg)
-{
-       /* Done by the implementation of the CALL_MEMBASE opcodes */
-}
-
 gpointer
 mono_arch_get_this_arg_from_call (mgreg_t *regs, guint8 *code)
 {
index 1d84ef867b0ef480a649fabe1337ac56d56a36dc..1dff79050641082d2b0d88274cdf2492f997431a 100644 (file)
@@ -17,7 +17,7 @@
 #endif
 
 
-#define MONO_ARCH_CPU_SPEC mips_desc
+#define MONO_ARCH_CPU_SPEC mono_mips_desc
 
 #define MONO_MAX_IREGS 32
 #define MONO_MAX_FREGS 32
index 1d9997b92746dbc9fe28f55150ca4929b0cdb3c1..93bd63e5b027e2beef68eacd28e2ecd378dadff0 100644 (file)
@@ -8,9 +8,9 @@
 #include <glib.h>
 
 #ifdef __mono_ppc64__
-#define MONO_ARCH_CPU_SPEC ppc64_cpu_desc
+#define MONO_ARCH_CPU_SPEC mono_ppc64_cpu_desc
 #else
-#define MONO_ARCH_CPU_SPEC ppcg4
+#define MONO_ARCH_CPU_SPEC mono_ppcg4
 #endif
 
 #define MONO_MAX_IREGS 32
index e39c3618a76565c4dac38863a86eea653ebc43bd..df1a81aa2863ee62561a2ac7db9fd361e2cddd9d 100644 (file)
@@ -658,11 +658,11 @@ register_opcode_emulation (int opcode, const char *name, const char *sigstr, gpo
 /*
  * For JIT icalls implemented in C.
  * NAME should be the same as the name of the C function whose address is FUNC.
- * If SAVE is TRUE, no wrapper is generated. This is for perf critical icalls which
+ * If @avoid_wrapper is TRUE, no wrapper is generated. This is for perf critical icalls which
  * can't throw exceptions.
  */
 static void
-register_icall (gpointer func, const char *name, const char *sigstr, gboolean save)
+register_icall (gpointer func, const char *name, const char *sigstr, gboolean avoid_wrapper)
 {
        MonoMethodSignature *sig;
 
@@ -671,7 +671,7 @@ register_icall (gpointer func, const char *name, const char *sigstr, gboolean sa
        else
                sig = NULL;
 
-       mono_register_jit_icall_full (func, name, sig, save, FALSE, save ? name : NULL);
+       mono_register_jit_icall_full (func, name, sig, avoid_wrapper, FALSE, avoid_wrapper ? name : NULL);
 }
 
 static void
@@ -2848,7 +2848,7 @@ mini_create_jit_domain_info (MonoDomain *domain)
        info->delegate_trampoline_hash = g_hash_table_new (class_method_pair_hash, class_method_pair_equal);
        info->llvm_vcall_trampoline_hash = g_hash_table_new (mono_aligned_addr_hash, NULL);
        info->runtime_invoke_hash = mono_conc_hashtable_new_full (&domain->lock, mono_aligned_addr_hash, NULL, NULL, runtime_invoke_info_free);
-       info->seq_points = g_hash_table_new_full (mono_aligned_addr_hash, NULL, NULL, seq_point_info_free);
+       info->seq_points = g_hash_table_new_full (mono_aligned_addr_hash, NULL, NULL, mono_seq_point_info_free);
        info->arch_seq_points = g_hash_table_new (mono_aligned_addr_hash, NULL);
        info->jump_target_hash = g_hash_table_new (NULL, NULL);
 
@@ -3240,10 +3240,10 @@ register_icalls (void)
 #endif
 
 #if defined(__native_client__) || defined(__native_client_codegen__)
-       register_icall (mono_nacl_gc, "mono_nacl_gc", "void", TRUE);
+       register_icall (mono_nacl_gc, "mono_nacl_gc", "void", FALSE);
 #endif
 #if defined(USE_COOP_GC)
-       register_icall (mono_threads_state_poll, "mono_threads_state_poll", "void", TRUE);
+       register_icall (mono_threads_state_poll, "mono_threads_state_poll", "void", FALSE);
 #endif
 
 #ifndef MONO_ARCH_NO_EMULATE_LONG_MUL_OPTS
index 26ec96de7cb582a6676c1016b34f22ae377a2e6b..46bc61036fccc200a12ca6628bccc4b74f45dd5e 100644 (file)
@@ -5,7 +5,7 @@
 #include <mono/utils/mono-context.h>
 #include <signal.h>
 
-#define MONO_ARCH_CPU_SPEC s390x_cpu_desc
+#define MONO_ARCH_CPU_SPEC mono_s390x_cpu_desc
 
 #define MONO_MAX_IREGS 16
 #define MONO_MAX_FREGS 16
index 4a4f4503339fe81038d148536e5dd2661d8e21cf..9941b2387548d4d937b4be19597edfa4d0cb5471 100644 (file)
@@ -5025,15 +5025,15 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
                        break;
                }
                case OP_GC_SAFE_POINT: {
-                       gpointer polling_func = NULL;
+                       const char *polling_func = NULL;
                        int compare_val = 0;
                        guint8 *br [1];
 
 #if defined (USE_COOP_GC)
-                       polling_func = (gpointer)mono_threads_state_poll;
+                       polling_func = "mono_threads_state_poll";
                        compare_val = 1;
 #elif defined(__native_client_codegen__) && defined(__native_client_gc__)
-                       polling_func = (gpointer)mono_nacl_gc;
+                       polling_func = "mono_nacl_gc";
                        compare_val = 0xFFFFFFFF;
 #endif
                        if (!polling_func)
@@ -5041,7 +5041,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
 
                        x86_test_membase_imm (code, ins->sreg1, 0, compare_val);
                        br[0] = code; x86_branch8 (code, X86_CC_EQ, 0, FALSE);
-                       code = emit_call (cfg, code, MONO_PATCH_INFO_ABS, polling_func);
+                       code = emit_call (cfg, code, MONO_PATCH_INFO_INTERNAL_METHOD, polling_func);
                        x86_patch (br [0], code);
 
                        break;
index c45ae23eda71d7d450500d9e4b8dff9f97fac02b..084bb22a56297aa8e2914e48121a076129fed4a9 100644 (file)
@@ -89,7 +89,7 @@ struct sigcontext {
 #endif
 #define MONO_ARCH_HAVE_RESTORE_STACK_SUPPORT 1
 
-#define MONO_ARCH_CPU_SPEC x86_desc
+#define MONO_ARCH_CPU_SPEC mono_x86_desc
 
 #define MONO_MAX_IREGS 8
 #define MONO_MAX_FREGS 8
index f6bf460a79d6fd12678e1a4fc1a0f5f6c619929c..cba4f465528dae5c2d75e4ec7b60c7da16c2b197 100644 (file)
@@ -2413,7 +2413,7 @@ mono_codegen (MonoCompile *cfg)
                        mono_arch_peephole_pass_2 (cfg, bb);
 
                if (cfg->gen_seq_points && !cfg->gen_sdb_seq_points)
-                       bb_deduplicate_op_il_seq_points (cfg, bb);
+                       mono_bb_deduplicate_op_il_seq_points (cfg, bb);
        }
 
        if (cfg->prof_options & MONO_PROFILE_COVERAGE)
index 2a11e7922bab6a56ba1d906432067716258c938a..b5b2523cb54d72d065f3f9d299700a1b7a853b44 100644 (file)
@@ -2600,7 +2600,6 @@ gpointer mono_arch_get_this_arg_from_call       (mgreg_t *regs, guint8 *code);
 gpointer mono_arch_get_delegate_invoke_impl     (MonoMethodSignature *sig, gboolean has_target);
 gpointer mono_arch_get_delegate_virtual_invoke_impl (MonoMethodSignature *sig, MonoMethod *method, int offset, gboolean load_imt_reg);
 gpointer mono_arch_create_specific_trampoline   (gpointer arg1, MonoTrampolineType tramp_type, MonoDomain *domain, guint32 *code_len);
-void        mono_arch_emit_imt_argument         (MonoCompile *cfg, MonoCallInst *call, MonoInst *imt_arg);
 MonoMethod* mono_arch_find_imt_method           (mgreg_t *regs, guint8 *code);
 MonoVTable* mono_arch_find_static_call_vtable   (mgreg_t *regs, guint8 *code);
 gpointer    mono_arch_build_imt_thunk           (MonoVTable *vtable, MonoDomain *domain, MonoIMTCheckItem **imt_entries, int count, gpointer fail_tramp);
index c0dcd6da7daabfcadb27011f09f7b51be9f9c60a..b2b511f0cb49347eefabf908987a7539aceaecc8 100644 (file)
@@ -156,7 +156,7 @@ mono_save_seq_point_info (MonoCompile *cfg)
                        if (has_debug_data)
                                next_list = next[i];
 
-                       if (seq_point_info_add_seq_point (array, sp, last_seq_point, next_list, has_debug_data))
+                       if (mono_seq_point_info_add_seq_point (array, sp, last_seq_point, next_list, has_debug_data))
                                last_seq_point = sp;
 
                        if (has_debug_data)
@@ -167,7 +167,7 @@ mono_save_seq_point_info (MonoCompile *cfg)
        if (has_debug_data)
                g_free (next);
 
-       cfg->seq_point_info = seq_point_info_new (array->len, TRUE, array->data, has_debug_data, &seq_info_size);
+       cfg->seq_point_info = mono_seq_point_info_new (array->len, TRUE, array->data, has_debug_data, &seq_info_size);
        mono_jit_stats.allocated_seq_points_size += seq_info_size;
 
        g_byte_array_free (array, TRUE);
@@ -186,7 +186,7 @@ mono_save_seq_point_info (MonoCompile *cfg)
 }
 
 MonoSeqPointInfo*
-get_seq_points (MonoDomain *domain, MonoMethod *method)
+mono_get_seq_points (MonoDomain *domain, MonoMethod *method)
 {
        MonoSeqPointInfo *seq_points;
 
@@ -204,16 +204,16 @@ get_seq_points (MonoDomain *domain, MonoMethod *method)
 }
 
 /*
- * find_next_seq_point_for_native_offset:
+ * mono_find_next_seq_point_for_native_offset:
  *
  *   Find the first sequence point after NATIVE_OFFSET.
  */
 gboolean
-find_next_seq_point_for_native_offset (MonoDomain *domain, MonoMethod *method, gint32 native_offset, MonoSeqPointInfo **info, SeqPoint* seq_point)
+mono_find_next_seq_point_for_native_offset (MonoDomain *domain, MonoMethod *method, gint32 native_offset, MonoSeqPointInfo **info, SeqPoint* seq_point)
 {
        MonoSeqPointInfo *seq_points;
 
-       seq_points = get_seq_points (domain, method);
+       seq_points = mono_get_seq_points (domain, method);
        if (!seq_points) {
                if (info)
                        *info = NULL;
@@ -222,20 +222,20 @@ find_next_seq_point_for_native_offset (MonoDomain *domain, MonoMethod *method, g
        if (info)
                *info = seq_points;
 
-       return seq_point_find_next_by_native_offset (seq_points, native_offset, seq_point);
+       return mono_seq_point_find_next_by_native_offset (seq_points, native_offset, seq_point);
 }
 
 /*
- * find_prev_seq_point_for_native_offset:
+ * mono_find_prev_seq_point_for_native_offset:
  *
  *   Find the first sequence point before NATIVE_OFFSET.
  */
 gboolean
-find_prev_seq_point_for_native_offset (MonoDomain *domain, MonoMethod *method, gint32 native_offset, MonoSeqPointInfo **info, SeqPoint* seq_point)
+mono_find_prev_seq_point_for_native_offset (MonoDomain *domain, MonoMethod *method, gint32 native_offset, MonoSeqPointInfo **info, SeqPoint* seq_point)
 {
        MonoSeqPointInfo *seq_points;
 
-       seq_points = get_seq_points (domain, method);
+       seq_points = mono_get_seq_points (domain, method);
        if (!seq_points) {
                if (info)
                        *info = NULL;
@@ -244,21 +244,21 @@ find_prev_seq_point_for_native_offset (MonoDomain *domain, MonoMethod *method, g
        if (info)
                *info = seq_points;
 
-       return seq_point_find_prev_by_native_offset (seq_points, native_offset, seq_point);
+       return mono_seq_point_find_prev_by_native_offset (seq_points, native_offset, seq_point);
 }
 
 /*
- * find_seq_point:
+ * mono_find_seq_point:
  *
  *   Find the sequence point corresponding to the IL offset IL_OFFSET, which
  * should be the location of a sequence point.
  */
 gboolean
-find_seq_point (MonoDomain *domain, MonoMethod *method, gint32 il_offset, MonoSeqPointInfo **info, SeqPoint *seq_point)
+mono_find_seq_point (MonoDomain *domain, MonoMethod *method, gint32 il_offset, MonoSeqPointInfo **info, SeqPoint *seq_point)
 {
        MonoSeqPointInfo *seq_points;
 
-       seq_points = get_seq_points (domain, method);
+       seq_points = mono_get_seq_points (domain, method);
        if (!seq_points) {
                if (info)
                        *info = NULL;
@@ -267,11 +267,11 @@ find_seq_point (MonoDomain *domain, MonoMethod *method, gint32 il_offset, MonoSe
        if (info)
                *info = seq_points;
 
-       return seq_point_find_by_il_offset (seq_points, il_offset, seq_point);
+       return mono_seq_point_find_by_il_offset (seq_points, il_offset, seq_point);
 }
 
 void
-bb_deduplicate_op_il_seq_points (MonoCompile *cfg, MonoBasicBlock *bb)
+mono_bb_deduplicate_op_il_seq_points (MonoCompile *cfg, MonoBasicBlock *bb)
 {
        MonoInst *ins, *n, *prev;
 
index 3c0677a61c709a0f6ceec68e793dd288f40efaa3..3d053dba3dd57f944c66919c942c582bdf575163 100644 (file)
@@ -11,21 +11,21 @@ void
 mono_save_seq_point_info (MonoCompile *cfg);
 
 MonoSeqPointInfo*
-get_seq_points (MonoDomain *domain, MonoMethod *method);
+mono_get_seq_points (MonoDomain *domain, MonoMethod *method);
 
 gboolean
-find_next_seq_point_for_native_offset (MonoDomain *domain, MonoMethod *method, gint32 native_offset, MonoSeqPointInfo **info, SeqPoint* seq_point);
+mono_find_next_seq_point_for_native_offset (MonoDomain *domain, MonoMethod *method, gint32 native_offset, MonoSeqPointInfo **info, SeqPoint* seq_point);
 
 gboolean
-find_prev_seq_point_for_native_offset (MonoDomain *domain, MonoMethod *method, gint32 native_offset, MonoSeqPointInfo **info, SeqPoint* seq_point);
+mono_find_prev_seq_point_for_native_offset (MonoDomain *domain, MonoMethod *method, gint32 native_offset, MonoSeqPointInfo **info, SeqPoint* seq_point);
 
 gboolean
-find_seq_point (MonoDomain *domain, MonoMethod *method, gint32 il_offset, MonoSeqPointInfo **info, SeqPoint *seq_point);
+mono_find_seq_point (MonoDomain *domain, MonoMethod *method, gint32 il_offset, MonoSeqPointInfo **info, SeqPoint *seq_point);
 
 void
-bb_deduplicate_op_il_seq_points (MonoCompile *cfg, MonoBasicBlock *bb);
+mono_bb_deduplicate_op_il_seq_points (MonoCompile *cfg, MonoBasicBlock *bb);
 
 void
 mono_image_get_aot_seq_point_path (MonoImage *image, char **str);
 
-#endif /* __MONO_SEQ_POINTS_H__ */
\ No newline at end of file
+#endif /* __MONO_SEQ_POINTS_H__ */
index 10f73decb3863798827d05d44d27240e835fde05..e249e6e8e958f6b1f30ebe79f2366115453fc4cb 100644 (file)
@@ -158,15 +158,15 @@ mono_xdebug_init (const char *options)
        unlink ("xdb.s");
        xdebug_fp = fopen ("xdb.s", "w");
        
-       w = img_writer_create (xdebug_fp, FALSE);
+       w = mono_img_writer_create (xdebug_fp, FALSE);
 
-       img_writer_emit_start (w);
+       mono_img_writer_emit_start (w);
 
        xdebug_writer = mono_dwarf_writer_create (w, il_file, 0, TRUE, TRUE);
 
        /* Emit something so the file has a text segment */
-       img_writer_emit_section_change (w, ".text", 0);
-       img_writer_emit_string (w, "");
+       mono_img_writer_emit_section_change (w, ".text", 0);
+       mono_img_writer_emit_string (w, "");
 
        mono_dwarf_writer_emit_base_info (xdebug_writer, "JITted code", mono_unwind_get_cie_program ());
 }
@@ -177,9 +177,9 @@ xdebug_begin_emit (MonoImageWriter **out_w, MonoDwarfWriter **out_dw)
        MonoImageWriter *w;
        MonoDwarfWriter *dw;
 
-       w = img_writer_create (NULL, TRUE);
+       w = mono_img_writer_create (NULL, TRUE);
 
-       img_writer_emit_start (w);
+       mono_img_writer_emit_start (w);
 
        /* This file will contain the IL code for methods which don't have debug info */
        if (!il_file)
@@ -204,11 +204,11 @@ xdebug_end_emit (MonoImageWriter *w, MonoDwarfWriter *dw, MonoMethod *method)
        il_file_line_index = mono_dwarf_writer_get_il_file_line_index (dw);
        mono_dwarf_writer_close (dw);
 
-       img_writer_emit_writeout (w);
+       mono_img_writer_emit_writeout (w);
 
-       img = img_writer_get_output (w, &img_size);
+       img = mono_img_writer_get_output (w, &img_size);
 
-       img_writer_destroy (w);
+       mono_img_writer_destroy (w);
 
        if (FALSE) {
                /* Save the symbol files to help debugging */
@@ -302,14 +302,14 @@ mono_save_xdebug_info (MonoCompile *cfg)
                 * FIXME: This doesn't work when multiple methods are emitted into the same file.
                 */
                sym = get_debug_sym (cfg->jit_info->method, "", xdebug_syms);
-               img_writer_emit_section_change (w, ".text", 0);
+               mono_img_writer_emit_section_change (w, ".text", 0);
                if (!xdebug_text_addr) {
                        xdebug_text_addr = cfg->jit_info->code_start;
-                       img_writer_set_section_addr (w, (gssize)xdebug_text_addr);
+                       mono_img_writer_set_section_addr (w, (gssize)xdebug_text_addr);
                }
-               img_writer_emit_global_with_size (w, sym, cfg->jit_info->code_size, TRUE);
-               img_writer_emit_label (w, sym);
-               img_writer_emit_bytes (w, cfg->jit_info->code_start, cfg->jit_info->code_size);
+               mono_img_writer_emit_global_with_size (w, sym, cfg->jit_info->code_size, TRUE);
+               mono_img_writer_emit_label (w, sym);
+               mono_img_writer_emit_bytes (w, cfg->jit_info->code_start, cfg->jit_info->code_size);
                g_free (sym);
 #endif
                
index 6ced264969069e46ecbbbe84bb61e74295190bff..be53b493fdd8fa35ae4faaa69e7905f00f1a7559 100644 (file)
@@ -854,7 +854,7 @@ mono_gc_scan_for_specific_ref (GCObject *key, gboolean precise)
        } SGEN_HASH_TABLE_FOREACH_END;
 
        if (sgen_is_world_stopped ())
-               find_pinning_ref_from_thread ((char*)key, sizeof (MonoObject));
+               find_pinning_ref_from_thread ((char*)key, sizeof (GCObject));
 }
 
 #ifndef SGEN_WITHOUT_MONO
index 53eedc0931af30a851f972f5974fb3e0859f80a0..e7a003bcad1b523b8f9bd06f8b46b144b55bde3f 100644 (file)
@@ -58,7 +58,7 @@ enum {
        STATE_WORKING,
        STATE_WORK_ENQUEUED,
        STATE_NURSERY_COLLECTION
-} WorkersStateName;
+};
 
 typedef gint32 State;
 
index f83272f88e651859ccdb4cedcf19bdfbf1eeb1e2..2ce2a6ea95e4afb928e2bb91d7bd0df263c936ae 100644 (file)
@@ -1164,7 +1164,7 @@ int mspace_mallopt(int, int);
 
 /*------------------------------ internal #includes ---------------------- */
 
-#ifdef WIN32
+#ifdef _MSC_VER
 #pragma warning( disable : 4146 ) /* no "unsigned" warnings */
 #endif /* WIN32 */
 
index ced9cdad63dc9015800cd2eb38bd621646002df6..0d7d37ac736c04065cf200e8be8a0ae10ab9a925 100644 (file)
@@ -16,8 +16,8 @@
 #include <mono/utils/atomic.h>
 #include <mono/utils/mono-mutex.h>
 #ifdef SGEN_WITHOUT_MONO
-#include <mono/metadata/sgen-gc.h>
-#include <mono/metadata/sgen-client.h>
+#include <mono/sgen/sgen-gc.h>
+#include <mono/sgen/sgen-client.h>
 #else
 #include <mono/utils/mono-mmap.h>
 #include <mono/utils/mono-threads.h>
index 4de3e9f5cdda6dc7007f81edacff0f4fbbcb5990..2ca9ec247457aa5490ec14587282698366ab081c 100644 (file)
@@ -9,7 +9,7 @@
 
 #include <mono/utils/json.h>
 
-void json_writer_init (JsonWriter* writer)
+void mono_json_writer_init (JsonWriter* writer)
 {
        g_assert (writer && "Expected a valid JSON writer instance");
 
@@ -17,25 +17,25 @@ void json_writer_init (JsonWriter* writer)
        writer->indent = 0;
 }
 
-void json_writer_destroy (JsonWriter* writer)
+void mono_json_writer_destroy (JsonWriter* writer)
 {
        g_assert (writer && "Expected a valid JSON writer instance");
        g_string_free (writer->text, /*free_segment=*/TRUE);
 }
 
-void json_writer_indent_push(JsonWriter* writer)
+void mono_json_writer_indent_push(JsonWriter* writer)
 {
        g_assert (writer && "Expected a valid JSON writer instance");
        writer->indent += JSON_INDENT_VALUE;
 }
 
-void json_writer_indent_pop(JsonWriter* writer)
+void mono_json_writer_indent_pop(JsonWriter* writer)
 {
        g_assert (writer && "Expected a valid JSON writer instance");
        writer->indent -= JSON_INDENT_VALUE;
 }
 
-void json_writer_indent(JsonWriter* writer)
+void mono_json_writer_indent(JsonWriter* writer)
 {
        g_assert (writer && "Expected a valid JSON writer instance");
 
@@ -44,13 +44,13 @@ void json_writer_indent(JsonWriter* writer)
                g_string_append_c (writer->text, ' ');
 }
 
-void json_writer_vprintf(JsonWriter* writer, const gchar *format, va_list args)
+void mono_json_writer_vprintf(JsonWriter* writer, const gchar *format, va_list args)
 {
        g_assert (writer && "Expected a valid JSON writer instance");
        g_string_append_vprintf (writer->text, format, args);
 }
 
-void json_writer_printf(JsonWriter* writer, const gchar *format, ...)
+void mono_json_writer_printf(JsonWriter* writer, const gchar *format, ...)
 {
        g_assert (writer && "Expected a valid JSON writer instance");
 
@@ -62,34 +62,34 @@ void json_writer_printf(JsonWriter* writer, const gchar *format, ...)
        va_end (args);
 }
 
-void json_writer_array_begin(JsonWriter* writer)
+void mono_json_writer_array_begin(JsonWriter* writer)
 {
        g_assert (writer && "Expected a valid JSON writer instance");
        g_string_append_printf (writer->text, "[\n");
        writer->indent += JSON_INDENT_VALUE;
 }
 
-void json_writer_array_end(JsonWriter* writer)
+void mono_json_writer_array_end(JsonWriter* writer)
 {
        g_assert (writer && "Expected a valid JSON writer instance");
        g_string_append_printf (writer->text, "]");
        writer->indent -= JSON_INDENT_VALUE;
 }
 
-void json_writer_object_begin(JsonWriter* writer)
+void mono_json_writer_object_begin(JsonWriter* writer)
 {
        g_assert (writer && "Expected a valid JSON writer instance");
-       json_writer_printf (writer, "{\n");
+       mono_json_writer_printf (writer, "{\n");
        writer->indent += JSON_INDENT_VALUE;
 }
 
-void json_writer_object_end(JsonWriter* writer)
+void mono_json_writer_object_end(JsonWriter* writer)
 {
        g_assert (writer && "Expected a valid JSON writer instance");
-       json_writer_printf (writer, "}");
+       mono_json_writer_printf (writer, "}");
 }
 
-void json_writer_object_key(JsonWriter* writer, const gchar* format, ...)
+void mono_json_writer_object_key(JsonWriter* writer, const gchar* format, ...)
 {
        g_assert (writer && "Expected a valid JSON writer instance");
 
@@ -97,7 +97,7 @@ void json_writer_object_key(JsonWriter* writer, const gchar* format, ...)
        va_start (args, format);
 
        g_string_append_printf (writer->text, "\"");
-       json_writer_vprintf (writer, format, args);
+       mono_json_writer_vprintf (writer, format, args);
        g_string_append_printf (writer->text, "\" : ");
 
        va_end (args);
index 5e5a06ae7765f86710489d000a5680723987a6a5..cee9c8905dcfa9ea200a8bc63b07b11037a35c8e 100644 (file)
@@ -19,17 +19,17 @@ typedef struct JsonWriter {
        int indent;
 } JsonWriter;
 
-void json_writer_init (JsonWriter* writer);
-void json_writer_destroy (JsonWriter* writer);
-void json_writer_indent(JsonWriter* writer);
-void json_writer_indent_push(JsonWriter* writer);
-void json_writer_indent_pop(JsonWriter* writer);
-void json_writer_vprintf(JsonWriter* writer, const gchar *format, va_list args);
-void json_writer_printf(JsonWriter* writer, const gchar *format, ...);
-void json_writer_array_begin(JsonWriter* writer);
-void json_writer_array_end(JsonWriter* writer);
-void json_writer_object_begin(JsonWriter* writer);
-void json_writer_object_end(JsonWriter* writer);
-void json_writer_object_key(JsonWriter* writer, const gchar* format, ...);
+void mono_json_writer_init (JsonWriter* writer);
+void mono_json_writer_destroy (JsonWriter* writer);
+void mono_json_writer_indent(JsonWriter* writer);
+void mono_json_writer_indent_push(JsonWriter* writer);
+void mono_json_writer_indent_pop(JsonWriter* writer);
+void mono_json_writer_vprintf(JsonWriter* writer, const gchar *format, va_list args);
+void mono_json_writer_printf(JsonWriter* writer, const gchar *format, ...);
+void mono_json_writer_array_begin(JsonWriter* writer);
+void mono_json_writer_array_end(JsonWriter* writer);
+void mono_json_writer_object_begin(JsonWriter* writer);
+void mono_json_writer_object_end(JsonWriter* writer);
+void mono_json_writer_object_key(JsonWriter* writer, const gchar* format, ...);
 
 #endif
index 305d64dc9fed3cd6dc1d2c79a7c8b303be668fda..55d7937025445975608cc478a13439e87a5def1d 100644 (file)
@@ -84,8 +84,8 @@
 
 #include <mono/utils/atomic.h>
 #ifdef SGEN_WITHOUT_MONO
-#include <mono/metadata/sgen-gc.h>
-#include <mono/metadata/sgen-client.h>
+#include <mono/sgen/sgen-gc.h>
+#include <mono/sgen/sgen-client.h>
 #else
 #include <mono/utils/mono-mmap.h>
 #endif
index 7742d6555e146a647533cb1a3c7592f7bdec7203..1bafb685d63fb53cbbc971ee1fddbc2f30f78b32 100644 (file)
@@ -21,8 +21,8 @@
 #include <mono/utils/atomic.h>
 #include <mono/utils/mono-membar.h>
 #ifdef SGEN_WITHOUT_MONO
-#include <mono/metadata/sgen-gc.h>
-#include <mono/metadata/sgen-client.h>
+#include <mono/sgen/sgen-gc.h>
+#include <mono/sgen/sgen-client.h>
 #else
 #include <mono/utils/mono-mmap.h>
 #endif
index 4304851c11dff8d901d42515452c3932dac9461d..740db4c7543cb72bc2b8f1d6c68775849bb35cbd 100644 (file)
@@ -12,7 +12,7 @@
 
 #include <dirent.h>
 
-int __mono_io_portability_helpers = PORTABILITY_UNKNOWN;
+int mono_io_portability_helpers = PORTABILITY_UNKNOWN;
 
 static inline gchar *mono_portability_find_file_internal (GString **report, const gchar *pathname, gboolean last_exists);
 
@@ -20,10 +20,10 @@ void mono_portability_helpers_init (void)
 {
         const gchar *env;
 
-       if (__mono_io_portability_helpers != PORTABILITY_UNKNOWN)
+       if (mono_io_portability_helpers != PORTABILITY_UNKNOWN)
                return;
        
-        __mono_io_portability_helpers = PORTABILITY_NONE;
+        mono_io_portability_helpers = PORTABILITY_NONE;
        
         env = g_getenv ("MONO_IOMAP");
         if (env != NULL) {
@@ -44,11 +44,11 @@ void mono_portability_helpers_init (void)
                                    options[i]);
 #endif
                         if (!strncasecmp (options[i], "drive", 5)) {
-                                __mono_io_portability_helpers |= PORTABILITY_DRIVE;
+                                mono_io_portability_helpers |= PORTABILITY_DRIVE;
                         } else if (!strncasecmp (options[i], "case", 4)) {
-                                __mono_io_portability_helpers |= PORTABILITY_CASE;
+                                mono_io_portability_helpers |= PORTABILITY_CASE;
                         } else if (!strncasecmp (options[i], "all", 3)) {
-                                __mono_io_portability_helpers |= (PORTABILITY_DRIVE | PORTABILITY_CASE);
+                                mono_io_portability_helpers |= (PORTABILITY_DRIVE | PORTABILITY_CASE);
                        }
                 }
        }
index b2cee59bfe28773185c78023700c063269821595..4451aa2e30cb79c9afee0eca055ff1508d76b4ed 100644 (file)
@@ -28,13 +28,13 @@ enum {
 void mono_portability_helpers_init (void);
 gchar *mono_portability_find_file (const gchar *pathname, gboolean last_exists);
 
-extern int __mono_io_portability_helpers;
+extern int mono_io_portability_helpers;
 
-#define IS_PORTABILITY_NONE (__mono_io_portability_helpers & PORTABILITY_NONE)
-#define IS_PORTABILITY_UNKNOWN (__mono_io_portability_helpers & PORTABILITY_UNKNOWN)
-#define IS_PORTABILITY_DRIVE (__mono_io_portability_helpers & PORTABILITY_DRIVE)
-#define IS_PORTABILITY_CASE (__mono_io_portability_helpers & PORTABILITY_CASE)
-#define IS_PORTABILITY_SET (__mono_io_portability_helpers > 0)
+#define IS_PORTABILITY_NONE (mono_io_portability_helpers & PORTABILITY_NONE)
+#define IS_PORTABILITY_UNKNOWN (mono_io_portability_helpers & PORTABILITY_UNKNOWN)
+#define IS_PORTABILITY_DRIVE (mono_io_portability_helpers & PORTABILITY_DRIVE)
+#define IS_PORTABILITY_CASE (mono_io_portability_helpers & PORTABILITY_CASE)
+#define IS_PORTABILITY_SET (mono_io_portability_helpers > 0)
 
 #endif
 
index 5e5adfe2f0009e64f32907f1750abc671ce1376a..8900bb23572c0abb6a994afd1e68e968565a8d77 100755 (executable)
@@ -1,3 +1,8 @@
+#ifdef HOST_WIN32
+/* For select */
+#include <winsock2.h>
+#endif
+
 #include "mono-poll.h"
 #include <errno.h>
 
@@ -20,11 +25,6 @@ mono_poll (mono_pollfd *ufds, unsigned int nfds, int timeout)
 }
 #else
 
-#ifdef HOST_WIN32
-/* For select */
-#include <winsock2.h>
-#endif
-
 int
 mono_poll (mono_pollfd *ufds, unsigned int nfds, int timeout)
 {
index 566e6ec7e59d7bdd3f34e450793a73d5634da125..dea168417927c9934afc12fa1439459c8aaa4faa 100644 (file)
@@ -610,6 +610,11 @@ mono_process_current_pid ()
 int
 mono_cpu_count (void)
 {
+#ifdef HOST_WIN32
+       SYSTEM_INFO info;
+       GetSystemInfo (&info);
+       return info.dwNumberOfProcessors;
+#else
        int count = 0;
 #ifdef PLATFORM_ANDROID
        /* Android tries really hard to save power by powering off CPUs on SMP phones which
@@ -645,12 +650,6 @@ mono_cpu_count (void)
                        return count;
        }
 #endif
-#ifdef HOST_WIN32
-       {
-               SYSTEM_INFO info;
-               GetSystemInfo (&info);
-               return info.dwNumberOfProcessors;
-       }
 #endif
        /* FIXME: warn */
        return 1;
index 9d55cd562c213e681518e3a8c43c793ec3da31e8..b720063ad63eb100e333b4ca6ec722a7c4c4adb7 100644 (file)
@@ -347,7 +347,14 @@ unregister_thread (void *arg)
        if (threads_callbacks.thread_detach)
                threads_callbacks.thread_detach (info);
 
+       /*
+       Since the thread info lock is taken from within blocking sections, we can't check from there, so it must be done here.
+       This ensures that we won't lose any suspend requests as a suspend initiator must hold the lock.
+       Once we're holding the suspend lock, no threads can suspend us and once we unregister, no thread can find us. 
+       */
+       MONO_PREPARE_BLOCKING
        mono_thread_info_suspend_lock ();
+       MONO_FINISH_BLOCKING
 
        /*
        Now perform the callback that must be done under locks.
index 70366f8b1e8602f05c739abd248808c84e31c5fd..8abe83907ceeb5cbdb419f03c0a12bc92c0365e2 100644 (file)
@@ -38,13 +38,28 @@ enum {
 
 /* Fast access to bits which depends on the implementation of the bitset */
 #define mono_bitset_test_fast(set,n) ((set)->data [(n)/MONO_BITSET_BITS_PER_CHUNK] & ((gsize)1 << ((n) % MONO_BITSET_BITS_PER_CHUNK)))
-#define mono_bitset_test_fast(set,n) ((set)->data [(n)/MONO_BITSET_BITS_PER_CHUNK] & ((gsize)1 << ((n) % MONO_BITSET_BITS_PER_CHUNK)))
 #define mono_bitset_set_fast(set,n) do { (set)->data [(n)/MONO_BITSET_BITS_PER_CHUNK] |= ((gsize)1 << ((n) % MONO_BITSET_BITS_PER_CHUNK)); } while (0)
 #define mono_bitset_clear_fast(set,n) do { (set)->data [(n)/MONO_BITSET_BITS_PER_CHUNK] &= ~((gsize)1 << ((n) % MONO_BITSET_BITS_PER_CHUNK)); } while (0)
 #define mono_bitset_get_fast(set,n) ((set)->data[(n)])
 
 #define mono_bitset_copyto_fast(src,dest) do { memcpy (&(dest)->data, &(src)->data, (dest)->size / 8); } while (0)
 
+#define MONO_BITSET_FOREACH(set,idx,/*stmt*/...) \
+       do \
+       { \
+               MonoBitSet *set__ = (set); \
+               for (int i__ = 0; i__ < set__->size / MONO_BITSET_BITS_PER_CHUNK; i__++) { \
+                       if (set__->data [i__]) { \
+                               for (int j__ = 0; j__ < MONO_BITSET_BITS_PER_CHUNK; j__++) { \
+                                       if (set__->data [i__] & ((gsize) 1 << j__)) { \
+                                               guint idx = j__ + i__ * MONO_BITSET_BITS_PER_CHUNK; \
+                                               __VA_ARGS__; \
+                                       } \
+                               } \
+                       } \
+               } \
+       } while (0)
+
 #define mono_bitset_union_fast(dest,src) do { \
     MonoBitSet *tmp_src = (src); \
     MonoBitSet *tmp_dest = (dest); \
index 7dec326b2ec0922120a5c34fdcad90d9257f7eba..5263738fbb44431afc6cb705d40782d277d40840 100644 (file)
@@ -52,7 +52,7 @@ typedef union {
  * Hash a single 512-bit block. This is the core of the algorithm.
  */
 void
-SHA1Transform(guint32 state[5], const guint8 buffer[SHA1_BLOCK_LENGTH])
+mono_SHA1Transform(guint32 state[5], const guint8 buffer[SHA1_BLOCK_LENGTH])
 {
        guint32 a, b, c, d, e;
        guint8 workspace[SHA1_BLOCK_LENGTH];
@@ -105,7 +105,7 @@ SHA1Transform(guint32 state[5], const guint8 buffer[SHA1_BLOCK_LENGTH])
  * SHA1Init - Initialize new context
  */
 void
-SHA1Init(SHA1_CTX *context)
+mono_SHA1Init(SHA1_CTX *context)
 {
 
        /* SHA1 initialization constants */
@@ -122,7 +122,7 @@ SHA1Init(SHA1_CTX *context)
  * Run your data through this.
  */
 void
-SHA1Update(SHA1_CTX *context, const guint8 *data, size_t len)
+mono_SHA1Update(SHA1_CTX *context, const guint8 *data, size_t len)
 {
        size_t i, j;
 
@@ -130,9 +130,9 @@ SHA1Update(SHA1_CTX *context, const guint8 *data, size_t len)
        context->count += (len << 3);
        if ((j + len) > 63) {
                (void)memcpy(&context->buffer[j], data, (i = 64-j));
-               SHA1Transform(context->state, context->buffer);
+               mono_SHA1Transform(context->state, context->buffer);
                for ( ; i + 63 < len; i += 64)
-                       SHA1Transform(context->state, (guint8 *)&data[i]);
+                       mono_SHA1Transform(context->state, (guint8 *)&data[i]);
                j = 0;
        } else {
                i = 0;
@@ -145,7 +145,7 @@ SHA1Update(SHA1_CTX *context, const guint8 *data, size_t len)
  * Add padding and return the message digest.
  */
 void
-SHA1Pad(SHA1_CTX *context)
+mono_SHA1Pad(SHA1_CTX *context)
 {
        guint8 finalcount[8];
        guint i;
@@ -154,18 +154,18 @@ SHA1Pad(SHA1_CTX *context)
                finalcount[i] = (guint8)((context->count >>
                    ((7 - (i & 7)) * 8)) & 255);        /* Endian independent */
        }
-       SHA1Update(context, (guint8 *)"\200", 1);
+       mono_SHA1Update(context, (guint8 *)"\200", 1);
        while ((context->count & 504) != 448)
-               SHA1Update(context, (guint8 *)"\0", 1);
-       SHA1Update(context, finalcount, 8); /* Should cause a SHA1Transform() */
+               mono_SHA1Update(context, (guint8 *)"\0", 1);
+       mono_SHA1Update(context, finalcount, 8); /* Should cause a SHA1Transform() */
 }
 
 void
-SHA1Final(guint8 digest[SHA1_DIGEST_LENGTH], SHA1_CTX *context)
+mono_SHA1Final(guint8 digest[SHA1_DIGEST_LENGTH], SHA1_CTX *context)
 {
        guint i;
 
-       SHA1Pad(context);
+       mono_SHA1Pad(context);
        if (digest) {
                for (i = 0; i < SHA1_DIGEST_LENGTH; i++) {
                        digest[i] = (guint8)
index 588518266cab0ebbf29a629b8f38c2dcbfb06730..a3782aaed7b069123ce682f61d1789cd7e4d52b7 100644 (file)
@@ -22,15 +22,12 @@ typedef struct {
 } SHA1_CTX;
 
 G_BEGIN_DECLS
-void SHA1Init(SHA1_CTX *);
-void SHA1Pad(SHA1_CTX *);
-void SHA1Transform(guint32 [5], const guint8 [SHA1_BLOCK_LENGTH]);
-void SHA1Update(SHA1_CTX *, const guint8 *, size_t);
-void SHA1Final(guint8 [SHA1_DIGEST_LENGTH], SHA1_CTX *);
-char *SHA1End(SHA1_CTX *, char *);
-char *SHA1File(const char *, char *);
-char *SHA1FileChunk(const char *, char *, off_t, off_t);
-char *SHA1Data(const guint8 *, size_t, char *);
+void mono_SHA1Init(SHA1_CTX *);
+void mono_SHA1Pad(SHA1_CTX *);
+void mono_SHA1Transform(guint32 [5], const guint8 [SHA1_BLOCK_LENGTH]);
+void mono_SHA1Update(SHA1_CTX *, const guint8 *, size_t);
+void mono_SHA1Final(guint8 [SHA1_DIGEST_LENGTH], SHA1_CTX *);
+char *mono_SHA1End(SHA1_CTX *, char *);
 G_END_DECLS
 
 #define HTONDIGEST(x) do {                                              \
index 64f3db4c2d329cd4aaa2bf0b360960b1715a3757..761b695c61b128f595ab309bb0e69adfdfeb872d 100644 (file)
@@ -8,7 +8,7 @@
 #define SGEN_BINARY_PROTOCOL
 #define MONO_INTERNAL
 
-#include <mono/metadata/sgen-protocol.h>
+#include <mono/sgen/sgen-protocol.h>
 
 #define SGEN_PROTOCOL_EOF      255
 
@@ -122,7 +122,7 @@ read_entry (EntryStream *stream, void *data)
 #define END_PROTOCOL_ENTRY
 #define END_PROTOCOL_ENTRY_HEAVY
 
-#include <mono/metadata/sgen-protocol-def.h>
+#include <mono/sgen/sgen-protocol-def.h>
 
        default: assert (0);
        }
@@ -182,7 +182,7 @@ is_always_match (int type)
 #define END_PROTOCOL_ENTRY
 #define END_PROTOCOL_ENTRY_HEAVY
 
-#include <mono/metadata/sgen-protocol-def.h>
+#include <mono/sgen/sgen-protocol-def.h>
 
        default: assert (0);
        }
@@ -420,7 +420,7 @@ print_entry (int type, void *data, int num_nums, int *match_indices, gboolean co
 #define END_PROTOCOL_ENTRY_HEAVY \
        END_PROTOCOL_ENTRY
 
-#include <mono/metadata/sgen-protocol-def.h>
+#include <mono/sgen/sgen-protocol-def.h>
 
        default: assert (0);
        }
@@ -503,7 +503,7 @@ match_index (gpointer ptr, int type, void *data)
 #define END_PROTOCOL_ENTRY_HEAVY \
        END_PROTOCOL_ENTRY
 
-#include <mono/metadata/sgen-protocol-def.h>
+#include <mono/sgen/sgen-protocol-def.h>
 
        default: assert (0);
        }
@@ -566,7 +566,7 @@ is_vtable_match (gpointer ptr, int type, void *data)
 #define END_PROTOCOL_ENTRY_HEAVY \
        END_PROTOCOL_ENTRY
 
-#include <mono/metadata/sgen-protocol-def.h>
+#include <mono/sgen/sgen-protocol-def.h>
 
        default: assert (0);
        }