wasDAVClient
/wasDAVClient/Helpers/ResponseParser.cs |
@@ -9,12 +9,19 @@ |
namespace wasDAVClient.Helpers |
{ |
/// <summary> |
/// Represents the parser for response's results. |
/// Represents the parser for response's results. |
/// </summary> |
internal static class ResponseParser |
{ |
internal static XmlReaderSettings XmlReaderSettings = new XmlReaderSettings |
{ |
IgnoreComments = true, |
IgnoreProcessingInstructions = true, |
IgnoreWhitespace = true |
}; |
|
/// <summary> |
/// Parses the disk item. |
/// Parses the disk item. |
/// </summary> |
/// <param name="stream">The response text.</param> |
/// <returns>The parsed item.</returns> |
@@ -23,15 +30,8 @@ |
return ParseItems(stream).FirstOrDefault(); |
} |
|
internal static XmlReaderSettings XmlReaderSettings = new XmlReaderSettings |
{ |
IgnoreComments = true, |
IgnoreProcessingInstructions = true, |
IgnoreWhitespace = true |
}; |
|
/// <summary> |
/// Parses the disk items. |
/// Parses the disk items. |
/// </summary> |
/// <param name="stream">The response text.</param> |
/// <returns>The list of parsed items.</returns> |
@@ -40,7 +40,6 @@ |
var items = new List<Item>(); |
using (var reader = XmlReader.Create(stream, XmlReaderSettings)) |
{ |
|
Item itemInfo = null; |
while (reader.Read()) |
{ |
@@ -125,7 +124,8 @@ |
{ |
reader.Read(); |
var resourceType = reader.LocalName.ToLower(); |
if (string.Equals(resourceType, "collection", StringComparison.InvariantCultureIgnoreCase)) |
if (string.Equals(resourceType, "collection", |
StringComparison.InvariantCultureIgnoreCase)) |
itemInfo.IsCollection = true; |
} |
break; |
@@ -138,10 +138,10 @@ |
reader.Skip(); |
break; |
default: |
{ |
int a = 0; |
break; |
} |
{ |
var a = 0; |
break; |
} |
} |
} |
else if (reader.NodeType == XmlNodeType.EndElement && reader.LocalName.ToLower() == "response") |
@@ -164,7 +164,5 @@ |
|
return items; |
} |
|
|
} |
} |
} |