forked from zzzprojects/System.Linq.Dynamic.Core
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathClass.cshtml
More file actions
98 lines (81 loc) · 3.29 KB
/
Class.cshtml
File metadata and controls
98 lines (81 loc) · 3.29 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
@using DynamicLinqWebDocs.Models
@model DynamicLinqWebDocs.ViewModels.Class
@{
string entityName;
if (Model.IsInterface)
{
entityName = "Interface";
}
else
{
entityName = "Class";
}
ViewBag.Title = Model.Name + " " + entityName + " (" + Model.Namespace + ")";
int[] s;
}
@Html.ActionLink("Back to Library", "Index", "Library", null, new { @class= "btn btn-xs btn-default" })
<h2>@Model.Name <small>@entityName</small></h2>
@Html.FormatMarkdown(Model.Description)
@Html.FormatMarkdown("**Namespace**: `{0}`", Model.Namespace)
@if (Model.Properties.Count > 0) {
<h3>Properties</h3>
<table class="table">
<thead>
<tr>
<th>Name</th>
<th>Description</th>
<th>Supported Frameworks</th>
</tr>
</thead>
<tbody>
@foreach (var property in Model.Properties.OrderBy(x => x.Name).ThenBy(x => x.Frameworks))
{
var linkName = property.Name;
Frameworks? framework = null;
if (property.Frameworks != Frameworks.All)
{
framework = Enum.GetValues(typeof(Frameworks)).Cast<Frameworks>().Reverse().Where(x => property.Frameworks.HasFlag(x)).FirstOrDefault();
}
<tr>
<td>@Html.ActionLink(linkName, "Property", "Library", new { className = Model.Name, propertyName = property.Name.Replace('<', '(').Replace('>', ')'), framework = framework }, null)</td>
<td>@Html.FormatMarkdown(property.Description)</td>
<td>@Helpers.GetEnumDescription(property.Frameworks)</td>
</tr>
}
</tbody>
</table>
}
@if (Model.Methods.Count > 0) {
<h3>Methods</h3>
<table class="table">
<thead>
<tr>
<th>Name</th>
<th>Description</th>
<th>Supported Frameworks</th>
</tr>
</thead>
<tbody>
@foreach (var methodGroup in Model.Methods.OrderBy(x => x.Name).GroupBy(x => new { x.Name, x.Frameworks }))
{
int methodCount = 0;
foreach (var method in methodGroup)
{
var linkName = method.Name + "(" + String.Join(", ", method.Arguments.Select(x => x.Type)) + ")";
Frameworks? framework = null;
if (method.Frameworks != Frameworks.All)
{
framework = Enum.GetValues(typeof(Frameworks)).Cast<Frameworks>().Reverse().Where(x => method.Frameworks.HasFlag(x)).FirstOrDefault();
}
<tr>
<td>@Html.ActionLink(linkName, "Method", "Library", new { className = Model.Name, methodName = method.Name.Replace('<', '(').Replace('>', ')'), framework = framework, o = methodCount > 0 ? (int?)methodCount : null }, null)</td>
<td>@Html.FormatMarkdown(method.Description)</td>
<td>@Helpers.GetEnumDescription(method.Frameworks)</td>
</tr>
methodCount++;
}
}
</tbody>
</table>
}
@Html.DisplayFor(x => x.Remarks, "Remarks")