Example #1
0
        public Celownik_M(Mianownik mianownik)
        {
            Text = mianownik.Text;
            var l = Text.Length;

            if (l < 2)
            {
                return;
            }

            if (Text[l - 2] == 'e')
            {
                if (Text.Last() == 'j')
                {
                }
                else
                {
                    Text = Text.Remove(l - 2, 1);
                }
            }
            l = Text.Length;

            if (Text.Last() == 'a')
            {
                ReplaceLast("om");
            }
            else
            {
                Text += "om";
            }
        }
Example #2
0
        public Wołacz(Mianownik mianownik)
        {
            Text = mianownik.Text;
            var l = Text.Length;

            if (l < 2)
            {
                return;
            }

            if (Text[l - 2] == 'e')
            {
                if (Text.Last() == 'j')
                {
                }
                else
                {
                    Text = Text.Remove(l - 2, 1);
                }
            }
            else if (Text[l - 2] == 'ó')
            {
                ReplaceSecondLast('o');
            }
            l = Text.Length;

            if (Text.Last() == 'a')
            {
                ReplaceLast('o');
            }
            else if (Text.Last() == 'ć')
            {
                ReplaceLast("ci");
            }
            else if (Text.Last() == 'd')
            {
                Text += "zie";
            }
            else if (Text.Last() == 'e' || Text.Last() == 'o')
            {
                ReplaceLast('u');
            }
            else if (Text.Last() == 'r')
            {
                Text += "ze";
            }
            else if (Text.Last() == 'n' || Text.Last() == 's' || Text.Last() == 'z')
            {
                Text += "ie";
            }
            else if (Text.Last() == 't')
            {
                ReplaceLast("cie");
            }
            else
            {
                Text += 'u';
            }
        }
Example #3
0
        public Dopełniacz(Mianownik mianownik)
        {
            Text = mianownik.Text;
            var l = Text.Length;

            if (l < 2)
            {
                return;
            }

            if (Text[l - 2] == 'e')
            {
                if (Text.Last() == 'j')
                {
                }
                else
                {
                    Text = Text.Remove(l - 2, 1);
                }
            }
            else if (Text[l - 2] == 'ó')
            {
                ReplaceSecondLast('o');
            }
            l = Text.Length;

            if (Text.Last() == 'a')
            {
                if (Text[l - 2] == 'i' || Text[l - 2] == 'k' || Text[l - 2] == 'l')
                {
                    ReplaceLast('i');
                }
                else
                {
                    ReplaceLast('y');
                }
            }
            else if (Text.Last() == 'ć')
            {
                ReplaceLast("ci");
            }
            else if (Text.Last() == 'n' || Text.Last() == 's' || Text.Last() == 't')
            {
                Text += 'u';
            }
            else if (Text.Last() == 'e' || Text.Last() == 'o')
            {
                ReplaceLast('a');
            }
            else if (Text.Last() == 'w')
            {
                Text  = Text.Remove(l - 2, 1);
                Text += 'i';
            }
            else
            {
                Text += 'a';
            }
        }
Example #4
0
        public Mianownik_M(Mianownik mianownik)
        {
            Text = mianownik.Text;
            var l = Text.Length;

            if (l < 2)
            {
                return;
            }

            if (Text[l - 2] == 'e')
            {
                if (Text.Last() == 'j')
                {
                }
                else
                {
                    Text = Text.Remove(l - 2, 1);
                }
            }
            l = Text.Length;

            if (Text.Last() == 'a')
            {
                if (Text[l - 2] == 'i')
                {
                    ReplaceLast('e');
                }
                else if (Text[l - 2] == 'k')
                {
                    ReplaceLast('i');
                }
                else
                {
                    ReplaceLast('y');
                }
            }
            else if (Text.Last() == 'c' || Text.Last() == 'l')
            {
                Text += 'e';
            }
            else if (Text.Last() == 'k' && !IsName())
            {
                Text += 'i';
            }
            else if (Text.Last() == 'o')
            {
                ReplaceLast('a');
            }
            else if (IsName())
            {
                Text += "owie";
            }
            else
            {
                Text += 'y';
            }
        }
