public static double AsDouble(this MsdTag tag, double defaultValue = 0.0) { double value; return(double.TryParse(tag.Content, NumberStyles.Any, CultureInfo.InvariantCulture, out value) ? value : defaultValue); }
public static TextWithAlternative AsTextWithAlternative(this MsdTag tag, MsdTag other = null) => new TextWithAlternative { Original = tag?.Content, Alternative = other?.Content };
public static bool AsBoolean(this MsdTag tag) => MsdTagContentParser.YesOrNo.Parse(tag.Content);