public static bool TryParse(string name, string type, out ValueTypeMemberDefinition propertyDefintion) { if (string.IsNullOrWhiteSpace(name)) { throw new ArgumentException("can't be null or empty", nameof(name)); } if (string.IsNullOrWhiteSpace(type)) { throw new ArgumentException("can't be null or empty", nameof(type)); } propertyDefintion = null; if (Utils.TryGetValueType(type, out var valueTypeKind, out var nullable)) { propertyDefintion = new ValueTypeMemberDefinition(name, valueTypeKind, nullable); } return(propertyDefintion != null); }
public static bool TryParse(PropertyDeclarationSyntax propertyDeclarationSyntax, out ValueTypeMemberDefinition propertyDefintion) { var name = propertyDeclarationSyntax.Identifier.Text; var type = propertyDeclarationSyntax.Type.ToString(); return(TryParse(name, type, out propertyDefintion)); }