-
-
Notifications
You must be signed in to change notification settings - Fork 492
/
Copy pathFileTypeToStringConverter.cs
62 lines (60 loc) · 2.15 KB
/
FileTypeToStringConverter.cs
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
50
51
52
53
54
55
56
57
58
59
60
61
62
//
// Copyright Fela Ameghino 2015-2025
//
// Distributed under the GNU General Public License v3.0. (See accompanying
// file LICENSE or copy at https://www.gnu.org/licenses/gpl-3.0.txt)
//
using System;
using Telegram.Td.Api;
using Telegram.ViewModels.Settings;
using Windows.UI.Xaml.Data;
namespace Telegram.Converters
{
public partial class FileTypeToStringConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, string language)
{
switch (value)
{
case FileTypeNotes:
return Strings.LocalAudioCache;
case FileTypeOther:
return Strings.MessagesDataUsage;
case FileTypeTotal:
return Strings.TotalDataUsage;
case FileTypeAnimation:
return Strings.LocalGifCache;
case FileTypeAudio:
return Strings.LocalMusicCache;
case FileTypeDocument:
return Strings.FilesDataUsage;
case FileTypePhoto:
return Strings.LocalPhotoCache;
case FileTypeVideo:
return Strings.LocalVideoCache;
case FileTypeVideoNote:
return Strings.VideoMessagesAutodownload;
case FileTypeVoiceNote:
return Strings.AudioAutodownload;
case FileTypeNone:
return "Other";
case FileTypeProfilePhoto:
return "Profile photos";
case FileTypeSticker:
return "Stickers";
case FileTypeThumbnail:
return "Thumbnails";
case FileTypeSecret:
case FileTypeSecretThumbnail:
case FileTypeUnknown:
case FileTypeWallpaper:
default:
return value?.ToString();
}
}
public object ConvertBack(object value, Type targetType, object parameter, string language)
{
throw new NotImplementedException();
}
}
}