-
Notifications
You must be signed in to change notification settings - Fork 3
/
Entry.cs
50 lines (43 loc) · 1.28 KB
/
Entry.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
using System;
using System.Text.Json.Serialization;
namespace Flow.Launcher.Plugin.VisualStudio
{
//For Json deserialization.
public class Entry
{
public string Key { get; init; }
public Value Value { get; init; }
//NonJson
[JsonIgnore]
public string Path => Value.LocalProperties.FullPath;
[JsonIgnore]
public int ItemType => Value.LocalProperties.Type;
public override bool Equals(object obj)
{
return obj is Entry entry &&
Key == entry.Key;
}
public override int GetHashCode()
{
return HashCode.Combine(Key);
}
}
public class Value
{
public LocalProperties LocalProperties { get; init; }
public object Remote { get; init; }
public bool IsFavorite { get; init; }
public DateTime LastAccessed { get; init; }
public bool IsLocal { get; init; }
public bool HasRemote { get; init; }
public bool IsSourceControlled { get; init; }
}
public class LocalProperties
{
public string FullPath { get; init; }
//0 is a solution/project.
//1 is a file
public int Type { get; init; }
public object SourceControl { get; init; }
}
}