Example #5
0
 private void updatebtn_Click(object sender, EventArgs e)
 {
     {
         UpdateEvent(formulatxt.Text);
         if (Text.Last() != '*')
         {
             Text += "*";
         }
     }
 }
Example #6
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (UpdateEvent != null)
     {
         UpdateEvent(formulatxt.Text);
         if (Text.Last() != '*')
         {
             Text += "*";
         }
     }
 }
Example #7
0
        public Narzędnik(Mianownik mianownik)
        {
            Text = mianownik.Text;
            var l = Text.Length;

            if (l < 2)
            {
                return;
            }

            if (Text[l - 2] == 'e')
            {
                if (Text.Last() == 'j')
                {
                }
                else
                {
                    Text = Text.Remove(l - 2, 1);
                }
            }
            else if (Text[l - 2] == 'ó')
            {
                ReplaceSecondLast('o');
            }
            l = Text.Length;

            if (Text.Last() == 'a')
            {
                ReplaceLast('ą');
            }
            else if (Text.Last() == 'ć')
            {
                ReplaceLast("cią");
            }
            else if (Text.Last() == 'e')
            {
                Text += 'm';
            }
            else if (Text.Last() == 'g' || Text.Last() == 'k')
            {
                Text += "iem";
            }
            else if (Text.Last() == 'o')
            {
                ReplaceLast("em");
            }
            else
            {
                Text += "em";
            }
        }
        public string GetFullPlainText()
        {
            var result = "";

            if (References != null && Text.Length == References.Length + 1)
            {
                for (var i = 0; i < References.Length; i++)
                {
                    result += Text[i] + References[i].Value;
                }
            }
            result += Text.Last();
            return(result);
        }
        public string GetFormatText()
        {
            var result = "";

            if (References != null && Text.Length == References.Length + 1)
            {
                for (var i = 0; i < References.Length; i++)
                {
                    result += Text[i] + $"{{{i}}}";
                }
            }
            result += Text.Last();
            return(result);
        }
Example #10
0
 //-------------------------------------------------------------------------
 private void OnDataChanged(object sender, ListChangedEventArgs e)
 {
     if (checkChanges && e.ListChangedType != ListChangedType.Reset)
     {
         if (Text.Last() != '*')
         {
             Text = Text + "*";
         }
         if (DataEdit != null)
         {
             DataEdit();
         }
     }
 }
Example #11
0
            /// <summary>
            /// Writes the data element into the given buffer (at its current position).
            /// </summary>
            /// <param name="buffer">The buffer where the data element should be deserialized into.</param>
            public void WriteData(RAMBuffer buffer)
            {
                buffer.WriteUInteger((uint)Type);

                buffer.WriteUInteger(0x00000017);

                buffer.WriteInteger(AiGoal);
                buffer.WriteInteger(Amount);
                buffer.WriteInteger(ResourceId);
                buffer.WriteInteger(Diplomacy);

                buffer.WriteInteger(SelectedUnitInstanceIds.Count);

                buffer.WriteInteger(LocationUnitInstanceId);
                buffer.WriteInteger(UnitType);
                buffer.WriteInteger(PlayerSource);
                buffer.WriteInteger(PlayerTarget);
                buffer.WriteInteger(ResearchId);
                buffer.WriteInteger(StringId);
                buffer.WriteInteger(SoundId);
                buffer.WriteInteger(DisplayTime);
                buffer.WriteInteger(TriggerIndex);
                buffer.WriteInteger(LocationX);
                buffer.WriteInteger(LocationY);
                buffer.WriteInteger(AreaBottomLeftX);
                buffer.WriteInteger(AreaBottomLeftY);
                buffer.WriteInteger(AreaTopRightX);
                buffer.WriteInteger(AreaTopRightY);
                buffer.WriteInteger(UnitClass);
                buffer.WriteInteger(UnitType2);
                buffer.WriteInteger(InstructionPanel);

                if (Text.Length == 0 || Text.Last() != '\0')
                {
                    Text += '\0';
                }
                buffer.WriteInteger(Text.Length);
                buffer.WriteString(Text);

                if (SoundFileName.Length == 0 || SoundFileName.Last() != '\0')
                {
                    SoundFileName += '\0';
                }
                buffer.WriteInteger(SoundFileName.Length);
                buffer.WriteString(SoundFileName);

                SelectedUnitInstanceIds.ForEach(u => buffer.WriteUInteger(u));
            }
