-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathKmlFormatter-lock-format.cs.patch
More file actions
49 lines (45 loc) · 1.93 KB
/
Copy pathKmlFormatter-lock-format.cs.patch
File metadata and controls
49 lines (45 loc) · 1.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
Index: SharpKml/Base/KmlFormatter.cs
===================================================================
--- SharpKml/Base/KmlFormatter.cs (revision 44542)
+++ SharpKml/Base/KmlFormatter.cs (working copy)
@@ -9,6 +9,7 @@
internal class KmlFormatter : ICustomFormatter, IFormatProvider
{
private static readonly KmlFormatter SingleInstance = new KmlFormatter();
+ private object _formatLock;
private KmlFormatter()
{
@@ -43,22 +44,25 @@
{
if (format == null)
{
- var convertible = arg as IConvertible;
- if (convertible != null)
+ lock (_formatLock)
{
- switch (convertible.GetTypeCode())
+ var convertible = arg as IConvertible;
+ if (convertible != null)
{
- case TypeCode.Boolean:
- return GetBool((bool)arg);
+ switch (convertible.GetTypeCode())
+ {
+ case TypeCode.Boolean:
+ return GetBool((bool) arg);
- case TypeCode.DateTime:
- return GetDateTime((DateTime)arg);
+ case TypeCode.DateTime:
+ return GetDateTime((DateTime) arg);
- case TypeCode.Double:
- return GetFloatingPoint((double)arg);
+ case TypeCode.Double:
+ return GetFloatingPoint((double) arg);
- case TypeCode.Single:
- return GetFloatingPoint((float)arg);
+ case TypeCode.Single:
+ return GetFloatingPoint((float) arg);
+ }
}
}
}