protected void OnSymbolClicked(object sender, EventArgs e) { Widget ctl = sender as Widget; if (ctl != null) { string num = Regex.Replace(ctl.Name, @"\D", ""); byte id = byte.Parse(num); id--; if (currentPic >= _secretLength) { data[_secretLength - 1] = id; secretwidget1.SetSecret(data, _region); } else { data[currentPic] = id; currentPic++; secretwidget1.SetSecret(data.Take(currentPic).ToArray(), _region); } txtSymbols.Text = SecretParser.CreateString(data.Take(currentPic).ToArray(), _region); } }
private void SymbolButton_Click(object sender, RoutedEventArgs e) { // We do not have a JP keyboard _region = GameRegion.US; Control ctl = sender as Control; if (ctl != null) { string num = Regex.Replace(ctl.Name, @"\D", ""); byte id = byte.Parse(num); if (currentPic >= _secretLength) { data[_secretLength - 1] = id; uxSecretDisplay.SetSecret(data, _region); } else { data[currentPic] = id; currentPic++; uxSecretDisplay.SetSecret(data.Take(currentPic).ToArray(), _region); } txtSymbols.Text = SecretParser.CreateString(data.Take(currentPic).ToArray(), _region); } }
protected void OnBtnBackClicked(object sender, EventArgs e) { if (currentPic > 0) { currentPic--; } secretwidget1.SetSecret(data.Take(currentPic).ToArray(), _region); txtSymbols.Text = SecretParser.CreateString(data.Take(currentPic).ToArray(), _region); }
private void btnBack_Click(object sender, RoutedEventArgs e) { if (currentPic > 0) { currentPic--; } uxSecretDisplay.SetSecret(data.Take(currentPic).ToArray()); txtSymbols.Text = SecretParser.CreateString(data.Take(currentPic).ToArray()); }
protected void OnNotebook1SwitchPage(object o, SwitchPageArgs args) { txtSymbols.Text = SecretParser.CreateString(data.Take(currentPic).ToArray(), _region); }
protected void OnBtnResetClicked(object sender, EventArgs e) { secretwidget1.Reset(); currentPic = 0; txtSymbols.Text = SecretParser.CreateString(data.Take(currentPic).ToArray(), _region); }
public void ParseInvalidBytes() { SecretParser.CreateString(new byte[] { 2, 15, 53, 21, 64 }); }
public void CreateString() { string testString = SecretParser.CreateString(DesiredSecretBytes); Assert.AreEqual(DesiredSecretString, testString); }
public void ParseInvalidBytes() { Assert.Throws <SecretException>(() => SecretParser.CreateString(new byte[] { 2, 15, 53, 21, 64 }, GameRegion.US)); }
public void CreateString_JP() { string testString = SecretParser.CreateString(desiredSecretBytes_JP, GameRegion.JP); Assert.AreEqual(desiredSecretString_JP, testString); }
public void CreateString() { string testString = SecretParser.CreateString(desiredSecretBytes, GameRegion.US); Assert.AreEqual(desiredSecretString, testString); }
private void CopySecret_Executed(object sender, ExecutedRoutedEventArgs e) { string s = SecretParser.CreateString(_secret, _region); System.Windows.Clipboard.SetText(s); }