Example #12
0
 public Rodzaj JakiRodzaj()
 {
     if (Text.Length == 0)
     {
         return(Rodzaj.Męski);
     }
     if (Text.Last() == 'a' || (Text[Text.Length - 2] == 'e' && Text.Last() == 'w') || Text.Last() == 'i')
     {
         return(Rodzaj.Żeński);
     }
     if (Text.Last() == 'o' || Text.Last() == 'e' || Text.Last() == 'ę' || (Text[Text.Length - 2] == 'u' && Text.Last() == 'm'))
     {
         return(Rodzaj.Nijaki);
     }
     return(Rodzaj.Męski);
 }
Example #13
0
        public Dopełniacz_M(Mianownik mianownik)
        {
            Text = mianownik.Text;
            var l = Text.Length;

            if (l < 2)
            {
                return;
            }

            if (Text[l - 2] == 'e')
            {
                if (Text.Last() == 'j')
                {
                }
                else
                {
                    Text = Text.Remove(l - 2, 1);
                }
            }
            else if (Text[l - 2] == 'k')
            {
                Text = Text.Insert(l - 2, "e");
            }
            l = Text.Length;

            if (Text.Last() == 'a')
            {
                Text = Text.Substring(0, l - 1);
            }
            else if (Text.Last() == 'c' && Text[l - 2] == 'ą')
            {
                ReplaceSecondLast('ę');
                ReplaceLast("cy");
            }
            else
            {
                Text += "ów";
            }
        }
Example #14
0
        public Biernik(Mianownik mianownik)
        {
            Text = mianownik.Text;
            var l = Text.Length;

            if (l < 2)
            {
                return;
            }

            if (Text[l - 2] == 'e')
            {
                if (Text.Last() == 'j')
                {
                }
                else
                {
                    Text = Text.Remove(l - 2, 1);
                }
            }
            else if (Text[l - 2] == 'ó')
            {
                ReplaceSecondLast('o');
            }
            l = Text.Length;

            if (Text.Last() == 'a')
            {
                ReplaceLast('ę');
            }
            else if (IsName() || Text.Last() == 'c')
            {
                Text += 'a';
            }
            else
            {
            }
        }
Example #15
0
        private void AddText(string text)
        {
            var formattedText = Format(text);

            if (formattedText == "Back" && lastText == formattedText)
            {
                var repeatText = string.Format(" x {0} ", ++lastTextRepeatCount);
                if (Text.Last() == lastText)
                {
                    textCollection.Add(repeatText);
                }
                else
                {
                    textCollection[Text.Count - 1] = repeatText;
                }
            }
            else
            {
                textCollection.Add(formattedText);
                lastText            = formattedText;
                lastTextRepeatCount = 1;
            }
        }
Example #16
0
        private void AddText(string text)
        {
            var formattedText = Format(text, lastKeyPress.IsShortcut);

            if (repeatDetectionText.Contains(text) && Text.Any())
            {
                var repeatText = string.Format(" x {0} ", ++lastTextRepeatCount);
                if (Text.Last() == lastText)
                {
                    textCollection.Add(repeatText);
                }
                else
                {
                    textCollection[Text.Count - 1] = repeatText;
                }
            }
            else
            {
                textCollection.Add(formattedText);
                lastText            = formattedText;
                lastTextRepeatCount = 1;
            }
        }
