Пример #1
0
 public PropertyModel(string propertyName, string typeName, bool requireInit = true, ValueModel valueModel = null, PropertyScope propertyScope = PropertyScope.Get)
 {
     Name = String.IsNullOrWhiteSpace(propertyName) ?
            throw new ArgumentNullException("Class name can not be empty, null or whitespace.", nameof(propertyName))
     : propertyName;
     TypeName = String.IsNullOrWhiteSpace(typeName) ?
                throw new ArgumentNullException("Class type name can not be empty, null or whitespace.", nameof(typeName))
         : typeName;
     if (valueModel != null)
     {
         if (valueModel.TypeName != TypeName)
         {
             throw new ArgumentException("Value type does not match with property type.");
         }
     }
     Value = valueModel;
     RequireInitialization = requireInit;
     Scope = propertyScope;
 }
Пример #2
0
 public PropertyModel(string propertyName, Type type, bool requireInit = true, ValueModel valueModel = null, PropertyScope propertyScope = PropertyScope.Get)
     : this(propertyName, type?.FullName, requireInit, valueModel, propertyScope)
 {
 }