private void buttonSave_Click(object sender, RoutedEventArgs e)
        {
            PacketStructure ps = new PacketStructure(false);

            ps.script = textBox.Text;
            PacketStructureManager.saveStructure(comboBox.SelectedItem, ps);
            MessageBox.Show("Сохранено");
        }
        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;
            }
        }