虫虫首页|资源下载|资源专辑|精品软件
登录|注册

您现在的位置是:虫虫下载站 > 资源下载 > 多国语言处理 > AutomaticPropertiesDefaultValues Article_src.zip PropertyInfo[] props = o.GetType().GetPropert

AutomaticPropertiesDefaultValues Article_src.zip PropertyInfo[] props = o.GetType().GetPropert

资 源 简 介

AutomaticPropertiesDefaultValues Article_src.zip PropertyInfo[] props = o.GetType().GetProperties(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static) for (int i = 0 i < props.Length i++) { PropertyInfo prop = props[i] if (prop.GetCustomAttributes(true).Length > 0) { object[] defaultValueAttribute = prop.GetCustomAttributes(typeof(DefaultValueAttribute), true) if (defaultValueAttribute != null) { DefaultValueAttribute dva = defaultValueAttribute[0] as DefaultValueAttribute if(dva != null) prop.SetValue(o, dva.Value, null) }

相 关 资 源