aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/Views/MainView.xaml.cs
blob: 358cd792799e4ccf70b1e8bad05ab73da95aab84 (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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
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.MachineEM.UI.Views
{
    /// <summary>
    /// Interaction logic for MainView.xaml
    /// </summary>
    public partial class MainView : UserControl
    {
        public MainView()
        {
            InitializeComponent();
        }

        private void txtResponse_TextChanged(object sender, TextChangedEventArgs e)
        {
            //txtResponse.ScrollToEnd();
        }

        private void txtLog_TextChanged(object sender, TextChangedEventArgs e)
        {
            Task.Factory.StartNew(() =>
            {
                Thread.Sleep(50);

                this.Dispatcher.Invoke(() =>
                {
                    txtLog.SelectionStart = txtLog.Text.Length;
                    txtLog.ScrollToEnd();
                });
            });
        }
    }
}
); } size_t file_upload_request__pack_to_buffer (const FileUploadRequest *message, ProtobufCBuffer *buffer) { assert(message->base.descriptor == &file_upload_request__descriptor); return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); } FileUploadRequest * file_upload_request__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data) { return (FileUploadRequest *) protobuf_c_message_unpack (&file_upload_request__descriptor, allocator, len, data); } void file_upload_request__free_unpacked (FileUploadRequest *message, ProtobufCAllocator *allocator) { if(!message) return; assert(message->base.descriptor == &file_upload_request__descriptor); protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); } static const ProtobufCFieldDescriptor file_upload_request__field_descriptors[2] = { { "", 1, PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_TYPE_STRING, 0, /* quantifier_offset */ offsetof(FileUploadRequest, path), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { "", 2, PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_TYPE_INT64, offsetof(FileUploadRequest, has_length), offsetof(FileUploadRequest, length), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; static const unsigned file_upload_request__field_indices_by_name[] = { 1, /* field[1] = Length */ 0, /* field[0] = Path */ }; static const ProtobufCIntRange file_upload_request__number_ranges[1 + 1] = { { 1, 0 }, { 0, 2 } }; const ProtobufCMessageDescriptor file_upload_request__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, "", "", "", "", sizeof(FileUploadRequest), 2, file_upload_request__field_descriptors, file_upload_request__field_indices_by_name, 1, file_upload_request__number_ranges, (ProtobufCMessageInit) file_upload_request__init, NULL,NULL,NULL /* reserved[123] */ };