<commit_before>using System;
using System.Xml;
using Gecko;
using Palaso.Code;

namespace Bloom
{
	/// <summary>
	/// Takes a Gecko element or an XmlElement, and then provides a few simple operations on
	/// the element so that the client doesn't have to know which it has.
	/// This is useful because it would be hard to introduce gecko elements in many simple
	/// unit tests.
	/// </summary>
	public class ElementProxy
	{
		private readonly GeckoHtmlElement _geckoElement;
		private readonly XmlElement _xmlElement;

		public ElementProxy(GeckoHtmlElement element)
		{

			_geckoElement = element;
		}
		public ElementProxy(XmlElement element)
		{
			Guard.AgainstNull(element, "element");
			_xmlElement = element;
		}

		/// <summary>
		/// Sets the named attribute
		/// </summary>
		public void SetAttribute(string attributeName, string value)
		{
			if (_xmlElement == null)
			{
				_geckoElement.SetAttribute(attributeName, value);
			}
			else 
			{
				_xmlElement.SetAttribute(attributeName, value);
			}
		}

		/// <summary>
		/// Gets the class name
		/// </summary>
		public string Name
		{
			get
			{
				if (_xmlElement == null)
				{
					return _geckoElement.ClassName;
				}
				else
				{
					return _xmlElement.Name;
				}
			}
		}<commit_msg>Fix editMetadata button<commit_after>using System;
using System.Xml;
using Gecko;
using Palaso.Code;

namespace Bloom
{
	/// <summary>
	/// Takes a Gecko element or an XmlElement, and then provides a few simple operations on
	/// the element so that the client doesn't have to know which it has.
	/// This is useful because it would be hard to introduce gecko elements in many simple
	/// unit tests.
	/// </summary>
	public class ElementProxy
	{
		private readonly GeckoHtmlElement _geckoElement;
		private readonly XmlElement _xmlElement;

		public ElementProxy(GeckoHtmlElement element)
		{

			_geckoElement = element;
		}
		public ElementProxy(XmlElement element)
		{
			Guard.AgainstNull(element, "element");
			_xmlElement = element;
		}

		/// <summary>
		/// Sets the named attribute
		/// </summary>
		public void SetAttribute(string attributeName, string value)
		{
			if (_xmlElement == null)
			{
				_geckoElement.SetAttribute(attributeName, value);
			}
			else 
			{
				_xmlElement.SetAttribute(attributeName, value);
			}
		}

		/// <summary>
		/// Gets the class name
		/// </summary>
		public string Name
		{
			get
			{
				if (_xmlElement == null)
				{
					return _geckoElement.NodeName;
				}
				else
				{
					return _xmlElement.Name;
				}
			}
		}
{'fraction_non_alphanumeric': 0.09901768172888016, 'fraction_numerical': 0.0, 'mean_word_length': 2.805680119581465, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 12}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '898404', 'n_tokens_mistral': 959, 'n_tokens_neox': 771, 'n_words': 238}