mercredi 23 septembre 2020

Understanding a C# implementation of the Extensible Enum Pattern

I see the following code in a codebase. However, I don't get how this implements the Extensible Enum pattern.

    // Summary:
    //     An "extensible Enum" .
    public class FileType : IEquatable<FileType>
    {
        public FileType(string TypeName);

        public static FileType A { get; }

        public static FileType B { get; }

        public override bool Equals(object obj);
        public override int GetHashCode();
    }

Aucun commentaire:

Enregistrer un commentaire