コード例 #1
0
        private void comboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            PacketStructureManager.loadStructure(comboBox.SelectedItem);
            PacketStructure ps = PacketStructureManager.getStructure(comboBox.SelectedItem);

            textBox.Text = ps.script;
        }
コード例 #2
0
        private void buttonSave_Click(object sender, RoutedEventArgs e)
        {
            PacketStructure ps = new PacketStructure(false);

            ps.script = textBox.Text;
            PacketStructureManager.saveStructure(comboBox.SelectedItem, ps);
            MessageBox.Show("Сохранено");
        }
コード例 #3
0
        private void buttonLoad_Click(object sender, RoutedEventArgs e)
        {
            PacketStructureManager.loadStructure(comboBox.SelectedItem);
            PacketStructure ps = PacketStructureManager.getStructure(comboBox.SelectedItem);

            textBox.Text = ps.script;
            MessageBox.Show("Загруженно");
        }
コード例 #4
0
        private void dataGrid_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (dataGrid.SelectedItem != null)
            {
                DataPacket      p  = (dataGrid.SelectedItem as DataPacket);
                PacketStructure ps = PacketStructureManager.getStructure(p.opCode);
                textBlockPacket.Text = ps.parse(p.getTeraPacket()).ToString();
            }
            //textBlockPacket.Text = Detrav.Sniffer.Tera.TeraPacketCreator.create((dataGrid.SelectedItem as DataPacket).getTeraPacket()).ToString();

            /*richTextBox.Document.Blocks.Clear();
             * richTextBox.Selection.Text = Detrav.Sniffer.Tera.TeraPacketCreator.create((dataGrid.SelectedItem as DataPacket).getTeraPacket()).ToString();*/
        }
コード例 #5
0
        private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            var result = MessageBox.Show("Хотите сохранить изменения в текущем пакете?", "Закрытие", MessageBoxButton.YesNoCancel);

            switch (result)
            {
            case MessageBoxResult.Yes:
                PacketStructure ps = new PacketStructure(false);
                ps.script = textBox.Text;
                PacketStructureManager.saveStructure(comboBox.SelectedItem, ps);
                break;

            case MessageBoxResult.No: break;

            default: e.Cancel = true; break;
            }
        }