コード例 #1
0
 public TranslatedProperty(TranslateAttribute attr, PropertyInfo propertyInfo)
 {
     _propertyInfo = propertyInfo;
     if (propertyInfo.PropertyType != typeof(string))
     {
         throw new InvalidOperationException("The property " + propertyInfo.DeclaringType.FullName + "." + propertyInfo.Name + " can not be translated because it does not have type string.");
     }
     Name = _propertyInfo.Name;
 }
コード例 #2
0
 public TranslatedProperty(TranslateAttribute attr, PropertyInfo propertyInfo)
 {
     _propertyInfo = propertyInfo;
     if(propertyInfo.PropertyType != typeof(string))
     {
         throw new InvalidOperationException("The property " + propertyInfo.DeclaringType.FullName + "." + propertyInfo.Name + " can not be translated because it does not have type string.");
     }
     Name = _propertyInfo.Name;
 }