mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2024-12-23 20:05:29 +00:00
d35ef48f86
This will make it easier to correctly handle attributes that contain a boolean value.
21 lines
361 B
C#
21 lines
361 B
C#
using System;
|
|
using System.Xml;
|
|
|
|
namespace GtkSharp.Generation
|
|
{
|
|
public static class XmlElementExtensions
|
|
{
|
|
public static bool GetAttributeAsBoolean (this XmlElement elt, string name)
|
|
{
|
|
string value = elt.GetAttribute (name);
|
|
|
|
if (String.IsNullOrEmpty (value)) {
|
|
return false;
|
|
} else {
|
|
return XmlConvert.ToBoolean (value);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|