public int GetAmountOfPass(int countOfNames) { Passwords paswordLine = this; int amountofPass = 1; paswordLine.PositionOnStart(); while (!paswordLine.EndOfPasswordLine()) { switch (paswordLine.GetCurrentChar()) { case PassContent.NAME: if (countOfNames == 0) { amountofPass = amountofPass * 1; //если лист имен пуст чтобы не обнулялось } else { amountofPass = amountofPass * countOfNames; } break; case PassContent.NUMBER: amountofPass = amountofPass * 10; break; case PassContent.LETTER: amountofPass = amountofPass * 52; break; case PassContent.SmallLetter: amountofPass = amountofPass * 26; break; case PassContent.BigLetter: amountofPass = amountofPass * 26; break; case PassContent.YEAR: amountofPass = amountofPass * 140; break; case PassContent.LowLine: amountofPass = amountofPass * 1; break; default: break; } paswordLine.StepNext(); } paswordLine.ReturnCurrentPosition(); return(amountofPass); }
private void btnClearPasswords_Click(object sender, RoutedEventArgs e) { Passwords.Clear(); }