aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.Publisher/MainWindow.xaml.cs
blob: 64e7e8740ed635063c3c28b97079e1dd42525cb4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
using Microsoft.Win32;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Tango.PPC.Publisher
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
            DataContext = new MainWindowVM();
        }

        private void DataGrid_AddingNewItem(object sender, AddingNewItemEventArgs e)
        {
            OpenFileDialog dlg = new OpenFileDialog();
            dlg.Filter = "SQL Examiner Configuration|*.xml";
            if (dlg.ShowDialog().Value)
            {
                SequenceItem item = new SequenceItem();

                if ((DataContext as MainWindowVM).SequenceItems.Count > 0)
                {
                    item.Index = (DataContext as MainWindowVM).SequenceItems.Max(x => x.Index + 1);
                }
                item.FilePath = dlg.FileName;
                item.Name = System.IO.Path.GetFileNameWithoutExtension(dlg.FileName);

                e.NewItem = item;
            }
        }
    }
}
"w"> file_upload_response__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data) { return (FileUploadResponse *) protobuf_c_message_unpack (&file_upload_response__descriptor, allocator, len, data); } void file_upload_response__free_unpacked (FileUploadResponse *message, ProtobufCAllocator *allocator) { if(!message) return; assert(message->base.descriptor == &file_upload_response__descriptor); protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); } static const ProtobufCFieldDescriptor file_upload_response__field_descriptors[2] = { { "", 1, PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_TYPE_STRING, 0, /* quantifier_offset */ offsetof(FileUploadResponse, uploadid), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { "", 2, PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_TYPE_INT64, offsetof(FileUploadResponse, has_maxchunklength), offsetof(FileUploadResponse, maxchunklength), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; static const unsigned file_upload_response__field_indices_by_name[] = { 1, /* field[1] = MaxChunkLength */ 0, /* field[0] = UploadID */ }; static const ProtobufCIntRange file_upload_response__number_ranges[1 + 1] = { { 1, 0 }, { 0, 2 } }; const ProtobufCMessageDescriptor file_upload_response__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, "", "", "", "", sizeof(FileUploadResponse), 2, file_upload_response__field_descriptors, file_upload_response__field_indices_by_name, 1, file_upload_response__number_ranges, (ProtobufCMessageInit) file_upload_response__init, NULL,NULL,NULL /* reserved[123] */ };