mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-23 17:24:46 +03:00
Moved the http server to it's own assembly. added comments and made other minor re-organizations.
This commit is contained in:
parent
6fbd5cf464
commit
80b3ad7bd2
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Globalization;
|
||||
using System.Xml;
|
||||
|
||||
namespace MediaBrowser.Controller.Xml
|
||||
@@ -8,13 +7,16 @@ namespace MediaBrowser.Controller.Xml
|
||||
{
|
||||
private static CultureInfo _usCulture = new CultureInfo("en-US");
|
||||
|
||||
/// <summary>
|
||||
/// Reads a float from the current element of an XmlReader
|
||||
/// </summary>
|
||||
public static float ReadFloatSafe(this XmlReader reader)
|
||||
{
|
||||
string valueString = reader.ReadElementContentAsString();
|
||||
|
||||
float value = 0;
|
||||
|
||||
if (!string.IsNullOrEmpty(valueString))
|
||||
if (!string.IsNullOrWhiteSpace(valueString))
|
||||
{
|
||||
// float.TryParse is local aware, so it can be probamatic, force us culture
|
||||
float.TryParse(valueString, NumberStyles.AllowDecimalPoint, _usCulture, out value);
|
||||
@@ -23,13 +25,16 @@ namespace MediaBrowser.Controller.Xml
|
||||
return value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Reads an int from the current element of an XmlReader
|
||||
/// </summary>
|
||||
public static int ReadIntSafe(this XmlReader reader)
|
||||
{
|
||||
string valueString = reader.ReadElementContentAsString();
|
||||
|
||||
int value = 0;
|
||||
|
||||
if (!string.IsNullOrEmpty(valueString))
|
||||
if (!string.IsNullOrWhiteSpace(valueString))
|
||||
{
|
||||
|
||||
int.TryParse(valueString, out value);
|
||||
|
||||
Reference in New Issue
Block a user