forked from syncfusion/blazor-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSampleModel.cs
More file actions
124 lines (117 loc) · 4.83 KB
/
SampleModel.cs
File metadata and controls
124 lines (117 loc) · 4.83 KB
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
#region Copyright Syncfusion® Inc. 2001-2025.
// Copyright Syncfusion® Inc. 2001-2025. All rights reserved.
// Use of this code is subject to the terms of our license.
// A copy of the current license can be obtained at any time by e-mailing
// licensing@syncfusion.com. Any infringement will be prosecuted under
// applicable laws.
#endregion
using System.Collections.Generic;
using System.Runtime.Serialization;
using System.Text.Json.Serialization;
namespace BlazorDemos
{
public class SampleListType
{
public List<SampleListType>? SourceData { get; set; }
public string? Name { get; set; }
[JsonConverter(typeof(JsonStringEnumConverter))]
public SampleType Type { get; set; }
public List<Sample>? Samples { get; set; }
public string? DemoPath { get; set; }
public string? Category { get; set; }
public string? InfoTooltip { get; set; }
public bool? IsHide { get; set; }
}
public class SampleList
{
public string? Name { get; set; }
public string? Directory { get; set; }
public string? Category { get; set; }
[JsonConverter(typeof(JsonStringEnumConverter))]
public SampleType Type { get; set; }
public List<Sample> Samples { get; set; } = new List<Sample>();
public string? ControllerName { get; set; }
public string? DemoPath { get; set; }
public bool IsPreview { get; set; }
public string? CustomDocLink { get; set; }
public bool IsHideFromHomePageList { get; set; }
public bool IsHide { get; set; }
public string? InfoTooltip { get; set; }
public string? ComponentIconName { get; set; }
public string[]? NotificationDescription { get; set; }
}
public class Sample
{
public string? Name { get; set; }
public string? Directory { get; set; }
public string? Category { get; set; }
public string? FileName { get; set; }
public string? Url { get; set; }
public string? MappingSampleName { get; set; }
public string? MetaTitle { get; set; }
public string? MetaDescription { get; set; }
public string? HeaderText { get; set; }
public List<SourceCollection> SourceFiles { get; set; } = new List<SourceCollection>();
[JsonConverter(typeof(JsonStringEnumConverter))]
public SampleType Type { get; set; }
public string[]? NotificationDescription { get; set; }
public bool IsHideInMobile { get; set; }
public bool IsHideFromSamplePageList { get; set; }
}
public class SourceCollection
{
public string? FileName { get; set; }
public string? Id { get; set; }
}
internal static class SampleBrowser
{
public static List<SampleList> SampleList { get; set; } = new List<SampleList>();
internal static List<string> SampleUrls = new List<string>();
internal static SampleConfig Config { get; set; } = new SampleConfig();
internal static List<string> PreLoadFiles = new List<string>()
{
#if DEBUG || STAGING
#if WASM
#if NET8_0
"_content/Blazor_WASM_Common_NET8/styles/common/fonts/open-sans-700.woff2",
"_content/Blazor_WASM_Common_NET8/styles/common/fonts/open-sans-regular.woff2"
#elif NET9_0
"_content/Blazor_WASM_Common_NET9/styles/common/fonts/open-sans-700.woff2",
"_content/Blazor_WASM_Common_NET9/styles/common/fonts/open-sans-regular.woff2"
#else
"_content/Blazor_WASM_Common_NET10/styles/common/fonts/open-sans-700.woff2",
"_content/Blazor_WASM_Common_NET10/styles/common/fonts/open-sans-regular.woff2"
#endif
#else
#if NET8_0
"_content/Blazor_Server_Common_NET8/styles/common/fonts/open-sans-700.woff2",
"_content/Blazor_Server_Common_NET8/styles/common/fonts/open-sans-regular.woff2",
#elif NET9_0
"_content/Blazor_Server_Common_NET9/styles/common/fonts/open-sans-700.woff2",
"_content/Blazor_Server_Common_NET9/styles/common/fonts/open-sans-regular.woff2",
#else
"_content/Blazor_Server_Common_NET10/styles/common/fonts/open-sans-700.woff2",
"_content/Blazor_Server_Common_NET10/styles/common/fonts/open-sans-regular.woff2",
#endif
#endif
#else
"https://cdn.syncfusion.com/blazor/sb/styles/32.1.19/common/fonts/open-sans-700.woff2",
"https://cdn.syncfusion.com/blazor/sb/styles/32.1.19/common/fonts/open-sans-regular.woff2"
#endif
};
}
[JsonConverter(typeof(JsonStringEnumConverter))]
public enum SampleType
{
[EnumMember(Value = "none")]
None,
[EnumMember(Value = "new")]
New,
[EnumMember(Value = "updated")]
Updated,
[EnumMember(Value = "preview")]
Preview,
[EnumMember(Value = "ai")]
AI
}
}