예제 #1
0
파일: Info.cs 프로젝트: thuongtin/AutoFill
        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));
        }
예제 #2
0
        /// <summary>
        /// Получение всех информационных строк
        /// </summary>
        private void GetInfoRows()
        {
            XlsFileReader.Read();

            string row = XlsFileReader.GetString(0);

            while (row.StartsWith("#") && XlsFileReader.Read())
            {
                InfoRows.Add(row);
                row = XlsFileReader.GetString(0);
            }
        }
예제 #3
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,
                });
            }
        }