private void LoadTypesPlatformTypesConvertors() { var targetAttributeType = typeof(PlatformTypesConvertorAttribute); var typesList = AppDomainTypesEnumerator.GetTypes().Where(p => p.GetCustomAttributesData().Any(x => x.AttributeType == targetAttributeType)).ToList(); foreach (var type in typesList) { var convertor = (IPlatformTypesConvertor)Activator.CreateInstance(type); PlatformTypesConvertorsRegistry.AddConvertor(convertor); } }
private static void TstGetTypes() { _logger.Log("Begin"); var typesList = AppDomainTypesEnumerator.GetTypes(); _logger.Log($"typesList.Length = {typesList.Count}"); foreach (var type in typesList) { _logger.Log($"type.FullName = {type.FullName}"); } _logger.Log("End"); }
private static void TstLoadTypesPlatformTypesConvertors() { _logger.Log("Begin"); var targetAttributeType = typeof(PlatformTypesConvertorAttribute); var typesList = AppDomainTypesEnumerator.GetTypes().Where(p => p.GetCustomAttributesData().Any(x => x.AttributeType == targetAttributeType)); _logger.Log($"typesList.Length = {typesList.Count()}"); foreach (var type in typesList) { _logger.Log($"type.FullName = {type.FullName}"); var convertor = (IPlatformTypesConvertor)Activator.CreateInstance(type); _logger.Log($"convertor = {convertor}"); } _logger.Log("End"); }