本文整理汇总了C#中System.Data.DataSet.SetLocaleValue方法的典型用法代码示例。如果您正苦于以下问题:C# System.Data.DataSet.SetLocaleValue方法的具体用法?C# System.Data.DataSet.SetLocaleValue怎么用?C# System.Data.DataSet.SetLocaleValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Data.DataSet
的用法示例。
在下文中一共展示了System.Data.DataSet.SetLocaleValue方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WriteXmlSchema
public void WriteXmlSchema(XmlWriter writer, bool writeHierarchy)
{
IntPtr ptr;
Bid.ScopeEnter(out ptr, "<ds.DataTable.WriteXmlSchema|API> %d#\n", this.ObjectID);
try
{
if (this.tableName.Length == 0)
{
throw ExceptionBuilder.CanNotSerializeDataTableWithEmptyName();
}
if (!this.CheckForClosureOnExpressions(this, writeHierarchy))
{
throw ExceptionBuilder.CanNotSerializeDataTableHierarchy();
}
System.Data.DataSet set = null;
string tableNamespace = this.tableNamespace;
if (this.DataSet == null)
{
set = new System.Data.DataSet();
set.SetLocaleValue(this._culture, this._cultureUserSet);
set.CaseSensitive = this.CaseSensitive;
set.Namespace = this.Namespace;
set.RemotingFormat = this.RemotingFormat;
set.Tables.Add(this);
}
if (writer != null)
{
new XmlTreeGen(SchemaFormat.Public).Save(null, this, writer, writeHierarchy);
}
if (set != null)
{
set.Tables.Remove(this);
this.tableNamespace = tableNamespace;
}
}
finally
{
Bid.ScopeLeave(ref ptr);
}
}
示例2: SerializeDataTable
private void SerializeDataTable(SerializationInfo info, StreamingContext context, bool isSingleTable, SerializationFormat remotingFormat)
{
info.AddValue("DataTable.RemotingVersion", new Version(2, 0));
if (remotingFormat != SerializationFormat.Xml)
{
info.AddValue("DataTable.RemotingFormat", remotingFormat);
}
if (remotingFormat != SerializationFormat.Xml)
{
this.SerializeTableSchema(info, context, isSingleTable);
if (isSingleTable)
{
this.SerializeTableData(info, context, 0);
}
}
else
{
string str = "";
bool flag = false;
if (this.dataSet == null)
{
System.Data.DataSet set = new System.Data.DataSet("tmpDataSet");
set.SetLocaleValue(this._culture, this._cultureUserSet);
set.CaseSensitive = this.CaseSensitive;
set.namespaceURI = this.Namespace;
set.Tables.Add(this);
flag = true;
}
else
{
str = this.DataSet.Namespace;
this.DataSet.namespaceURI = this.Namespace;
}
info.AddValue("XmlSchema", this.dataSet.GetXmlSchemaForRemoting(this));
info.AddValue("XmlDiffGram", this.dataSet.GetRemotingDiffGram(this));
if (flag)
{
this.dataSet.Tables.Remove(this);
}
else
{
this.dataSet.namespaceURI = str;
}
}
}
示例3: WriteXml
public void WriteXml(XmlWriter writer, XmlWriteMode mode, bool writeHierarchy)
{
IntPtr ptr;
Bid.ScopeEnter(out ptr, "<ds.DataTable.WriteXml|API> %d#, mode=%d{ds.XmlWriteMode}\n", this.ObjectID, (int) mode);
try
{
if (this.tableName.Length == 0)
{
throw ExceptionBuilder.CanNotSerializeDataTableWithEmptyName();
}
if (writer != null)
{
if (mode == XmlWriteMode.DiffGram)
{
new NewDiffgramGen(this, writeHierarchy).Save(writer, this);
}
else if (mode == XmlWriteMode.WriteSchema)
{
System.Data.DataSet set = null;
string tableNamespace = this.tableNamespace;
if (this.DataSet == null)
{
set = new System.Data.DataSet();
set.SetLocaleValue(this._culture, this._cultureUserSet);
set.CaseSensitive = this.CaseSensitive;
set.Namespace = this.Namespace;
set.RemotingFormat = this.RemotingFormat;
set.Tables.Add(this);
}
if (writer != null)
{
new XmlDataTreeWriter(this, writeHierarchy).Save(writer, true);
}
if (set != null)
{
set.Tables.Remove(this);
this.tableNamespace = tableNamespace;
}
}
else
{
new XmlDataTreeWriter(this, writeHierarchy).Save(writer, false);
}
}
}
finally
{
Bid.ScopeLeave(ref ptr);
}
}
示例4: ReadXmlSchema
internal void ReadXmlSchema(XmlReader reader, bool denyResolving)
{
IntPtr ptr;
Bid.ScopeEnter(out ptr, "<ds.DataTable.ReadXmlSchema|INFO> %d#, denyResolving=%d{bool}\n", this.ObjectID, denyResolving);
try
{
System.Data.DataSet set = new System.Data.DataSet();
SerializationFormat remotingFormat = this.RemotingFormat;
set.ReadXmlSchema(reader, denyResolving);
string mainTableName = set.MainTableName;
if (!ADP.IsEmpty(this.tableName) || !ADP.IsEmpty(mainTableName))
{
DataTable currentTable = null;
if (!ADP.IsEmpty(this.tableName))
{
if (!ADP.IsEmpty(this.Namespace))
{
currentTable = set.Tables[this.tableName, this.Namespace];
}
else
{
int num3 = set.Tables.InternalIndexOf(this.tableName);
if (num3 > -1)
{
currentTable = set.Tables[num3];
}
}
}
else
{
string str3 = "";
int index = mainTableName.IndexOf(':');
if (index > -1)
{
str3 = mainTableName.Substring(0, index);
}
string str4 = mainTableName.Substring(index + 1, (mainTableName.Length - index) - 1);
currentTable = set.Tables[str4, str3];
}
if (currentTable == null)
{
string tableName = string.Empty;
if (!ADP.IsEmpty(this.tableName))
{
tableName = (this.Namespace.Length > 0) ? (this.Namespace + ":" + this.tableName) : this.tableName;
}
else
{
tableName = mainTableName;
}
throw ExceptionBuilder.TableNotFound(tableName);
}
currentTable._remotingFormat = remotingFormat;
List<DataTable> tableList = new List<DataTable> {
currentTable
};
this.CreateTableList(currentTable, tableList);
List<DataRelation> relationList = new List<DataRelation>();
this.CreateRelationList(tableList, relationList);
if (relationList.Count == 0)
{
if (this.Columns.Count == 0)
{
DataTable table5 = currentTable;
if (table5 != null)
{
table5.CloneTo(this, null, false);
}
if ((this.DataSet == null) && (this.tableNamespace == null))
{
this.tableNamespace = table5.Namespace;
}
}
}
else
{
if (ADP.IsEmpty(this.TableName))
{
this.TableName = currentTable.TableName;
if (!ADP.IsEmpty(currentTable.Namespace))
{
this.Namespace = currentTable.Namespace;
}
}
if (this.DataSet == null)
{
System.Data.DataSet set2 = new System.Data.DataSet(set.DataSetName);
set2.SetLocaleValue(set.Locale, set.ShouldSerializeLocale());
set2.CaseSensitive = set.CaseSensitive;
set2.Namespace = set.Namespace;
set2.mainTableName = set.mainTableName;
set2.RemotingFormat = set.RemotingFormat;
set2.Tables.Add(this);
}
this.CloneHierarchy(currentTable, this.DataSet, null);
foreach (DataTable table2 in tableList)
{
DataTable table4 = this.DataSet.Tables[table2.tableName, table2.Namespace];
DataTable table6 = set.Tables[table2.tableName, table2.Namespace];
foreach (Constraint constraint3 in table6.Constraints)
//.........这里部分代码省略.........