<commit_before>// $Id$

using System;
using System.Collections;
using System.Globalization;
using System.Reflection;
using System.Resources;

namespace PlayOnline.Core {

  public class NamedEnum {

    private object EnumValue_;
    private string EnumValueName_;

    public NamedEnum(object EnumValue) {
      this.EnumValue_ = EnumValue;
    string MessageName = String.Format("E:{0}.{1}", EnumValue.GetType().Name, EnumValue);
      this.EnumValueName_ = I18N.GetText(MessageName, EnumValue.GetType().Assembly);
      if (this.EnumValueName_ == MessageName)
	this.EnumValueName_ = I18N.GetText(MessageName, Assembly.GetCallingAssembly());
      if (this.EnumValueName_ == MessageName)
	this.EnumValueName_ = EnumValue.ToString();
    }

    public string Name {
      get {
	return this.EnumValueName_;
      }
    }

    public object Value {
      get {
	return this.EnumValue_;
      }
    }

    public override string ToString() {
      return this.Name;
    }

    public static NamedEnum[] GetAll(Type T) {
      if (!T.IsEnum)
	return null;
    ArrayList Values = new ArrayList();
      foreach (FieldInfo FI in T.GetFields(BindingFlags.Public | BindingFlags.Static))
	Values.Add(new NamedEnum(FI.GetValue(null)));
      return (NamedEnum[]) Values.ToArray(typeof(NamedEnum));
    }

  }

}<commit_msg>Minor cosmetic change.<commit_after>// $Id$

using System;
using System.Collections;
using System.Globalization;
using System.Reflection;
using System.Resources;

namespace PlayOnline.Core {

  public class NamedEnum {

    private object EnumValue_;
    private string EnumValueName_;

    public NamedEnum(object EnumValue) {
      this.EnumValue_ = EnumValue;
    string MessageName = String.Format("E:{0}.{1}", EnumValue.GetType().Name, EnumValue);
      this.EnumValueName_ = I18N.GetText(MessageName, EnumValue.GetType().Assembly);
      if (this.EnumValueName_ == MessageName)
	this.EnumValueName_ = I18N.GetText(MessageName, Assembly.GetCallingAssembly());
      if (this.EnumValueName_ == MessageName)
	this.EnumValueName_ = EnumValue.ToString();
    }

    public string Name  { get { return this.EnumValueName_; } }
    public object Value { get { return this.EnumValue_;     } }

    public override string ToString() { return this.Name; }

    public static NamedEnum[] GetAll(Type T) {
      if (!T.IsEnum)
	return null;
    ArrayList Values = new ArrayList();
      foreach (FieldInfo FI in T.GetFields(BindingFlags.Public | BindingFlags.Static))
	Values.Add(new NamedEnum(FI.GetValue(null)));
      return (NamedEnum[]) Values.ToArray(typeof(NamedEnum));
    }

  }

}
{'fraction_non_alphanumeric': 0.11273566756444786, 'fraction_numerical': 0.00461716044632551, 'mean_word_length': 3.6594982078853047, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '7291932', 'n_tokens_mistral': 802, 'n_tokens_neox': 772, 'n_words': 180}