<commit_before>﻿// <copyright file="RegisterActionAttribute.cs" company="<NAME>">
//  Opus
// </copyright>
// <summary>Opus Core</summary>
// <author><NAME></author>
namespace Opus.Core
{
    [System.AttributeUsage(System.AttributeTargets.Assembly, AllowMultiple=true)]
    public class RegisterActionAttribute : System.Attribute, System.IComparable
    {
        public RegisterActionAttribute(System.Type classType)
        {
            if (!typeof(IAction).IsAssignableFrom(classType))
            {
                throw new Exception(System.String.Format("Class '{0}' does not implement the IAction interface", classType.ToString()));
            }

            this.Action = System.Activator.CreateInstance(classType) as IAction;
        }

        public IAction Action
        {
            get;
            private set;
        }

        int System.IComparable.CompareTo(object obj)
        {
            RegisterActionAttribute thisAs = this as RegisterActionAttribute;
            RegisterActionAttribute objAs = obj as RegisterActionAttribute;

            int compare = thisAs.Action.CommandLineSwitch.CompareTo(objAs.Action.CommandLineSwitch);
            return compare;
        }
    }
}<commit_msg>[trunk] Opus.Core.RegisterActionAttribute now has an overridden ToString<commit_after>﻿// <copyright file="RegisterActionAttribute.cs" company="<NAME>">
//  Opus
// </copyright>
// <summary>Opus Core</summary>
// <author><NAME></author>
namespace Opus.Core
{
    [System.AttributeUsage(System.AttributeTargets.Assembly, AllowMultiple=true)]
    public class RegisterActionAttribute : System.Attribute, System.IComparable
    {
        public RegisterActionAttribute(System.Type classType)
        {
            if (!typeof(IAction).IsAssignableFrom(classType))
            {
                throw new Exception(System.String.Format("Class '{0}' does not implement the IAction interface", classType.ToString()));
            }

            this.Action = System.Activator.CreateInstance(classType) as IAction;
        }

        public IAction Action
        {
            get;
            private set;
        }

        int System.IComparable.CompareTo(object obj)
        {
            RegisterActionAttribute thisAs = this as RegisterActionAttribute;
            RegisterActionAttribute objAs = obj as RegisterActionAttribute;

            int compare = thisAs.Action.CommandLineSwitch.CompareTo(objAs.Action.CommandLineSwitch);
            return compare;
        }

        public override string ToString()
        {
            return this.Action.CommandLineSwitch + " (" + this.Action.Description + ")";
        }
    }
}

{'fraction_non_alphanumeric': 0.09698750918442321, 'fraction_numerical': 0.0007347538574577516, 'mean_word_length': 2.2649880095923263, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, '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': '2486478', 'n_tokens_mistral': 695, 'n_tokens_neox': 673, 'n_words': 137}