Example #17
0
        private void DecimalInput(TextCompositionEventArgs e)
        {
            if (TextType == TextTypes.Decimal && DecimalLenght == 0)
            {
                DecimalLenght = 3;
            }

            if (Maximum == 0)
            {
                Maximum = 999999999.999M;
            }
            if (e.Text.Contains(Separator))
            {
                if (!Text.Contains(Separator))
                {
                    base.OnTextInput(e);
                }
                isPressSeparator = true;
                SelectionStart   = Text.Length;
                return;
            }

            if (!string.IsNullOrEmpty(Text))
            {
                if (TextType == TextTypes.Money)
                {
                    Text          = Text.Replace(Separator + "00", Separator);
                    DecimalLenght = DecimalLenght == 0 ? 2 : DecimalLenght;
                    if (!e.Text.Contains("0"))
                    {
                        if (!_IsZeroPress)
                        {
                            Text = Text.Replace(Separator + "00", Separator);
                            if (Text.Contains(Separator))
                            {
                                if (Text.Last() == '0')
                                {
                                    Text = Text.Substring(0, Text.Length - 1);
                                }
                            }
                        }

                        _IsZeroPress = false;
                    }
                    else
                    {
                        _IsZeroPress = true;
                    }
                }
            }

            var LastText = Text;

            base.OnTextInput(e);
            int separatorIndex = Text.IndexOf(Separator);

            if (!isPressSeparator)
            {
                SelectionStart = separatorIndex < 0 ? Text.Length : separatorIndex;
            }
            else
            {
                SelectionStart = Text.Length;
            }

            decimal DataValue = decimal.Parse(Text);
            decimal decVal    = 0;

            if (separatorIndex != -1)
            {
                if (Text.Substring(separatorIndex, Text.Length - separatorIndex) == Separator + "000")
                {
                    Text = LastText;
                    return;
                }
                var decStr = Text.Substring(separatorIndex, Text.Length - separatorIndex);
                if (Text.EndsWith("00"))
                {
                    decStr = Text.Substring(separatorIndex, Text.Length - separatorIndex).Replace(Separator + "00", Separator);
                }
                if (decStr.Length - 1 > DecimalLenght)
                {
                    Text = LastText;
                    return;
                }
                if (TextType == TextTypes.Money && decStr.Replace(Separator, "").Length > 2)
                {
                    Text = LastText;
                    return;
                }

                decVal = decStr.Length > 1 ? decimal.Parse(decStr) : 0;
            }
            decimal intVal = DataValue - decVal;

            if (DataValue > Maximum)
            {
                Text = LastText;
                return;
            }
            Value = DataValue;
            if (TextType == TextTypes.Money)
            {
                if (!isPressSeparator)
                {
                    Text = DataValue.ToString("N2");
                }
                if (decVal != 0)
                {
                    Text = DataValue.ToString("N2");
                }
            }
            //else if(TextType == TextTypes.Decimal)
            //{
            //    var format = string.Format("#.{0}", "".PadRight(DecimalLenght, '0'));
            //    Text = DataValue.ToString(format);
            //}
        }
