Skip to content

Commit ddbf56e

Browse files
committed
Remove "using System.Xml"
1 parent de68652 commit ddbf56e

File tree

3 files changed

+16
-10
lines changed

3 files changed

+16
-10
lines changed

src/Newtonsoft.Json/JsonConvert.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@
3434
#endif
3535
using Newtonsoft.Json.Linq;
3636
using Newtonsoft.Json.Utilities;
37+
#if !(UNITY3D)
3738
using System.Xml;
39+
#endif
3840
using Newtonsoft.Json.Converters;
3941
using Newtonsoft.Json.Serialization;
4042
using System.Text;
@@ -504,7 +506,7 @@ public static string ToString(object value)
504506
throw new ArgumentException("Unsupported type: {0}. Use the JsonSerializer class to get the object's JSON representation.".FormatWith(CultureInfo.InvariantCulture, value.GetType()));
505507
}
506508

507-
#region Serialize
509+
#region Serialize
508510
/// <summary>
509511
/// Serializes the specified object to a JSON string.
510512
/// </summary>
@@ -693,9 +695,9 @@ public static Task<string> SerializeObjectAsync(object value, Formatting formatt
693695
return Task.Factory.StartNew(() => SerializeObject(value, formatting, settings));
694696
}
695697
#endif
696-
#endregion
698+
#endregion
697699

698-
#region Deserialize
700+
#region Deserialize
699701
/// <summary>
700702
/// Deserializes the JSON to a .NET object.
701703
/// </summary>
@@ -915,7 +917,7 @@ public static Task<object> DeserializeObjectAsync(string value, Type type, JsonS
915917
return Task.Factory.StartNew(() => DeserializeObject(value, type, settings));
916918
}
917919
#endif
918-
#endregion
920+
#endregion
919921

920922
/// <summary>
921923
/// Populates the object with values from the JSON string.

src/Newtonsoft.Json/JsonTextWriter.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@
3131
#endif
3232
using System.Text;
3333
using System.IO;
34+
#if !(UNITY3D)
3435
using System.Xml;
36+
#endif
3537
using Newtonsoft.Json.Utilities;
3638

3739
namespace Newtonsoft.Json
@@ -333,7 +335,7 @@ private void WriteValueInternal(string value, JsonToken token)
333335
_writer.Write(value);
334336
}
335337

336-
#region WriteValue methods
338+
#region WriteValue methods
337339
/// <summary>
338340
/// Writes a <see cref="Object"/> value.
339341
/// An error will raised if the value cannot be written as a single JSON token.
@@ -705,7 +707,7 @@ public override void WriteValue(Uri value)
705707
WriteEscapedString(value.OriginalString, true);
706708
}
707709
}
708-
#endregion
710+
#endregion
709711

710712
/// <summary>
711713
/// Writes out a comment <code>/*...*/</code> containing the specified text.

src/Newtonsoft.Json/Utilities/DateTimeUtils.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@
2525

2626
using System;
2727
using System.IO;
28+
#if !UNITY3D
2829
using System.Xml;
30+
#endif
2931
using System.Globalization;
3032

3133
namespace Newtonsoft.Json.Utilities
@@ -195,7 +197,7 @@ internal static DateTime ConvertJavaScriptTicksToDateTime(long javaScriptTicks)
195197
return dateTime;
196198
}
197199

198-
#region Parse
200+
#region Parse
199201

200202
internal static bool TryParseDateTimeIso(StringReference text, DateTimeZoneHandling dateTimeZoneHandling, out DateTime dt)
201203
{
@@ -583,9 +585,9 @@ private static bool TryReadOffset(StringReference offsetText, int startIndex, ou
583585

584586
return true;
585587
}
586-
#endregion
588+
#endregion
587589

588-
#region Write
590+
#region Write
589591
internal static void WriteDateTimeString(TextWriter writer, DateTime value, DateFormatHandling format, string formatString, CultureInfo culture)
590592
{
591593
if (string.IsNullOrEmpty(formatString))
@@ -733,7 +735,7 @@ internal static void WriteDateTimeOffsetString(TextWriter writer, DateTimeOffset
733735
}
734736
}
735737
#endif
736-
#endregion
738+
#endregion
737739

738740
private static void GetDateValues(DateTime td, out int year, out int month, out int day)
739741
{

0 commit comments

Comments
 (0)