internal static void AddExtendedProperties(PropertyCollection props, XmlElement node, Type type)
{
if (props != null)
{
foreach (DictionaryEntry entry in props)
{
string s, v;
if (entry.Key is INullable)
{
s = (string)SqlConvert.ChangeTypeForXML(entry.Key, typeof(string));
}
else
{
s = Convert.ToString(entry.Key, CultureInfo.InvariantCulture);
}
if (entry.Value is INullable)
{
v = (string)SqlConvert.ChangeTypeForXML(entry.Value, typeof(string));
}
else if (entry.Value is System.Numerics.BigInteger)
{
v = (string)BigIntegerStorage.ConvertFromBigInteger((System.Numerics.BigInteger)entry.Value, typeof(string), CultureInfo.InvariantCulture);
}
else
{
v = Convert.ToString(entry.Value, CultureInfo.InvariantCulture);
}
if (type == typeof(DataRelation))
{
s = Keywords.MSD_REL_PREFIX + s;
}
else if (type == typeof(ForeignKeyConstraint))
{
s = Keywords.MSD_FK_PREFIX + s;
}
node.SetAttribute(XmlConvert.EncodeLocalName(s), Keywords.MSPROPNS, v);
}
}
}