예제 #1
0
파일: grammar.cs 프로젝트: 0xCM/Meta.Core
 /// <summary>
 /// Returns the identifiers as determined by defined enum literals and/or attributions
 /// </summary>
 /// <typeparam name="E">The enum type</typeparam>
 /// <returns></returns>
 public static IReadOnlyList <string> identifiers <E>()
     where E : Enum
 => _enumIdentifiers.GetOrAdd(typeof(E), _ => ClrEnum.Get <E>().Identifiers.Stream().ToReadOnlyList());
예제 #2
0
파일: Choice.cs 프로젝트: 0xCM/Meta.Core
        public void Test10()
        {
            var choices = Choices.FromEnum <Pick>();

            claim.count(ClrEnum.Get <Pick>().Literals.Count, choices.Stream());
        }
예제 #3
0
파일: Choices.cs 프로젝트: 0xCM/Meta.Core
 public static Seq <EnumChoice <E> > FromEnum <E>()
     where E : Enum => from l in ClrEnum.Get <E>().Literals
 select new EnumChoice <E>(parseEnum <E>(l.LiteralName));