My enum consists of the following values:
private enum PublishStatusses{
NotCompleted,
Completed,
Error
};
I want to be able to
Instead of using an enum use a static class.
replace
private enum PublishStatuses{
NotCompleted,
Completed,
Error
};
with
private static class PublishStatuses{
public static readonly string NotCompleted = "Not Completed";
public static readonly string Completed = "Completed";
public static readonly string Error = "Error";
};
it will be used like this
PublishStatuses.NotCompleted; // "Not Completed"
Issue using the top "extension method" solutions:
A private enum is often used inside another class. The extension method solution is not valid there since it must be in it's own class. This solution can be private and embedded in another class.