コード例 #1
0
ファイル: WinSHLH1.xaml.cs プロジェクト: neobreaker/MD
        private void UpdateDisplay()
        {
            Model.ModelSHLH1 shlh1 = new Model.ModelSHLH1(m_decryptbytes);

            this.tbPin.Text                = shlh1.pin_str;
            this.tbSecretKey.Text          = shlh1.secretkey_str;
            this.tbManufacturer.Text       = shlh1.manufacturer_str;
            this.tbVIN.Text                = shlh1.vin_str;
            this.tbVINASCII.Text           = shlh1.vin_ascii;
            this.tbKeyIdentification1.Text = shlh1.keyidentification1_str;
            this.tbKeyIdentification2.Text = shlh1.keyidentification2_str;
            this.tbKeyIdentification3.Text = shlh1.keyidentification3_str;
            this.tbKeyIdentification4.Text = shlh1.keyidentification4_str;
            this.tbKeyIdentification5.Text = shlh1.keyidentification5_str;
            this.tbKeyIdentification6.Text = shlh1.keyidentification6_str;
            this.tbKeyIdentification7.Text = shlh1.keyidentification7_str;
            this.tbKeyIdentification8.Text = shlh1.keyidentification8_str;
            this.tbErrCode.Text            = shlh1.errcode_str;
            this.tbPwdErrCnt.Text          = shlh1.pwderrcnt_str;

            //back up
            this.tbPinBkp.Text                = shlh1.pin_bkp_str;
            this.tbSecretKeyBkp.Text          = shlh1.secretkey_bkp_str;
            this.tbManufacturerBkp.Text       = shlh1.manufacturer_bkp_str;
            this.tbVINBkp.Text                = shlh1.vin_bkp_str;
            this.tbVINBkpASCII.Text           = shlh1.vin_bkp_ascii;
            this.tbKeyIdentification1Bkp.Text = shlh1.keyidentification1_bkp_str;
            this.tbKeyIdentification2Bkp.Text = shlh1.keyidentification2_bkp_str;
            this.tbKeyIdentification3Bkp.Text = shlh1.keyidentification3_bkp_str;
            this.tbKeyIdentification4Bkp.Text = shlh1.keyidentification4_bkp_str;
            this.tbKeyIdentification5Bkp.Text = shlh1.keyidentification5_bkp_str;
            this.tbKeyIdentification6Bkp.Text = shlh1.keyidentification6_bkp_str;
            this.tbKeyIdentification7Bkp.Text = shlh1.keyidentification7_bkp_str;
            this.tbKeyIdentification8Bkp.Text = shlh1.keyidentification8_bkp_str;
            this.tbErrCodeBkp.Text            = shlh1.errcode_bkp_str;

            this.uchbDecrypy.SetHexbox(m_decryptbytes);
            this.uchbEncrypy.SetHexbox(m_encryptbytes);

            CheckDataValid(shlh1);
        }
コード例 #2
0
ファイル: WinSHLH1.xaml.cs プロジェクト: neobreaker/MD
        private void CheckDataValid(Model.ModelSHLH1 shlh1)
        {
            if (shlh1.CheckConsistencyPin())
            {
                this.tbPinBkp.Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FFD2D2D2"));
            }
            else
            {
                this.tbPinBkp.Background = new SolidColorBrush(Colors.Yellow);
            }

            if (shlh1.CheckConsistencySecretKey())
            {
                this.tbSecretKeyBkp.Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FFD2D2D2"));
            }
            else
            {
                this.tbSecretKeyBkp.Background = new SolidColorBrush(Colors.Yellow);
            }

            if (shlh1.CheckConsistencyManufacturer())
            {
                this.tbManufacturerBkp.Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FFD2D2D2"));
            }
            else
            {
                this.tbManufacturerBkp.Background = new SolidColorBrush(Colors.Yellow);
            }

            this.tbVIN.Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FFD2D2D2"));
            if (shlh1.CheckConsistencyVIN())
            {
                this.tbVINBkp.Background      = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FFD2D2D2"));
                this.tbVINBkpASCII.Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FFD2D2D2"));
            }
            else
            {
                this.tbVINBkp.Background      = new SolidColorBrush(Colors.Yellow);
                this.tbVINBkpASCII.Background = new SolidColorBrush(Colors.Yellow);
            }

            if (shlh1.CheckConsistencyKeyidentification1())
            {
                this.tbKeyIdentification1Bkp.Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FFD2D2D2"));
            }
            else
            {
                this.tbKeyIdentification1Bkp.Background = new SolidColorBrush(Colors.Yellow);
            }

            if (shlh1.CheckConsistencyKeyidentification2())
            {
                this.tbKeyIdentification2Bkp.Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FFD2D2D2"));
            }
            else
            {
                this.tbKeyIdentification2Bkp.Background = new SolidColorBrush(Colors.Yellow);
            }

            if (shlh1.CheckConsistencyKeyidentification3())
            {
                this.tbKeyIdentification3Bkp.Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FFD2D2D2"));
            }
            else
            {
                this.tbKeyIdentification3Bkp.Background = new SolidColorBrush(Colors.Yellow);
            }

            if (shlh1.CheckConsistencyKeyidentification4())
            {
                this.tbKeyIdentification4Bkp.Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FFD2D2D2"));
            }
            else
            {
                this.tbKeyIdentification4Bkp.Background = new SolidColorBrush(Colors.Yellow);
            }

            if (shlh1.CheckConsistencyKeyidentification5())
            {
                this.tbKeyIdentification5Bkp.Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FFD2D2D2"));
            }
            else
            {
                this.tbKeyIdentification5Bkp.Background = new SolidColorBrush(Colors.Yellow);
            }

            if (shlh1.CheckConsistencyKeyidentification6())
            {
                this.tbKeyIdentification6Bkp.Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FFD2D2D2"));
            }
            else
            {
                this.tbKeyIdentification6Bkp.Background = new SolidColorBrush(Colors.Yellow);
            }

            if (shlh1.CheckConsistencyKeyidentification7())
            {
                this.tbKeyIdentification7Bkp.Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FFD2D2D2"));
            }
            else
            {
                this.tbKeyIdentification7Bkp.Background = new SolidColorBrush(Colors.Yellow);
            }

            if (shlh1.CheckConsistencyKeyidentification8())
            {
                this.tbKeyIdentification8Bkp.Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FFD2D2D2"));
            }
            else
            {
                this.tbKeyIdentification8Bkp.Background = new SolidColorBrush(Colors.Yellow);
            }

            if (shlh1.CheckConsistencyErrcode())
            {
                this.tbErrCodeBkp.Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FFD2D2D2"));
            }
            else
            {
                this.tbErrCodeBkp.Background = new SolidColorBrush(Colors.Yellow);
            }
        }