This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Description
Flag Enums produce an empty string when calling GetDisplayName(). It might be preferable if it produced a comma separated list in this case.
e.g. "Walk, Drive"
If we don't want to support it we could through an exception so this doesn't fail quietly.
using System;
using Enable.EnumDisplayName;
namespace ConsoleApp
{
[Flags]
public enum Commute
{
[EnumDisplayName("Cycle")]
Bike = 1,
[EnumDisplayName("Drive")]
Car = 2,
[EnumDisplayName("Walk")]
Walk = 4
}
class Program
{
static void Main(string[] args)
{
var commuteWalk = Commute.Walk;
Console.WriteLine(commuteWalk.GetDisplayName()); // "Walk"
var commuteWalkDrive = Commute.Walk | Commute.Car;
Console.WriteLine(commuteWalkDrive.GetDisplayName()); // ""
}
}
}