Пример #1
0
        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);
            }
        }
Пример #2
0
        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);
            }
        }
Пример #3
0
 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);
 }
Пример #4
0
 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());
 }
Пример #5
0
 protected void OnNotebook1SwitchPage(object o, SwitchPageArgs args)
 {
     txtSymbols.Text = SecretParser.CreateString(data.Take(currentPic).ToArray(), _region);
 }
Пример #6
0
 protected void OnBtnResetClicked(object sender, EventArgs e)
 {
     secretwidget1.Reset();
     currentPic      = 0;
     txtSymbols.Text = SecretParser.CreateString(data.Take(currentPic).ToArray(), _region);
 }
Пример #7
0
 public void ParseInvalidBytes()
 {
     SecretParser.CreateString(new byte[] { 2, 15, 53, 21, 64 });
 }
Пример #8
0
        public void CreateString()
        {
            string testString = SecretParser.CreateString(DesiredSecretBytes);

            Assert.AreEqual(DesiredSecretString, testString);
        }
Пример #9
0
 public void ParseInvalidBytes()
 {
     Assert.Throws <SecretException>(() => SecretParser.CreateString(new byte[] { 2, 15, 53, 21, 64 }, GameRegion.US));
 }
Пример #10
0
        public void CreateString_JP()
        {
            string testString = SecretParser.CreateString(desiredSecretBytes_JP, GameRegion.JP);

            Assert.AreEqual(desiredSecretString_JP, testString);
        }
Пример #11
0
        public void CreateString()
        {
            string testString = SecretParser.CreateString(desiredSecretBytes, GameRegion.US);

            Assert.AreEqual(desiredSecretString, testString);
        }
Пример #12
0
        private void CopySecret_Executed(object sender, ExecutedRoutedEventArgs e)
        {
            string s = SecretParser.CreateString(_secret, _region);

            System.Windows.Clipboard.SetText(s);
        }