-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathEmoji.cs
More file actions
39 lines (32 loc) · 683 Bytes
/
Emoji.cs
File metadata and controls
39 lines (32 loc) · 683 Bytes
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
using System;
using System.IO;
using System.Windows.Media.Imaging;
namespace Emoji
{
class Emoji
{
public string Name { get; }
public string FileName { get; }
public Uri Uri { get; }
public bool IsRetrieved => File.Exists(FileName);
private BitmapImage _bitmap;
public Emoji(string name, Uri uri, string fileName)
{
Name = name;
Uri = uri;
FileName = fileName;
}
public BitmapImage Bitmap()
{
if (_bitmap == null)
{
_bitmap = new BitmapImage();
_bitmap.BeginInit();
_bitmap.UriSource = new Uri(FileName, UriKind.Absolute);
_bitmap.EndInit();
}
return _bitmap;
}
public override string ToString() => Name;
}
}