forked from syncfusion/blazor-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
86 lines (78 loc) · 2.69 KB
/
Program.cs
File metadata and controls
86 lines (78 loc) · 2.69 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
using System;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System.Collections.Generic;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Hosting;
using System.Runtime.Serialization;
namespace blazor_samples
{
public class Program
{
public static void Main(string[] args)
{
CreateHostBuilder(args).Build().Run();
}
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStaticWebAssets();
webBuilder.UseStartup<Startup>();
});
}
public class SampleListType
{
public List<SampleListType> SourceData { get; set; }
public string Name { get; set; }
[JsonConverter(typeof(StringEnumConverter))]
public SampleType Type { get; set; }
public List<Sample> Samples { get; set; }
}
public class SampleList
{
public string Name { get; set; }
public string Directory { get; set; }
public string Category { get; set; }
[JsonConverter(typeof(StringEnumConverter))]
public SampleType Type { get; set; }
public List<Sample> Samples { get; set; } = new List<Sample>();
public String ControllerName { 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 List<SourceCollection> SourceFiles { get; set; } = new List<SourceCollection>();
[JsonConverter(typeof(StringEnumConverter))]
public SampleType Type { 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();
}
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))]
[JsonConverter(typeof(StringEnumConverter))]
public enum SampleType
{
[EnumMember(Value = "none")]
None,
[EnumMember(Value = "new")]
New,
[EnumMember(Value = "updated")]
Updated,
[EnumMember(Value = "preview")]
Preview
}
}