File: XmlElementExtensions.cs

package info (click to toggle)
gnome-subtitles 1.8-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid
  • size: 103,144 kB
  • sloc: xml: 406,395; cs: 364,495; ansic: 3,104; perl: 1,477; sh: 769; python: 545; javascript: 500; makefile: 49
file content (20 lines) | stat: -rw-r--r-- 361 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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);
			}
		}
	}
}