コード例 #1
0
ファイル: ExtensionsEnumTest.cs プロジェクト: 74nu5/Ustilz
        public void TestToDescriptionDictionaryNominal()
        {
            var descriptionDictionary = ExtensionsEnum.GetDescriptionDictionary <TestEnum>();

            Assert.NotEmpty(descriptionDictionary);
            Assert.Equal(3, descriptionDictionary.Count);
            Assert.Equal(string.Empty, descriptionDictionary["Valeur1"]);
            Assert.Null(descriptionDictionary["Valeur2"]);
            Assert.Equal("Troisième valeur", descriptionDictionary["Valeur3"]);
        }
コード例 #2
0
        private void showEntries(IEnumerable <IEntry <string, object> > _map)
        {
            Console.WriteLine(_map.GetType());
            foreach (IEntry <string, object> e in _map)
            {
                Console.WriteLine(e.getKey() + " " + e.getValue());
                Console.WriteLine(e.getKey().GetType() + " " + e.getValue().GetType());
                foreach (Type t in e.GetType().GetGenericArguments())
                {
                    Console.WriteLine(t);
                }
            }
            object o   = Hobbies.AIKIDO;
            bool   is_ = o is Enum;
            Enum   h_  = o as Enum;

            Console.WriteLine(h_.getFullName() + " " + is_);
            Console.WriteLine(ExtensionsEnum.getFullName(h_) + " " + is_);
            //_map.getKeys();
            Console.WriteLine(_map is IEnumerable <IEntry <object, object> >);
        }
コード例 #3
0
ファイル: DbVote.cs プロジェクト: tonineXtalliya/Nanoka
 public static string CreateId(string userId, NanokaEntity entity, string entityId)
 => $"{userId}_{ExtensionsEnum<NanokaEntity>.GetName(entity)}_{entityId}";