-
-
Notifications
You must be signed in to change notification settings - Fork 15
/
UmbNavItem.cs
89 lines (65 loc) · 2.37 KB
/
UmbNavItem.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
using UmbNav.Core.Enums;
#if NETCOREAPP
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Models.PublishedContent;
#else
using Umbraco.Core;
using Umbraco.Core.Models.PublishedContent;
#endif
namespace UmbNav.Core.Models
{
public class UmbNavItem
{
[JsonProperty("id", NullValueHandling = NullValueHandling.Ignore)]
[Obsolete("This is here purely for legacy reasons, please use the Key or Udi property as this is unreliable")]
public int Id { get; set; } = 0;
[JsonProperty("udi")]
public GuidUdi Udi { get; set; }
[JsonProperty("key")]
public Guid Key { get; set; }
[JsonProperty("title")]
public string Title { get; set; }
[JsonProperty("target")]
public string Target { get; set; }
[JsonProperty("noopener")]
public string Noopener { get; set; }
[JsonProperty("noreferrer")]
public string Noreferrer { get; set; }
[JsonProperty("anchor")]
public string Anchor { get; set; }
[JsonProperty("children")]
public IEnumerable<UmbNavItem> Children { get; set; }
[JsonIgnore]
public IPublishedContent Content { get; set; }
[JsonIgnore]
public UmbNavItemType ItemType { get; set; }
[JsonIgnore]
public int Level { get; set; }
[JsonProperty("culture")]
public string Culture { get; set; }
[JsonProperty("collapsed")]
internal bool Collapsed { get; set; }
[JsonProperty("hideLoggedIn")]
internal bool HideLoggedIn { get; set; }
[JsonProperty("hideLoggedOut")]
internal bool HideLoggedOut { get; set; }
[JsonProperty("url")]
internal string Url { get; set; }
[JsonProperty("includeChildNodes")]
internal bool IncludeChildNodes { get; set; }
[JsonProperty("customClasses")]
public string CustomClasses { get; set; }
[JsonProperty("image")]
internal ImageItem[] ImageArray { get; set; }
[JsonIgnore]
public IPublishedContent Image { get; set; }
[JsonProperty("itemType")] internal string MenuItemType { get; set; } = "link";
[JsonIgnore]
public bool IsActive { get; set; }
[JsonProperty("displayAsLabel")]
public bool DisplayAsLabel { get; set; }
}
}