Esempio n. 1
0
        public void GetAllNbRefFieldStrings_should_ok()
        {
            //var theType = typeof(Dic_DicTypeCode);
            //var nbRefFileds = NbRefFieldValue.GetAllNbRefFieldStrings(theType);
            //foreach (var nbRefFiled in nbRefFileds)
            //{
            //    var barValue = DicType.Create(nbRefFiled.FieldValue, nbRefFiled.Description, true, true);
            //    barValue.LogJson();
            //}

            var allNbRefFieldStrings = NbRefFieldValue.GetAllNbRefFieldStrings(typeof(MockCodes));

            allNbRefFieldStrings.LogJson();
            ShouldOK("A1", "A1", "A1Desc", allNbRefFieldStrings[0]);
            ShouldOK("X", "B1", "XDesc", allNbRefFieldStrings[1]);
            ShouldOK("A2", "A2", "A2Desc", allNbRefFieldStrings[2]);
        }
Esempio n. 2
0
        public static IList <NbRefFieldValue> ExportNbRefFields(params Assembly[] assemblies)
        {
            var nbRefFieldValues = new List <NbRefFieldValue>();

            foreach (var assembly in assemblies)
            {
                var types = assembly.GetTypes();
                foreach (var type in types)
                {
                    var theFieldValues = NbRefFieldValue.GetAllNbRefFieldStrings(type);
                    foreach (var theFieldValue in theFieldValues)
                    {
                        nbRefFieldValues.Add(theFieldValue);
                    }
                }
            }

            return(nbRefFieldValues);
        }