public static bool TryParseISODate(string dateString, out DateTimeIndex dateTimeIndex) { if (DateTime.TryParseExact(dateString, DateTimeIndex.IsoPattern, null, DateTimeStyles.None, out var tmpDateTime)) { dateTimeIndex = new DateTimeIndex(tmpDateTime); return(true); } dateTimeIndex = null; return(false); }
public Row(string commaSeparated) { var row = commaSeparated.Split(","); if (DateTimeIndex.TryParseISODate(row.First(), out var witsmlDateTime)) { Index = witsmlDateTime; } else { Index = new DepthIndex(double.Parse(row.First(), CultureInfo.InvariantCulture)); } Values = row[1..].Select(CurveValue.From);
public Point(string commaSeparated) { var values = commaSeparated.Split(","); if (DateTimeIndex.TryParseISODate(values.First(), out var witsmlDateTime)) { Index = witsmlDateTime; } else { Index = new DepthIndex(double.Parse(values.First(), CultureInfo.InvariantCulture)); } Value = CurveValue.From(values[1]); }