예제 #1
0
        private void AnalyzovatText()
        {
            string sText = mstrText.Trim();

            //jde o řadovou číslovku
            if (sText[sText.Length - 1] == '.')
            {
                sText = sText.Substring(0, sText.Length - 1);
            }
            int i;

            if (Int32.TryParse(sText, out i))
            {
                switch (sText.Length.ToString())
                {
                case "1":
                    mttTyp = TypTextovehoPrvku.JednomistneCislo;
                    break;

                case "2":
                    mttTyp = TypTextovehoPrvku.DvojmistneCislo;
                    break;

                case "4":
                    mttTyp = TypTextovehoPrvku.CtyrmistneCislo;
                    break;

                default:
                    mttTyp = TypTextovehoPrvku.Neurceno;
                    break;
                }
            }
            else
            {
                if (msglsKonektory.Contains(sText))
                {
                    mttTyp = TypTextovehoPrvku.Konektor;
                }
                if (msglsObdobi.Contains(sText))
                {
                    mttTyp = TypTextovehoPrvku.Obdobi;
                }
                if (msglsUpresneni.Contains(sText))
                {
                    mttTyp = TypTextovehoPrvku.Upresneni;
                }
                if (msglsZlomek.Contains(sText))
                {
                    mttTyp = TypTextovehoPrvku.Zlomek;
                }
            }
        }
예제 #2
0
        public List <TextovyPrvek> PrvkyPodleTypu(TypTextovehoPrvku tpTyp)
        {
            List <TextovyPrvek> tps = new List <TextovyPrvek>(this.Count);

            foreach (TextovyPrvek tp in this)
            {
                if (tp.Typ == tpTyp)
                {
                    tps.Add(tp);
                }
            }
            return(tps);
        }