예제 #1
0
        private void button5_Click(object sender, EventArgs e)
        {
            string temp_pck = " ";

            if (checkBox6.Checked) // parse edit
            {
                temp_pck = textBox2.Text;
            }
            else
            {
                ListView.SelectedIndexCollection indexes = this.listView1.SelectedIndices;

                if (indexes.Count > 0)
                {
                    if (indexes[0] < Globals.pck_thread.pck_record.Count)
                    {
                        if (Globals.pck_thread.filter_wind_pck == true)
                        {
                            for (uint i = 0; i < Globals.pck_thread.pck_record[Globals.pck_thread.filtered_pck[indexes[0]]].bytebuffer.Length; i++)
                            {
                                temp_pck += Globals.pck_thread.pck_record[Globals.pck_thread.filtered_pck[indexes[0]]].bytebuffer[i].ToString("X2");;
                                temp_pck += " ";
                            }
                        }
                        else
                        {
                            for (uint i = 0; i < Globals.pck_thread.pck_record[indexes[0]].bytebuffer.Length; i++)
                            {
                                temp_pck += Globals.pck_thread.pck_record[indexes[0]].bytebuffer[i].ToString("X2");;
                                temp_pck += " ";
                            }
                        }
                    }
                }
            }
            if (parse_codebox.TextLength > 0)
            {
                if (temp_pck.Length > 0)
                {
                    pck_parser tmp_data = new pck_parser(parse_codebox.Text, temp_pck);

                    if (tmp_data.code_check())
                    {
                        if (tmp_data.pck_check())
                        {
                            textBox2.Text = tmp_data.parse();
                        }
                    }
                    //if (tmp_data.error_check())
                    //
                    error_label.Text = tmp_data.error_string();
                    // MessageBox.Show("dupa error.", "Pika Pika!", MessageBoxButtons.YesNo);
                    //}
                }
            }
        }
예제 #2
0
        private void button5_Click(object sender, EventArgs e)
        {
            string temp_pck = " ";
            if (checkBox6.Checked) // parse edit
            {
                temp_pck = textBox2.Text;
            }
            else
            {
                ListView.SelectedIndexCollection indexes = this.listView1.SelectedIndices;
                
                if (indexes.Count > 0)
                {
                    if (indexes[0] < Globals.pck_thread.pck_record.Count)
                    {
                        if (Globals.pck_thread.filter_wind_pck == true)
                        {
                            for (uint i = 0; i < Globals.pck_thread.pck_record[Globals.pck_thread.filtered_pck[indexes[0]]].bytebuffer.Length; i++)
                            {
                                temp_pck += Globals.pck_thread.pck_record[Globals.pck_thread.filtered_pck[indexes[0]]].bytebuffer[i].ToString("X2"); ;
                                temp_pck += " ";
                            }
                        }
                        else
                        {
                            for (uint i = 0; i < Globals.pck_thread.pck_record[indexes[0]].bytebuffer.Length; i++)
                            {
                                temp_pck += Globals.pck_thread.pck_record[indexes[0]].bytebuffer[i].ToString("X2"); ;
                                temp_pck += " ";
                            }
                        }
                    }
                }
            }
            if(parse_codebox.TextLength > 0)
            {
                if (temp_pck.Length > 0)
                {
                    pck_parser tmp_data = new pck_parser(parse_codebox.Text, temp_pck);

                    if (tmp_data.code_check())
                    {
                        if (tmp_data.pck_check())
                        {
                            textBox2.Text =  tmp_data.parse();
                        }
                    }
                    //if (tmp_data.error_check())
                    //
                        error_label.Text = tmp_data.error_string();
                       // MessageBox.Show("dupa error.", "Pika Pika!", MessageBoxButtons.YesNo);
                    //}
                }
            }
        }