protected object ExtractProperty(ReactStylesDiffMap props) { if (props.IsNull(Name) && s_defaultValues.TryGetValue(PropertyType, out var defaultFunc)) { return(defaultFunc(_attribute)); } return(props.GetProperty(Name)? .ToObject(PropertyType)); }
protected object ExtractProperty(ReactStylesDiffMap props) { if (props.IsNull(Name) && s_defaultValues.TryGetValue(PropertyType, out var defaultFunc)) { return(defaultFunc(_attribute)); } var prop = props.GetProperty(Name)? .ToObject(PropertyType); if (prop == null && PropertyType.GetTypeInfo().IsValueType) { return(Activator.CreateInstance(PropertyType)); } return(prop); }
protected object ExtractProperty(ReactStylesDiffMap props) { var defaultFunc = default(Func <ReactPropBaseAttribute, object>); if (props.IsNull(Name) && s_defaultValues.TryGetValue(PropertyType, out defaultFunc)) { return(defaultFunc(_attribute)); } try { return(props.GetProperty(Name)? .ToObject(PropertyType)); } catch (Exception ex) { Log.Error(ReactConstants.Tag, $"ExtractProperty failed, Name is {Method.Name}, PropertyType is {PropertyType}"); throw ex; } }