static TCWriteValue()
{
if (typeMapper == null)
{
typeMapper = new Dictionary<string, Type>();
typeMapper.Add("UInt64", typeof(UInt64));
typeMapper.Add("UInt32", typeof(UInt32));
typeMapper.Add("UInt16", typeof(UInt16));
typeMapper.Add("Int64", typeof(Int64));
typeMapper.Add("Int32", typeof(Int32));
typeMapper.Add("Int16", typeof(Int16));
typeMapper.Add("Byte", typeof(Byte));
typeMapper.Add("SByte", typeof(SByte));
typeMapper.Add("Decimal", typeof(Decimal));
typeMapper.Add("Single", typeof(Single));
typeMapper.Add("float", typeof(float));
typeMapper.Add("object", typeof(object));
typeMapper.Add("bool", typeof(bool));
typeMapper.Add("DateTime", typeof(DateTime));
typeMapper.Add("DateTimeOffset", typeof(DateTimeOffset));
typeMapper.Add("ByteArray", typeof(byte[]));
typeMapper.Add("BoolArray", typeof(bool[]));
typeMapper.Add("ObjectArray", typeof(Object[]));
typeMapper.Add("DecimalArray", typeof(Decimal[]));
typeMapper.Add("DoubleArray", typeof(Double[]));
typeMapper.Add("DateTimeArray", typeof(DateTime[]));
typeMapper.Add("DateTimeOffsetArray", typeof(DateTimeOffset[]));
typeMapper.Add("Int16Array", typeof(Int16[]));
typeMapper.Add("Int32Array", typeof(Int32[]));
typeMapper.Add("Int64Array", typeof(Int64[]));
typeMapper.Add("SByteArray", typeof(SByte[]));
typeMapper.Add("SingleArray", typeof(Single[]));
typeMapper.Add("StringArray", typeof(string[]));
typeMapper.Add("TimeSpanArray", typeof(TimeSpan[]));
typeMapper.Add("UInt16Array", typeof(UInt16[]));
typeMapper.Add("UInt32Array", typeof(UInt32[]));
typeMapper.Add("UInt64Array", typeof(UInt64[]));
typeMapper.Add("UriArray", typeof(Uri[]));
typeMapper.Add("XmlQualifiedNameArray", typeof(XmlQualifiedName[]));
typeMapper.Add("List", typeof(List<string>));
typeMapper.Add("TimeSpan", typeof(TimeSpan));
typeMapper.Add("Double", typeof(Double));
typeMapper.Add("Uri", typeof(Uri));
typeMapper.Add("XmlQualifiedName", typeof(XmlQualifiedName));
typeMapper.Add("Char", typeof(Char));
typeMapper.Add("string", typeof(string));
}
if (value == null)
{
value = new Dictionary<string, object>();
value.Add("UInt64", UInt64.MaxValue);
value.Add("UInt32", UInt32.MaxValue);
value.Add("UInt16", UInt16.MaxValue);
value.Add("Int64", Int64.MaxValue);
value.Add("Int32", Int32.MaxValue);
value.Add("Int16", Int16.MaxValue);
value.Add("Byte", Byte.MaxValue);
value.Add("SByte", SByte.MaxValue);
value.Add("Decimal", Decimal.MaxValue);
value.Add("Single", -4582.24);
value.Add("float", -4582.24F);
value.Add("object", 0);
value.Add("bool", false);
value.Add("DateTime", new DateTime(2002, 1, 3, 21, 59, 59, 59));
value.Add("DateTimeOffset", new DateTimeOffset(2002, 1, 3, 21, 59, 59, 59, TimeSpan.FromHours(0)));
value.Add("ByteArray", new byte[] { 0xd8, 0x7e });
value.Add("BoolArray", new bool[] { true, false });
value.Add("ObjectArray", new Object[] { 0, 1 });
value.Add("DecimalArray", new Decimal[] { 0, 1 });
value.Add("DoubleArray", new Double[] { 0, 1 });
value.Add("DateTimeArray", new DateTime[] { new DateTime(2002, 12, 30), new DateTime(2, 1, 3, 23, 59, 59, 59) });
value.Add("DateTimeOffsetArray", new DateTimeOffset[] { new DateTimeOffset(2002, 12, 30, 0, 0, 0, TimeSpan.FromHours(-8.0)), new DateTimeOffset(2, 1, 3, 23, 59, 59, 59, TimeSpan.FromHours(0)) });
value.Add("Int16Array", new Int16[] { 0, 1 });
value.Add("Int32Array", new Int32[] { 0, 1 });
value.Add("Int64Array", new Int64[] { 0, 1 });
value.Add("SByteArray", new SByte[] { 0, 1 });
value.Add("SingleArray", new Single[] { 0, 1 });
value.Add("StringArray", new string[] { "0", "1" });
value.Add("TimeSpanArray", new TimeSpan[] { TimeSpan.MinValue, TimeSpan.MaxValue });
value.Add("UInt16Array", new UInt16[] { 0, 1 });
value.Add("UInt32Array", new UInt32[] { 0, 1 });
value.Add("UInt64Array", new UInt64[] { 0, 1 });
value.Add("UriArray", new Uri[] { new Uri("http://wddata", UriKind.Absolute), new Uri("http://webxtest") });
value.Add("XmlQualifiedNameArray", new XmlQualifiedName[] { new XmlQualifiedName("a"), new XmlQualifiedName("b", null) });
value.Add("List", new List<Guid>[] { });
value.Add("TimeSpan", new TimeSpan());
value.Add("Double", Double.MaxValue);
value.Add("Uri", "http");
value.Add("XmlQualifiedName", new XmlQualifiedName("a", null));
value.Add("Char", Char.MaxValue);
value.Add("string", "123");
}
}
private object[] _dates = new object[]