-
Notifications
You must be signed in to change notification settings - Fork 1
/
CCursor.cs
39 lines (31 loc) · 917 Bytes
/
CCursor.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
using System.IO;
namespace Cursor_Installer_Creator;
public enum CCursorType
{
cur,
ani,
unknown,
}
public sealed class CCursor
{
public required CursorAssignment Assignment { get; set; }
public required string CursorPath { get; set; }
public CCursorType GetCursorType()
{
if (string.IsNullOrEmpty(CursorPath))
return CCursorType.unknown;
if (CursorPath.EndsWith(".ani"))
return CCursorType.ani;
else if (CursorPath.EndsWith(".cur"))
return CCursorType.cur;
return CCursorType.unknown;
}
public string? GetImagePath()
{
var imagePath = Path.Combine(Program.TempPath, $"{Assignment.WindowsReg}.png");
if (File.Exists(imagePath))
return imagePath;
imagePath = CursorHelper.CreateCursorImage(this);
return File.Exists(imagePath) ? imagePath : null;
}
}