aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Statistics/Converters/StringToFirstLetterConverter.cs
blob: a1c9561b915c36d36cc5d435dd4bea22580bad59 (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
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;

namespace Tango.MachineStudio.Statistics.Converters
{
    public class StringToFirstLetterConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value != null && value.ToString().Length > 1)
            {
                return value.ToString().First().ToString();
            }
            else
            {
                return value;
            }
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
n>ProtobufCMessage*)message, out); } size_t stop_debug_log_request__pack_to_buffer (const StopDebugLogRequest *message, ProtobufCBuffer *buffer) { assert(message->base.descriptor == &stop_debug_log_request__descriptor); return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); } StopDebugLogRequest * stop_debug_log_request__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data) { return (StopDebugLogRequest *) protobuf_c_message_unpack (&stop_debug_log_request__descriptor, allocator, len, data); } void stop_debug_log_request__free_unpacked (StopDebugLogRequest *message, ProtobufCAllocator *allocator) { if(!message) return; assert(message->base.descriptor == &stop_debug_log_request__descriptor); protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); } #define stop_debug_log_request__field_descriptors NULL #define stop_debug_log_request__field_indices_by_name NULL #define stop_debug_log_request__number_ranges NULL const ProtobufCMessageDescriptor stop_debug_log_request__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, "StopDebugLogRequest", "StopDebugLogRequest", "StopDebugLogRequest", "", sizeof(StopDebugLogRequest), 0, stop_debug_log_request__field_descriptors, stop_debug_log_request__field_indices_by_name, 0, stop_debug_log_request__number_ranges, (ProtobufCMessageInit) stop_debug_log_request__init, NULL,NULL,NULL /* reserved[123] */ };