Exemple #1
0
 public void Load(Stream stream)
 {
     Ua.Load(stream);
     Wa.Load(stream);
     bUa.Load(stream);
     bWa.Load(stream);
     V.Load(stream);
 }
Exemple #2
0
 public void Save(Stream stream)
 {
     Ua.Save(stream);
     Wa.Save(stream);
     bUa.Save(stream);
     bWa.Save(stream);
     V.Save(stream);
 }
Exemple #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrWhiteSpace(comboBox1.Text))
            {
                textBox1.Clear();
                textBox1.AppendText(string.Format("Версия библиотеки: {0}\r\n", Core.Version));
                if (radioButton1.Checked)
                {
                    Ru lang = new Ru();
                    textBox1.AppendText(string.Format("[Ru] Версия правил: {0}\r\n", Ru.LanguageBuild));
                    textBox1.AppendText("\r\n");

                    string[]  m  = lang.Q(comboBox1.Text);
                    WordArray wa = lang.GetWordsArray();
                    textBox1.AppendText(string.Format("Фамилия:  {0}\r\n", lang.GetSurNameCase(Padeg.IMENITLN)));
                    textBox1.AppendText(string.Format("Имя:      {0}\r\n", lang.GetNameCase(Padeg.IMENITLN)));
                    textBox1.AppendText(string.Format("Отчество: {0}\r\n", lang.GetPatrNameCase(Padeg.IMENITLN)));
                    textBox1.AppendText("\r\n");

                    textBox1.AppendText(string.Format("Пол: {0}\r\n", lang.GenderAutoDetect().GetDescription()));
                    textBox1.AppendText("\r\n");

                    textBox1.AppendText("Падежи:\r\n");
                    textBox1.AppendText(string.Format(" Именительный   (кто? что?): {0}\r\n", m[0]));
                    textBox1.AppendText(string.Format(" Родительный  (кого? чего?): {0}\r\n", m[1]));
                    textBox1.AppendText(string.Format(" Дательный    (кому? чему?): {0}\r\n", m[2]));
                    textBox1.AppendText(string.Format(" Винительный   (кого? что?): {0}\r\n", m[3]));
                    textBox1.AppendText(string.Format(" Творительный   (кем? чем?): {0}\r\n", m[4]));
                    textBox1.AppendText(string.Format(" Предложный (о ком? о чём?): {0}\r\n", m[5]));
                }
                else
                {
                    Ua lang = new Ua();
                    textBox1.AppendText(string.Format("[Ua] Версiя правил: {0}\r\n", Ua.LanguageBuild));
                    textBox1.AppendText("\r\n");

                    string[]  m  = lang.Q(comboBox1.Text);
                    WordArray wa = lang.GetWordsArray();
                    textBox1.AppendText(string.Format("Прізвище: {0}\r\n", lang.GetSurNameCase(Padeg.IMENITLN)));
                    textBox1.AppendText(string.Format("Iм'я:     {0}\r\n", lang.GetNameCase(Padeg.IMENITLN)));
                    textBox1.AppendText(string.Format("Батькові: {0}\r\n", lang.GetPatrNameCase(Padeg.IMENITLN)));
                    textBox1.AppendText("\r\n");

                    Gender gender = lang.GenderAutoDetect();
                    textBox1.AppendText(string.Format("Стать: {0}\r\n", (gender == Gender.Man) ? "Чоловіча" : "Жіноча"));
                    textBox1.AppendText("\r\n");

                    textBox1.AppendText("Відмінки:\r\n");
                    textBox1.AppendText(string.Format(" Називний : {0}\r\n", m[0]));
                    textBox1.AppendText(string.Format(" Родовий  : {0}\r\n", m[1]));
                    textBox1.AppendText(string.Format(" Давальний: {0}\r\n", m[2]));
                    textBox1.AppendText(string.Format(" Знахідний: {0}\r\n", m[3]));
                    textBox1.AppendText(string.Format(" Орудний  : {0}\r\n", m[4]));
                    textBox1.AppendText(string.Format(" Місцевий : {0}\r\n", m[5]));
                    textBox1.AppendText(string.Format(" Кличний  : {0}\r\n", m[6]));
                }
            }
        }
        //NIT 등 Pos. , Neg. Pos.만 적용
        private void PosBtn_Click(object sender, EventArgs e)
        {
            InitBlood();
            var button     = sender as Button;
            Ua  buttonName = ((Ua)(Enum.Parse(typeof(Ua), button.Text)));

            count[(int)buttonName]++;
            urintPrint[(int)buttonName] = button.Text + " pos.";
            RefreshPrintBox();
        }
        //URO , GLU, BIL, 등 +/- 버튼
        private void UrinePnBtn_Click(object sender, EventArgs e)
        {
            InitBlood();
            var button     = sender as Button;
            Ua  buttonName = ((Ua)(Enum.Parse(typeof(Ua), button.Name.Substring(0, 3))));

            count[(int)buttonName] = -1;

            urintPrint[(int)buttonName] = buttonName.ToString() + " +/-";


            RefreshPrintBox();
        }
        //URO , GLU, BIL, 등 + 버튼
        private void UrineBtn_Click(object sender, EventArgs e)
        {
            InitBlood();
            var button     = sender as Button;
            Ua  buttonName = ((Ua)(Enum.Parse(typeof(Ua), button.Text)));

            if (count[(int)buttonName] < 0)
            {
                count[(int)buttonName] = 0;
            }
            count[(int)buttonName]++;
            if (count[(int)buttonName] < 2)
            {
                urintPrint[(int)buttonName] = button.Text + " +";
            }
            else
            {
                urintPrint[(int)buttonName] += "+";
            }

            RefreshPrintBox();
        }