public void Add(String info) { info = info.Trim(); Regex pattern = new Regex(@"^2fa:(.*?)$", RegexOptions.IgnoreCase); if (info.IndexOf('@') == -1 && !pattern.IsMatch(info)) { info = Regex.Replace(info.ToLower(), "(?:^|\\s)\\w", new MatchEvaluator(delegate(Match m) { return(m.Value.ToUpper()); })); } InfoRows.Add(new InfoRow(info)); }
/// <summary> /// Получение всех информационных строк /// </summary> private void GetInfoRows() { XlsFileReader.Read(); string row = XlsFileReader.GetString(0); while (row.StartsWith("#") && XlsFileReader.Read()) { InfoRows.Add(row); row = XlsFileReader.GetString(0); } }
private void InitInfoRows() { InfoRows.Add(new InfoRow() { Label = "Value : ", Text = " " + ((MathExpression?.CalcQuantity?.CalcStatus == CalcStatus.Good) ? $"{(MathExpression?.CalcQuantity?.Value)}" : ""), }); InfoRows.Add(new InfoRow() { Label = "Units Set : ", Text = " " + MathExpression?.CalcQuantity?.AnonUOM?.UOMSet?.Name, }); Dimensions dims = MathExpression?.CalcQuantity?.AnonUOM?.Dimensions; string dimText = "unknown"; if (dims != null) { dimText = IsDimenionless(dims) ? "dimensionless" : $"{dims?.ToString()} // {Dimensions.GetExplanationLine()}"; } InfoRows.Add(new InfoRow() { Label = "Dimensions : ", Text = " " + dimText, }); //InfoRows.Add(new InfoRow() //{ // Label = "Units : ", // Text = "?", //}); if (MathExpression?.CalcQuantity?.Message?.Length > 0) { InfoRows.Add(new InfoRow() { Label = "Message : ", Text = " " + MathExpression?.CalcQuantity?.Message, }); } }