本文整理汇总了C#中System.Runtime.Serialization.XmlWriterDelegator.WriteDateTimeArray方法的典型用法代码示例。如果您正苦于以下问题:C# XmlWriterDelegator.WriteDateTimeArray方法的具体用法?C# XmlWriterDelegator.WriteDateTimeArray怎么用?C# XmlWriterDelegator.WriteDateTimeArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Runtime.Serialization.XmlWriterDelegator
的用法示例。
在下文中一共展示了XmlWriterDelegator.WriteDateTimeArray方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReflectionTryWritePrimitiveArray
private bool ReflectionTryWritePrimitiveArray(XmlWriterDelegator xmlWriter, object obj, Type type, Type itemType, XmlDictionaryString collectionItemName, XmlDictionaryString itemNamespace)
{
PrimitiveDataContract primitiveContract = PrimitiveDataContract.GetPrimitiveDataContract(itemType);
if (primitiveContract == null)
return false;
switch (itemType.GetTypeCode())
{
case TypeCode.Boolean:
xmlWriter.WriteBooleanArray((bool[])obj, collectionItemName, itemNamespace);
break;
case TypeCode.DateTime:
xmlWriter.WriteDateTimeArray((DateTime[])obj, collectionItemName, itemNamespace);
break;
case TypeCode.Decimal:
xmlWriter.WriteDecimalArray((decimal[])obj, collectionItemName, itemNamespace);
break;
case TypeCode.Int32:
xmlWriter.WriteInt32Array((int[])obj, collectionItemName, itemNamespace);
break;
case TypeCode.Int64:
xmlWriter.WriteInt64Array((long[])obj, collectionItemName, itemNamespace);
break;
case TypeCode.Single:
xmlWriter.WriteSingleArray((float[])obj, collectionItemName, itemNamespace);
break;
case TypeCode.Double:
xmlWriter.WriteDoubleArray((double[])obj, collectionItemName, itemNamespace);
break;
default:
return false;
}
return true;
}