private static bool TryParse(string str, out Column column) { column = null; if (string.IsNullOrEmpty(str)) { return(false); } if (!ColumnParsingUtils.TryParse(str, out string name, out string sourceStr, out string kindStr)) { return(false); } InternalDataKind?kind = null; if (kindStr != null && TypeParsingUtils.TryParseDataKind(kindStr, out InternalDataKind parsedKind, out var keyCount)) { kind = parsedKind; } if (!int.TryParse(sourceStr, out int source)) { return(false); } column = new Column() { Name = name, Source = source, Type = kind }; return(true); }
public static bool TryParse(string str, out Column column) { column = null; if (string.IsNullOrEmpty(str)) { return(false); } if (!ColumnParsingUtils.TryParse(str, out string name, out string sourceStr, out string kindStr)) { return(false); } DataKind?kind = null; if (kindStr != null && TypeParsingUtils.TryParseDataKind(kindStr, out DataKind parsedKind, out KeyRange range)) { kind = parsedKind; } if (!int.TryParse(sourceStr, out int source)) { return(false); } column = new Column() { Name = name, Source = source, Type = kind }; return(true); }