2021-05-13 21:36:20 +03:00
|
|
|
|
using System;
|
|
|
|
|
using System.Globalization;
|
2022-01-21 12:31:03 +03:00
|
|
|
|
using Bit.Core;
|
2021-05-13 21:36:20 +03:00
|
|
|
|
using Bit.Core.Enums;
|
|
|
|
|
using Bit.Core.Models.View;
|
|
|
|
|
using Xamarin.Forms;
|
|
|
|
|
|
|
|
|
|
namespace Bit.App.Utilities
|
|
|
|
|
{
|
|
|
|
|
public class SendIconGlyphConverter : IValueConverter
|
|
|
|
|
{
|
|
|
|
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
|
|
|
|
{
|
|
|
|
|
var send = value as SendView;
|
|
|
|
|
if (send == null)
|
|
|
|
|
{
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
string icon = null;
|
|
|
|
|
switch (send.Type)
|
|
|
|
|
{
|
|
|
|
|
case SendType.Text:
|
2022-01-21 12:31:03 +03:00
|
|
|
|
icon = BitwardenIcons.FileText;
|
2021-05-13 21:36:20 +03:00
|
|
|
|
break;
|
|
|
|
|
case SendType.File:
|
2022-01-21 12:31:03 +03:00
|
|
|
|
icon = BitwardenIcons.File;
|
2021-05-13 21:36:20 +03:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
return icon;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|