Common/DataSetSurrogate.cs
(开头部分) 46KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.IO;
using System.ComponentModel;
using System.Collections;
using System.Globalization;
using System.Xml;
using System.Data;
using System.Runtime.Serialization;
using System.Diagnostics;
/*
Author : Ravinder Vuppula.
Purpose : To implement binary serialization of the DataSet through a Surrogate object.
Notes:
1. All the surrogate objects DataSetSurrogate, DataTableSurrogate, DataColumnSurrogate are marked [Serializable] and hence will get automatically serialized by the remoting framework.
2. The data is serialized in binary "column" wise.
3. This class can be used as a wrapper around DataSet. A DataSetSurrogate object can be constructed from DataSet and vice-versa. This helps if the user wants to wrap the DataSet in DataSetSurrogate and serialize and deserialize DataSetSurrogate instead.
History:
05/10/04 - Fix for the issue of serializing default values.
*/
[Serializable]
public class DataSetSurrogate {
//DataSet properties
private string _datasetName;
private string _namespace;
private string _prefix;
private bool _caseSensitive;
private CultureInfo _locale;
private bool _enforceConstraints;
//ForeignKeyConstraints
private ArrayList _fkConstraints;//An ArrayList of foreign key constraints : [constraintName]->[parentTableIndex, parentcolumnIndexes]->[childTableIndex, childColumnIndexes]->[AcceptRejectRule, UpdateRule, Delete]->[extendedProperties]
//Relations
private ArrayList _relations;//An ArrayList of foreign key constraints : [relationName]->[parentTableIndex, parentcolumnIndexes]->[childTableIndex, childColumnIndexes]->[Nested]->[extendedProperties]
//ExtendedProperties
private Hashtable _extendedProperties;
//Columns and Rows
private DataTableSurrogate[] _dataTableSurrogates;
/*
Constructs a DataSetSurrogate object from a DataSet.
*/
public DataSetSurrogate(DataSet ds) {
if (ds == null) {
throw new ArgumentNullException("The parameter dataset is null");
}
//DataSet properties
_datasetName = ds.DataSetName;
_namespace = ds.Namespace;
_prefix = ds.Prefix;
_caseSensitive = ds.CaseSensitive;
_locale = ds.Locale;
_enforceConstraints = ds.EnforceConstraints;
//Tables, Columns, Rows
后面还有 1101 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读 AI
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