Example #18
0
        string Quzimu(int num, string text1, string text2)
        {
            string[] zimu =
            {
                "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z",
                "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z",
                "0", "1", "2", "3", "4", "5", "6", "7", "8", "9"
            };
            try
            {
                string NumberStr = string.Empty;
                int[]  Text;
                string str = text1 + text2;
                for (int i = 0; i < num; i++)
                {
                    int t;
                    if (str.Length > i)
                    {
                        t = Array.IndexOf(zimu, str[i].ToString());
                        if (t < 0)
                        {
                            return("输入字符不存在");
                        }
                        NumberStr += t > 0 ? t.ToString() + "," : "0,";
                    }
                    else
                    {
                        NumberStr += "0,";
                    }
                }
                Text = Array.ConvertAll(NumberStr.Trim(',').Split(','), int.Parse);
                if (!string.IsNullOrEmpty(text2))
                {
                    Text[num - 1] += 1;
                }
                for (int i = Text.Last(); i <= zimu.Length; i++)
                {
jinzh:
                    Text[Text.Length - 1] = i;
                    int Text62 = Array.IndexOf(Text, 62);
                    if (Text62 == text1.Length)
                    {
                        //Console.WriteLine("结束");
                        return("结束");
                    }
                    if (Text62 == num - 2)
                    {
                        Console.WriteLine(string.Join(",", Text));
                    }
                    if (Text62 > 0)
                    {
                        i                 = 0;
                        Text[Text62]      = 0;
                        Text[Text62 - 1] += +1;
                        goto jinzh;
                    }

                    string MinText = string.Empty;
                    foreach (var item in Text)
                    {
                        MinText += zimu[Convert.ToInt32(item)];
                    }
                    addMd5(MinText, MD5(MinText));
                    //Console.WriteLine(MinText);
                }
                return("结束");
            }
            catch (Exception e)
            {
                return(e.Message);
            }
        }
Example #19
0
        public static Text Parse(TextReader reader)
        {
            var text = new Text();

            var line = reader.ReadLine();
            while(!string.IsNullOrEmpty(line))
            {
                var paragraph = new Paragraph();
                text.Add(paragraph);

                while (!string.IsNullOrEmpty(line))
                {
                    var sentenceString = line;
                    var terminalPunctuationMark = line.GetFirstOrDefaultPunctuationMark(DefaultPunctuationMarks.TerminalPunctuationMarks);
                    if (terminalPunctuationMark.HasValue)
                    {
                        var index = line.IndexOfPunctuationMark(terminalPunctuationMark);
                        sentenceString = line.Substring(0, index).TrimStart(' ');
                        line = line.Remove(0, index + terminalPunctuationMark.StringValue.Length);

                        if(text.Count > 1)
                        {
                            var lastParagraph = text.Last(p => p.HasValue);
                            if (lastParagraph.Any())
                            {
                                var lastSentence = lastParagraph.Last();
                                if (lastSentence.IsNotFinished)
                                {
                                    text.Remove(paragraph);
                                    paragraph = lastParagraph;
                                    lastSentence.Concat(sentenceString);
                                    continue;
                                }
                            }
                        }
                    }
                    else
                    {
                        line = string.Empty;
                    }

                    var sentence = ParseSentenceString(sentenceString, terminalPunctuationMark);
                    paragraph.Add(sentence);
                }

                line = reader.ReadLine();
            }

            return text;
        }
Example #20
0
        public Celownik(Mianownik mianownik)
        {
            Text = mianownik.Text;
            var l = Text.Length;

            if (l < 2)
            {
                return;
            }

            if (Text[l - 2] == 'e')
            {
                if (Text.Last() == 'j')
                {
                }
                else
                {
                    Text = Text.Remove(l - 2, 1);
                }
            }
            else if (Text[l - 2] == 'ó')
            {
                ReplaceSecondLast('o');
            }
            l = Text.Length;

            if (Text.Last() == 'a')
            {
                if (Text[l - 2] == 'c')
                {
                    ReplaceLast("y");
                }
                else if (Text[l - 2] == 'd')
                {
                    ReplaceLast("zie");
                }
                else if (Text[l - 2] == 'k')
                {
                    ReplaceSecondLast('c');
                    ReplaceLast('e');
                }
                else if (Text[l - 2] == 'r')
                {
                    ReplaceLast("ze");
                }
                else if (Text[l - 2] == 't')
                {
                    ReplaceSecondLast('c');
                    ReplaceLast("ie");
                }
                else
                {
                    ReplaceLast("ie");
                }
            }
            else if (Text.Last() == 'ć')
            {
                ReplaceLast("ci");
            }
            else if (Text.Last() == 'e')
            {
                ReplaceLast('u');
            }
            else if (Text.Last() == 'o')
            {
                ReplaceLast('u');
            }
            else
            {
                Text += "owi";
            }
        }