Skip to content

Commit

Permalink
Update docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikernet committed Jan 7, 2021
1 parent a78594e commit 88446bb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ var enumNames = Enum<ConsoleKey>.Names;
var enumValues = Enum<ConsoleKey>.Values;

// Get enum field name for a particular value
var backspaceName = Enum<ConsoleKey>.GetName(ConsoleKey.Backspace);
string backspaceName = ConsoleKey.Backspace.GetName();

// Bitwise flag operations
var value = AttributeTargets.Assembly.SetFlags(AttributeTargets.Class, AttributeTargets.Method);
Expand All @@ -52,7 +52,7 @@ IEnumerable<AttributeTargets> splitValues = value.SplitFlags(); // 3 separate fl
// Create a parser that uses the [Display] attribute to get the names
var displayNameParser = new EnumParser<MyEnum>(
m => m.Field.GetCustomAttribute<DisplayAttribute>()!.GetName());
m => m.Field.GetCustomAttribute<DisplayAttribute>().GetName());

// Create a case-insensitive parser with a non-default separator
var parser = new EnumParser<AttributeTargets>(separator: " | ", caseSensitive: false);
Expand Down
2 changes: 1 addition & 1 deletion Source/Singulink.Enums/Enum.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public static ImmutableArray<T> Values {
}

/// <summary>
/// Gets the enumeration members.
/// Gets the enumeration members. This is a slow reflection-based operation that does not cache the results.
/// </summary>
public static IEnumerable<EnumMember<T>> GetMembers() => typeof(T).GetFields(BindingFlags.Static | BindingFlags.Public).Select(f => new EnumMember<T>(f));

Expand Down
2 changes: 1 addition & 1 deletion Source/Singulink.Enums/EnumParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
namespace Singulink.Enums
{
/// <summary>
/// Provides enumeration string conversion functionality.
/// Provides enumeration string conversion functionality. All operations are thread-safe.
/// </summary>
public sealed class EnumParser<T> where T : unmanaged, Enum
{
Expand Down

0 comments on commit 88446bb

Please sign in to comment.